| | |
| | | <table>
|
| | | <tbody>
|
| | | <tr>
|
| | | <th>省</th>
|
| | | <!-- 省 -->
|
| | | <th>市</th>
|
| | | <!-- 市 -->
|
| | | <th>机房名称</th>
|
| | | <!-- 机房站点 -->
|
| | | <th>省</th> <!-- 省 -->
|
| | | <th>市</th> <!-- 市 -->
|
| | | <th>区/县</th> <!-- 区/县 -->
|
| | | <th>机房名称</th> <!-- 机房站点 -->
|
| | | </tr>
|
| | | <tr>
|
| | | <td><select name="station_name1" id="station_name1" lay-verify="">
|
| | | |
| | | </select></td>
|
| | | <td><select name="" id="city" lay-verify="">
|
| | | </select></td>
|
| | | <td><select name="" id="station_name3" lay-verify="">
|
| | | </select></td>
|
| | | <td>
|
| | | <select name="station_name1" id="station_name1"></select>、
|
| | | </td>
|
| | | <td>
|
| | | <select name="" id="city"></select>
|
| | | </td>
|
| | | <td>
|
| | | <select name="" id="county"></select>
|
| | | </td>
|
| | | <td>
|
| | | <select name="" id="station_name3" ></select>
|
| | | </td>
|
| | | </tr>
|
| | | </tbody>
|
| | | </table>
|
| | |
| | | $select.text('').html('<option>暂无可测市</option>');
|
| | | renderForm();
|
| | | }
|
| | | findStationNamebyStationname1();
|
| | | searchCounty();
|
| | | }
|
| | | });
|
| | | }
|
| | | |
| | | // 查询区/县
|
| | | function searchCounty() {
|
| | | // 构造查询条件
|
| | | var tmp = {
|
| | | StationName1: $("#province").val(),
|
| | | StationName2: $("#city").val()
|
| | | };
|
| | | // 根据构造条件查询内容
|
| | | $.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');
|
| | | |
| | | // 查询机房
|
| | | findCity();
|
| | | }
|
| | | });
|
| | | }
|
| | | //当维护区的值变换时更新市
|
| | | $('#station_name1').change(function() {
|
| | | findCity();
|
| | | });
|
| | | //当维护区的值变换时更新机房站点
|
| | | $('#city').change(function() {
|
| | | findStationNamebyStationname1();
|
| | | searchCounty();
|
| | | });
|
| | | // 切换区/县-机房
|
| | | form.on('select(county)', function(data) {
|
| | | // 查询机房
|
| | | findCity(true);
|
| | | });
|
| | |
|
| | | //根据省,市查询站点
|
| | | function findStationNamebyStationname1() {
|