D:/workspace/chenjingjing/git/gx_tieta/gx_tieta/.gitignore
2019-01-03 eb76b43741480d9b819bde9f8a258fdc0b118b00
已验收不显示于已审批,通信计数方法重写优化
3个文件已修改
145 ■■■■■ 已修改文件
gx_tieta/WebRoot/mobil/batt-approve-index.html 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/WebRoot/mobil/batt-approved1.html 118 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/WebRoot/mobil/ele-param2.html 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/WebRoot/mobil/batt-approve-index.html
@@ -125,20 +125,21 @@
                         var model = new Array();
                         console.info(data);
                         for(var i=0;i<data.length;i++){
                             arrdata.push(data[i]);//存储数据
                             if(model.length==0){
                                 model.push(data[i].binf.StationName);
                             }else{
                                 if(model[model.length-1]!=data[i].binf.StationName){
                                     model.push(data[i].binf.StationName);
                                 }
                             }
                             console.info(model);
                             stationlist=model;
                             if(data[i].check_en!=1){
                                 arrdata.push(data[i]);//存储数据
                                 if(model.length==0){
                                     model.push(data[i].binf.StationName);
                                 }else{
                                     if(model[model.length-1]!=data[i].binf.StationName){//若不重复,则PUSH进去
                                         model.push(data[i].binf.StationName);
                                     }
                                 }
                                 console.info(model);
                                 stationlist=model;
                             }
                         }
                         createUl($('#battList'),model);
                     }
                 }
             });             
         }    
gx_tieta/WebRoot/mobil/batt-approved1.html
@@ -377,20 +377,18 @@
    $(function () {
        //setTimes($("#startTestrecord"),'2000-01-01');
        //setTimes($("#endTestrecord"),new Date().format('yyyy-MM-dd'));
    installstartdata(temp);//导入初始页面值
    diubao();//初始丢包率
    updateinstalldata(temp);//实时更新验收状态
    timeer = window.setTimeout(function() {
            diubao();
            updateinstalldata(temp);
                        }, 4000);    //丢包率,通信计数,4秒刷新1次。
        //4秒刷新一次页面
        //setTimes($("#endTestrecord"),new Date().format('yyyy-MM-dd'));
        installstartdata(temp);//导入初始页面值
        getnewnumber(temp[0].binf.FBSDeviceId);
        updateinstalldata();
    });
    var timeer = '';
    
    function updateinstalldata(temp){
        //console.info(temp);
    function updateinstalldata(){
        console.info(temp);
        // 清除计时器
        clearInterval(updateinstalldata.timer);
        var data=temp[0].binf.StationId;
         var _data ={ binf:{
                     StationId:data
@@ -404,15 +402,19 @@
                url: 'Battinf_applyAction!serchById',
                data: "json="+data,
                dataType: 'json',
                success:function(data) {
                data = JSON.parse(data.result);
                console.info(data);
                if(data.code==1&&data.data.length>0){
                    data = data.data;
                    //console.info(data[0].check_en);
                    document.getElementById("check_en").value = yanshou(data[0].check_en);
                }
                success:function(data) {
                    data = JSON.parse(data.result);
                    console.info(data);
                    if(data.code==1&&data.data.length>0){
                        data = data.data;
                        //console.info(data[0].check_en);
                        document.getElementById("check_en").value = yanshou(data[0].check_en);
                    }
                    // 更新内容
                    updateinstalldata.timer = setTimeout(function() {
                        updateinstalldata();
                    }, 4000);
                }
            });
    }
@@ -512,67 +514,40 @@
            }
    }
    
    function diubao(){
        if(temp.length>0){
            data=temp[0].binf;
            document.getElementById("tongxunnumber").value = getCookienumber(data.StationId);
            document.getElementById("diubaonumber").value = getCookiediubao(data.StationId);
        }
    }
     function getCookienumber(id){//输入ID,返回通讯计数。数据从缓存获取。
         var a = getnumber();
         //console.info(a);
         if(getCookie("numberget")){
             var number = getCookie("numberget");
             number = JSON.parse(number);
             console.info(number);
             if(number[0]){
                 for(var i =0; i<number.length;i++){
                     if(id == number[i].dev_id){
                         return number[i].dev_commcount;
                     }
                 }
             }
         }
         return 0;
     }
     function getnumber(){     //向获取所有通讯计数并存入缓存
        $.ajax({
     function getnewnumber(id){//丢包率,通讯计数
     $.ajax({
             type: 'post',
            async: true,
            url: 'Battinf_applyAction!devCommNum',
            data: null,
            dataType: 'json',
            success:function(data) {
                console.info(data);
                data = JSON.parse(data.result);
                if(data.code==1){
                    console.info(data.data);
                    var json =JSON.stringify(data.data);
                    setCookie("numberget",json);
                    //return data.data;
                    data=data.data;
                    console.info(data[0]);
                    for(var i=0;i<data.length;i++){
                    console.info(data[i].dev_id);
                    console.info(id)
                        if(data[i].dev_id==id){
                            console.info(id);
                            document.getElementById("tongxunnumber").value = data[i].dev_commcount;
                            var errorCount = data[i].dev_errcommcount;
                             var allCount = data[i].dev_commcount+errorCount;
                             var parcent = (allCount==0?0:errorCount/allCount*100);
                             console.info(parcent);
                             document.getElementById("diubaonumber").value = parcent;
                        }
                    }
                }
            }
        });
     }
     
     function getCookiediubao(id){   //丢包率
         if(getCookie("numberget")){
             var number = getCookie("numberget");
             number = JSON.parse(number);
             console.info(number);
             if(number[0]){
                 for(var i =0; i<number.length;i++){
                     if(id == number[i].dev_id){
                         var errorCount = number[i].dev_errcommcount;
                         var allCount = number[i].dev_commcount+errorCount;
                         var parcent = (allCount==0?0:errCount/allCount*100)
                         return parcent;
                     }
                 }
             }
         }
         return 0;
     }
    // 格式化提交后台信息的对象数组并返回 单个修改,手机方式不修改多个电池组
        function getUpdateArr(){
            mon=$('#MonVolStd').val();
@@ -652,13 +627,6 @@
            });  
        });
     function nullOrn(){
             return true;
     }
     function editBatt(){//
         console.info(getUpdateArr());
         var temp = JSON.stringify(getUpdateArr());
gx_tieta/WebRoot/mobil/ele-param2.html
@@ -464,9 +464,7 @@
                },
            };
            console.info(temp);
            searchBattLife(temp)
            searchBattLife(temp);
        }    
    // 查询内容
    function searchBattLife(temp){