Commit f013eba5f2a8413f80dec8da8cdc0fbd537b4e82

Authored by 娄高锋
1 parent b44ec03c

选择线路改变公司

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