Commit f013eba5f2a8413f80dec8da8cdc0fbd537b4e82
1 parent
b44ec03c
选择线路改变公司
Showing
1 changed file
with
6 additions
and
5 deletions
src/main/resources/static/pages/forms/statement/firstAndLastBus.html
| @@ -157,7 +157,6 @@ | @@ -157,7 +157,6 @@ | ||
| 157 | } | 157 | } |
| 158 | } | 158 | } |
| 159 | $('#subCompany').html(options); | 159 | $('#subCompany').html(options); |
| 160 | - initXl(); | ||
| 161 | } | 160 | } |
| 162 | 161 | ||
| 163 | // $("#subCompany").on("change",initXl); | 162 | // $("#subCompany").on("change",initXl); |
| @@ -187,7 +186,7 @@ | @@ -187,7 +186,7 @@ | ||
| 187 | // fage=true; | 186 | // fage=true; |
| 188 | // } | 187 | // } |
| 189 | 188 | ||
| 190 | - function initXl(){ | 189 | + var tempData = {}; |
| 191 | $.get('/report/lineList',function(xlList){ | 190 | $.get('/report/lineList',function(xlList){ |
| 192 | var data = []; | 191 | var data = []; |
| 193 | data.push({id: " ", text: "全部线路"}); | 192 | data.push({id: " ", text: "全部线路"}); |
| @@ -200,23 +199,25 @@ | @@ -200,23 +199,25 @@ | ||
| 200 | for(var k=0;k < xlList.length;k++ ){ | 199 | for(var k=0;k < xlList.length;k++ ){ |
| 201 | if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){ | 200 | if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){ |
| 202 | data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]}); | 201 | data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]}); |
| 202 | + tempData[xlList[k]["xlbm"]] = companyCode+":"+code; | ||
| 203 | } | 203 | } |
| 204 | } | 204 | } |
| 205 | } | 205 | } |
| 206 | } | 206 | } |
| 207 | initPinYinSelect2('#line',data,''); | 207 | initPinYinSelect2('#line',data,''); |
| 208 | 208 | ||
| 209 | - $("#company").attr("disabled", false); | ||
| 210 | - $("#subCompany").attr("disabled", false); | ||
| 211 | }); | 209 | }); |
| 212 | }); | 210 | }); |
| 213 | - } | ||
| 214 | 211 | ||
| 215 | $("#line").on("change", function(){ | 212 | $("#line").on("change", function(){ |
| 216 | if($("#line").val() == " "){ | 213 | if($("#line").val() == " "){ |
| 217 | $("#company").attr("disabled", false); | 214 | $("#company").attr("disabled", false); |
| 218 | $("#subCompany").attr("disabled", false); | 215 | $("#subCompany").attr("disabled", false); |
| 219 | } else { | 216 | } else { |
| 217 | + var temp = tempData[$("#line").val()].split(":"); | ||
| 218 | + $("#company").val(temp[0]); | ||
| 219 | + updateCompany(); | ||
| 220 | + $("#subCompany").val(temp[1]); | ||
| 220 | $("#company").attr("disabled", true); | 221 | $("#company").attr("disabled", true); |
| 221 | $("#subCompany").attr("disabled", true); | 222 | $("#subCompany").attr("disabled", true); |
| 222 | } | 223 | } |