From 1cd67d97e505e5c09f2d4a3a5d436f9ec1d2a4d8 Mon Sep 17 00:00:00 2001
From: 81041 <81041@DESKTOP-025NVD9>
Date: 星期二, 25 十二月 2018 10:01:42 +0800
Subject: [PATCH] Merge branch 'dev_lxw' of https://whyclxw1@gitlab.com/whyclxw1/gx_tieta.git into dev_lxw

---
 gx_tieta/WebRoot/mobil/batt-approved.html |  236 ++++++++++++++++++++++++++--------------------------------
 1 files changed, 106 insertions(+), 130 deletions(-)

diff --git a/gx_tieta/WebRoot/mobil/batt-approved.html b/gx_tieta/WebRoot/mobil/batt-approved.html
index 737ce6a..2616b63 100644
--- a/gx_tieta/WebRoot/mobil/batt-approved.html
+++ b/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,8 +259,9 @@
  				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].binf);//瀛樺偍鏁版嵁
+ 					arrdata.push(data[i]);//瀛樺偍鏁版嵁
  					arrTd[index++] = data[i].binf.StationId;
  					arrTd[index++] = data[i].binf.StationName1;
  					arrTd[index++] = data[i].binf.StationName2;
@@ -286,77 +299,111 @@
  					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鎸夐挳瑙e紑浠ヤ笅涓�鏉℃敞閲婃寜閽�
