| | |
| | |
|
| | | <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE10" />
|
| | | <meta charset="UTF-8">
|
| | | <title>电池组配组管理</title>
|
| | | <title>电池组配组记录</title>
|
| | | <meta http-equiv="pragma" content="no-cache">
|
| | | <meta http-equiv="cache-control" content="no-cache">
|
| | | <meta http-equiv="expires" content="0">
|
| | |
| | | <div class="layui-input-inline">
|
| | | <div class="layui-form" lay-filter="cityFilter">
|
| | | <select name="city" id="city" lay-filter="city">
|
| | | <option value="">请选择市/区</option>
|
| | | <option value="">请选择市</option>
|
| | | </select>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-input-inline">
|
| | | <div class="layui-form" lay-filter="countyFilter">
|
| | | <select name="county" id="county" lay-filter="county">
|
| | | <option value="">请选择区/县</option>
|
| | | </select>
|
| | | </div>
|
| | | </div>
|
| | |
| | | <option value="">请选择机房</option>
|
| | | </select>
|
| | | </div>
|
| | | |
| | | </div>
|
| | | <div class="layui-input-inline">
|
| | | <div class="layui-form" lay-filter="groupFilter">
|
| | |
| | | var obj = {};
|
| | | obj.StationName1 = '';
|
| | | obj.StationName2 = '';
|
| | | obj.StationName5 = '';
|
| | | obj.StationName3 = '';
|
| | | obj.BattGroupName = '';
|
| | | obj.BattGroupId = data.BattGroupId;
|
| | |
| | | }
|
| | |
|
| | | // 查询省下拉框
|
| | | var filterLoad = layer.load();
|
| | | searchProvince();
|
| | | // 查询省
|
| | | function searchProvince() {
|
| | |
| | | // 切换省-市
|
| | | form.on('select(province)', function(data) {
|
| | | // 查询市
|
| | | searchCity();
|
| | | searchCity(true);
|
| | | });
|
| | |
|
| | | // 查询市
|
| | | function searchCity() {
|
| | | function searchCity(isLoad) {
|
| | | // 构造查询条件
|
| | | var tmp = {
|
| | | StationName1: $("#province").val()
|
| | | };
|
| | | // 是否添加等待
|
| | | if(isLoad) {
|
| | | filterLoad = layer.load();
|
| | | }
|
| | | // 根据构造条件查询内容
|
| | | $.ajax({
|
| | | type: 'post',
|
| | |
| | | var ele = $('#city'); // 目标select
|
| | | if(rs.code == 1) {
|
| | | var data = rs.data;
|
| | | list.push(getLayuiSelect('请选择市/区', '', {}, undefined));
|
| | | list.push(getLayuiSelect('请选择市', '', {}, undefined));
|
| | | // 遍历查询结果
|
| | | for(var i=0; i<data.length; i++) {
|
| | | var _data = data[i];
|
| | |
| | | list.push(_tmp);
|
| | | }
|
| | | }else {
|
| | | list.push(getLayuiSelect('暂无市/区', '', {}, undefined));
|
| | | list.push(getLayuiSelect('暂无市', '', {}, undefined));
|
| | | }
|
| | |
|
| | | // 根据对象数组生成下拉列表
|
| | | createLayuiSelect(ele, list);
|
| | | form.render('select', 'cityFilter');
|
| | | // 查询区/县
|
| | | searchCounty();
|
| | | }
|
| | | });
|
| | | }
|
| | | |
| | | // 查询区/县
|
| | | function searchCounty(isLoad) {
|
| | | // 构造查询条件
|
| | | var tmp = {
|
| | | StationName1: $("#province").val(),
|
| | | StationName2: $("#city").val()
|
| | | };
|
| | | // 是否添加等待
|
| | | if(isLoad) {
|
| | | filterLoad = layer.load();
|
| | | }
|
| | | // 根据构造条件查询内容
|
| | | $.ajax({
|
| | | type: 'post',
|
| | | async: true,
|
| | | url: 'BattInfAction!serchStationName5',
|
| | | dataType: 'json',
|
| | | data: "json = "+JSON.stringify(tmp),
|
| | | success: function(result) {
|
| | | var rs = JSON.parse(result.result);
|
| | | var list = []; // option结果集
|
| | | var ele = $('#county'); // 目标select
|
| | | if(rs.code == 1) {
|
| | | var data = rs.data;
|
| | | list.push(getLayuiSelect('请选择区/县', '', {}, undefined));
|
| | | // 遍历查询结果
|
| | | for(var i=0; i<data.length; i++) {
|
| | | var _data = data[i];
|
| | | var _tmp = getLayuiSelect(_data.StationName5, _data.StationName5, {}, _data);
|
| | | list.push(_tmp);
|
| | | }
|
| | | }else {
|
| | | list.push(getLayuiSelect('暂无区/县', '', {}, undefined));
|
| | | }
|
| | | |
| | | // 根据对象数组生成下拉列表
|
| | | createLayuiSelect(ele, list);
|
| | | form.render('select', 'countyFilter');
|
| | |
|
| | | // 查询机房
|
| | | searchHome();
|
| | |
| | | });
|
| | | }
|
| | |
|
| | | // 切换市-机房
|
| | | |
| | | // 切换市-区/县
|
| | | form.on('select(city)', function(data) {
|
| | | // 查询区/县
|
| | | searchCounty(true);
|
| | | });
|
| | | |
| | | // 切换区/县-机房
|
| | | form.on('select(county)', function(data) {
|
| | | // 查询机房
|
| | | searchHome();
|
| | | searchHome(true);
|
| | | });
|
| | |
|
| | | // 查询机房
|
| | | function searchHome() {
|
| | | function searchHome(isLoad) {
|
| | | // 构造查询条件
|
| | | var tmp = {
|
| | | StationName1:$("#province").val(),
|
| | | StationName2:$("#city").val()
|
| | | StationName2:$("#city").val(),
|
| | | StationName5:$("#county").val()
|
| | | };
|
| | | // 是否添加等待
|
| | | if(isLoad) {
|
| | | filterLoad = layer.load();
|
| | | }
|
| | | // 根据构造条件查询内容
|
| | | $.ajax({
|
| | | type: 'post',
|
| | |
| | | });
|
| | |
|
| | | // 查询机房
|
| | | function searchGroup() {
|
| | | function searchGroup(isLoad) {
|
| | | // 构造查询条件
|
| | | var tmp = {
|
| | | StationName1:$("#province").val(),
|
| | | StationName2:$("#city").val(),
|
| | | StationName5:$("#county").val(),
|
| | | StationName: $("#home").val(),
|
| | | StationId: $("#home").find('option:selected').attr('stationid')
|
| | | };
|
| | | // 是否添加等待
|
| | | if(isLoad) {
|
| | | filterLoad = layer.load();
|
| | | }
|
| | | // 根据构造条件查询内容
|
| | | $.ajax({
|
| | | type: 'post',
|
| | |
| | | list.push(_tmp);
|
| | | }
|
| | | }else {
|
| | | list.push(getLayuiSelect('暂无机房', '', {}, undefined));
|
| | | list.push(getLayuiSelect('暂无电池组', '', {}, undefined));
|
| | | }
|
| | |
|
| | | layer.close(filterLoad);
|
| | | // 根据对象数组生成下拉列表
|
| | | createLayuiSelect(ele, list);
|
| | | form.render('select', 'groupFilter');
|