From 7b8e271ed8344866c0dbe56942625ccedb5564c7 Mon Sep 17 00:00:00 2001
From: hdw <496960745@qq.com>
Date: 星期五, 02 十一月 2018 17:31:00 +0800
Subject: [PATCH] 问题反馈

---
 gx_tieta/WebRoot/iframe/batt-fault-manage-add.html |   79 ++++++++++++++++++++++++++++++++-------
 1 files changed, 64 insertions(+), 15 deletions(-)

diff --git a/gx_tieta/WebRoot/iframe/batt-fault-manage-add.html b/gx_tieta/WebRoot/iframe/batt-fault-manage-add.html
index e9cb1f4..60b1953 100644
--- a/gx_tieta/WebRoot/iframe/batt-fault-manage-add.html
+++ b/gx_tieta/WebRoot/iframe/batt-fault-manage-add.html
@@ -38,21 +38,24 @@
 								<table>
 									<tbody>
 										<tr>
-											<th>鐪�</th>
-											<!-- 鐪� -->
-											<th>甯�</th>
-											<!-- 甯� -->
-											<th>鏈烘埧鍚嶇О</th>
-											<!-- 鏈烘埧绔欑偣 -->
+											<th>鐪�</th>			<!-- 鐪� -->
+											<th>甯�</th>			<!-- 甯� -->
+											<th>鍖�/鍘�</th>		<!-- 鍖�/鍘� -->
+											<th>鏈烘埧鍚嶇О</th>		<!-- 鏈烘埧绔欑偣 -->
 										</tr>
 										<tr>
-											<td><select name="station_name1" id="station_name1" lay-verify="">
-											
-											</select></td>
-											<td><select name="" id="city" lay-verify="">
-											</select></td>
-											<td><select name="" id="station_name3" lay-verify="">
-											</select></td>
+											<td>
+												<select name="station_name1" id="station_name1"></select>銆�
+											</td>
+											<td>
+												<select name="" id="city"></select>
+											</td>
+											<td>
+												<select name="" id="county"></select>
+											</td>
+											<td>
+												<select name="" id="station_name3" ></select>
+											</td>
 										</tr>
 									</tbody>
 								</table>
@@ -201,18 +204,64 @@
                     $select.text('').html('<option>鏆傛棤鍙祴甯�</option>');
                     renderForm();
                 }
-                findStationNamebyStationname1();
+                searchCounty();
             }
         });
     }
+    
+    // 鏌ヨ鍖�/鍘�
+	function searchCounty() {
+		// 鏋勯�犳煡璇㈡潯浠�
+		var tmp = {
+			StationName1: $("#province").val(),
+			StationName2: $("#city").val()
+		};
+		// 鏍规嵁鏋勯�犳潯浠舵煡璇㈠唴瀹�
+		$.ajax({
+			type: 'post',
+			async: true,
+			url: 'BattInfAction!serchStationName5',
+			dataType: 'json',
+			data: "json = "+JSON.stringify(tmp),
+			success: function(result) {
+				var rs = JSON.parse(result.result);
+				var list = [];				// option缁撴灉闆�
+				var ele = $('#county');	// 鐩爣select
+				if(rs.code == 1) {
+					var data = rs.data;
+					list.push(getLayuiSelect('璇烽�夋嫨鍖�/鍘�', '', {}, undefined));
+					// 閬嶅巻鏌ヨ缁撴灉
+					for(var i=0; i<data.length; i++) {
+						var _data = data[i];
+						var _tmp = getLayuiSelect(_data.StationName5, _data.StationName5, {}, _data);
+						list.push(_tmp);
+					}
+				}else {
+					list.push(getLayuiSelect('鏆傛棤鍖�/鍘�', '', {}, undefined));
+				}
+				
+				// 鏍规嵁瀵硅薄鏁扮粍鐢熸垚涓嬫媺鍒楄〃
+				createLayuiSelect(ele, list);
+				form.render('select', 'countyFilter');
+				
+				// 鏌ヨ鏈烘埧
+				findCity();
+			}
+		});
+	}
     //褰撶淮鎶ゅ尯鐨勫�煎彉鎹㈡椂鏇存柊甯�
     $('#station_name1').change(function() {
         findCity();
     });
     //褰撶淮鎶ゅ尯鐨勫�煎彉鎹㈡椂鏇存柊鏈烘埧绔欑偣
     $('#city').change(function() {
-        findStationNamebyStationname1();
+        searchCounty();
     });
+    // 鍒囨崲鍖�/鍘�-鏈烘埧
+	form.on('select(county)', function(data) {
+		// 鏌ヨ鏈烘埧
+		findCity(true);
+	});
 
     //鏍规嵁鐪侊紝甯傛煡璇㈢珯鐐�
     function findStationNamebyStationname1() {

--
Gitblit v1.9.1