hdw
2019-01-04 7e03924896b49f1857f3f1bd5d81a475ed1c79ff
gx_tieta/WebRoot/ex-battinfo.jsp
@@ -45,6 +45,7 @@
               <ul class="layui-tab-title">
                  <li class="layui-this">待审核<span class="layui-badge" id="applyNum">0</span></li>
                  <li>待验收<span class="layui-badge" id="acceptNum">0</span></li>
                  <li>已验收<span class="layui-badge" id="acceptedNum">0</span></li>
               </ul>
               <div class="layui-tab-content">
                  <div class="layui-tab-item layui-show">
@@ -54,6 +55,10 @@
                  <div class="layui-tab-item">
                     <!-- 表格内容 -->
                     <table id="acceptTbl" lay-filter="acceptTbl"></table>
                  </div>
                  <div class="layui-tab-item">
                     <!-- 表格内容 -->
                     <table id="acceptedTbl" lay-filter="acceptedTbl"></table>
                  </div>
               </div>
            </div>
@@ -91,6 +96,10 @@
         {{# }else { }}
            <a class="layui-btn layui-btn-xs layui-bg-blue" lay-event="accept">验收</a>
         {{# } }}
         <a class="layui-btn layui-btn-xs layui-bg-blue" lay-event="look">机房环境</a>
         <a class="layui-btn layui-btn-xs layui-bg-blue" lay-event="control">实时查询</a>
      </script>
      <script type="text/html" id="acceptedBattGroupTools">
         <a class="layui-btn layui-btn-xs layui-bg-blue" lay-event="look">机房环境</a>
         <a class="layui-btn layui-btn-xs layui-bg-blue" lay-event="control">实时查询</a>
      </script>
@@ -145,6 +154,9 @@
            var acceptPage = new TblPage();      // 实例化TblPage对象--待验收的分页信息
            acceptPage.set(1, 0, 20);         // 初始化值
            
            var acceptedPage = new TblPage();   // 实例化TblPage对象--已验收的分页信息
            acceptedPage.set(1, 0, 20);         // 初始值
                // 页面dom对象
              var pagePage = new PagePage({
                 search: $('#paging .search')      // 查询
@@ -168,10 +180,13 @@
               // console.log(data.index);    //得到当前Tab的所在下标
               // console.log(data.elem);    //得到当前的Tab大容器
               tabsIndex = data.index;      // 标识显示的选项卡内容
               if(tabsIndex) {
               console.log(tabsIndex);
               if(tabsIndex == 0) {
                  pagePage.init(Page, search);            // 待审核
               }else if(tabsIndex == 1){
                  pagePage.init(acceptPage, acceptSearch);   // 待验收
               }else {
                  pagePage.init(Page, search);         // 待审核
               }else if(tabsIndex == 2) {
                  pagePage.init(acceptedPage, acceptedSearch);            // 已验收
               }
               $(window).resize();
            });
@@ -295,6 +310,69 @@
            // 生成表格数据
            table.render(acceptOptions);
            
            // 待验收的表格
            var acceptedOptions = {
               elem: '#acceptedTbl'
               ,toolbar: false
               ,defaultToolbar: []
               ,cellMinWidth: 80
               ,cols: [[
                  {type:'checkbox',fixed: 'left'}
                  ,{field:'StationId', title:'机房编号', align:'center', width: 120}
                  ,{field:'StationName1', title:'省', align:'center', width: 100}
                  ,{field:'StationName2', title:'市', align:'center', width: 100}
                  ,{field:'StationName5', title:'区县', align:'center', width: 100}
                  ,{field:'StationName3', title:'机房名称', align:'center', width: 360}
                  ,{field:'StationName4', title:'设备名称', align:'center', width: 150}
                  ,{field:'StationIp', title:'机房ip', align:'center', width: 160}
                  ,{field: 'FBSDeviceId', title: 'FBS设备ID(重要)', align: 'center', width: 160}
                  ,{field:'FbsDeviceIp', title:'FBS设备IP(重要)', align:'center', width: 160}
                  ,{field:'FbsDeviceIp_YM', title:'子网掩码', align:'center', width: 160}
                  ,{field:'FbsDeviceIp_WG', title:'网关', align:'center', width: 160}
                  ,{field:'FBSDeviceName', title:'FBS设备名称', align:'center', width: 160}
                  ,{field:'GroupIndexInFBSDevice', title:'FBS设备索引', align:'center', width: 160}
                  ,{field:'BattGroupId', title:'电池组ID', align:'center', width: 160}
                  ,{field:'BattGroupNum', title:'机房内电池组编号', align:'center', width: 160}
                  ,{field:'BattGroupName', title:'电池组名称', align:'center', width: 160}
                  ,{field:'FloatVolLevel', title:'浮充电压阀值', align:'center', width: 160}
                  ,{field:'OfflineVolLevel', title:'离线电压阀值', align:'center', width: 160}
                  ,{field:'BattFloatCurrent', title:'浮充阀值', align:'center', width: 100}
                  ,{field:'MonCount', title:'单体数量', align:'center', width: 100}
                  ,{field:'MonCapStd', title:'标称容量', align:'center', width: 100}
                  ,{field:'MonVolStd', title:'标称单体电压', align:'center', width: 140}
                  ,{field:'MonResStd', title:'标称单体内阻', align:'center', width: 140}
                  ,{field:'MonSerStd', title:'标称单体电导', align:'center', width: 140}
                  ,{field:'MonVolLowToAvg', title:'单体电压次低偏移量', align:'center', width: 140}
                  ,{field:'Load_curr', title:'负载电流', align:'center', width: 140}
                  ,{field:'DisCurrMax', title:'最大核容电流', align:'center', width: 140}
                  ,{field:'station_phone', title:'基站手机号码', align:'center', width: 140}
                  ,{field:'BattProducer', title:'电池品牌', align:'center', width: 140}
                  ,{field:'BattModel', title:'电池型号', align:'center', width: 260}
                  ,{field:'productDate', title:'电池生产日期', templet: '#produceTime', align:'center', width: 140}
                  ,{field:'useDate', title:'投入使用日期', templet: '#useTime', align:'center', width: 140}
                  ,{field:'isInstall', title:'安装状态', templet: '#isInstall', align:'center', width: 140}
                  ,{field:'install_user', title:'设备安装人员', align:'center', width: 260}
                  ,{field:'check_en', title:'验收状态', templet: '#acceptEn',align:'center', width: 120}
                  ,{field:'latitude', title:'经度', align:'center', width: 150}
                  ,{field:'longitude', title:'纬度', align:'center', width: 150}
                  ,{field:'address', title:'地址', align:'center', width: 230}
                  ,{field:'apply_name', title:'申请人', align:'center', width: 120}
                  ,{field:'apply_date', title:'申请日期', align:'center', width: 260}
                  ,{field:'confirm_name', title:'审核人', align:'center', width: 120}
                  ,{field:'check_uname', title:'验收人', align:'center', width: 120}
                   ,{field:'doThings', fixed: 'right', title:'验收操作', align: 'center', toolbar: '#acceptedBattGroupTools', width:200}
                ]]
               ,data:[]
               ,limit: 10000
                ,page: false
                ,height: 'full-235'
            };
            // 生成表格数据
            table.render(acceptedOptions);
            // 更新表格的对象
              var layuiTbl = new LayuiTbl(acceptOptions, layui, laytpl, table.cache.acceptTbl);
            
@@ -417,7 +495,7 @@
            function acceptBattGroup(data) {
               // 构造验收通过的机房的信息
               var temp = [createAcceptParam(data)];
               console.log(temp);
               // console.log(temp);
               // 是否却确认验收
               layer.confirm('是否确认验收', {icon: 3, title: '提示'}, function(index) {
                  layer.close(index);
@@ -466,6 +544,9 @@
                        
                        // 查询待验收后台数据
                        acceptSearch();
                        // 查询已验收机房的信息
                        acceptedSearch();
                     }else {
                        layer.msg('确认验收失败!');
                     }
@@ -559,6 +640,7 @@
            function createSearchParam() {
               var temp = {
                  apply_en: 0
                  ,check_en: 100
                  ,binf: {
                     page: Page.getPage()
                  }
@@ -647,7 +729,7 @@
                        acceptPage.setAll(0);
                     }
                     pagePage.setVal();            // 设置分页信息
                     $('#acceptNum').text(getAcceptHome(resData));    // 设置徽章
                     $('#acceptNum').text(acceptPage.all);    // 设置徽章
                     acceptOptions.data = resData;      // 设置表格的数据
                     
                     // 生成表格数据
@@ -662,10 +744,64 @@
               });
            }
            
            // 构造验收的查询条件
            // 构造待验收的查询条件
            function acceptSearchParam() {
               var temp = {
                  apply_en: 1
                  ,check_en: 0
                  ,binf: {
                     page: acceptPage.getPage()
                  }
               };
               return temp;
            }
            // 查询已验收的机房
            acceptedSearch();
            function acceptedSearch(temp, newLoad) {
               var load = layer.load(1);
               var temp = acceptedSearchParam();
               //console.log(temp);
               // 查询后台
               $.ajax({
                  type: 'post'
                  ,async: true
                  ,url: "Battinf_applyAction!serchByCondition"
                  ,data: "json="+JSON.stringify(temp)
                  ,dataType: 'json'
                  ,success: function(res) {
                     var rs = JSON.parse(res.result);
                     var resData = [];
                     if(rs.code == 1) {
                        var data = rs.data;
                        // 遍历数据的值
                        for(var i=0; i<data.length; i++) {
                           var _data = data[i];
                           var _tmp = formaterResData(_data);
                           resData.push(_tmp);
                           acceptedPage.setAll(_data.apply_note);
                        }
                     }else {
                        acceptedPage.setAll(0);
                     }
                     pagePage.setVal();            // 设置分页信息
                     $('#acceptedNum').text(acceptedPage.all);    // 设置徽章
                     acceptedOptions.data = resData;      // 设置表格的数据
                     // 生成表格数据
                     table.render(acceptedOptions);
                  }
                  ,complete: function() {
                     layer.close(load);
                  }
               });
            }
            // 构造待验收的查询条件
            function acceptedSearchParam() {
               var temp = {
                  apply_en: 1
                  ,check_en: 1
                  ,binf: {
                     page: acceptPage.getPage()
                  }