From bba339575f11b6922b7cadda4eca2dddaa728e08 Mon Sep 17 00:00:00 2001
From: hdw <hdw@192.168.7.112>
Date: 星期四, 03 一月 2019 16:11:28 +0800
Subject: [PATCH] Merge branch 'dev_lxw' of https://gitlab.com/whyclxw1/gx_tieta.git into dev_lxw

---
 gx_tieta/WebRoot/mobil/ele-param2.html         |    4 -
 gx_tieta/WebRoot/mobil/batt-approved1.html     |  126 +++++++++++++++--------------------------
 gx_tieta/WebRoot/mobil/batt-approve-index.html |   37 ++++++------
 3 files changed, 67 insertions(+), 100 deletions(-)

diff --git a/gx_tieta/WebRoot/mobil/batt-approve-index.html b/gx_tieta/WebRoot/mobil/batt-approve-index.html
index fa21748..1c493a4 100644
--- a/gx_tieta/WebRoot/mobil/batt-approve-index.html
+++ b/gx_tieta/WebRoot/mobil/batt-approve-index.html
@@ -125,32 +125,33 @@
 	 					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);
 	 				}
-	 			
 	 			}
 	 		});			 
 	 	}	
 	 	
 	 	function setarrbatt(arrdata,station){
-	 	console.info(arrdata);
-		if(arrdata.length>0){   //瀛樺叆鐨勪负鎵�鏈夊凡鏌ュ嚭鏁版嵁		                                      
-					var arr= creatYanshouObj(arrdata,station);//鐢宠楠屾敹鏂规硶銆�
-					return arr;
-				}else{
-					alert("璇风瓑寰呭嚑绉掑悗鍐嶆彁浜ょ敵璇�");
-				}
+	 		console.info(arrdata);
+			if(arrdata.length>0){   //瀛樺叆鐨勪负鎵�鏈夊凡鏌ュ嚭鏁版嵁		                                      
+				var arr= creatYanshouObj(arrdata,station);//鐢宠楠屾敹鏂规硶銆�
+				return arr;
+			}else{
+				alert("璇风瓑寰呭嚑绉掑悗鍐嶆彁浜ょ敵璇�");
+			}
 		}
 	 	function creatYanshouObj(arrdata,station){          //閫氳繃鐐瑰嚮鏈烘埧淇℃伅锛坰tationid锛夛紝鑾峰彇璇ユ満鎴跨數姹犵粍
 			//var StationId = arrdata[index].binf.StationId;
diff --git a/gx_tieta/WebRoot/mobil/batt-approved1.html b/gx_tieta/WebRoot/mobil/batt-approved1.html
index 1c7d0ff..f0dc700 100644
--- a/gx_tieta/WebRoot/mobil/batt-approved1.html
+++ b/gx_tieta/WebRoot/mobil/batt-approved1.html
@@ -318,8 +318,8 @@
 	var arr = temp;
 	
 	function setcookieCreat(i){
-	console.info(temp);
-	console.info(i)
+		console.info(temp);
+		console.info(i)
 		//var index=Math.ceil(i-1);
 		arrdata = temp[i].binf;
 		console.info(arrdata);
@@ -336,7 +336,7 @@
 		}
 		
 		// 瀛樺偍鎵�鏈夌殑鏁版嵁
-		$('#homeInfoIframeAll').data('allData', temp);
+	$('#homeInfoIframeAll').data('allData', temp);
 		var _data = temp[0];
 		var _temp = {
 			homeId: _data.binf.StationId
@@ -347,7 +347,7 @@
 		}
 		
 		// 瀛樺偍闇�瑕佺殑homeInfo淇℃伅
-		$('#homeInfoIframe').data('homeInfo', _temp);
+	$('#homeInfoIframe').data('homeInfo', _temp);
 		
 		iframePopup = layer.open({
              type: 2
@@ -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