Commit 656b79e8f0a7f38397281c6a465a13683e0bb7f3

Authored by 廖磊
1 parent c2efac08

报表线路选择 不根据公司选

Showing 35 changed files with 1120 additions and 788 deletions
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
... ... @@ -570,15 +570,15 @@ public class ReportServiceImpl implements ReportService{
570 570 String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
571 571  
572 572 //查询全程
573   - String sqlqc="select t.*,x.station_name as qdz_name from ( "
574   - + " (SELECT bc_type, fcsj,qdz,2 as xh,xl_dir FROM bsth_c_s_ttinfo_detail "
  573 + String sqlqc="select t.* from ( "
  574 + + " (SELECT bc_type, fcsj,qdz,2 as xh,xl_dir,qdz_name FROM bsth_c_s_ttinfo_detail "
575 575 + " where ttinfo ='"+ttinfo+"' and (bc_type='normal' || bc_type='region') "
576 576 + " and fcsj <='"+minfcsj+"') "
577 577 + " union "
578   - + " (SELECT bc_type, fcsj,qdz,1 as xh,xl_dir FROM bsth_c_s_ttinfo_detail "
  578 + + " (SELECT bc_type, fcsj,qdz,1 as xh,xl_dir,qdz_name FROM bsth_c_s_ttinfo_detail "
579 579 + " where ttinfo ='"+ttinfo+"' and (bc_type='normal' || bc_type='region') "
580 580 + " and fcsj > '"+minfcsj+"') "
581   - + "order by xl_dir,xh,fcsj ) t left join bsth_c_station x on t.qdz=x.id";
  581 + + "order by xl_dir,xh,fcsj ) t ";
582 582 List<Map<String, String>> qclist= jdbcTemplate.query(sqlqc,
583 583 new RowMapper<Map<String, String>>(){
584 584 @Override
... ... @@ -619,12 +619,12 @@ public class ReportServiceImpl implements ReportService{
619 619 sxbc++;
620 620 upfcsj.add(m.get("fcsj"));
621 621 if(sxqdz.length() == 0 && m.containsKey("qdz_name"))
622   - sxqdz = m.get("qdz_name");
  622 + sxqdz = m.get("qdz_name")==null?"":m.get("qdz_name").toString();
623 623 } else {
624 624 xxbc++;
625 625 downfcsj.add(m.get("fcsj"));
626 626 if(xxqdz.length() == 0 && m.containsKey("qdz_name"))
627   - xxqdz = m.get("qdz_name");
  627 + xxqdz = m.get("qdz_name")==null?"":m.get("qdz_name").toString();
628 628 }
629 629 }
630 630 if(upfcsj.size() != 0)
... ...
src/main/resources/static/pages/forms/statement/account.html
... ... @@ -86,7 +86,7 @@
86 86 locale : 'zh-cn'
87 87 });
88 88  
89   - $.get('/basic/lineCode2Name',function(result){
  89 + /* $.get('/basic/lineCode2Name',function(result){
90 90 var data=[];
91 91  
92 92 for(var code in result){
... ... @@ -94,7 +94,29 @@
94 94 }
95 95 initPinYinSelect2('#line',data,'');
96 96  
97   - })
  97 + }) */
  98 +
  99 + $.get('/report/lineList',function(xlList){
  100 + var data = [];
  101 +// data.push({id: " ", text: "全部线路"});
  102 + $.get('/user/companyData', function(result){
  103 + for(var i = 0; i < result.length; i++){
  104 + var companyCode = result[i].companyCode;
  105 + var children = result[i].children;
  106 + for(var j = 0; j < children.length; j++){
  107 + var code = children[j].code;
  108 + for(var k=0;k < xlList.length;k++ ){
  109 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  110 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  111 +// tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  112 + }
  113 + }
  114 + }
  115 + }
  116 + initPinYinSelect2('#line',data,'');
  117 +
  118 + });
  119 + });
98 120 //重置
99 121 $('#czcl').on('click', function () {
100 122 $('#code').val('').change();
... ...
src/main/resources/static/pages/forms/statement/busInterval.html
... ... @@ -217,42 +217,51 @@
217 217 }
218 218 }
219 219 $('#subCompany').html(options);
220   - initXl();
221 220 }
222 221  
223   - $("#subCompany").on("change",initXl);
224   - function initXl(){
225   - var data=[];
226   - data.push({id:" ", text:"全部线路"});
227   - if(fage){
228   - $("#line").select2("destroy").html('');
229   - }
230   - var fgs=$('#subCompany').val();
231   - var gs=$('#company').val();
232   - for(var i=0;i<xlList.length;i++){
233   - if(gs!=""){
234   - if(fgs!=""){
235   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
236   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
237   - }
238   - }else{
239   - if(xlList[i]["gsbm"]==gs){
240   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  222 +
  223 + var tempData = {};
  224 + $.get('/report/lineList',function(xlList){
  225 + var data = [];
  226 + data.push({id: " ", text: "全部线路"});
  227 + $.get('/user/companyData', function(result){
  228 + for(var i = 0; i < result.length; i++){
  229 + var companyCode = result[i].companyCode;
  230 + var children = result[i].children;
  231 + for(var j = 0; j < children.length; j++){
  232 + var code = children[j].code;
  233 + for(var k=0;k < xlList.length;k++ ){
  234 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  235 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  236 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  237 + }
241 238 }
242 239 }
243 240 }
244   - }
245   - initPinYinSelect2('#line',data,'');
246   - fage=true;
247   -
248   - $("#endDate").attr("disabled", true);
249   - $("#endDate").val($("#startDate").val());
250   - line = data[0].id;
251   - statu = 0;
252   -
253   - updateModel();
254   - }
  241 + initPinYinSelect2('#line',data,'');
  242 + $("#endDate").attr("disabled", true);
  243 + $("#endDate").val($("#startDate").val());
  244 + line = data[0].id;
  245 + statu = 0;
  246 +
  247 + updateModel();
  248 +
  249 + });
  250 + });
255 251  
  252 + $("#line").on("change", function(){
  253 + if($("#line").val() == " "){
  254 + $("#company").attr("disabled", false);
  255 + $("#subCompany").attr("disabled", false);
  256 + } else {
  257 + var temp = tempData[$("#line").val()].split(":");
  258 + $("#company").val(temp[0]);
  259 + updateCompany();
  260 + $("#subCompany").val(temp[1]);
  261 + $("#company").attr("disabled", true);
  262 + $("#subCompany").attr("disabled", true);
  263 + }
  264 + });
256 265  
257 266 $("#query").on("click",jsDoQuery);
258 267  
... ...
src/main/resources/static/pages/forms/statement/commandState.html
... ... @@ -178,33 +178,44 @@
178 178 }
179 179 }
180 180 $('#subCompany').html(options);
181   - initXl();
182 181 }
183 182  
184   - $("#subCompany").on("change",initXl);
185   - function initXl(){
186   - var data=[];
187   - if(fage){
188   - $("#line").select2("destroy").html('');
189   - }
190   - var fgs=$('#subCompany').val();
191   - var gs=$('#company').val();
192   - for(var i=0;i<xlList.length;i++){
193   - if(gs!=""){
194   - if(fgs!=""){
195   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
196   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
197   - }
198   - }else{
199   - if(xlList[i]["gsbm"]==gs){
200   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  183 + var tempData = {};
  184 + $.get('/report/lineList',function(xlList){
  185 + var data = [];
  186 + $.get('/user/companyData', function(result){
  187 + for(var i = 0; i < result.length; i++){
  188 + var companyCode = result[i].companyCode;
  189 + var children = result[i].children;
  190 + for(var j = 0; j < children.length; j++){
  191 + var code = children[j].code;
  192 + for(var k=0;k < xlList.length;k++ ){
  193 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  194 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  195 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  196 + }
201 197 }
202 198 }
203 199 }
  200 + initPinYinSelect2('#line',data,'');
  201 +
  202 + });
  203 + });
  204 +
  205 + $("#line").on("change", function(){
  206 + if($("#line").val() == " "){
  207 + $("#company").attr("disabled", false);
  208 + $("#subCompany").attr("disabled", false);
  209 + } else {
  210 + var temp = tempData[$("#line").val()].split(":");
  211 + $("#company").val(temp[0]);
  212 + updateCompany();
  213 + $("#subCompany").val(temp[1]);
  214 + $("#company").attr("disabled", true);
  215 + $("#subCompany").attr("disabled", true);
204 216 }
205   - initPinYinSelect2('#line',data,'');
206   - fage=true;
207   - }
  217 + });
  218 +
208 219  
209 220 $('#code').select2({
210 221 ajax: {
... ...
src/main/resources/static/pages/forms/statement/correctForm.html
... ... @@ -112,16 +112,29 @@
112 112 $("#date").val(year + "-" + month + "-" + day);
113 113 $("#endDate").val(year + "-" + month + "-" + day);
114 114  
115   - $.get('/basic/lineCode2Name',function(result){
116   - var data=[];
117   -
118   - for(var code in result){
119   - data.push({id: code, text: result[code]});
120   - }
121   - initPinYinSelect2('#line',data,'');
122   -
123   - })
124   - $('#czcl').on('click', function () {
  115 + $.get('/report/lineList',function(xlList){
  116 + var data = [];
  117 +// data.push({id: " ", text: "全部线路"});
  118 + $.get('/user/companyData', function(result){
  119 + for(var i = 0; i < result.length; i++){
  120 + var companyCode = result[i].companyCode;
  121 + var children = result[i].children;
  122 + for(var j = 0; j < children.length; j++){
  123 + var code = children[j].code;
  124 + for(var k=0;k < xlList.length;k++ ){
  125 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  126 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  127 +// tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  128 + }
  129 + }
  130 + }
  131 + }
  132 + initPinYinSelect2('#line',data,'');
  133 +
  134 + });
  135 + });
  136 +
  137 + $('#czcl').on('click', function () {
125 138 $('#code').val('').change();
126 139 });
127 140  
... ... @@ -203,7 +216,7 @@
203 216 });
204 217  
205 218 var line = $("#line").val();
206   - var date = $("#date").val();endDate
  219 + var date = $("#date").val();
207 220 var lpName = $("#lpName").val();
208 221 var endDate = $("#endDate").val();
209 222 var code = $("#code").val();
... ...
src/main/resources/static/pages/forms/statement/correctStatis.html
... ... @@ -145,49 +145,8 @@
145 145 $("#times1").attr("disabled", true);
146 146 $("#times2").attr("disabled", true);
147 147  
148   -// $.get('/basic/lineCode2Name', function(result){
149   -// var data=[];
150   -
151   -// data.push({id: " ", text: "全部线路"});
152   -// for(var code in result){
153   -// data.push({id: code, text: result[code]});
154   -// }
155   -// console.log(data);
156   -// initPinYinSelect2('#line',data,'');
157 148  
158   -// line = "";
159   -// // updateModel();
160   -// });
161   -
162   -// var obj = [];
163   -// $.get('/user/companyData', function(result){
164   -// obj = result;
165   -// var options = '';
166   -// for(var i = 0; i < obj.length; i++){
167   -// options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
168   -// }
169   -// if(obj.length == 1){
170   -// $('#company1').hide();
171   -// if(obj[0].children.length == 1)
172   -// $('#subCompany1').hide();
173   -// }
174   -// $('#company').html(options);
175   -// updateCompany();
176   -// });
177   -// $("#company").on("change",updateCompany);
178   -// function updateCompany(){
179   -// var company = $('#company').val();
180   -// var options = '';
181   -// for(var i = 0; i < obj.length; i++){
182   -// if(obj[i].companyCode == company){
183   -// var children = obj[i].children;
184   -// for(var j = 0; j < children.length; j++){
185   -// options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
186   -// }
187   -// }
188   -// }
189   -// $('#subCompany').html(options);
190   -// }
  149 +
191 150 var fage=false;
192 151 var xlList;
193 152 var obj = [];
... ... @@ -225,36 +184,44 @@
225 184 }
226 185 }
227 186 $('#subCompany').html(options);
228   - initXl();
229 187 }
230 188  
231   - $("#subCompany").on("change",initXl);
232   - function initXl(){
233   - var data=[];
234   - data.push({id:" ", text:"全部线路"});
235   - if(fage){
236   - $("#line").select2("destroy").html('');
237   - }
238   - var fgs=$('#subCompany').val();
239   - var gs=$('#company').val();
240   - for(var i=0;i<xlList.length;i++){
241   - if(gs!=""){
242   - if(fgs!=""){
243   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
244   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
245   - }
246   - }else{
247   - if(xlList[i]["gsbm"]==gs){
248   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  189 + var tempData = {};
  190 + $.get('/report/lineList',function(xlList){
  191 + var data = [];
  192 + data.push({id: " ", text: "全部线路"});
  193 + $.get('/user/companyData', function(result){
  194 + for(var i = 0; i < result.length; i++){
  195 + var companyCode = result[i].companyCode;
  196 + var children = result[i].children;
  197 + for(var j = 0; j < children.length; j++){
  198 + var code = children[j].code;
  199 + for(var k=0;k < xlList.length;k++ ){
  200 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  201 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  202 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  203 + }
249 204 }
250 205 }
251 206 }
  207 + initPinYinSelect2('#line',data,'');
  208 +
  209 + });
  210 + });
  211 +
  212 + $("#line").on("change", function(){
  213 + if($("#line").val() == " "){
  214 + $("#company").attr("disabled", false);
  215 + $("#subCompany").attr("disabled", false);
  216 + } else {
  217 + var temp = tempData[$("#line").val()].split(":");
  218 + $("#company").val(temp[0]);
  219 + updateCompany();
  220 + $("#subCompany").val(temp[1]);
  221 + $("#company").attr("disabled", true);
  222 + $("#subCompany").attr("disabled", true);
252 223 }
253   - initPinYinSelect2('#line',data,'');
254   - fage=true;
255   -
256   - line = "";
257   - }
  224 + });
258 225  
259 226  
260 227 $("#query").on("click",jsDoQuery);
... ...
src/main/resources/static/pages/forms/statement/daily.html
... ... @@ -139,7 +139,7 @@
139 139 }
140 140 }
141 141 $('#fgsdmDaily').html(options);
142   - initXl();
  142 +// initXl();
143 143 }
144 144  
145 145 /* $.get('/basic/lineCode2Name',function(result){
... ... @@ -152,7 +152,7 @@
152 152  
153 153 }) */
154 154  
155   - $("#fgsdmDaily").on("change",initXl);
  155 + /* $("#fgsdmDaily").on("change",initXl);
156 156 function initXl(){
157 157 var data=[];
158 158 if(fage){
... ... @@ -175,7 +175,44 @@
175 175 }
176 176 initPinYinSelect2('#line',data,'');
177 177 fage=true;
178   - }
  178 + } */
  179 + var tempData = {};
  180 + $.get('/report/lineList',function(xlList){
  181 + var data = [];
  182 +// data.push({id: " ", text: "全部线路"});
  183 + $.get('/user/companyData', function(result){
  184 + for(var i = 0; i < result.length; i++){
  185 + var companyCode = result[i].companyCode;
  186 + var children = result[i].children;
  187 + for(var j = 0; j < children.length; j++){
  188 + var code = children[j].code;
  189 + for(var k=0;k < xlList.length;k++ ){
  190 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  191 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  192 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  193 + }
  194 + }
  195 + }
  196 + }
  197 + initPinYinSelect2('#line',data,'');
  198 +
  199 + });
  200 + });
  201 +
  202 + $("#line").on("change", function(){
  203 + if($("#line").val() == " "){
  204 + $("#gsdmDaily").attr("disabled", false);
  205 + $("#fgsdmDaily").attr("disabled", false);
  206 + } else {
  207 + var temp = tempData[$("#line").val()].split(":");
  208 + $("#gsdmDaily").val(temp[0]);
  209 + updateCompany();
  210 + $("#fgsdmDaily").val(temp[1]);
  211 + $("#gsdmDaily").attr("disabled", true);
  212 + $("#fgsdmDaily").attr("disabled", true);
  213 + }
  214 + });
  215 +
