From 2fe250ece8de95b3f70172fe5b45793ab6a3084a Mon Sep 17 00:00:00 2001
From: D:/workspace/chenjingjing/git/gx_tieta/gx_tieta/.gitignore <chenjingjing@LAPTOP-E51P2139>
Date: 星期五, 18 一月 2019 17:30:50 +0800
Subject: [PATCH] 未审批可更改

---
 gx_tieta/WebRoot/iframe/batt-info-add.html |  143 +++++++++++++++++++++++++++++++++++++----------
 1 files changed, 112 insertions(+), 31 deletions(-)

diff --git a/gx_tieta/WebRoot/iframe/batt-info-add.html b/gx_tieta/WebRoot/iframe/batt-info-add.html
index a541c9e..b43ff93 100644
--- a/gx_tieta/WebRoot/iframe/batt-info-add.html
+++ b/gx_tieta/WebRoot/iframe/batt-info-add.html
@@ -17,6 +17,9 @@
     		font-size: 20px;
     		color: #FF5722;
     	}
+    	.layui-not-show {
+    		display: none;
+    	}
     </style>
 </head>
 <body>
@@ -92,7 +95,7 @@
                 </div>
             </div>
         </div>
-        <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
+        <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3 layui-not-show">
             <div class="layui-block">
                 <label class="layui-form-label">璁惧ID<span class="red">*</span></label>
                 <div class="layui-input-block">
@@ -100,7 +103,7 @@
                 </div>
             </div>
         </div>
-        <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
+        <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3 layui-not-show">
             <div class="layui-block">
                 <label class="layui-form-label">璁惧IP</label>
                 <div class="layui-input-block">
@@ -230,9 +233,9 @@
         </div>
         <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
             <div class="layui-block">
-                <label class="layui-form-label">浣跨敤鏃ユ湡</label>
+                <label class="layui-form-label">鎶曞叆浣跨敤鏃ユ湡</label>
                 <div class="layui-input-block">
-                    <input type="text" name="BattInUseDate" disabled="" id="usedate" autocomplete="off" class="layui-input layui-bg-gray" value="{{= d.BattInUseDate }}">
+                    <input type="text" name="BattInUseDate"  id="usedate" autocomplete="off" class="layui-input" value="{{= d.BattInUseDate }}">
                 </div>
             </div>
         </div>
