From eb76b43741480d9b819bde9f8a258fdc0b118b00 Mon Sep 17 00:00:00 2001 From: D:/workspace/chenjingjing/git/gx_tieta/gx_tieta/.gitignore <chenjingjing@LAPTOP-E51P2139> Date: 星期四, 03 一月 2019 11:54:25 +0800 Subject: [PATCH] 已验收不显示于已审批,通信计数方法重写优化 --- gx_tieta/WebRoot/mobil/ele-param2.html | 4 - gx_tieta/WebRoot/mobil/batt-approved1.html | 118 ++++++++++++++------------------------- gx_tieta/WebRoot/mobil/batt-approve-index.html | 23 ++++--- 3 files changed, 56 insertions(+), 89 deletions(-) diff --git a/gx_tieta/WebRoot/mobil/batt-approve-index.html b/gx_tieta/WebRoot/mobil/batt-approve-index.html index fa21748..58e62f0 100644 --- a/gx_tieta/WebRoot/mobil/batt-approve-index.html +++ b/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); } - } }); } diff --git a/gx_tieta/WebRoot/mobil/batt-approved1.html b/gx_tieta/WebRoot/mobil/batt-approved1.html index 1c7d0ff..2d90d2e 100644 --- a/gx_tieta/WebRoot/mobil/batt-approved1.html +++ b/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()); diff --git a/gx_tieta/WebRoot/mobil/ele-param2.html b/gx_tieta/WebRoot/mobil/ele-param2.html index e4075f3..74553c3 100644 --- a/gx_tieta/WebRoot/mobil/ele-param2.html +++ b/gx_tieta/WebRoot/mobil/ele-param2.html @@ -464,9 +464,7 @@ }, }; console.info(temp); - searchBattLife(temp) - - + searchBattLife(temp); } // 鏌ヨ鍐呭 function searchBattLife(temp){ -- Gitblit v1.9.1