179 216  
180 217 var line;
181 218 var date;
... ...
src/main/resources/static/pages/forms/statement/firstAndLastBus_sum.html
... ... @@ -176,34 +176,44 @@
176 176 }
177 177 }
178 178 $('#subCompany').html(options);
179   - initXl();
180 179 }
181   -
182   - $("#subCompany").on("change",initXl);
183   - function initXl(){
184   - var data=[];
185   - if(fage){
186   - $("#line").select2("destroy").html('');
187   - }
188   - var fgs=$('#subCompany').val();
189   - var gs=$('#company').val();
  180 +
  181 + var tempData = {};
  182 + $.get('/report/lineList',function(xlList){
  183 + var data = [];
190 184 data.push({id: " ", text: "全部线路"});
191   - for(var i=0;i<xlList.length;i++){
192   - if(gs!=""){
193   - if(fgs!=""){
194   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
195   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
196   - }
197   - }else{
198   - if(xlList[i]["gsbm"]==gs){
199   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  185 + $.get('/user/companyData', function(result){
  186 + for(var i = 0; i < result.length; i++){
  187 + var companyCode = result[i].companyCode;
  188 + var children = result[i].children;
  189 + for(var j = 0; j < children.length; j++){
  190 + var code = children[j].code;
  191 + for(var k=0;k < xlList.length;k++ ){
  192 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  193 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  194 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  195 + }
200 196 }
201 197 }
202 198 }
  199 + initPinYinSelect2('#line',data,'');
  200 +
  201 + });
  202 + });
  203 +
  204 + $("#line").on("change", function(){
  205 + if($("#line").val() == " "){
  206 + $("#company").attr("disabled", false);
  207 + $("#subCompany").attr("disabled", false);
  208 + } else {
  209 + var temp = tempData[$("#line").val()].split(":");
  210 + $("#company").val(temp[0]);
  211 + updateCompany();
  212 + $("#subCompany").val(temp[1]);
  213 + $("#company").attr("disabled", true);
  214 + $("#subCompany").attr("disabled", true);
203 215 }
204   - initPinYinSelect2('#line',data,'');
205   - fage=true;
206   - }
  216 + });
207 217  
208 218 var list;
209 219 $("#forms tbody").on("click","a",function(){
... ...
src/main/resources/static/pages/forms/statement/historyMessage.html
... ... @@ -81,16 +81,29 @@
81 81 locale : 'zh-cn'
82 82 });
83 83  
84   - $.get('/basic/lineCode2Name',function(result){
85   - var data=[];
86   -
87   - for(var code in result){
88   - data.push({id: code, text: result[code]});
89   - }
90   - console.log(data);
91   - initPinYinSelect2('#line',data,'');
92   -
93   - })
  84 + $.get('/report/lineList',function(xlList){
  85 + var data = [];
  86 +// data.push({id: " ", text: "全部线路"});
  87 + $.get('/user/companyData', function(result){
  88 + for(var i = 0; i < result.length; i++){
  89 + var companyCode = result[i].companyCode;
  90 + var children = result[i].children;
  91 + for(var j = 0; j < children.length; j++){
  92 + var code = children[j].code;
  93 + for(var k=0;k < xlList.length;k++ ){
  94 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  95 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  96 +// tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  97 + }
  98 + }
  99 + }
  100 + }
  101 + initPinYinSelect2('#line',data,'');
  102 +
  103 + });
  104 + });
  105 +
  106 +
94 107 $('#code').select2({
95 108 ajax: {
96 109 url: '/realSchedule/sreachVehic',
... ...
src/main/resources/static/pages/forms/statement/jobSummary.html
... ... @@ -240,43 +240,46 @@
240 240 }
241 241 }
242 242 $('#fgsdmJob').html(options);
243   - initXl();
  243 +// initXl();
244 244 }
245 245  
246   - $("#fgsdmJob").on("change",initXl);
247   - function initXl(){
248   - var data=[];
249   - if(fage){
250   - $("#line").select2("destroy").html('');
251   - }
252   - var fgs=$('#fgsdmJob').val();
253   - var gs=$('#gsdmJob').val();
254   - for(var i=0;i<xlList.length;i++){
255   - if(gs!=""){
256   - if(fgs!=""){
257   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
258   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
259   - }
260   - }else{
261   - if(xlList[i]["gsbm"]==gs){
262   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  246 + var tempData = {};
  247 + $.get('/report/lineList',function(xlList){
  248 + var data = [];
  249 +// data.push({id: " ", text: "全部线路"});
  250 + $.get('/user/companyData', function(result){
  251 + for(var i = 0; i < result.length; i++){
  252 + var companyCode = result[i].companyCode;
  253 + var children = result[i].children;
  254 + for(var j = 0; j < children.length; j++){
  255 + var code = children[j].code;
  256 + for(var k=0;k < xlList.length;k++ ){
  257 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  258 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  259 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  260 + }
263 261 }
264 262 }
265 263 }
266   - }
267   - initPinYinSelect2('#line',data,'');
268   - fage=true;
269   - }
  264 + initPinYinSelect2('#line',data,'');
  265 +
  266 + });
  267 + });
270 268  
271   - /* $.get('/basic/lineCode2Name',function(result){
272   - var data=[];
273   -
274   - for(var code in result){
275   - data.push({id: code, text: result[code]});
  269 + $("#line").on("change", function(){
  270 + if($("#line").val() == " "){
  271 + $("#gsdmJob").attr("disabled", false);
  272 + $("#fgsdmJob").attr("disabled", false);
  273 + } else {
  274 + var temp = tempData[$("#line").val()].split(":");
  275 + $("#gsdmJob").val(temp[0]);
  276 + updateCompany();
  277 + $("#fgsdmJob").val(temp[1]);
  278 + $("#gsdmJob").attr("disabled", true);
  279 + $("#fgsdmJob").attr("disabled", true);
276 280 }
277   - initPinYinSelect2('#line',data,'');
278   -
279   - }) */
  281 + });
  282 +
280 283  
281 284 jQuery.fn.rowspan = function(colIdx) { //封装的一个JQuery小插件
282 285 return this.each(function(){
... ...
src/main/resources/static/pages/forms/statement/lbStatuAnaly.html
... ... @@ -233,36 +233,44 @@
233 233 }
234 234 }
235 235 $('#subCompany').html(options);
236   - initXl();
237 236 }
238 237  
239   - $("#subCompany").on("change",initXl);
240   - function initXl(){
241   - var data=[];
242   - data.push({id:" ", text:"全部线路"});
243   - if(fage){
244   - $("#line").select2("destroy").html('');
245   - }
246   - var fgs=$('#subCompany').val();
247   - var gs=$('#company').val();
248   - for(var i=0;i<xlList.length;i++){
249   - if(gs!=""){
250   - if(fgs!=""){
251   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
252   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
253   - }
254   - }else{
255   - if(xlList[i]["gsbm"]==gs){
256   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  238 + var tempData = {};
  239 + $.get('/report/lineList',function(xlList){
  240 + var data = [];
  241 + data.push({id: " ", text: "全部线路"});
  242 + $.get('/user/companyData', function(result){
  243 + for(var i = 0; i < result.length; i++){
  244 + var companyCode = result[i].companyCode;
  245 + var children = result[i].children;
  246 + for(var j = 0; j < children.length; j++){
  247 + var code = children[j].code;
  248 + for(var k=0;k < xlList.length;k++ ){
  249 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  250 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  251 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  252 + }
257 253 }
258 254 }
259 255 }
  256 + initPinYinSelect2('#line',data,'');
  257 +
  258 + });
  259 + });
  260 +
  261 + $("#line").on("change", function(){
  262 + if($("#line").val() == " "){
  263 + $("#company").attr("disabled", false);
  264 + $("#subCompany").attr("disabled", false);
  265 + } else {
  266 + var temp = tempData[$("#line").val()].split(":");
  267 + $("#company").val(temp[0]);
  268 + updateCompany();
  269 + $("#subCompany").val(temp[1]);
  270 + $("#company").attr("disabled", true);
  271 + $("#subCompany").attr("disabled", true);
260 272 }
261   - initPinYinSelect2('#line',data,'');
262   - line = data[0].id;
263   - updateModel();
264   - fage=true;
265   - }
  273 + });
266 274  
267 275 var lb = 0; //标志是否有选择至少一个烂班类型
268 276 $("#totalLb").on("change", function(){
... ...
src/main/resources/static/pages/forms/statement/lineTimeAnaly.html
... ... @@ -291,48 +291,57 @@
291 291 }
292 292 }
293 293 $('#subCompany').html(options);
294   - initXl();
295 294 }
296 295  
297   - $("#subCompany").on("change",initXl);
298   - function initXl(){
299   - var data=[];
300   - if(fage){
301   - $("#line").select2("destroy").html('');
302   - }
303   - var fgs=$('#subCompany').val();
304   - var gs=$('#company').val();
305   - for(var i=0;i<xlList.length;i++){
306   - if(gs!=""){
307   - if(fgs!=""){
308   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
309   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
310   - }
311   - }else{
312   - if(xlList[i]["gsbm"]==gs){
313   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  296 +
  297 +
  298 + var tempData = {};
  299 + $.get('/report/lineList',function(xlList){
  300 + var data = [];
  301 + $.get('/user/companyData', function(result){
  302 + for(var i = 0; i < result.length; i++){
  303 + var companyCode = result[i].companyCode;
  304 + var children = result[i].children;
  305 + for(var j = 0; j < children.length; j++){
  306 + var code = children[j].code;
  307 + for(var k=0;k < xlList.length;k++ ){
  308 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  309 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  310 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  311 + }
314 312 }
315 313 }
316 314 }
317   - }
318   - initPinYinSelect2('#line',data,'');
319   - fage=true;
320   -
321   - line = data[0].id;
322   - updateModel();
323   -
324   - var params = {};
325   - params['line'] = line;
326   - $get('/busInterval/getDir', params, function(result){
327   - dirData = createTreeData(result);
328   - var options = '<option value="">全部方向</option>';
329   - $.each(dirData, function(i, g){
330   - options += '<option value="'+g.name+'">'+g.name+'</option>';
  315 + initPinYinSelect2('#line',data,'');
  316 + line = data[0].id;
  317 + updateModel();
  318 +
  319 + var params = {};
  320 + params['line'] = line;
  321 + $get('/busInterval/getDir', params, function(result){
  322 + dirData = createTreeData(result);
  323 + var options = '<option value="">全部方向</option>';
  324 + $.each(dirData, function(i, g){
  325 + options += '<option value="'+g.name+'">'+g.name+'</option>';
  326 + });
  327 + $('#upDown').html(options);
331 328 });
332   - $('#upDown').html(options);
333 329 });
334   - }
335   -
  330 + });
  331 +
  332 + $("#line").on("change", function(){
  333 + if($("#line").val() == " "){
  334 + $("#company").attr("disabled", false);
  335 + $("#subCompany").attr("disabled", false);
  336 + } else {
  337 + var temp = tempData[$("#line").val()].split(":");
  338 + $("#company").val(temp[0]);
  339 + updateCompany();
  340 + $("#subCompany").val(temp[1]);
  341 + $("#company").attr("disabled", true);
  342 + $("#subCompany").attr("disabled", true);
  343 + }
  344 + });
336 345  
337 346 $("#query").on("click", function (){
338 347 jsDoQuery();
... ...
src/main/resources/static/pages/forms/statement/peopleCarPlan.html
... ... @@ -138,33 +138,43 @@
138 138 }
139 139 }
140 140 $('#subCompany').html(options);
141   - initXl();
142 141 }
143   -
144   - $("#subCompany").on("change",initXl);
145   - function initXl(){
146   - var data=[];
147   - if(fage){
148   - $("#line").select2("destroy").html('');
149   - }
150   - var fgs=$('#subCompany').val();
151   - var gs=$('#company').val();
152   - for(var i=0;i<xlList.length;i++){
153   - if(gs!=""){
154   - if(fgs!=""){
155   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
156   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
157   - }
158   - }else{
159   - if(xlList[i]["gsbm"]==gs){
160   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  142 + var tempData = {};
  143 + $.get('/report/lineList',function(xlList){
  144 + var data = [];
  145 + $.get('/user/companyData', function(result){
  146 + for(var i = 0; i < result.length; i++){
  147 + var companyCode = result[i].companyCode;
  148 + var children = result[i].children;
  149 + for(var j = 0; j < children.length; j++){
  150 + var code = children[j].code;
  151 + for(var k=0;k < xlList.length;k++ ){
  152 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  153 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  154 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  155 + }
161 156 }
162 157 }
163 158 }
  159 + initPinYinSelect2('#line',data,'');
  160 +
  161 + });
  162 + });
  163 +
  164 + $("#line").on("change", function(){
  165 + if($("#line").val() == " "){
  166 + $("#company").attr("disabled", false);
  167 + $("#subCompany").attr("disabled", false);
  168 + } else {
  169 + var temp = tempData[$("#line").val()].split(":");
  170 + $("#company").val(temp[0]);
  171 + updateCompany();
  172 + $("#subCompany").val(temp[1]);
  173 + $("#company").attr("disabled", true);
  174 + $("#subCompany").attr("disabled", true);
164 175 }
165   - initPinYinSelect2('#line',data,'');
166   - fage=true;
167   - }
  176 + });
  177 +
168 178  
169 179  
170 180 $("#query").on("click",jsDoQuery);
... ...
src/main/resources/static/pages/forms/statement/scheduleAnaly.html
... ... @@ -171,35 +171,46 @@
171 171 }
172 172 }
173 173 $('#subCompany').html(options);
174   - initXl();
175 174 }
176 175  
177   - $("#subCompany").on("change",initXl);
178   - function initXl(){
179   - var data=[];
180   - if(fage){
181   - $("#line").select2("destroy").html('');
182   - }
183   - var fgs=$('#subCompany').val();
184   - var gs=$('#company').val();
185   - for(var i=0;i<xlList.length;i++){
186   - if(gs!=""){
187   - if(fgs!=""){
188   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
189   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
190   - }
191   - }else{
192   - if(xlList[i]["gsbm"]==gs){
193   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  176 +
  177 + var tempData = {};
  178 + $.get('/report/lineList',function(xlList){
  179 + var data = [];
  180 + $.get('/user/companyData', function(result){
  181 + for(var i = 0; i < result.length; i++){
  182 + var companyCode = result[i].companyCode;
  183 + var children = result[i].children;
  184 + for(var j = 0; j < children.length; j++){
  185 + var code = children[j].code;
  186 + for(var k=0;k < xlList.length;k++ ){
  187 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  188 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  189 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  190 + }
194 191 }
195 192 }
196 193 }
  194 + initPinYinSelect2('#line',data,'');
  195 + line = data[0].id;
  196 + updateModel();
  197 +
  198 + });
  199 + });
  200 +
  201 + $("#line").on("change", function(){
  202 + if($("#line").val() == " "){
  203 + $("#company").attr("disabled", false);
  204 + $("#subCompany").attr("disabled", false);
  205 + } else {
  206 + var temp = tempData[$("#line").val()].split(":");
  207 + $("#company").val(temp[0]);
  208 + updateCompany();
  209 + $("#subCompany").val(temp[1]);
  210 + $("#company").attr("disabled", true);
  211 + $("#subCompany").attr("disabled", true);
197 212 }
198   - initPinYinSelect2('#line',data,'');
199   - line = data[0].id;
200   - updateModel();
201   - fage=true;
202   - }
  213 + });
203 214  
204 215  
205 216 $("#query").on("click", function(){
... ...
src/main/resources/static/pages/forms/statement/scheduleAnaly_sum.html
... ... @@ -171,38 +171,45 @@
171 171 }
172 172 }
173 173 $('#subCompany').html(options);
174   - initXl();
175 174 }
176   -
177   - $("#subCompany").on("change",initXl);
178   - function initXl(){
179   - var data=[];
180   - if(fage){
181   - $("#line").select2("destroy").html('');
182   - }
183   - var fgs=$('#subCompany').val();
184   - var gs=$('#company').val();
185   - for(var i=0;i<xlList.length;i++){
186   - if(gs!=""){
187   - if(fgs!=""){
188   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
189   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
190   - }
191   - }else{
192   - if(xlList[i]["gsbm"]==gs){
193   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  175 +
  176 + var tempData = {};
  177 + $.get('/report/lineList',function(xlList){
  178 + var data = [];
  179 + $.get('/user/companyData', function(result){
  180 + for(var i = 0; i < result.length; i++){
  181 + var companyCode = result[i].companyCode;
  182 + var children = result[i].children;
  183 + for(var j = 0; j < children.length; j++){
  184 + var code = children[j].code;
  185 + for(var k=0;k < xlList.length;k++ ){
  186 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  187 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  188 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  189 + }
194 190 }
195 191 }
196 192 }
197   - }
198   - initPinYinSelect2('#line',data,'');
199   - line = data[0].id;
200   - updateModel();
201   - initCl();
202   -
203   - fage=true;
204   - }
  193 + initPinYinSelect2('#line',data,'');
  194 + line = data[0].id;
  195 + updateModel();
  196 + initCl();
  197 + });
  198 + });
205 199  
  200 + $("#line").on("change", function(){
  201 + if($("#line").val() == " "){
  202 + $("#company").attr("disabled", false);
  203 + $("#subCompany").attr("disabled", false);
  204 + } else {
  205 + var temp = tempData[$("#line").val()].split(":");
  206 + $("#company").val(temp[0]);
  207 + updateCompany();
  208 + $("#subCompany").val(temp[1]);
  209 + $("#company").attr("disabled", true);
  210 + $("#subCompany").attr("disabled", true);
  211 + }
  212 + });
206 213  
207 214 $("#query").on("click", function(){
208 215 page = 0;
... ...
src/main/resources/static/pages/forms/statement/scheduleDaily.html
... ... @@ -340,32 +340,46 @@ word-wrap: break-word;
340 340 }
341 341 }
342 342 $('#fgsdmDdrb').html(options);
343   - initXl();
344 343 }
345   - $("#fgsdmDdrb").on("change",initXl);
346   - function initXl(){
347   - var data=[];
348   - if(fage){
349   - $("#line").select2("destroy").html('');
350   - }
351   - var fgs=$('#fgsdmDdrb').val();
352   - var gs=$('#gsdmDdrb').val();
353   - for(var i=0;i<xlList.length;i++){
354   - if(gs!=""){
355   - if(fgs!=""){
356   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
357   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
358   - }
359   - }else{
360   - if(xlList[i]["gsbm"]==gs){
361   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  344 +
  345 +
  346 + var tempData = {};
  347 + $.get('/report/lineList',function(xlList){
  348 + var data = [];
  349 + $.get('/user/companyData', function(result){
  350 + for(var i = 0; i < result.length; i++){
  351 + var companyCode = result[i].companyCode;
  352 + var children = result[i].children;
  353 + for(var j = 0; j < children.length; j++){
  354 + var code = children[j].code;
  355 + for(var k=0;k < xlList.length;k++ ){
  356 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  357 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  358 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  359 + }
362 360 }
363 361 }
364 362 }
  363 + initPinYinSelect2('#line',data,'');
  364 +
  365 + });
  366 + });
  367 +
  368 + $("#line").on("change", function(){
  369 + if($("#line").val() == " "){
  370 + $("#gsdmDdrb").attr("disabled", false);
  371 + $("#fgsdmDdrb").attr("disabled", false);
  372 + } else {
  373 + var temp = tempData[$("#line").val()].split(":");
  374 + $("#gsdmDdrb").val(temp[0]);
  375 + updateCompany();
  376 + $("#fgsdmDdrb").val(temp[1]);
  377 + $("#gsdmDdrb").attr("disabled", true);
  378 + $("#fgsdmDdrb").attr("disabled", true);
365 379 }
366   - initPinYinSelect2('#line',data,'');
367   - fage=true;
368   - }
  380 + });
  381 +
  382 +
369 383 $('#export').attr('disabled', "true");
370 384  
371 385 var line = $("#line").val();
... ...
src/main/resources/static/pages/forms/statement/statisticsDaily.html
... ... @@ -206,33 +206,47 @@
206 206 }
207 207 }
208 208 $('#fgsdm').html(options);
209   - initXl();
  209 +// initXl();
210 210 }
211   - $("#fgsdm").on("change",initXl);
212   - function initXl(){
213   - var data=[];
  211 +
  212 + var tempData = {};
  213 + $.get('/report/lineList',function(xlList){
  214 + var data = [];
214 215 data.push({id: " ", text: "全部线路"});
215   - if(fage){
216   - $("#line").select2("destroy").html('');
217   - }
218   - var fgs=$('#fgsdm').val();
219   - var gs=$('#gsdm').val();
220   - for(var i=0;i<xlList.length;i++){
221   - if(gs!=""){
222   - if(fgs!=""){
223   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
224   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
225   - }
226   - }else{
227   - if(xlList[i]["gsbm"]==gs){
228   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  216 + $.get('/user/companyData', function(result){
  217 + for(var i = 0; i < result.length; i++){
  218 + var companyCode = result[i].companyCode;
  219 + var children = result[i].children;
  220 + for(var j = 0; j < children.length; j++){
  221 + var code = children[j].code;
  222 + for(var k=0;k < xlList.length;k++ ){
  223 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  224 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  225 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  226 + }
229 227 }
230 228 }
231 229 }
  230 + initPinYinSelect2('#line',data,'');
  231 +
  232 + });
  233 + });
  234 +
  235 + $("#line").on("change", function(){
  236 + if($("#line").val() == " "){
  237 + $("#gsdm").attr("disabled", false);
  238 + $("#fgsdm").attr("disabled", false);
  239 + } else {
  240 + var temp = tempData[$("#line").val()].split(":");
  241 + $("#gsdm").val(temp[0]);
  242 + updateCompany();
  243 + $("#fgsdm").val(temp[1]);
  244 + $("#gsdm").attr("disabled", true);
  245 + $("#fgsdm").attr("disabled", true);
232 246 }
233   - initPinYinSelect2('#line',data,'');
234   - fage=true;
235   - }
  247 + });
  248 +
  249 +
236 250 var line ="";
237 251 var xlName ="";
238 252 var date = "";
... ...
src/main/resources/static/pages/forms/statement/timeAndSpeed.html
... ... @@ -235,43 +235,50 @@
235 235 }
236 236 }
237 237 $('#subCompany').html(options);
238   - initXl();
239   - }
  238 + }
240 239  
241   - $("#subCompany").on("change",initXl);
242   - function initXl(){
243   - var data=[];
244   - data.push({id:" ", text:"全部线路"});
245   - if(fage){
246   - $("#line").select2("destroy").html('');
247   - }
248   - var fgs=$('#subCompany').val();
249   - var gs=$('#company').val();
250   - for(var i=0;i<xlList.length;i++){
251   - if(gs!=""){
252   - if(fgs!=""){
253   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
254   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
255   - }
256   - }else{
257   - if(xlList[i]["gsbm"]==gs){
258   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  240 + var tempData = {};
  241 + $.get('/report/lineList',function(xlList){
  242 + var data = [];
  243 + data.push({id: " ", text: "全部线路"});
  244 + $.get('/user/companyData', function(result){
  245 + for(var i = 0; i < result.length; i++){
  246 + var companyCode = result[i].companyCode;
  247 + var children = result[i].children;
  248 + for(var j = 0; j < children.length; j++){
  249 + var code = children[j].code;
  250 + for(var k=0;k < xlList.length;k++ ){
  251 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  252 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  253 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  254 + }
259 255 }
260 256 }
261 257 }
262   - }
263   - initPinYinSelect2('#line',data,'');
264   - fage=true;
265   -
266   - $("#endDate").attr("disabled", true);
267   - $("#endDate").val($("#startDate").val());
268   - line = data[0].id;
269   - statu = 0;
270   -
271   - updateModel();
272   - updateLp("");
273   - }
  258 + initPinYinSelect2('#line',data,'');
  259 + $("#endDate").attr("disabled", true);
  260 + $("#endDate").val($("#startDate").val());
  261 + line = data[0].id;
  262 + statu = 0;
  263 +
  264 + updateModel();
  265 + updateLp("");
  266 + });
  267 + });
274 268  
  269 + $("#line").on("change", function(){
  270 + if($("#line").val() == " "){
  271 + $("#company").attr("disabled", false);
  272 + $("#subCompany").attr("disabled", false);
  273 + } else {
  274 + var temp = tempData[$("#line").val()].split(":");
  275 + $("#company").val(temp[0]);
  276 + updateCompany();
  277 + $("#subCompany").val(temp[1]);
  278 + $("#company").attr("disabled", true);
  279 + $("#subCompany").attr("disabled", true);
  280 + }
  281 + });
275 282  
276 283 $("#query").on("click", function (){
277 284 jsDoQuery();
... ...
src/main/resources/static/pages/forms/statement/waybill.html
... ... @@ -158,14 +158,14 @@
158 158 }
159 159 }
160 160 $('#fgsdmXcld').html(options);
161   - initXl();
  161 +// initXl();
162 162 }
163 163  
164 164  
165 165  
166 166  
167   - $("#fgsdmXcld").on("change",initXl);
168   - function initXl(){
  167 +// $("#fgsdmXcld").on("change",initXl);
  168 + /* function initXl(){
169 169 var data=[];
170 170 if(fage){
171 171 $("#line").select2("destroy").html('');
... ... @@ -187,7 +187,44 @@
187 187 }
188 188 initPinYinSelect2('#line',data,'');
189 189 fage=true;
190   - }
  190 + } */
  191 +
  192 + var tempData = {};
  193 + $.get('/report/lineList',function(xlList){
  194 + var data = [];
  195 +// data.push({id: " ", text: "全部线路"});
  196 + $.get('/user/companyData', function(result){
  197 + for(var i = 0; i < result.length; i++){
  198 + var companyCode = result[i].companyCode;
  199 + var children = result[i].children;
  200 + for(var j = 0; j < children.length; j++){
  201 + var code = children[j].code;
  202 + for(var k=0;k < xlList.length;k++ ){
  203 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  204 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  205 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  206 + }
  207 + }
  208 + }
  209 + }
  210 + initPinYinSelect2('#line',data,'');
  211 +
  212 + });
  213 + });
  214 +
  215 + $("#line").on("change", function(){
  216 + if($("#line").val() == " "){
  217 + $("#gsdmXcld").attr("disabled", false);
  218 + $("#fgsdmXcld").attr("disabled", false);
  219 + } else {
  220 + var temp = tempData[$("#line").val()].split(":");
  221 + $("#gsdmXcld").val(temp[0]);
  222 + updateCompany();
  223 + $("#fgsdmXcld").val(temp[1]);
  224 + $("#gsdmXcld").attr("disabled", true);
  225 + $("#fgsdmXcld").attr("disabled", true);
  226 + }
  227 + });
191 228 var date = '';
192 229 var line = '';
193 230 $("#query").on("click",function(){
... ...
src/main/resources/static/pages/forms/statement/workDaily.html
... ... @@ -112,44 +112,6 @@
112 112 day = "0" + day;
113 113 $("#date").val(year + "-" + month + "-" + day);
114 114  
115   -// $.get('/basic/lineCode2Name',function(result){
116   -// var data=[];
117   -
118   -// data.push({id: " ", text: "全部线路"});
119   -// for(var code in result){
120   -// data.push({id: code, text: result[code]});
121   -// }
122   -// initPinYinSelect2('#line',data,'');
123   -// })
124   -// var obj = [];
125   -// $.get('/user/companyData', function(result){
126   -// obj = result;
127   -// var options = '';
128   -// for(var i = 0; i < obj.length; i++){
129   -// options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
130   -// }
131   -// if(obj.length == 1){
132   -// $('#company1').hide();
133   -// if(obj[0].children.length == 1)
134   -// $('#subCompany1').hide();
135   -// }
136   -// $('#company').html(options);
137   -// updateCompany();
138   -// });
139   -// $("#company").on("change",updateCompany);
140   -// function updateCompany(){
141   -// var company = $('#company').val();
142   -// var options = '';
143   -// for(var i = 0; i < obj.length; i++){
144   -// if(obj[i].companyCode == company){
145   -// var children = obj[i].children;
146   -// for(var j = 0; j < children.length; j++){
147   -// options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
148   -// }
149   -// }
150   -// }
151   -// $('#subCompany').html(options);
152   -// }
153 115 var fage=false;
154 116 var xlList;
155 117 var obj = [];
... ... @@ -188,34 +150,45 @@
188 150 }
189 151 }
190 152 $('#subCompany').html(options);
191   - initXl();
192 153 }
193 154  
194   - $("#subCompany").on("change",initXl);
195   - function initXl(){
196   - var data=[];
197   - if(fage){
198   - $("#line").select2("destroy").html('');
199   - }
200   - var fgs=$('#subCompany').val();
201   - var gs=$('#company').val();
  155 + var tempData = {};
  156 + $.get('/report/lineList',function(xlList){
  157 + var data = [];
202 158 data.push({id: " ", text: "全部线路"});
203   - for(var i=0;i<xlList.length;i++){
204   - if(gs!=""){
205   - if(fgs!=""){
206   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
207   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
208   - }
209   - }else{
210   - if(xlList[i]["gsbm"]==gs){
211   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  159 + $.get('/user/companyData', function(result){
  160 + for(var i = 0; i < result.length; i++){
  161 + var companyCode = result[i].companyCode;
  162 + var children = result[i].children;
  163 + for(var j = 0; j < children.length; j++){
  164 + var code = children[j].code;
  165 + for(var k=0;k < xlList.length;k++ ){
  166 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  167 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  168 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  169 + }
212 170 }
213 171 }
214 172 }
  173 + initPinYinSelect2('#line',data,'');
  174 +
  175 + });
  176 + });
  177 +
  178 + $("#line").on("change", function(){
  179 + if($("#line").val() == " "){
  180 + $("#company").attr("disabled", false);
  181 + $("#subCompany").attr("disabled", false);
  182 + } else {
  183 + var temp = tempData[$("#line").val()].split(":");
  184 + $("#company").val(temp[0]);
  185 + updateCompany();
  186 + $("#subCompany").val(temp[1]);
  187 + $("#company").attr("disabled", true);
  188 + $("#subCompany").attr("disabled", true);
215 189 }
216   - initPinYinSelect2('#line',data,'');
217   - fage=true;
218   - }
  190 + });
  191 +
219 192  
220 193  
221 194  
... ...
src/main/resources/static/pages/mforms/changetochanges/changetochange.html
... ... @@ -180,35 +180,46 @@
180 180 }
181 181 }
182 182 $('#fgsdmChange').html(options);
183   - initXl();
184 183 }
185 184  
186   - $("#fgsdmChange").on("change",initXl);
187   - function initXl(){
188   - var data=[];
189   - data.push({id: " ", text: "请选择"});
190   - if(fage){
191   - $("#line").select2("destroy").html('');
192   - }
193   - var fgs=$('#fgsdmChange').val();
194   - var gs=$('#gsdmChange').val();
195   - for(var i=0;i<xlList.length;i++){
196   - if(gs!=""){
197   - if(fgs!=""){
198   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
199   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
200   - }
201   - }else{
202   - if(xlList[i]["gsbm"]==gs){
203   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  185 +
  186 + var tempData = {};
  187 + $.get('/report/lineList',function(xlList){
  188 + var data = [];
  189 + data.push({id: " ", text: "全部线路"});
  190 + $.get('/user/companyData', function(result){
  191 + for(var i = 0; i < result.length; i++){
  192 + var companyCode = result[i].companyCode;
  193 + var children = result[i].children;
  194 + for(var j = 0; j < children.length; j++){
  195 + var code = children[j].code;
  196 + for(var k=0;k < xlList.length;k++ ){
  197 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  198 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  199 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  200 + }
204 201 }
205 202 }
206 203 }
  204 + initPinYinSelect2('#line',data,'');
  205 +
  206 + });
  207 + });
  208 +
  209 + $("#line").on("change", function(){
  210 + if($("#line").val() == " "){
  211 + $("#gsdmChange").attr("disabled", false);
  212 + $("#fgsdmChange").attr("disabled", false);
  213 + } else {
  214 + var temp = tempData[$("#line").val()].split(":");
  215 + $("#gsdmChange").val(temp[0]);
  216 + updateCompany();
  217 + $("#fgsdmChange").val(temp[1]);
  218 + $("#gsdmChange").attr("disabled", true);
  219 + $("#fgsdmChange").attr("disabled", true);
207 220 }
208   - initPinYinSelect2('#line',data,'');
209   - fage=true;
210   - }
211   -
  221 + });
  222 +
212 223 var line;
213 224 var startDate;
214 225 var endDate;
... ...
src/main/resources/static/pages/mforms/operationservices/operationservice.html
... ... @@ -153,45 +153,45 @@
153 153 }
154 154 }
155 155 $('#fgsdmOperat').html(options);
156   - initXl();
157 156 }
158 157  
159   - /* $.get('/basic/lineCode2Name',function(result){
160   - var data=[];
161   -
162   - for(var code in result){
163   - data.push({id: code, text: result[code]});
164   - }
165   - initPinYinSelect2('#line',data,'');
166   -
167   - }) */
168   -
169   - $("#fgsdmOperat").on("change",initXl);
170   - function initXl(){
171   - var data=[];
  158 + var tempData = {};
  159 + $.get('/report/lineList',function(xlList){
  160 + var data = [];
172 161 data.push({id: " ", text: "全部线路"});
173   - if(fage){
174   - $("#line").select2("destroy").html('');
175   - }
176   - var fgs=$('#fgsdmOperat').val();
177   - var gs=$('#gsdmOperat').val();
178   - for(var i=0;i<xlList.length;i++){
179   - if(gs!=""){
180   - if(fgs!=""){
181   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
182   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
183   - }
184   - }else{
185   - if(xlList[i]["gsbm"]==gs){
186   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  162 + $.get('/user/companyData', function(result){
  163 + for(var i = 0; i < result.length; i++){
  164 + var companyCode = result[i].companyCode;
  165 + var children = result[i].children;
  166 + for(var j = 0; j < children.length; j++){
  167 + var code = children[j].code;
  168 + for(var k=0;k < xlList.length;k++ ){
  169 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  170 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  171 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  172 + }
187 173 }
188 174 }
189 175 }
190   - }
191   - initPinYinSelect2('#line',data,'');
192   - fage=true;
193   - }
  176 + initPinYinSelect2('#line',data,'');
  177 +
  178 + });
  179 + });
194 180  
  181 + $("#line").on("change", function(){
  182 + if($("#line").val() == " "){
  183 + $("#gsdmOperat").attr("disabled", false);
  184 + $("#fgsdmOperat").attr("disabled", false);
  185 + } else {
  186 + var temp = tempData[$("#line").val()].split(":");
  187 + $("#gsdmOperat").val(temp[0]);
  188 + updateCompany();
  189 + $("#fgsdmOperat").val(temp[1]);
  190 + $("#gsdmOperat").attr("disabled", true);
  191 + $("#fgsdmOperat").attr("disabled", true);
  192 + }
  193 + });
  194 +
195 195  
196 196 $("#query").on(
197 197 "click",
... ...
src/main/resources/static/pages/mforms/shifdays/shifday.html
... ... @@ -152,7 +152,6 @@ $(function(){
152 152 }
153 153 }
154 154 $('#fgsdmShif').html(options);
155   - initXl();
156 155 }
157 156  
158 157  
... ... @@ -166,30 +165,43 @@ $(function(){
166 165  
167 166 // })
168 167  
169   - $("#fgsdmShif").on("change",initXl);
170   - function initXl(){
171   - var data=[];
172   - if(fage){
173   - $("#line").select2("destroy").html('');
174   - }
175   - var fgs=$('#fgsdmShif').val();
176   - var gs=$('#gsdmShif').val();
177   - for(var i=0;i<xlList.length;i++){
178   - if(gs!=""){
179   - if(fgs!=""){
180   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
181   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
182   - }
183   - }else{
184   - if(xlList[i]["gsbm"]==gs){
185   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  168 + var tempData = {};
  169 + $.get('/report/lineList',function(xlList){
  170 + var data = [];
  171 +// data.push({id: " ", text: "全部线路"});
  172 + $.get('/user/companyData', function(result){
  173 + for(var i = 0; i < result.length; i++){
  174 + var companyCode = result[i].companyCode;
  175 + var children = result[i].children;
  176 + for(var j = 0; j < children.length; j++){
  177 + var code = children[j].code;
  178 + for(var k=0;k < xlList.length;k++ ){
  179 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  180 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  181 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  182 + }
  183 + }
186 184 }
187 185 }
  186 + initPinYinSelect2('#line',data,'');
  187 +
  188 + });
  189 + });
  190 +
  191 + $("#line").on("change", function(){
  192 + if($("#line").val() == " "){
  193 + $("#gsdmShif").attr("disabled", false);
  194 + $("#fgsdmShif").attr("disabled", false);
  195 + } else {
  196 + var temp = tempData[$("#line").val()].split(":");
  197 + $("#gsdmShif").val(temp[0]);
  198 + updateCompany();
  199 + $("#fgsdmShif").val(temp[1]);
  200 + $("#gsdmShif").attr("disabled", true);
  201 + $("#fgsdmShif").attr("disabled", true);
188 202 }
189   - }
190   - initPinYinSelect2('#line',data,'');
191   - fage=true;
192   - }
  203 + });
  204 +
193 205  
194 206  
195 207 $("#query").on("click",function(){
... ...
src/main/resources/static/pages/mforms/shiftuehiclemanths/shiftuehiclemanth.html
... ... @@ -150,32 +150,45 @@
150 150 }
151 151 }
152 152 $('#fgsdmManth').html(options);
153   - initXl();
154 153 }
155   - $("#fgsdmManth").on("change",initXl);
156   - function initXl(){
157   - var data=[];
158   - if(fage){
159   - $("#line").select2("destroy").html('');
160   - }
161   - var fgs=$('#fgsdmManth').val();
162   - var gs=$('#gsdmManth').val();
163   - for(var i=0;i<xlList.length;i++){
164   - if(gs!=""){
165   - if(fgs!=""){
166   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
167   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
168   - }
169   - }else{
170   - if(xlList[i]["gsbm"]==gs){
171   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  154 +
  155 +
  156 + var tempData = {};
  157 + $.get('/report/lineList',function(xlList){
  158 + var data = [];
  159 + $.get('/user/companyData', function(result){
  160 + for(var i = 0; i < result.length; i++){
  161 + var companyCode = result[i].companyCode;
  162 + var children = result[i].children;
  163 + for(var j = 0; j < children.length; j++){
  164 + var code = children[j].code;
  165 + for(var k=0;k < xlList.length;k++ ){
  166 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  167 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  168 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  169 + }
172 170 }
173 171 }
174 172 }
  173 + initPinYinSelect2('#line',data,'');
  174 +
  175 + });
  176 + });
  177 +
  178 + $("#line").on("change", function(){
  179 + if($("#line").val() == " "){
  180 + $("#gsdmManth").attr("disabled", false);
  181 + $("#fgsdmManth").attr("disabled", false);
  182 + } else {
  183 + var temp = tempData[$("#line").val()].split(":");
  184 + $("#gsdmManth").val(temp[0]);
  185 + updateCompany();
  186 + $("#fgsdmManth").val(temp[1]);
  187 + $("#gsdmManth").attr("disabled", true);
  188 + $("#fgsdmManth").attr("disabled", true);
175 189 }
176   - initPinYinSelect2('#line',data,'');
177   - fage=true;
178   - }
  190 + });
  191 +
179 192 $("#query").on("click",function(){
180 193 if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){
181 194 layer.msg("请选择时间范围!");
... ...
src/main/resources/static/pages/mforms/singledatas/singledata.html
... ... @@ -134,34 +134,44 @@
134 134 }
135 135 }
136 136 $('#fgsdmSing').html(options);
137   - initXl();
138 137 }
139 138  
140   - $("#fgsdmSing").on("change",initXl);
141   - function initXl(){
142   - var data=[];
143   - data.push({id: " ", text: "请选择"});
144   - if(fage){
145   - $("#line").select2("destroy").html('');
146   - }
147   - var fgs=$('#fgsdmSing').val();
148   - var gs=$('#gsdmSing').val();
149   - for(var i=0;i<xlList.length;i++){
150   - if(gs!=""){
151   - if(fgs!=""){
152   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
153   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
154   - }
155   - }else{
156   - if(xlList[i]["gsbm"]==gs){
157   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  139 + var tempData = {};
  140 + $.get('/report/lineList',function(xlList){
  141 + var data = [];
  142 + data.push({id: " ", text: "全部线路"});
  143 + $.get('/user/companyData', function(result){
  144 + for(var i = 0; i < result.length; i++){
  145 + var companyCode = result[i].companyCode;
  146 + var children = result[i].children;
  147 + for(var j = 0; j < children.length; j++){
  148 + var code = children[j].code;
  149 + for(var k=0;k < xlList.length;k++ ){
  150 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  151 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  152 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  153 + }
158 154 }
159 155 }
160 156 }
  157 + initPinYinSelect2('#line',data,'');
  158 +
  159 + });
  160 + });
  161 +
  162 + $("#line").on("change", function(){
  163 + if($("#line").val() == " "){
  164 + $("#gsdmSing").attr("disabled", false);
  165 + $("#fgsdmSing").attr("disabled", false);
  166 + } else {
  167 + var temp = tempData[$("#line").val()].split(":");
  168 + $("#gsdmSing").val(temp[0]);
  169 + updateCompany();
  170 + $("#fgsdmSing").val(temp[1]);
  171 + $("#gsdmSing").attr("disabled", true);
  172 + $("#fgsdmSing").attr("disabled", true);
161 173 }
162   - initPinYinSelect2('#line',data,'');
163   - fage=true;
164   - }
  174 + });
165 175  
166 176  
167 177 $("#query").on("click",function(){
... ...
src/main/resources/static/pages/mforms/turnoutrates/turnoutrate.html
... ... @@ -172,34 +172,44 @@
172 172 }
173 173 }
174 174 $('#fgsdmTurn').html(options);
175   - initXl();
176 175 }
177   -
178   - $("#fgsdmTurn").on("change",initXl);
179   - function initXl(){
180   - var data=[];
181   - data.push({id:" ", text:"全部线路"});
182   - if(fage){
183   - $("#line").select2("destroy").html('');
184   - }
185   - var fgs=$('#fgsdmTurn').val();
186   - var gs=$('#gsdmTurn').val();
187   - for(var i=0;i<xlList.length;i++){
188   - if(gs!=""){
189   - if(fgs!=""){
190   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
191   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
192   - }
193   - }else{
194   - if(xlList[i]["gsbm"]==gs){
195   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  176 +
  177 + var tempData = {};
  178 + $.get('/report/lineList',function(xlList){
  179 + var data = [];
  180 + data.push({id: " ", text: "全部线路"});
  181 + $.get('/user/companyData', function(result){
  182 + for(var i = 0; i < result.length; i++){
  183 + var companyCode = result[i].companyCode;
  184 + var children = result[i].children;
  185 + for(var j = 0; j < children.length; j++){
  186 + var code = children[j].code;
  187 + for(var k=0;k < xlList.length;k++ ){
  188 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  189 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  190 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  191 + }
196 192 }
197 193 }
198 194 }
  195 + initPinYinSelect2('#line',data,'');
  196 +
  197 + });
  198 + });
  199 +
  200 + $("#line").on("change", function(){
  201 + if($("#line").val() == " "){
  202 + $("#gsdmTurn").attr("disabled", false);
  203 + $("#fgsdmTurn").attr("disabled", false);
  204 + } else {
  205 + var temp = tempData[$("#line").val()].split(":");
  206 + $("#gsdmTurn").val(temp[0]);
  207 + updateCompany();
  208 + $("#fgsdmTurn").val(temp[1]);
  209 + $("#gsdmTurn").attr("disabled", true);
  210 + $("#fgsdmTurn").attr("disabled", true);
199 211 }
200   - initPinYinSelect2('#line',data,'');
201   - fage=true;
202   - }
  212 + });
203 213  
204 214 var line;
205 215 var startDate;
... ...
src/main/resources/static/pages/mforms/vehicleloadings/vehicleloading.html
... ... @@ -127,33 +127,43 @@
127 127 }
128 128 }
129 129 $('#fgsdmVehic').html(options);
130   - initXl();
131 130 }
132 131  
133   - $("#fgsdmVehic").on("change",initXl);
134   - function initXl(){
135   - var data=[];
136   - if(fage){
137   - $("#line").select2("destroy").html('');
138   - }
139   - var fgs=$('#fgsdmVehic').val();
140   - var gs=$('#gsdmVehic').val();
141   - for(var i=0;i<xlList.length;i++){
142   - if(gs!=""){
143   - if(fgs!=""){
144   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
145   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
146   - }
147   - }else{
148   - if(xlList[i]["gsbm"]==gs){
149   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  132 + var tempData = {};
  133 + $.get('/report/lineList',function(xlList){
  134 + var data = [];
  135 + $.get('/user/companyData', function(result){
  136 + for(var i = 0; i < result.length; i++){
  137 + var companyCode = result[i].companyCode;
  138 + var children = result[i].children;
  139 + for(var j = 0; j < children.length; j++){
  140 + var code = children[j].code;
  141 + for(var k=0;k < xlList.length;k++ ){
  142 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  143 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  144 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  145 + }
150 146 }
151 147 }
152 148 }
  149 + initPinYinSelect2('#line',data,'');
  150 +
  151 + });
  152 + });
  153 +
  154 + $("#line").on("change", function(){
  155 + if($("#line").val() == " "){
  156 + $("#gsdmVehic").attr("disabled", false);
  157 + $("#fgsdmVehic").attr("disabled", false);
  158 + } else {
  159 + var temp = tempData[$("#line").val()].split(":");
  160 + $("#gsdmVehic").val(temp[0]);
  161 + updateCompany();
  162 + $("#fgsdmVehic").val(temp[1]);
  163 + $("#gsdmVehic").attr("disabled", true);
  164 + $("#fgsdmVehic").attr("disabled", true);
153 165 }
154   - initPinYinSelect2('#line',data,'');
155   - fage=true;
156   - }
  166 + });
157 167  
158 168 var line ;
159 169 var date ;
... ...
src/main/resources/static/pages/mforms/waybilldays/waybillday.html
... ... @@ -131,32 +131,46 @@
131 131 }
132 132 }
133 133 $('#fgsdmWaybillday').html(options);
134   - initXl();
  134 +// initXl();
135 135 }
136   - $("#fgsdmWaybillday").on("change",initXl);
137   - function initXl(){
138   - var data=[];
139   - if(fage){
140   - $("#line").select2("destroy").html('');
141   - }
142   - var fgs=$('#fgsdmWaybillday').val();
143   - var gs=$('#gsdmWaybillday').val();
144   - for(var i=0;i<xlList.length;i++){
145   - if(gs!=""){
146   - if(fgs!=""){
147   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
148   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
149   - }
150   - }else{
151   - if(xlList[i]["gsbm"]==gs){
152   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  136 +
  137 + var tempData = {};
  138 + $.get('/report/lineList',function(xlList){
  139 + var data = [];
  140 +// data.push({id: " ", text: "全部线路"});
  141 + $.get('/user/companyData', function(result){
  142 + for(var i = 0; i < result.length; i++){
  143 + var companyCode = result[i].companyCode;
  144 + var children = result[i].children;
  145 + for(var j = 0; j < children.length; j++){
  146 + var code = children[j].code;
  147 + for(var k=0;k < xlList.length;k++ ){
  148 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  149 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  150 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  151 + }
153 152 }
154 153 }
155 154 }
  155 + initPinYinSelect2('#line',data,'');
  156 +
  157 + });
  158 + });
  159 +
  160 + $("#line").on("change", function(){
  161 + if($("#line").val() == " "){
  162 + $("#gsdmWaybillday").attr("disabled", false);
  163 + $("#fgsdmWaybillday").attr("disabled", false);
  164 + } else {
  165 + var temp = tempData[$("#line").val()].split(":");
  166 + $("#gsdmWaybillday").val(temp[0]);
  167 + updateCompany();
  168 + $("#fgsdmWaybillday").val(temp[1]);
  169 + $("#gsdmWaybillday").attr("disabled", true);
  170 + $("#fgsdmWaybillday").attr("disabled", true);
156 171 }
157   - initPinYinSelect2('#line',data,'');
158   - fage=true;
159   - }
  172 + });
  173 +
160 174 var line;
161 175 var date;
162 176 var gsdmWaybillday;
... ...
src/main/resources/static/pages/report/countMileage/countBus/countBusMileage.html
... ... @@ -149,33 +149,46 @@
149 149 }
150 150 }
151 151 $('#fgsdm').html(options);
152   - initXl();
153 152 }
154   - $("#fgsdm").on("change",initXl);
155   - function initXl(){
156   - var data=[];
  153 +
  154 +
  155 + var tempData = {};
  156 + $.get('/report/lineList',function(xlList){
  157 + var data = [];
157 158 data.push({id: " ", text: "全部线路"});
158   - if(fage){
159   - $("#line").select2("destroy").html('');
160   - }
161   - var fgs=$('#fgsdm').val();
162   - var gs=$('#gsdm').val();
163   - for(var i=0;i<xlList.length;i++){
164   - if(gs!=""){
165   - if(fgs!=""){
166   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
167   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
168   - }
169   - }else{
170   - if(xlList[i]["gsbm"]==gs){
171   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  159 + $.get('/user/companyData', function(result){
  160 + for(var i = 0; i < result.length; i++){
  161 + var companyCode = result[i].companyCode;
  162 + var children = result[i].children;
  163 + for(var j = 0; j < children.length; j++){
  164 + var code = children[j].code;
  165 + for(var k=0;k < xlList.length;k++ ){
  166 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  167 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  168 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  169 + }
172 170 }
173 171 }
174 172 }
  173 + initPinYinSelect2('#line',data,'');
  174 +
  175 + });
  176 + });
  177 +
  178 + $("#line").on("change", function(){
  179 + if($("#line").val() == " "){
  180 + $("#gsdm").attr("disabled", false);
  181 + $("#fgsdm").attr("disabled", false);
  182 + } else {
  183 + var temp = tempData[$("#line").val()].split(":");
  184 + $("#gsdm").val(temp[0]);
  185 + updateCompany();
  186 + $("#fgsdm").val(temp[1]);
  187 + $("#gsdm").attr("disabled", true);
  188 + $("#fgsdm").attr("disabled", true);
175 189 }
176   - initPinYinSelect2('#line',data,'');
177   - fage=true;
178   - }
  190 + });
  191 +
179 192 var line ="";
180 193 var xlName ="";
181 194 var date = "";
... ...
src/main/resources/static/pages/report/countMileage/countLine/countLineMileage.html
... ... @@ -184,33 +184,46 @@
184 184 }
185 185 }
186 186 $('#fgsdm').html(options);
187   - initXl();
188 187 }
189   - $("#fgsdm").on("change",initXl);
190   - function initXl(){
191   - var data=[];
  188 +
  189 +
  190 + var tempData = {};
  191 + $.get('/report/lineList',function(xlList){
  192 + var data = [];
192 193 data.push({id: " ", text: "全部线路"});
193   - if(fage){
194   - $("#line").select2("destroy").html('');
195   - }
196   - var fgs=$('#fgsdm').val();
197   - var gs=$('#gsdm').val();
198   - for(var i=0;i<xlList.length;i++){
199   - if(gs!=""){
200   - if(fgs!=""){
201   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
202   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
203   - }
204   - }else{
205   - if(xlList[i]["gsbm"]==gs){
206   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  194 + $.get('/user/companyData', function(result){
  195 + for(var i = 0; i < result.length; i++){
  196 + var companyCode = result[i].companyCode;
  197 + var children = result[i].children;
  198 + for(var j = 0; j < children.length; j++){
  199 + var code = children[j].code;
  200 + for(var k=0;k < xlList.length;k++ ){
  201 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  202 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  203 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  204 + }
207 205 }
208 206 }
209 207 }
  208 + initPinYinSelect2('#line',data,'');
  209 +
  210 + });
  211 + });
  212 +
  213 + $("#line").on("change", function(){
  214 + if($("#line").val() == " "){
  215 + $("#gsdm").attr("disabled", false);
  216 + $("#fgsdm").attr("disabled", false);
  217 + } else {
  218 + var temp = tempData[$("#line").val()].split(":");
  219 + $("#gsdm").val(temp[0]);
  220 + updateCompany();
  221 + $("#fgsdm").val(temp[1]);
  222 + $("#gsdm").attr("disabled", true);
  223 + $("#fgsdm").attr("disabled", true);
210 224 }
211   - initPinYinSelect2('#line',data,'');
212   - fage=true;
213   - }
  225 + });
  226 +
214 227 var line ="";
215 228 var xlName ="";
216 229 var date = "";
... ...
src/main/resources/static/pages/report/inoutstation.html
... ... @@ -238,37 +238,47 @@
238 238 }
239 239 }
240 240 $('#fgsdm').html(options);
241   - initXl();
242 241 initCl();
243 242 }
244 243  
245 244  
246 245  
247 246  
248   - $("#fgsdm").on("change",initXl);
249   - function initXl(){
250   - var data=[];
251   - if(fage){
252   - $("#line").select2("destroy").html('');
253   - }
254   - var fgs=$('#fgsdm').val();
255   - var gs=$('#gsdm').val();
256   - for(var i=0;i<xlList.length;i++){
257   - if(gs!=""){
258   - if(fgs!=""){
259   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
260   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
261   - }
262   - }else{
263   - if(xlList[i]["gsbm"]==gs){
264   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  247 + var tempData = {};
  248 + $.get('/report/lineList',function(xlList){
  249 + var data = [];
  250 + $.get('/user/companyData', function(result){
  251 + for(var i = 0; i < result.length; i++){
  252 + var companyCode = result[i].companyCode;
  253 + var children = result[i].children;
  254 + for(var j = 0; j < children.length; j++){
  255 + var code = children[j].code;
  256 + for(var k=0;k < xlList.length;k++ ){
  257 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  258 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  259 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  260 + }
265 261 }
266 262 }
267 263 }
  264 + initPinYinSelect2('#line',data,'');
  265 +
  266 + });
  267 + });
  268 +
  269 + $("#line").on("change", function(){
  270 + if($("#line").val() == " "){
  271 + $("#gsdm").attr("disabled", false);
  272 + $("#fgsdm").attr("disabled", false);
  273 + } else {
  274 + var temp = tempData[$("#line").val()].split(":");
  275 + $("#gsdm").val(temp[0]);
  276 + updateCompany();
  277 + $("#fgsdm").val(temp[1]);
  278 + $("#gsdm").attr("disabled", true);
  279 + $("#fgsdm").attr("disabled", true);
268 280 }
269   - initPinYinSelect2('#line',data,'');
270   - fage=true;
271   - }
  281 + });
272 282  
273 283  
274 284 $("#query").on("click",function(){
... ...
src/main/resources/static/pages/report/message/message.html
... ... @@ -120,16 +120,25 @@
120 120 day = "0" + day;
121 121 $("#date").val(year + "-" + month + "-" + day);
122 122  
123   - $.get('/basic/lineCode2Name',function(result){
124   - var data=[];
125   -
126   - for(var code in result){
127   - data.push({id: code, text: result[code]});
128   - }
129   - console.log(data);
130   - initPinYinSelect2('#line',data,'');
131   -
132   - })
  123 + $.get('/report/lineList',function(xlList){
  124 + var data = [];
  125 + $.get('/user/companyData', function(result){
  126 + for(var i = 0; i < result.length; i++){
  127 + var companyCode = result[i].companyCode;
  128 + var children = result[i].children;
  129 + for(var j = 0; j < children.length; j++){
  130 + var code = children[j].code;
  131 + for(var k=0;k < xlList.length;k++ ){
  132 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  133 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  134 + }
  135 + }
  136 + }
  137 + }
  138 + initPinYinSelect2('#line',data,'');
  139 +
  140 + });
  141 + });
133 142 $('#code').select2({
134 143 ajax: {
135 144 url: '/realSchedule/sreachVehic',
... ...
src/main/resources/static/pages/report/oil/oilListMonth.html
... ... @@ -105,16 +105,28 @@
105 105 $("#date").val(year + "-0" + month + "-" + day);
106 106 }
107 107  
108   - $.get('/basic/lineCode2Name',function(result){
109   - var data=[];
110   -
111   - for(var code in result){
112   - data.push({id: code, text: result[code]});
113   - }
114   - console.log(data);
115   - initPinYinSelect2('#line',data,'');
116   -
117   - })
  108 + var tempData = {};
  109 + $.get('/report/lineList',function(xlList){
  110 + var data = [];
  111 + $.get('/user/companyData', function(result){
  112 + for(var i = 0; i < result.length; i++){
  113 + var companyCode = result[i].companyCode;
  114 + var children = result[i].children;
  115 + for(var j = 0; j < children.length; j++){
  116 + var code = children[j].code;
  117 + for(var k=0;k < xlList.length;k++ ){
  118 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  119 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  120 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  121 + }
  122 + }
  123 + }
  124 + }
  125 + initPinYinSelect2('#line',data,'');
  126 +
  127 + });
  128 + });
  129 +
118 130  
119 131 //查询
120 132 $("#query").on('click',function(){
... ...
src/main/resources/static/pages/report/sheet/sheetList.html
... ... @@ -170,37 +170,47 @@
170 170 }
171 171 }
172 172 $('#fgsdm').html(options);
173   - initXl();
174   - }
175   -
176   -
177   -
178   -
179   - $("#fgsdm").on("change",initXl);
180   - function initXl(){
181   - var data=[];
182   - if(fage){
183   - $("#line").select2("destroy").html('');
184   - }
185   - data.push({id: " ", text: "请选择"});
186   - var fgs=$('#fgsdm').val();
187   - var gs=$('#gsdm').val();
188   - for(var i=0;i<xlList.length;i++){
189   - if(gs!=""){
190   - if(fgs!=""){
191   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
192   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
193   - }
194   - }else{
195   - if(xlList[i]["gsbm"]==gs){
196   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  173 +
  174 + var tempData = {};
  175 + $.get('/report/lineList',function(xlList){
  176 + var data = [];
  177 + data.push({id: " ", text: "全部线路"});
  178 + $.get('/user/companyData', function(result){
  179 + for(var i = 0; i < result.length; i++){
  180 + var companyCode = result[i].companyCode;
  181 + var children = result[i].children;
  182 + for(var j = 0; j < children.length; j++){
  183 + var code = children[j].code;
  184 + for(var k=0;k < xlList.length;k++ ){
  185 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  186 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  187 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  188 + }
  189 + }
197 190 }
198 191 }
  192 + initPinYinSelect2('#line',data,'');
  193 +
  194 + });
  195 + });
  196 +
  197 + $("#line").on("change", function(){
  198 + if($("#line").val() == " "){
  199 + $("#gsdm").attr("disabled", false);
  200 + $("#fgsdm").attr("disabled", false);
  201 + } else {
  202 + var temp = tempData[$("#line").val()].split(":");
  203 + $("#gsdm").val(temp[0]);
  204 + updateCompany();
  205 + $("#fgsdm").val(temp[1]);
  206 + $("#gsdm").attr("disabled", true);
  207 + $("#fgsdm").attr("disabled", true);
199 208 }
200   - }
201   - initPinYinSelect2('#line',data,'');
202   - fage=true;
  209 + });
203 210 }
  211 +
  212 +
  213 +
204 214 //查询
205 215 $("#query").on('click',function(){
206 216 var line = $("#line").val();
... ...
src/main/resources/static/pages/report/timetable/timetable.html
... ... @@ -237,36 +237,46 @@
237 237 }
238 238 }
239 239 $('#fgsdmTime').html(options);
240   - initXl();
241 240 }
242 241  
243   - $("#fgsdmTime").on("change",initXl);
244   - function initXl(){
245   - var data=[];
246   - if(fage){
247   - $("#line").select2("destroy").html('');
248   - }
249   - var fgs=$('#fgsdmTime').val();
250   - var gs=$('#gsdmTime').val();
251   - for(var i=0;i<xlList.length;i++){
252   - if(gs!=""){
253   - if(fgs!=""){
254   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
255   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
256   - }
257   - }else{
258   - if(xlList[i]["gsbm"]==gs){
259   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  242 +
  243 +
  244 + var tempData = {};
  245 + $.get('/report/lineList',function(xlList){
  246 + var data = [];
  247 + $.get('/user/companyData', function(result){
  248 + for(var i = 0; i < result.length; i++){
  249 + var companyCode = result[i].companyCode;
  250 + var children = result[i].children;
  251 + for(var j = 0; j < children.length; j++){
  252 + var code = children[j].code;
  253 + for(var k=0;k < xlList.length;k++ ){
  254 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  255 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  256 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  257 + }
260 258 }
261 259 }
262 260 }
  261 + initPinYinSelect2('#line',data,'');
  262 + line = data[0].id;
  263 + updateTtinfo();
  264 + });
  265 + });
  266 +
  267 + $("#line").on("change", function(){
  268 + if($("#line").val() == " "){
  269 + $("#gsdmTime").attr("disabled", false);
  270 + $("#fgsdmTime").attr("disabled", false);
  271 + } else {
  272 + var temp = tempData[$("#line").val()].split(":");
  273 + $("#gsdmTime").val(temp[0]);
  274 + updateCompany();
  275 + $("#fgsdmTime").val(temp[1]);
  276 + $("#gsdmTime").attr("disabled", true);
  277 + $("#fgsdmTime").attr("disabled", true);
263 278 }
264   - initPinYinSelect2('#line',data,'');
265   - fage=true;
266   -
267   - line = data[0].id;
268   - updateTtinfo();
269   - }
  279 + });
270 280  
271 281  
272 282 var flag = 0;
... ...