CJJ
2018-12-25 94e5b0bddf2b83e1591de425d3e30030fcbb1d23
gx_tieta/WebRoot/mobil/batt-approved.html
@@ -87,11 +87,14 @@
          margin: 0;
            padding-top: 0.1em;
            padding-bottom: 0.1em;
            margin-left:7em;
      }
      .ui-table-reflow td .ui-table-cell-label, .ui-table-reflow th .ui-table-cell-label{
          width:35%;
      } 
      .fr{
      float:right;
      }
   </style>
   <link rel="stylesheet" href="css/fgpanel.css">
</head>
@@ -138,7 +141,7 @@
 <script type="text/javascript">
          /* 获取点击的是哪个按钮   */
   function getButIndex(t){
   function getButIndex(t){ //查看实时数据
       var index = $(t).attr("but-index");   
      // index=(index/33-1);
         console.info(index);
@@ -149,11 +152,18 @@
   function getApplyYanshouIndex(t){
      var index = $(t).attr("but-index");
      console.info(index);
      setApplyYanshou(index);
      var arr=setApplyYanshou(index);
                           //方法一:1按钮搞定所有。请在此对接加入弹出框,上传视频经纬度等
      applyendyanshou(arr);
      return ;
   }
    function getApplyYanshoupicture(t){
       var index = $(t).attr("but-index");
      console.info(index);//方法2
      var arr=setApplyYanshou(index);
      //请在此对接加入弹出框
    }
    var arrTd = new Array();      //当前表格td数据
    var tblCon = $('.tbl-container');
    var Page = {
@@ -223,8 +233,10 @@
   function yanshou(check_en){
      if(check_en==0){
         return "未验收";
      }else{
         return "已验收";
      }else if(check_en==2){
         return "已申请验收";
      }else if(check==1){
         return"已完成验收";s
      }
   }
   // 查询内容
@@ -247,6 +259,7 @@
             if(data.code!=0&&data.data.length>0){
                data=data.data
                console.info(data);
                Page.pageAll=data[data.length-1].num;
                for(var i=0;i<data.length;i++){
                arrdata.push(data[i]);//存储数据
                arrTd[index++] = data[i].binf.StationId;
@@ -286,10 +299,15 @@
                arrTd[index++] = yanshou(data[i].check_en);
                arrTd[index++]='<a onclick="getButIndex(this)"  class="ui-btn ui-btn-inline ui-corner-all operat-but" data-position-to="window"'+'but-index='+i+'>电池组实时数据</a>'+
                '<a onclick="getApplyYanshouIndex(this)" href="#myPopup" id="apply_yanshou" data-rel="popup"  class="ui-btn ui-btn-inline ui-corner-all operat-but fr" data-position-to="window"'+'but-index='+i+'>申请验收</a>';
                //方法2 2按钮解开以下一条注释按钮
                //'<a onclick="getApplyYanshoupicture(this)" href="#myPopup" id="apply_yanshou" data-rel="popup"  class="ui-btn ui-btn-inline ui-corner-all operat-but fr" data-position-to="window"'+'but-index='+i+'>经纬度图片上传</a>'
                }
             }
             console.info(arrTd);
             console.info(arrdata);
             //Page.pageCurr=Math.ceil(Page.pageAll/Page.pageSize);
             //console.info(Page.pageCurr);
             setPage();
             createTbl(tblCon, arrTh, arrTd);
             /*timeer = window.setTimeout(function() {
                     searchBattLife();
@@ -299,10 +317,10 @@
   }
      
      function setApplyYanshou(index){
         //var value = Math.floor(34*index);
         console.info(arrdata);
         if(arrdata.length>0){   //存入的为所有已查出数据
            creatYanshouObj(arrdata,index);
         if(arrdata.length>0){   //存入的为所有已查出数据
            var arr= creatYanshouObj(arrdata,index);//申请验收方法。
            return arr;
         }else{
            alert("请等待几秒后再提交申请");
         }
@@ -310,11 +328,10 @@
      
      function creatYanshouObj(arrdata,index){
         var StationId = arrdata[index].binf.StationId;
         console.info(StationId);
         //console.info(StationId);
         var arr = new Array(); //初始化传参数组
         for(var i=0;i<arrdata.length;i++){
            if(StationId == arrdata[i].binf.StationId){
         for(var i=0;i<arrdata.length;i++){//一次验收该机房下的所有电池组构建对象 。
            if(StationId == arrdata[i].binf.StationId){
               var obj = {
                  binf:{
                     StationId : arrdata[i].binf.StationId,   // 机房编号
@@ -356,12 +373,18 @@
                  }
               }
               arr.push(obj);
               //console.info(obj)
            }
         }
         console.info(obj);
         var temp = JSON.stringify(arr);
         $.ajax({
         console.info(arr);
         return arr;
         //applyendyanshou(arr);//申请验收方法。
      }
      function applyendyanshou(arr){
      var temp = JSON.stringify(arr);
         $.ajax({                                   //申请验收
             type: 'post',
            async: true,
            url: 'Battinf_applyAction!checkPro',
@@ -375,11 +398,12 @@
               }
            }
         });
      }
       function setcookiedit(index){
             var arrcookie = new Array();   
               for(var i=0;i<33;i++){//共34项,最后一项为按钮,不必SET进数据
                  var value = Math.floor(34*index);
               for(var i=0;i<33;i++){//共arrTh.length项,最后几项为按钮,不必SET进数据
                  var value = Math.floor(arrTh.length*index);
                  value = Math.floor(value+i);
                  arrcookie.push(arrTd[value]);
               }
@@ -429,78 +453,8 @@
               setCookie("eleparm",json);  //这里setcookie,若有上一条cookie则清空上一笔
             setCookie("batt",json1);
       }
       function setcookieCreat(index){
             var arrcookie = new Array();
               for(var i=0;i<33;i++){//共34项,最后一项为按钮,不必SET进数据
                  var value = Math.floor(34*index);
                  //console.info(value);
                  value = Math.floor(value+i);
                if(i==13){//新建功能,电池组ID默认为当页最后一个电池组ID号加1
                   var groupid = Math.floor(arrTd[value]+1);
                   console.info(groupid);
                   arrcookie.push(groupid);
                }else{
                     //console.info(value);
                     arrcookie.push(arrTd[value]);
                  }
               }
               arrcookie.push("new");
               //console.info(arrcookie);
               var json=window.JSON.stringify(arrcookie);
               setCookie("eleparm",json);  //这里setcookie,若有上一条cookie则清空上一笔
       }
      
   // 查询内容
      function getUpdateArr(temp){
         var arr = new Array();
         var obj = new Object();
         obj.StationId = temp[0];   // 机房编号
         obj.StationName = (temp[1]+"-"+temp[2]+"-"+temp[4]+"-"+temp[5]);   // 拼接机房名称
         obj.StationName1 = temp[1];      // 省
         obj.StationName2 = temp[2];      // 市
         obj.StationName5 = temp[3];      // 区/县
         obj.StationName3 = temp[4];      // 机房名称
         obj.StationName4 = temp[5];      // 设备名称
         obj.StationIp = temp[6];            //机房ip
         obj.FBSDeviceId = temp[7];            //设备id
         obj.FbsDeviceIp = temp[8];            //设备ip
         obj.FbsDeviceIp_YM = temp[9];         // 设备掩码
         obj.FbsDeviceIp_WG = temp[10];         // 网关
         obj.FBSDeviceName = temp[11];         //设备名称
         obj.GroupIndexInFBSDevice = temp[12];   //fbs设备索引
         obj.BattGroupId = temp[13];            //电池组id
         obj.BattGroupNum = temp[14];         //机房内电池组编号
         obj.BattGroupName = temp[15];         //电池组名称
         obj.FloatVolLevel = temp[16];         //浮充电压阀值
         obj.OfflineVolLevel = temp[17];         //离线电压阀值
         obj.BattFloatCurrent = temp[18];      //浮充电流阀值
         obj.MonCount = temp[19];            //单体数量
         obj.MonCapStd = temp[20];            //标称容量
         obj.MonVolStd = temp[21];            //标称电压
         obj.MonResStd = temp[22];            //标称内阻
         obj.MonSerStd = temp[23];            //标称电导
         obj.MonVolLowToAvg = temp[24];         //单体电压次低偏移量
         obj.Load_curr = temp[25];            //负载电流
         obj.DisCurrMax = temp[26];            //最大核容电流
         obj.station_phone = temp[27];         //基站号码
         obj.BattProducer = temp[28];         //电池品牌
         obj.BattModel = temp[29];            //电池型号
         obj.BattProductDate =  temp[30];      //电池生产日期
         obj.BattInUseDate =  temp[31];         //电池使用日期
         obj.install_user = temp[32];         //安装人员
         arr.push(obj);
         console.info(arr);
         return arr;
      }
   function createSearchForm(){
   function createSearchForm(){//查询已审核传参。
      var temp={
            page:Page,
            StationName1:$('#mainteArea').val(),
@@ -525,8 +479,7 @@
            },
         };
         console.info(temp);
         return temp;
         return temp;
      }   
   
   $(function() {