@@ -371,6 +374,22 @@
 		{{# }); }}
 		</div>
     </script>
+    <script type="text/html" id="msgTpl">
+		<div style="width: 380px;" class="layui-form layui-form-pane">
+			<div class="layui-form-item">
+				<label class="layui-form-label">璁惧ID</label>
+				<div class="layui-input-block">
+					<input type="text" name="FBSDeviceId" disabled="" lay-verify="title" autocomplete="off" placeholder="璇疯緭鍏ユ爣棰�" class="layui-input layui-bg-gray" value="{{d.FBSDeviceId}}">
+				</div>
+			</div>
+			<div class="layui-form-item">
+				<label class="layui-form-label">璁惧IP</label>
+				<div class="layui-input-block">
+					<input type="text" name="FBSDeviceIP" disabled="" lay-verify="title" autocomplete="off" placeholder="璇疯緭鍏ユ爣棰�" class="layui-input layui-bg-gray" value="{{d.FbsDeviceIp}}">
+				</div>
+			</div>
+		</div>
+	</script>
     <script type="text/javascript" src="../js/jquery-1.8.3.js"></script>
     <script type="text/javascript" src="../js/base.js"></script>
     <script type="text/javascript" src="../src/layui.js"></script>
@@ -385,9 +404,13 @@
 
             var battInfoTpl = $('#battInfoTpl').html();
 			var editInfo = parent.$('#iframeEdit').data('data');
+			var editPopupShow = parent.$('#iframeShowEidt');
 			var monCapStds = [50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 1000];
-			var battProducers = ['鍦i槼', '鐞嗗+', '閾舵嘲', '鍗楅兘', '鍙岀櫥', 'SENRY', '鑹鹃粯鐢�', '绉戝+杈�', '涓版棩', '涓叴鑳芥淳', '鍏夊畤', '閮庤揪', '鑹捐鏂崕杈�', '闆勯煬', '椋庡竼', '鏂囬殕', '涓北'];
+			var battProducers = getBattProducers();
 			var monNums = [4, 24]
+			
+			// 娣诲姞瀹屾垚鍚庢彁绀轰俊鎭殑妯℃澘
+			var msgTpl = $('#msgTpl').html();
 			
 			editInfo.FbsDeviceIp = getDevIp(editInfo.FBSDeviceId);		// 璁剧疆璁惧IP
 			editInfo.monCapStds = monCapStds;		// 鏍囩О瀹归噺鍒楄〃
@@ -429,7 +452,7 @@
                 ,useDate: '2018-09-18 00:00:00'
                 ,install_user: '鍛靛懙'
             };
-            
+           
             // 娓叉煋鍐呭
             laytpl(battInfoTpl).render(editInfo, function(html) {
                 $('#battInfo').html(html);
@@ -445,6 +468,7 @@
                 laydate.render({
                     elem: '#usedate'
                     ,format: 'yyyy-MM-dd HH:mm:ss'
+                    ,value: new Date()
                 });
             });
             
@@ -519,29 +543,79 @@
             
             // 鎻愪氦鍐呭
             form.on('submit(enAdd)', function(data) {
-            	//console.log(data);
-            	layer.confirm('鏄惁纭娣诲姞', {icon: 3, title:'鎻愮ず'}, function(index){
-            		 var _data = data.field;
-            		 var province = _data.StationName1;		// 鐪�
-            		 var city = _data.StationName2;			// 甯�
-            		 var home = _data.StationName3;			// 鏈烘埧鍚嶇О
-            		 var bts = _data.StationName4;			// 璁惧鍚嶇О
-            		 _data.StationName = province+'-'+city+'-'+home+'-'+bts;
-            		 
-            		 var temp = analysisData(editInfo.addGroupNum, _data);
-            		 
-            		 checkDevId(_data.FBSDeviceId, function(devid){
-            		 	// 娣诲姞鐢垫睜淇℃伅
-            		 	addBatt(temp);
-            		 }, function(pre, max) {
-            		 	layer.msg('璁惧ID:'+pre+'琚崰鐢�,鎺ㄨ崘浣跨敤'+max);
-            		 	// 鏇存柊璁惧id鍜岃澶噄p
-            		 	$('#devid').val(max);
-            		 	$('#fbsip').val(getDevIp(max));
-            		 });
+            	// 鏍¢獙鏈烘埧鍚嶇О
+            	checkHomeName(data, function() {
+            		//console.log(data);
+	            	layer.confirm('鏄惁纭娣诲姞', {icon: 3, title:'鎻愮ず'}, function(index){
+	            		 var _data = data.field;
+	            		 var province = _data.StationName1;		// 鐪�
+	            		 var city = _data.StationName2;			// 甯�
+	            		 var home = _data.StationName3;			// 鏈烘埧鍚嶇О
+	            		 var bts = _data.StationName4;			// 璁惧鍚嶇О
+	            		 _data.StationName = province+'-'+city+'-'+home+'-'+bts;
+	            		 
+	            		 var temp = analysisData(editInfo.addGroupNum, _data);
+	            		 
+	            		 checkDevId(_data.FBSDeviceId, function(devid){
+	            		 	// 娣诲姞鐢垫睜淇℃伅
+	            		 	addBatt(temp);
+	            		 }, function(pre, max) {
+	            		 	layer.msg('璁惧ID:'+pre+'琚崰鐢�,鎺ㄨ崘浣跨敤'+max);
+	            		 	// 鏇存柊璁惧id鍜岃澶噄p
+	            		 	$('#devid').val(max);
+	            		 	$('#fbsip').val(getDevIp(max));
+	            		 });
+	            	});
             	});
+            	
             	return false;
             });
+            
+            // 妫�娴嬫満鎴垮悕绉版槸鍚︾浉鍚�
+            function checkHomeName(data, callback) {
+            	var _data = data.field;
+        		var province = _data.StationName1;		// 鐪�
+        		var city = _data.StationName2;			// 甯�
+        		var home = _data.StationName3;			// 鏈烘埧鍚嶇О
+        		var bts = _data.StationName4;			// 璁惧鍚嶇О
+        		_data.StationName = province+'-'+city+'-'+home+'-'+bts;
+        		// 鏋勯�犳煡璇㈡潯浠�
+        		var tmp = {
+        			StationName: _data.StationName
+        		};
+        		var loading = layer.load(1);
+        		// 璇锋眰鍚庡彴楠岃瘉
+        		$.ajax({
+        			type: 'post'
+        			,async: true
+        			,url: 'BattInfAction!judgeBatt'
+        			,data: 'json='+JSON.stringify(tmp)
+        			,dataType: 'json'
+        			,success: function(res) {
+        				var rs = JSON.parse(res.result);
+        				//console.log(rs);
+        				if(rs.code == 1) {
+        					// 鏈烘埧宸插瓨鍦ㄥ垽鏂槸鍚﹁繘鍏ョ紪杈戞満鎴�
+        					layer.confirm('璇ユ満鎴垮凡瀛樺湪锛屾槸鍚﹁繘鍏ョ紪杈戯紒',{icon:0, title: '鎻愮ず'}, function(index) {
+        						// 鏄剧ず缂栬緫闈㈡澘
+        						editPopupShow.data('sName', _data.StationName);
+        						editPopupShow.click();
+        						// 鍏抽棴娣诲姞闈㈡澘闈㈡澘
+        						parent.$('#iframeClose').click();
+        					});
+        				}else {
+        					callback();
+        				}
+        			}
+        			,error: function() {
+        				layer.msg('鏍¢獙鏈烘埧鍚嶇О澶辫触锛岃閲嶆柊鎻愪氦锛�');
+        			}
+        			,complete: function() {
+        				layer.close(loading);
+        			}
+        		});
+        		
+            }
             
             // 鐩戞祴褰撳墠鎻愪氦鐨勮澶嘔D鏄惁涓烘渶澶�
             function checkDevId(devid, success, error) {
@@ -668,11 +742,18 @@
 						var model = eval('('+data.result+')');
 						//console.info(model);
 						if(model.code ==1){
-							layer.msg('娣诲姞鎴愬姛锛�3绉掑悗闈㈡澘鑷姩鍏抽棴');
-							setTimeout(function() {
-								parent.$('#iframeClose').click();
-								parent.$('#paging .search').click();
-							}, 3000);
+							parent.layer.msg('娣诲姞鎴愬姛锛�3绉掑悗闈㈡澘鑷姩鍏抽棴');
+							// 鎻愮ず淇℃伅
+				           	laytpl(msgTpl).render(temp[0], function(html) {
+				           		parent.layer.open({
+					            	title: '閲嶈淇℃伅'
+					            	,area: ['420px', 'auto']
+					            	,content: html
+					            });
+				           	});
+							
+							parent.$('#iframeClose').click();
+							parent.$('#paging .search').click();
 						}else{
 							layer.msg('娣诲姞澶辫触锛�');
 						}			

--
Gitblit v1.9.1