From 208e6450a75b053c5fb71ffafcdd21b178c4899d Mon Sep 17 00:00:00 2001
From: hdw <hdw@192.168.1.132>
Date: 星期三, 26 十二月 2018 09:36:00 +0800
Subject: [PATCH] 修改头部信息

---
 gx_tieta/WebRoot/ex-battinfo.jsp |  117 +++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 107 insertions(+), 10 deletions(-)

diff --git a/gx_tieta/WebRoot/ex-battinfo.jsp b/gx_tieta/WebRoot/ex-battinfo.jsp
index e94e7b1..e97bd63 100644
--- a/gx_tieta/WebRoot/ex-battinfo.jsp
+++ b/gx_tieta/WebRoot/ex-battinfo.jsp
@@ -81,7 +81,7 @@
 			<a class="layui-btn layui-btn-xs" lay-event="adopt">瀹℃牳</a>
 		</script>
 		<script type="text/html" id="acceptBattGroupTools">
-			{{# if(d.check_en){ }}
+			{{# if(d.check_en !=2){ }}
 				<a class="layui-btn layui-btn-xs layui-btn-disabled" lay-event="accepted">楠屾敹</a>
 			{{# }else { }}
 				<a class="layui-btn layui-btn-xs layui-bg-blue" lay-event="accept">楠屾敹</a>
@@ -96,10 +96,12 @@
 			{{# } }}
 		</script>
 		<script type="text/html" id="acceptEn">
-			{{# if(d.check_en){ }}
+			{{# if(d.check_en == 1){ }}
 				<a class="layui-btn layui-btn-xs">宸查獙鏀�</a>
+			{{# }else if(d.check_en == 2){ }}
+				<a class="layui-btn layui-btn-danger layui-btn-xs">宸茬敵璇烽獙鏀�</a>
 			{{# }else{ }}
-				<a class="layui-btn layui-btn-danger layui-btn-xs">寰呴獙鏀�</a>
+				<a class="layui-btn layui-btn-danger layui-btn-xs">寰呯敵璇烽獙鏀�</a>
 			{{# } }}
 		</script>
 		<script type="text/html" id="produceTime">
@@ -212,12 +214,12 @@
 						,{field:'apply_name', title:'鐢宠浜�', align:'center', width: 120}
 						,{field:'apply_en', title:'鐢宠鐘舵��', align:'center', templet: '#applyEn',width: 120}
 						,{field:'apply_date', title:'鐢宠鏃ユ湡', align:'center', width: 260}
-				    	,{fixed: 'right', title:'瀹℃壒鎿嶄綔', align: 'center', toolbar: '#battGrouptools', width:120}
+				    	,{field:'doThings', fixed: 'right', title:'瀹℃壒鎿嶄綔', align: 'center', toolbar: '#battGrouptools', width:120}
 				    ]]
 					,data:[]
 					,limit: 10000
 				    ,page: false
-				    ,height: 'full-235'
+				    ,height: 'full-10'
 				};
 				
 				// 鐢熸垚琛ㄦ牸鏁版嵁
@@ -267,11 +269,14 @@
 						,{field:'isInstall', title:'瀹夎鐘舵��', templet: '#isInstall', align:'center', width: 140}
 						,{field:'install_user', title:'璁惧瀹夎浜哄憳', align:'center', width: 260}
 						,{field:'check_en', title:'楠屾敹鐘舵��', templet: '#acceptEn',align:'center', width: 120}
+						,{field:'latitude', title:'缁忓害', align:'center', width: 150}
+						,{field:'longitude', title:'绾害', align:'center', width: 150}
+						,{field:'address', title:'鍦板潃', align:'center', width: 230}
 						,{field:'apply_name', title:'鐢宠浜�', align:'center', width: 120}
 						,{field:'apply_date', title:'鐢宠鏃ユ湡', align:'center', width: 260}
 						,{field:'confirm_name', title:'瀹℃牳浜�', align:'center', width: 120}
 						,{field:'check_uname', title:'楠屾敹浜�', align:'center', width: 120}
-				    	,{fixed: 'right', title:'楠屾敹鎿嶄綔', align: 'center', toolbar: '#acceptBattGroupTools', width:180}
+				    	,{field:'doThings', fixed: 'right', title:'楠屾敹鎿嶄綔', align: 'center', toolbar: '#acceptBattGroupTools', width:180}
 				    ]]
 					,data:[]
 					,limit: 10000
@@ -399,6 +404,7 @@
 				function acceptBattGroup(data) {
 					// 鏋勯�犻獙鏀堕�氳繃鐨勬満鎴跨殑淇℃伅
 					var temp = [createAcceptParam(data)];
+					console.log(temp);
 					// 鏄惁鍗寸‘璁ら獙鏀�
 					layer.confirm('鏄惁纭楠屾敹', {icon: 3, title: '鎻愮ず'}, function(index) {
 						layer.close(index);
@@ -413,8 +419,14 @@
 					var temp = {};
 					temp.binf = {};
 					Object.keys(data).forEach(function(key) {
-						if(key == 'num') {
+						if(key == 'num') {		// 涓婚敭
 							temp.num = data[key];
+						}else if(key == 'latitude'){		// 绾害
+							temp.latitude = data[key];
+						}else if(key == 'longitude'){		// 缁忓害
+							temp.longitude = data[key];
+						}else if(key == 'address') {		// 鍦板潃
+							temp.address = data[key];
 						}else {
 							temp.binf[key] = data[key];
 						}
@@ -504,6 +516,8 @@
 						}
 						,complete: function() {
 							layer.close(load);
+							// 鍚姩鑷姩鍒锋柊
+							//updateSearch();
 						}
 					});
 				}
@@ -518,6 +532,48 @@
 					};
 					return temp;
 				}
+				
+				// 鏇存柊瀹℃煡琛ㄦ牸
+				function updateSearch() {
+					var temp = createSearchParam();
+					clearInterval(updateSearch.timer);
+					// 鏌ヨ鍚庡彴
+					$.ajax({
+						type: 'post'
+						,async: true
+						,url: "Battinf_applyAction!serchByCondition"
+						,data: "json="+JSON.stringify(temp)
+						,dataType: 'json'
+						,success: function(res) {
+							//console.log(res);
+							var rs = JSON.parse(res.result);
+							var resData = [];
+							if(rs.code == 1) {
+								var data = rs.data;
+								// console.log(data);
+								// 閬嶅巻鏁版嵁鐨勫��
+								for(var i=0; i<data.length; i++) {
+									var _data = data[i];
+									var _tmp = formaterResData(_data);
+									resData.push(_tmp);
+									Page.setAll(_data.apply_note);
+								}
+							}else {
+								Page.setAll(0);
+							}
+							$('#applyNum').text(Page.all);	 // 璁剧疆寰界珷
+							tOptions.data = resData;	//  璁剧疆琛ㄦ牸鐨勬暟鎹�
+							
+							// 鐢熸垚琛ㄦ牸鏁版嵁
+							table.reload('pageTbl', tOptions);
+							
+							// 瀹炴椂鍥炶皟
+							updateSearch.timer = setTimeout(updateSearch, 4000);
+						}
+					});
+				}
+				
+				
 				
 				// 鏌ヨ寰呴獙鏀剁殑鏈烘埧
 				acceptSearch();
@@ -538,7 +594,7 @@
 							var resData = [];
 							if(rs.code == 1) {
 								var data = rs.data;
-								// console.log(data);
+								//console.log(data);
 								// 閬嶅巻鏁版嵁鐨勫��
 								for(var i=0; i<data.length; i++) {
 									var _data = data[i];
@@ -556,10 +612,12 @@
 							
 							// 鐢熸垚琛ㄦ牸鏁版嵁
 							table.render(acceptOptions);
-							
+							console.log(table);
 						}
 						,complete: function() {
 							layer.close(load);
+							// 鍚姩鑷姩鍒锋柊
+							//updateAcceptSearch();
 						}
 					});
 				}
@@ -574,6 +632,45 @@
 					};
 					return temp;
 				}
+				
+				// 鏇存柊楠屾敹琛ㄦ牸
+				function updateAcceptSearch() {
+					var temp = acceptSearchParam();
+					clearInterval(updateAcceptSearch.timer);
+					// 鏌ヨ鍚庡彴
+					$.ajax({
+						type: 'post'
+						,async: true
+						,url: "Battinf_applyAction!serchByCondition"
+						,data: "json="+JSON.stringify(temp)
+						,dataType: 'json'
+						,success: function(res) {
+							var rs = JSON.parse(res.result);
+							var resData = [];
+							if(rs.code == 1) {
+								var data = rs.data;
+								// 閬嶅巻鏁版嵁鐨勫��
+								for(var i=0; i<data.length; i++) {
+									var _data = data[i];
+									var _tmp = formaterResData(_data);
+									resData.push(_tmp);
+									acceptPage.setAll(_data.apply_note);
+								}
+								//console.log(resData);
+							}else {
+								acceptPage.setAll(0);
+							}
+							
+							$('#acceptNum').text(getAcceptHome(resData));	 // 璁剧疆寰界珷
+							acceptOptions.data = resData;		// 璁剧疆琛ㄦ牸鐨勬暟鎹�
+							// 鐢熸垚琛ㄦ牸鏁版嵁
+							table.reload('acceptTbl', acceptOptions);
+							// 瀹炴椂鍥炶皟
+							updateAcceptSearch.timer = setTimeout(updateAcceptSearch, 4000);
+						}
+					});
+				}
+				
 				
 				// 鏋勯�犵粨鏋滈泦
 				function formaterResData(data) {
@@ -601,7 +698,7 @@
 					for(var i=0; i<data.length; i++) {
 						var _data = data[i];
 						// 鍒ゆ柇鏄惁琚獙鏀�
-						if(!_data.check_en) {
+						if(_data.check_en != 1) {
 							num++;
 						} 
 					}

--
Gitblit v1.9.1