| | |
| | | <tr class="fWeight">
|
| | | <td>省</td> <!-- 省 -->
|
| | | <td>市</td> <!-- 市 -->
|
| | | <td>区/县</td> <!-- 区/县 -->
|
| | | <td><s:text name="Computer_site"/></td> <!-- 机房站点(或机房设备) -->
|
| | | <td><s:text name="Battery"/></td> <!-- 蓄电池组 -->
|
| | | </tr>
|
| | |
| | | </td>
|
| | | <td>
|
| | | <select id="city" name=""></select>
|
| | | </td>
|
| | | <td>
|
| | | <select id="county" name=""></select>
|
| | | </td>
|
| | | <td>
|
| | | <select id="station_name" name=""></select>
|
| | |
| | | <select name="addType" id="addType">
|
| | | <option value="0">全省机房</option>
|
| | | <option value="1">全市机房</option>
|
| | | <option value="2">单个机房</option>
|
| | | <option value="3">电池组</option>
|
| | | <option value="2">全市区/县房</option>
|
| | | <option value="3">单个机房</option>
|
| | | <option value="4">电池组</option>
|
| | | </select>
|
| | | <a href="javasscript:;" class="tool-btn" id="toolBtnAdd" title="添加"><i class="fa fa-plus"></i></a>
|
| | | <a href="javasscript:;" class="tool-btn" id="toolBtnApply" title="应用"><i class="fa fa-sticky-note-o"></i></a>
|
| | |
| | | <div id="tb-right-menu">
|
| | | <a href="javascript:;" class="apply"><s:text name="Apply"/></a> <!-- 应用 -->
|
| | | <a href="javascript:;" class="add-province">添加全省机房</a> <!-- 添加全省机房 -->
|
| | | <a href="javascript:;" class="add-city">添加全市机房</a> <!-- 添加全市机房 -->
|
| | | <a href="javascript:;" class="add-city">添加全市机房</a>
|
| | | <a href="javascript:;" class="add-county">添加全区/县机房</a> <!-- 添加全市机房 -->
|
| | | <a href="javascript:;" class="add-station"><s:text name="Add_all_Chartere_room_batt_group"/></a> <!-- 添加整个机房电池组 -->
|
| | | <a href="javascript:;" class="add-batt"><s:text name="Add_single_batt_group"/></a> <!-- 添加单个电池组 -->
|
| | | <!--<a href="javascript:;" class="add-weihuqu"><s:text name="Add_maintenance_area_batt_group"/></a> 添加整个维护区电池组 -->
|
| | |
| | | }else {
|
| | | $select.text('').html('<option>暂无可测市</option>');
|
| | | }
|
| | | findStationNamebyStationname1();
|
| | | findCounty();
|
| | | }
|
| | | });
|
| | | }
|
| | | |
| | | // 查询区/县
|
| | | function findCounty() {
|
| | | var tmp = {
|
| | | StationName1:$("#station_name1").val(),
|
| | | StationName2:$("#city").val(),
|
| | | };
|
| | | |
| | | // 查询区县
|
| | | $.ajax({
|
| | | type: 'post',
|
| | | async: true,
|
| | | url: "BattInfAction!serchStationName5_all",
|
| | | data: "json="+JSON.stringify(tmp),
|
| | | success:function(data) {
|
| | | var rs = JSON.parse(data.result);
|
| | | var $select = $("#county");
|
| | | if(rs.code==1){
|
| | | var _data = rs.data;
|
| | | // 根据数据构造生成下拉列表的数据
|
| | | var optsList = [];
|
| | | for(var i=0;i<_data.length;i++){
|
| | | var __data = _data[i];
|
| | | var _attr = {
|
| | | StationId: __data.StationId
|
| | | };
|
| | | var tmp = getOptionsData(__data.StationName5, __data.StationName5, __data, _attr);
|
| | | optsList.push(tmp);
|
| | | }
|
| | | |
| | | // 根据数据生成下拉列表
|
| | | createOptions($select, optsList, true);
|
| | | }else{
|
| | | $select.text('').html('<option>暂无可测机房站点</option>');
|
| | | }
|
| | | findStationNamebyStationname1();
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | //当维护区的值变换时更新市
|
| | |
| | |
|
| | | //当维护区的值变换时更新机房站点
|
| | | $('#city').change(function(){
|
| | | findCounty();
|
| | | });
|
| | | |
| | | //当区/县的值变换时更新机房站点
|
| | | $('#county').change(function(){
|
| | | findStationNamebyStationname1();
|
| | | });
|
| | |
|
| | |
| | | function findStationNamebyStationname1(){
|
| | | var tmp = {
|
| | | StationName1:$("#station_name1").val(),
|
| | | StationName2:$("#city").val()
|
| | | StationName2:$("#city").val(),
|
| | | StationName5:$("#county").val()
|
| | | };
|
| | | //var selectvalue=$("#station_name1 option:selected").val();
|
| | | //alert(selectvalue);
|
| | |
| | | var tmp = {
|
| | | StationName1:$("#station_name1").val(),
|
| | | StationName2:$("#city").val(),
|
| | | StationName5:$("#county").val(),
|
| | | StationName: $("#station_name").val(),
|
| | | StationId: stationid
|
| | | };
|
| | |
| | | binf={
|
| | | BattGroupId: 0, // 电池组id
|
| | | StationName: '', // 机房名称
|
| | | StationName5: '', // 区/县
|
| | | StationName2: '', // 市
|
| | | StationName1: province, // 省
|
| | | };
|
| | |
| | | binf={
|
| | | BattGroupId: 0, // 电池组id
|
| | | StationName: '', // 机房名称
|
| | | StationName5: '', // 区/县
|
| | | StationName2: city, // 市
|
| | | StationName1: '', // 省
|
| | | };
|
| | | //console.log(binf);
|
| | | var json=window.JSON.stringify(binf);
|
| | | $.post('BattInfAction!serchBatt','result='+json,function(data){
|
| | | var model=eval("("+data.result+")");
|
| | | //console.info(model);
|
| | | if(model.code==1 && model.data.length>0){
|
| | | //var stationid=0;
|
| | | for(var i=0;i<model.data.length;i++){
|
| | | var batt=model.data[i];
|
| | | //console.info(batt);
|
| | | myRoom.push(batt.StationName);
|
| | | myRoomVal.push(batt.StationId); |
| | | singleELeGroup.push(batt.StationName);
|
| | | singleELeGroup.push(batt.BattGroupName);
|
| | | singleEleVal.push(batt.StationId);
|
| | | singleEleVal.push(batt.BattGroupId); |
| | | }
|
| | | //console.info(singleELeGroup);
|
| | | addRedLi(myRoom,myRoomVal,singleELeGroup,singleEleVal); |
| | | }
|
| | | });
|
| | | }else{
|
| | | layer.msg('请选择市!'); //请先选择市
|
| | | }
|
| | | });
|
| | | |
| | | // 添加整个区/县的机房
|
| | | $('#tb-right-menu .add-county').click(function() {
|
| | | //获取包机房名称和新增电池组名称
|
| | | var myRoom=new Array();
|
| | | var myRoomVal=new Array();
|
| | | var singleELeGroup=new Array();
|
| | | var singleEleVal=new Array();
|
| | | var county = $('#county').attr('value'); |
| | | if(county.length>0 && $('#lbottom .li-con li.b8cfe5').text().length>0){
|
| | | var binf=new Object();
|
| | | binf={
|
| | | BattGroupId: 0, // 电池组id
|
| | | StationName: '', // 机房名称
|
| | | StationName5: county, // 区/县
|
| | | StationName2: '', // 市 |
| | | StationName1: '', // 省
|
| | | };
|
| | | //console.log(binf);
|
| | |
| | | }
|
| | | });
|
| | | }else{
|
| | | layer.msg('请选择市!'); //请先选择市
|
| | | layer.msg('请选择区/县!'); //请先选择区/县
|
| | | }
|
| | | });
|
| | |
|
| | |
| | | binf={
|
| | | BattGroupId: battgrouid, // 电池组id
|
| | | StationName: '', // 机房名称
|
| | | StationName5: '', // 区/县
|
| | | StationName2: '', // 市
|
| | | StationName1: '', // 省
|
| | | };
|
| | |
| | | binf={
|
| | | BattGroupId: 0, // 电池组id
|
| | | StationName: stationname, // 机房名称
|
| | | StationName5: '', // 区/县
|
| | | StationName2: '', // 市
|
| | | StationName1: '', // 省
|
| | | };
|
| | |
| | | $('#tb-right-menu .add-city').click();
|
| | | break;
|
| | | case '2':
|
| | | $('#tb-right-menu .add-station').click();
|
| | | $('#tb-right-menu .add-county').click();
|
| | | break;
|
| | | case '3':
|
| | | $('#tb-right-menu .add-station').click();
|
| | | break;
|
| | | case '4':
|
| | | $('#tb-right-menu .add-batt').click();
|
| | | break;
|
| | |
|