From 19f804b2f248e851b0a675635f8413c8dbbc55cf Mon Sep 17 00:00:00 2001 From: hdw <496960745@qq.com> Date: 星期三, 31 十月 2018 09:53:43 +0800 Subject: [PATCH] 电池测试添加区/县筛选 --- gx_tieta/WebRoot/dischargetest.jsp | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 55 insertions(+), 3 deletions(-) diff --git a/gx_tieta/WebRoot/dischargetest.jsp b/gx_tieta/WebRoot/dischargetest.jsp index fb40743..8655f70 100644 --- a/gx_tieta/WebRoot/dischargetest.jsp +++ b/gx_tieta/WebRoot/dischargetest.jsp @@ -85,7 +85,8 @@ <thead> <tr> <th>鐪�</th> - <th>甯�<!-- 缁存姢鍖� --></th> + <th>甯�</th> + <th>鍖�/鍘�</th> <th><s:text name="Computer_site"/><!-- 鏈烘埧绔欑偣锛堟垨鏈烘埧璁惧锛� --></th> <th><s:text name="Battery_name"/><!-- 钃勭數姹犵粍鍚嶇О --></th> </tr> @@ -98,6 +99,10 @@ </td> <td> <select id="city"> + </select> + </td> + <td> + <select id="county"> </select> </td> <td> @@ -1180,7 +1185,8 @@ }else { $select.text('').html('<option>鏆傛棤鍙祴甯�</option>'); } - findStationNamebyStationname1(); + // 鏌ヨ鍖�/鍘� + findCounty(); } }); } @@ -1194,14 +1200,59 @@ //褰撳競鐨勫�煎彉鎹㈡椂鏇存柊鏈烘埧绔欑偣 $('#city').change(function(){ + findCounty(); + }); + + //褰撳尯/鍘跨殑鍊煎彉鎹㈡椂鏇存柊鏈烘埧绔欑偣 + $('#county').change(function(){ findStationNamebyStationname1(); }); + + // 鏌ヨ鍖�/鍘� + function findCounty() { + var tmp = { + StationName1:$("#station_name1").val(), + StationName2:$("#city").val(), + }; + + // 鏌ヨ鍖哄幙 + $.ajax({ + type: 'post', + async: true, + url: "BattInfAction!serchStationName5", + data: "json="+JSON.stringify(tmp), + success:function(data) { + var rs = JSON.parse(data.result); + var $select = $("#county"); + if(rs.code==1){ + var _data = rs.data; + // 鏍规嵁鏁版嵁鏋勯�犵敓鎴愪笅鎷夊垪琛ㄧ殑鏁版嵁 + var optsList = []; + for(var i=0;i<_data.length;i++){ + var __data = _data[i]; + var _attr = { + StationId: __data.StationId + }; + var tmp = getOptionsData(__data.StationName5, __data.StationName5, __data, _attr); + optsList.push(tmp); + } + + // 鏍规嵁鏁版嵁鐢熸垚涓嬫媺鍒楄〃 + createOptions($select, optsList, true); + }else{ + $select.text('').html('<option>鏆傛棤鍙祴鏈烘埧绔欑偣</option>'); + } + findStationNamebyStationname1(); + } + }); + } //鏍规嵁缁存姢鍖烘煡璇㈢珯鐐� function findStationNamebyStationname1(){ var tmp = { StationName1:$("#station_name1").val(), - StationName2:$("#city").val() + StationName2:$("#city").val(), + StationName5: $("#county").val() }; //var selectvalue=$("#station_name1 option:selected").val(); //alert(selectvalue); @@ -1241,6 +1292,7 @@ var tmp = { StationName1:$("#station_name1").val(), StationName2:$("#city").val(), + StationName5:$("#county").val(), StationName: $("#station_name").val(), StationId: stationid }; -- Gitblit v1.9.1