+ 					//'<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() {
+ 				/*timeer = window.setTimeout(function() {
 							searchBattLife();
-						}, 5000);	
+						}, 5000);	*/
  			}
  		});			
 	}
 		
 		function setApplyYanshou(index){
-			//var value = Math.floor(34*index);
 			console.info(arrdata);
-			if(arrdata){
-				creatYanshouObj(arrdata);
+			if(arrdata.length>0){   //瀛樺叆鐨勪负鎵�鏈夊凡鏌ュ嚭鏁版嵁		                                      
+				var arr= creatYanshouObj(arrdata,index);//鐢宠楠屾敹鏂规硶銆�
+				return arr;
 			}else{
 				alert("璇风瓑寰呭嚑绉掑悗鍐嶆彁浜ょ敵璇�");
 			}
 		}
 		
-		function creatYanshouObj(arrdata){
-			for(var i=0;i<tempindex.length;i++){
-				var obj = {
-					binf:{
-						StationId : temp[0],	// 鏈烘埧缂栧彿
-						StationName : (temp[1]+"-"+temp[2]+"-"+temp[4]+"-"+temp[5]),	// 鎷兼帴鏈烘埧鍚嶇О
-						StationName1 :temp[1],		// 鐪�
-						StationName2 : temp[2],		// 甯�
-						StationName5 : temp[3],		// 鍖�/鍘�
-						StationName3 : temp[4],		// 鏈烘埧鍚嶇О
-						StationName4 :temp[5],		// 璁惧鍚嶇О
-						StationIp : temp[6],				//鏈烘埧ip
-						FBSDeviceId : temp[7],				//璁惧id
-						FbsDeviceIp : temp[8],				//璁惧ip
-						FbsDeviceIp_YM : temp[9],			// 璁惧鎺╃爜
-						FbsDeviceIp_WG : temp[10],			// 缃戝叧
-						FBSDeviceName : temp[11],			//璁惧鍚嶇О
-						GroupIndexInFBSDevice : temp[12],	//fbs璁惧绱㈠紩
-						BattGroupId : tempid[temp[12]],				//鐢垫睜缁刬d
-						BattGroupNum : temp[14],			//鏈烘埧鍐呯數姹犵粍缂栧彿
-						BattGroupName : temp[15],        //鐢垫睜缁勭储寮�
-						FloatVolLevel : temp[16],			//娴厖鐢靛帇闃�鍊�
-						OfflineVolLevel : temp[17],			//绂荤嚎鐢靛帇闃�鍊�
-						BattFloatCurrent : temp[18],		//娴厖鐢垫祦闃�鍊�
-						MonCount : temp[19],				//鍗曚綋鏁伴噺
-						MonCapStd : temp[20],				//鏍囩О瀹归噺
-						MonVolStd : temp[21],				//鏍囩О鐢靛帇
-						MonResStd : temp[22],				//鏍囩О鍐呴樆
-						MonSerStd : temp[23],				//鏍囩О鐢靛
-						MonVolLowToAvg : temp[24],			//鍗曚綋鐢靛帇娆′綆鍋忕Щ閲�
-				
-						Load_curr : temp[25],				//璐熻浇鐢垫祦
-						DisCurrMax : temp[26],				//鏈�澶ф牳瀹圭數娴�
-						station_phone : temp[27],			//鍩虹珯鍙风爜
-										
-						BattProducer : temp[28],			//鐢垫睜鍝佺墝
-						BattModel : temp[29],				//鐢垫睜鍨嬪彿
-						BattProductDate :  temp[30]+" 00:00:00",		//鐢垫睜鐢熶骇鏃ユ湡
-						BattInUseDate :  temp[31]+" 00:00:00",			//鐢垫睜浣跨敤鏃ユ湡
-						install_user : temp[32],			//瀹夎浜哄憳
+		function creatYanshouObj(arrdata,index){
+			var StationId = arrdata[index].binf.StationId;
+			//console.info(StationId);
+			var arr = new Array(); //鍒濆鍖栦紶鍙傛暟缁�
+			for(var i=0;i<arrdata.length;i++){//涓�娆¢獙鏀惰鏈烘埧涓嬬殑鎵�鏈夌數姹犵粍鏋勫缓瀵硅薄 銆�
+				if(StationId == arrdata[i].binf.StationId){		
+					var obj = {
+						binf:{
+							StationId : arrdata[i].binf.StationId,	// 鏈烘埧缂栧彿
+							StationName : (arrdata[i].binf.StationName1+"-"+ arrdata[i].binf.StationName2+"-"+arrdata[i].binf.StationName5+"-"+arrdata[i].binf.StationName3),	// 鎷兼帴鏈烘埧鍚嶇О
+							StationName1 :arrdata[i].binf.StationName1,		// 鐪�
+							StationName2 : arrdata[i].binf.StationName2,		// 甯�
+							StationName5 :  arrdata[i].binf.StationName5,		// 鍖�/鍘�
+							StationName3 :  arrdata[i].binf.StationName3,		// 鏈烘埧鍚嶇О
+							StationName4 : arrdata[i].binf.StationName5,		// 璁惧鍚嶇О
+							StationIp :arrdata[i].binf.StationIp,				//鏈烘埧ip
+							FBSDeviceId : arrdata[i].binf.FBSDeviceId,				//璁惧id
+							FbsDeviceIp : arrdata[i].binf.FbsDeviceIp,				//璁惧ip
+							FbsDeviceIp_YM :  arrdata[i].binf.FbsDeviceIp_YM,			// 璁惧鎺╃爜
+							FbsDeviceIp_WG : arrdata[i].binf.FbsDeviceIp_WG ,			// 缃戝叧
+							FBSDeviceName : arrdata[i].binf.FBSDeviceName,			//璁惧鍚嶇О
+							GroupIndexInFBSDevice : arrdata[i].binf.GroupIndexInFBSDevice,	//fbs璁惧绱㈠紩
+							BattGroupId : arrdata[i].binf.BattGroupId,				//鐢垫睜缁刬d
+							BattGroupNum : arrdata[i].binf.BattGroupNum ,			//鏈烘埧鍐呯數姹犵粍缂栧彿
+							BattGroupName :arrdata[i].binf.BattGroupName,        //鐢垫睜缁勭储寮�
+							FloatVolLevel : arrdata[i].binf.FloatVolLevel,			//娴厖鐢靛帇闃�鍊�
+							OfflineVolLevel : arrdata[i].binf.OfflineVolLevel,			//绂荤嚎鐢靛帇闃�鍊�
+							BattFloatCurrent : arrdata[i].binf.BattFloatCurrent,		//娴厖鐢垫祦闃�鍊�
+							MonCount : arrdata[i].binf.MonCount,				//鍗曚綋鏁伴噺
+							MonCapStd : arrdata[i].binf.MonCapStd,				//鏍囩О瀹归噺
+							MonVolStd : arrdata[i].binf.MonVolStd,				//鏍囩О鐢靛帇
+							MonResStd : arrdata[i].binf.MonResStd,				//鏍囩О鍐呴樆
+							MonSerStd : arrdata[i].binf.MonSerStd,				//鏍囩О鐢靛
+							MonVolLowToAvg : arrdata[i].binf.MonVolLowToAvg,			//鍗曚綋鐢靛帇娆′綆鍋忕Щ閲�
+					
+							Load_curr : arrdata[i].binf.Load_curr,				//璐熻浇鐢垫祦
+							DisCurrMax : arrdata[i].binf.DisCurrMax,				//鏈�澶ф牳瀹圭數娴�
+							station_phone : arrdata[i].binf.station_phone,			//鍩虹珯鍙风爜
+											
+							BattProducer : arrdata[i].binf.BattProducer,			//鐢垫睜鍝佺墝
+							BattModel : arrdata[i].binf.BattModel,				//鐢垫睜鍨嬪彿
+							BattProductDate :  arrdata[i].binf.BattProductDate+" 00:00:00",		//鐢垫睜鐢熶骇鏃ユ湡
+							BattInUseDate :  arrdata[i].binf.BattInUseDate+" 00:00:00",			//鐢垫睜浣跨敤鏃ユ湡
+							install_user : arrdata[i].binf.install_user,			//瀹夎浜哄憳
+						}
+					}
+					arr.push(obj);
+				}
+			}
+			console.info(arr);
+			
+					
+			return arr;
+			//applyendyanshou(arr);//鐢宠楠屾敹鏂规硶銆�
+		}
+		
+		function applyendyanshou(arr){
+		var temp = JSON.stringify(arr);
+			$.ajax({                                   //鐢宠楠屾敹
+	 			type: 'post',
+				async: true,
+				url: 'Battinf_applyAction!checkPro',
+				data: "json="+temp,
+				dataType: 'json',
+				success:function(data) {
+					console.info(data);
+					data = JSON.parse(data.result);
+					if(data.code==1){
+						alert("鐢宠楠屾敹鎴愬姛");					
 					}
 				}
-			arr.push(obj);
-			}
+			});
+		
 		}
  		function setcookiedit(index){
  				var arrcookie = new Array();	
-			   	for(var i=0;i<33;i++){//鍏�34椤癸紝鏈�鍚庝竴椤逛负鎸夐挳锛屼笉蹇匰ET杩涙暟鎹�
-				   	var value = Math.floor(34*index);
+			   	for(var i=0;i<33;i++){//鍏盿rrTh.length椤癸紝鏈�鍚庡嚑椤逛负鎸夐挳锛屼笉蹇匰ET杩涙暟鎹�
+				   	var value = Math.floor(arrTh.length*index);
 				   	value = Math.floor(value+i);
 			   		arrcookie.push(arrTd[value]);
 			   	}
@@ -406,78 +453,8 @@
 			   	setCookie("eleparm",json);  //杩欓噷setcookie,鑻ユ湁涓婁竴鏉ookie鍒欐竻绌轰笂涓�绗�
  				setCookie("batt",json1);
  		}
- 		
- 		function setcookieCreat(index){
- 				var arrcookie = new Array();	
-			   	for(var i=0;i<33;i++){//鍏�34椤癸紝鏈�鍚庝竴椤逛负鎸夐挳锛屼笉蹇匰ET杩涙暟鎹�
-				   	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,鑻ユ湁涓婁竴鏉ookie鍒欐竻绌轰笂涓�绗�
- 		}
 		
-	// 鏌ヨ鍐呭
-
-		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];				//鐢垫睜缁刬d
-			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(),
@@ -502,8 +479,7 @@
 				},
 			};
 			console.info(temp);
-			return temp;
-			
+			return temp;		
 		}	
 	
 	$(function() {

--
Gitblit v1.9.1