Commit f992eaea81fe5381b1e0a416b651f8505cf358ed

Authored by 娄高锋
1 parent 6b4e6d80

选择公司同时改变线路下拉框选项

src/main/resources/static/pages/forms/statement/busInterval.html
@@ -38,15 +38,9 @@ @@ -38,15 +38,9 @@
38 <select class="form-control" name="subCompany" id="subCompany" style="width: 140px;"></select> 38 <select class="form-control" name="subCompany" id="subCompany" style="width: 140px;"></select>
39 </div> 39 </div>
40 <div style="display: inline-block; margin-left: 10px;"> 40 <div style="display: inline-block; margin-left: 10px;">
41 - <span class="item-label" style="width: 80px;">线路: </span>  
42 - <select class="form-control" name="statu" id="statu" style="width: 140px;">  
43 - <option value="0">多线</option>  
44 - <option value="1">单线</option>  
45 - </select>  
46 - </div>  
47 - <div style="display: inline-block; margin-left: 0px;" id="line1">  
48 - <span class="item-label" style="width: 80px;"> - </span>  
49 - <select class="form-control" name="line" id="line" style="width: 140px;"/> 41 + <span class="item-label" style="width: 80px;">选择线路: </span>
  42 + <select class="form-control" name="line" id="line" style="width: 165px;"/>
  43 + <input type="hidden" name="statu" id="statu"/>
50 </div> 44 </div>
51 <div style="display: inline-block; margin-left: 10px"> 45 <div style="display: inline-block; margin-left: 10px">
52 <span class="item-label" style="width: 80px;">时刻类型: </span> 46 <span class="item-label" style="width: 80px;">时刻类型: </span>
@@ -63,14 +57,20 @@ @@ -63,14 +57,20 @@
63 <span class="item-label" style="width: 80px;">结束时间: </span> 57 <span class="item-label" style="width: 80px;">结束时间: </span>
64 <input class="form-control" type="text" id="endDate" style="width: 140px;"/> 58 <input class="form-control" type="text" id="endDate" style="width: 140px;"/>
65 </div> 59 </div>
66 -<!-- <div style="display: inline-block;margin-left: 10px;"> -->  
67 -<!-- <span class="item-label" style="width: 80px;">时间段: </span> -->  
68 -<!-- <input class="form-control" type="text" id="times1" style="width: 80px;"/> -->  
69 -<!-- </div> -->  
70 -<!-- <div style="display: inline-block;"> -->  
71 -<!-- <span class="item-label" style="width: 80px;"> - </span> -->  
72 -<!-- <input class="form-control" type="text" id="times2" style="width: 80px;"/> -->  
73 -<!-- </div> --> 60 + <div style="display: inline-block; margin-left: 10px;">
  61 + <select class="form-control" name="sfqr" id="sfqr" style="width: 75px;">
  62 + <option value="0">全日</option>
  63 + <option value="1">时段</option>
  64 + </select>
  65 + </div>
  66 + <div style="display: inline-block;margin-left: 12px;">
  67 + <span class="item-label" style="width: 80px;"> </span>
  68 + <input class="form-control" type="text" id="times1" style="width: 60px;"/>
  69 + </div>
  70 + <div style="display: inline-block;">
  71 + <span class="item-label" style="width: 80px;"> - </span>
  72 + <input class="form-control" type="text" id="times2" style="width: 60px;"/>
  73 + </div>
74 <div class="form-group" style="margin-left: 14px"> 74 <div class="form-group" style="margin-left: 14px">
75 <input class="btn btn-default" type="button" id="query" value="筛选"/> 75 <input class="btn btn-default" type="button" id="query" value="筛选"/>
76 <input class="btn btn-default" type="button" id="export" value="导出"/> 76 <input class="btn btn-default" type="button" id="export" value="导出"/>
@@ -112,14 +112,14 @@ @@ -112,14 +112,14 @@
112 locale : 'zh-cn' 112 locale : 'zh-cn'
113 }); 113 });
114 114
115 -// $("#times1").datetimepicker({  
116 -// format : 'HH:mm',  
117 -// locale : 'zh-cn'  
118 -// });  
119 -// $("#times2").datetimepicker({  
120 -// format : 'HH:mm',  
121 -// locale : 'zh-cn'  
122 -// }); 115 + $("#times1").datetimepicker({
  116 + format : 'HH:mm',
  117 + locale : 'zh-cn'
  118 + });
  119 + $("#times2").datetimepicker({
  120 + format : 'HH:mm',
  121 + locale : 'zh-cn'
  122 + });
123 123
124 var d = new Date(); 124 var d = new Date();
125 var year = d.getFullYear(); 125 var year = d.getFullYear();
@@ -132,24 +132,78 @@ @@ -132,24 +132,78 @@
132 $("#startDate").val(year + "-" + month + "-" + day); 132 $("#startDate").val(year + "-" + month + "-" + day);
133 $("#endDate").val(year + "-" + month + "-" + day); 133 $("#endDate").val(year + "-" + month + "-" + day);
134 134
135 -// $("#times1").val("06:00");  
136 -// $("#times2").val("07:00"); 135 + $("#times1").val("05:00");
  136 + $("#times2").val("23:00");
  137 + $("#times1").attr("disabled", true);
  138 + $("#times2").attr("disabled", true);
137 139
  140 +// var obj = [];
  141 +// $.get('/user/companyData', function(result){
  142 +// obj = result;
  143 +// var options = '';
  144 +// for(var i = 0; i < obj.length; i++){
  145 +// options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  146 +// }
  147 +// if(obj.length == 1){
  148 +// $('#company1').hide();
  149 +// if(obj[0].children.length == 1)
  150 +// $('#subCompany1').hide();
  151 +// }
  152 +// $('#company').html(options);
  153 +// updateCompany();
  154 +// });
  155 +// $("#company").on("change",updateCompany);
  156 +// function updateCompany(){
  157 +// var company = $('#company').val();
  158 +// var options = '';
  159 +// for(var i = 0; i < obj.length; i++){
  160 +// if(obj[i].companyCode == company){
  161 +// var children = obj[i].children;
  162 +// for(var j = 0; j < children.length; j++){
  163 +// options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  164 +// }
  165 +// }
  166 +// }
  167 +// $('#subCompany').html(options);
  168 +// }
  169 +
  170 +// $.get('/basic/lineCode2Name',function(result){
  171 +// var data=[];
  172 +// // data.push({id:" ", text:"全部线路"});
  173 +// for(var code in result){
  174 +// data.push({id: code, text: result[code]});
  175 +// }
  176 +// console.log(data);
  177 +// initPinYinSelect2('#line',data,'');
  178 +
  179 +// // line = "";
  180 +// line = data[0].id;
  181 +// updateModel();
  182 +// })
  183 + var fage=false;
  184 + var xlList;
138 var obj = []; 185 var obj = [];
139 - $.get('/user/companyData', function(result){  
140 - obj = result;  
141 - var options = '';  
142 - for(var i = 0; i < obj.length; i++){  
143 - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';  
144 - }  
145 - if(obj.length == 1){  
146 - $('#company1').hide();  
147 - if(obj[0].children.length == 1)  
148 - $('#subCompany1').hide();  
149 - }  
150 - $('#company').html(options);  
151 - updateCompany();  
152 - }); 186 +
  187 + $.get('/report/lineList',function(result){
  188 + xlList=result;
  189 + $.get('/user/companyData', function(result){
  190 + obj = result;
  191 + var options = '';
  192 + for(var i = 0; i < obj.length; i++){
  193 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  194 + }
  195 +
  196 + if(obj.length ==0){
  197 + $("#company1").css('display','none');
  198 + }else if(obj.length ==1){
  199 + $("#company1").css('display','none');
  200 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  201 + $('#subCompany1').css('display','none');
  202 + }
  203 + $('#company').html(options);
  204 + updateCompany();
  205 + });
  206 + })
153 $("#company").on("change",updateCompany); 207 $("#company").on("change",updateCompany);
154 function updateCompany(){ 208 function updateCompany(){
155 var company = $('#company').val(); 209 var company = $('#company').val();
@@ -163,86 +217,82 @@ @@ -163,86 +217,82 @@
163 } 217 }
164 } 218 }
165 $('#subCompany').html(options); 219 $('#subCompany').html(options);
  220 + initXl();
166 } 221 }
167 -  
168 - $.get('/basic/lineCode2Name',function(result){ 222 +
  223 + $("#subCompany").on("change",initXl);
  224 + function initXl(){
169 var data=[]; 225 var data=[];
170 -// data.push({id:" ", text:"全部线路"});  
171 - for(var code in result){  
172 - data.push({id: code, text: result[code]}); 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"]});
  241 + }
  242 + }
  243 + }
173 } 244 }
174 - console.log(data);  
175 initPinYinSelect2('#line',data,''); 245 initPinYinSelect2('#line',data,'');
  246 + fage=true;
176 247
177 -// line = ""; 248 + $("#endDate").attr("disabled", true);
  249 + $("#endDate").val($("#startDate").val());
178 line = data[0].id; 250 line = data[0].id;
  251 + statu = 0;
  252 +
179 updateModel(); 253 updateModel();
180 - }) 254 + }
181 255
182 -// $('#line').select2({  
183 -// ajax: {  
184 -// url: '/realSchedule/findLine',  
185 -// type: 'post',  
186 -// dataType: 'json',  
187 -// delay: 150,  
188 -// data: function(params){  
189 -// return{line: params.term};  
190 -// },  
191 -// processResults: function (data) {  
192 -// return {  
193 -// results: data  
194 -// };  
195 -// },  
196 -// cache: true  
197 -// },  
198 -// templateResult: function(repo){  
199 -// if (repo.loading) return repo.text;  
200 -// var h = '<span>'+repo.text+'</span>';  
201 -// return h;  
202 -// },  
203 -// escapeMarkup: function (markup) { return markup; },  
204 -// minimumInputLength: 1,  
205 -// templateSelection: function(repo){  
206 -// return repo.text;  
207 -// },  
208 -// language: {  
209 -// noResults: function(){  
210 -// return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
211 -// },  
212 -// inputTooShort : function(e) {  
213 -// return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
214 -// },  
215 -// searching : function() {  
216 -// return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
217 -// }  
218 -// }  
219 -// });  
220 256
221 $("#query").on("click",jsDoQuery); 257 $("#query").on("click",jsDoQuery);
222 - 258 +
  259 + var sfqr = 0;
  260 + var statu = 0;
223 var line = $("#line").val(); 261 var line = $("#line").val();
224 - var statu = $("#statu").val(); 262 +// var statu = $("#statu").val();
225 var startDate = $("#startDate").val(); 263 var startDate = $("#startDate").val();
226 var endDate = $("#endDate").val(); 264 var endDate = $("#endDate").val();
227 var model = $("#model").val(); 265 var model = $("#model").val();
228 -// var times = $("#times1").val() + "-" + $("#times2").val(); 266 + var times1 = $("#times1").val();
  267 + var times2 = $("#times2").val();
229 var company = $("#company").val(); 268 var company = $("#company").val();
230 var subCompany = $("#subCompany").val(); 269 var subCompany = $("#subCompany").val();
231 function jsDoQuery(pagination){ 270 function jsDoQuery(pagination){
  271 + if($("#startDate").val().trim().length == 0 || $("#endDate").val().trim().length == 0){
  272 + layer.msg("请选择日期");
  273 + return;
  274 + }
  275 + if(sfqr == 1 && ($("#times1").val().trim().length == 0 || $("#times2").val().trim().length == 0)){
  276 + layer.msg("请选择时间");
  277 + return;
  278 + }
232 var params = {}; 279 var params = {};
233 -// line = $("#line").val(); 280 + line = $("#line").val();
234 startDate = $("#startDate").val(); 281 startDate = $("#startDate").val();
235 endDate = $("#endDate").val(); 282 endDate = $("#endDate").val();
236 model = $("#model").val(); 283 model = $("#model").val();
237 -// times = $("#times1").val() + "-" + $("#times2").val(); 284 + times1 = $("#times1").val();
  285 + times2 = $("#times2").val();
238 company = $("#company").val(); 286 company = $("#company").val();
239 subCompany = $("#subCompany").val(); 287 subCompany = $("#subCompany").val();
240 params['line'] = line; 288 params['line'] = line;
  289 + params['sfqr'] = sfqr;
241 params['statu'] = statu; 290 params['statu'] = statu;
242 params['startDate'] = startDate; 291 params['startDate'] = startDate;
243 params['endDate'] = endDate; 292 params['endDate'] = endDate;
244 params['model'] = model; 293 params['model'] = model;
245 -// params['times'] = times; 294 + params['times1'] = times1;
  295 + params['times2'] = times2;
246 params['company'] = company; 296 params['company'] = company;
247 params['subCompany'] = subCompany; 297 params['subCompany'] = subCompany;
248 params['type'] = "query"; 298 params['type'] = "query";
@@ -262,11 +312,22 @@ @@ -262,11 +312,22 @@
262 } 312 }
263 313
264 $("#export").on("click", function(){ 314 $("#export").on("click", function(){
  315 + if($("#startDate").val().trim().length == 0 || $("#endDate").val().trim().length == 0){
  316 + layer.msg("请选择日期");
  317 + return;
  318 + }
  319 + if(sfqr == 1 && ($("#times1").val().trim().length == 0 || $("#times2").val().trim().length == 0)){
  320 + layer.msg("请选择时间");
  321 + return;
  322 + }
265 var params = {}; 323 var params = {};
266 params['line'] = line; 324 params['line'] = line;
  325 + params['sfqr'] = sfqr;
267 params['statu'] = statu; 326 params['statu'] = statu;
268 params['startDate'] = startDate; 327 params['startDate'] = startDate;
269 params['endDate'] = endDate; 328 params['endDate'] = endDate;
  329 + params['times1'] = times1;
  330 + params['times2'] = times2;
270 params['model'] = model; 331 params['model'] = model;
271 params['company'] = company; 332 params['company'] = company;
272 params['subCompany'] = subCompany; 333 params['subCompany'] = subCompany;
@@ -278,30 +339,39 @@ @@ -278,30 +339,39 @@
278 }); 339 });
279 }); 340 });
280 341
  342 +// $("#lp1").hide();
  343 +// $("#line1").hide();
281 344
282 - $("#lp1").hide();  
283 - $("#line1").hide();  
284 - $("#statu").on("change", function(){  
285 - statu = $("#statu").val();  
286 - if(statu == 0){  
287 - $("#line1").hide();  
288 - $("#lp1").hide(); 345 + $("#sfqr").on("change", function(){
  346 + if($("#sfqr").val() == 0){
  347 + $("#times1").attr("disabled", true);
  348 + $("#times2").attr("disabled", true);
  349 + sfqr = 0;
289 }else{ 350 }else{
290 - $("#line1").show();  
291 - $("#lp1").show(); 351 + $("#times1").attr("disabled", false);
  352 + $("#times2").attr("disabled", false);
  353 + sfqr = 1;
292 } 354 }
293 - updateModel();  
294 }); 355 });
295 $("#line").on("change", function(){ 356 $("#line").on("change", function(){
296 line = $("#line").val(); 357 line = $("#line").val();
297 -// if(line == " ")  
298 -// line = ""; 358 + if(line.trim().length == 0){
  359 + statu = 0;
  360 + $("#endDate").attr("disabled", true);
  361 + $("#endDate").val($("#startDate").val());
  362 + }else{
  363 + statu = 1;
  364 + $("#endDate").attr("disabled", false);
  365 + }
299 updateModel(); 366 updateModel();
300 }); 367 });
301 $('#startDate').on("blur", function(){ 368 $('#startDate').on("blur", function(){
302 startDate = $("#startDate").val(); 369 startDate = $("#startDate").val();
303 endDate = $("#endDate").val(); 370 endDate = $("#endDate").val();
304 updateModel(); 371 updateModel();
  372 + if($("#endDate").prop("disabled")){
  373 + $("#endDate").val($("#startDate").val());
  374 + }
305 }); 375 });
306 $('#endDate').on("blur", function(){ 376 $('#endDate').on("blur", function(){
307 startDate = $("#startDate").val(); 377 startDate = $("#startDate").val();
src/main/resources/static/pages/forms/statement/commandState.html
@@ -141,33 +141,72 @@ @@ -141,33 +141,72 @@
141 day = "0" + day; 141 day = "0" + day;
142 $("#date").val(year + "-" + month + "-" + day); 142 $("#date").val(year + "-" + month + "-" + day);
143 143
144 - $.get('/basic/lineCode2Name',function(result){  
145 - var data=[]; 144 +// $.get('/basic/lineCode2Name',function(result){
  145 +// var data=[];
146 146
147 - data.push({id: " ", text: "全部线路"});  
148 - for(var code in result){  
149 - data.push({id: code, text: result[code]});  
150 - } 147 +// data.push({id: " ", text: "全部线路"});
  148 +// for(var code in result){
  149 +// data.push({id: code, text: result[code]});
  150 +// }
151 151
152 - console.log(data);  
153 - initPinYinSelect2('#line',data,'');  
154 - }) 152 +// console.log(data);
  153 +// initPinYinSelect2('#line',data,'');
  154 +// })
155 155
  156 +// var obj = [];
  157 +// $.get('/user/companyData', function(result){
  158 +// obj = result;
  159 +// var options = '';
  160 +// for(var i = 0; i < obj.length; i++){
  161 +// options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  162 +// }
  163 +// if(obj.length == 1){
  164 +// $('#company1').hide();
  165 +// if(obj[0].children.length == 1)
  166 +// $('#subCompany1').hide();
  167 +// }
  168 +// $('#company').html(options);
  169 +// updateCompany();
  170 +// });
  171 +// $("#company").on("change",updateCompany);
  172 +// function updateCompany(){
  173 +// var company = $('#company').val();
  174 +// var options = '';
  175 +// for(var i = 0; i < obj.length; i++){
  176 +// if(obj[i].companyCode == company){
  177 +// var children = obj[i].children;
  178 +// for(var j = 0; j < children.length; j++){
  179 +// options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  180 +// }
  181 +// }
  182 +// }
  183 +// $('#subCompany').html(options);
  184 +// }
  185 + var fage=false;
  186 + var xlList;
156 var obj = []; 187 var obj = [];
157 - $.get('/user/companyData', function(result){  
158 - obj = result;  
159 - var options = '';  
160 - for(var i = 0; i < obj.length; i++){  
161 - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';  
162 - }  
163 - if(obj.length == 1){  
164 - $('#company1').hide();  
165 - if(obj[0].children.length == 1)  
166 - $('#subCompany1').hide();  
167 - }  
168 - $('#company').html(options);  
169 - updateCompany();  
170 - }); 188 +
  189 +
  190 + $.get('/report/lineList',function(result){
  191 + xlList=result;
  192 + $.get('/user/companyData', function(result){
  193 + obj = result;
  194 + var options = '';
  195 + for(var i = 0; i < obj.length; i++){
  196 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  197 + }
  198 +
  199 + if(obj.length ==0){
  200 + $("#company1").css('display','none');
  201 + }else if(obj.length ==1){
  202 + $("#company1").css('display','none');
  203 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  204 + $('#subCompany1').css('display','none');
  205 + }
  206 + $('#company').html(options);
  207 + updateCompany();
  208 + });
  209 + })
171 $("#company").on("change",updateCompany); 210 $("#company").on("change",updateCompany);
172 function updateCompany(){ 211 function updateCompany(){
173 var company = $('#company').val(); 212 var company = $('#company').val();
@@ -181,6 +220,32 @@ @@ -181,6 +220,32 @@
181 } 220 }
182 } 221 }
183 $('#subCompany').html(options); 222 $('#subCompany').html(options);
  223 + initXl();
  224 + }
  225 +
  226 + $("#subCompany").on("change",initXl);
  227 + function initXl(){
  228 + var data=[];
  229 + if(fage){
  230 + $("#line").select2("destroy").html('');
  231 + }
  232 + var fgs=$('#subCompany').val();
  233 + var gs=$('#company').val();
  234 + for(var i=0;i<xlList.length;i++){
  235 + if(gs!=""){
  236 + if(fgs!=""){
  237 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  238 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  239 + }
  240 + }else{
  241 + if(xlList[i]["gsbm"]==gs){
  242 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  243 + }
  244 + }
  245 + }
  246 + }
  247 + initPinYinSelect2('#line',data,'');
  248 + fage=true;
184 } 249 }
185 250
186 $('#code').select2({ 251 $('#code').select2({
src/main/resources/static/pages/forms/statement/correctStatis.html
@@ -34,9 +34,9 @@ @@ -34,9 +34,9 @@
34 <span class="item-label" style="width: 80px;">分公司: </span> 34 <span class="item-label" style="width: 80px;">分公司: </span>
35 <select class="form-control" name="subCompany" id="subCompany" style="width: 140px;"></select> 35 <select class="form-control" name="subCompany" id="subCompany" style="width: 140px;"></select>
36 </div> 36 </div>
37 - <div style="display: inline-block; margin-left: 24px;">  
38 - <span class="item-label" style="width: 80px;">线路: </span>  
39 - <select class="form-control" name="line" id="line" style="width: 140px;"></select> 37 + <div style="display: inline-block; margin-left: 25px;">
  38 + <span class="item-label" style="width: 80px;">选择线路: </span>
  39 + <select class="form-control" name="line" id="line" style="width: 150px;"></select>
40 </div> 40 </div>
41 <div style="margin-top: 10px"></div> 41 <div style="margin-top: 10px"></div>
42 <div style="display: inline-block;margin-left: 5px;"> 42 <div style="display: inline-block;margin-left: 5px;">
@@ -47,8 +47,14 @@ @@ -47,8 +47,14 @@
47 <span class="item-label" style="width: 80px;">结束时间: </span> 47 <span class="item-label" style="width: 80px;">结束时间: </span>
48 <input class="form-control" type="text" id="endDate" style="width: 140px;"/> 48 <input class="form-control" type="text" id="endDate" style="width: 140px;"/>
49 </div> 49 </div>
50 - <div style="display: inline-block;margin-left: 10px;">  
51 - <span class="item-label" style="width: 80px;">时间段: </span> 50 + <div style="display: inline-block; margin-left: 10px;">
  51 + <select class="form-control" name="sfqr" id="sfqr" style="width: 75px;">
  52 + <option value="0">全日</option>
  53 + <option value="1">时段</option>
  54 + </select>
  55 + </div>
  56 + <div style="display: inline-block;margin-left: 12px;">
  57 + <span class="item-label" style="width: 80px;"> </span>
52 <input class="form-control" type="text" id="times1" style="width: 60px;"/> 58 <input class="form-control" type="text" id="times1" style="width: 60px;"/>
53 </div> 59 </div>
54 <div style="display: inline-block;"> 60 <div style="display: inline-block;">
@@ -62,21 +68,21 @@ @@ -62,21 +68,21 @@
62 </form> 68 </form>
63 </div> 69 </div>
64 <div class="portlet-body"> 70 <div class="portlet-body">
65 - <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">  
66 - <table class="table table-bordered table-hover table-checkable" id="forms">  
67 - </table>  
68 - <div style="text-align: right;">  
69 - <ul id="pagination" class="pagination"></ul>  
70 - </div>  
71 - </div> 71 +<!-- <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> -->
  72 +<!-- <table class="table table-bordered table-hover table-checkable" id="forms"> -->
  73 +<!-- </table> -->
  74 +<!-- <div style="text-align: right;"> -->
  75 +<!-- <ul id="pagination" class="pagination"></ul> -->
  76 +<!-- </div> -->
  77 +<!-- </div> -->
72 78
73 - <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">  
74 - <table class="table table-bordered table-hover table-checkable" id="subinfo">  
75 - </table>  
76 - <div style="text-align: right;">  
77 - <ul id="pagination" class="pagination"></ul>  
78 - </div>  
79 - </div> 79 +<!-- <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> -->
  80 +<!-- <table class="table table-bordered table-hover table-checkable" id="subinfo"> -->
  81 +<!-- </table> -->
  82 +<!-- <div style="text-align: right;"> -->
  83 +<!-- <ul id="pagination" class="pagination"></ul> -->
  84 +<!-- </div> -->
  85 +<!-- </div> -->
80 86
81 <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> 87 <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
82 <table class="table table-bordered table-hover table-checkable" id="lineinfo"> 88 <table class="table table-bordered table-hover table-checkable" id="lineinfo">
@@ -133,38 +139,78 @@ @@ -133,38 +139,78 @@
133 $("#startDate").val(year + "-" + month + "-" + day); 139 $("#startDate").val(year + "-" + month + "-" + day);
134 $("#endDate").val(year + "-" + month + "-" + day); 140 $("#endDate").val(year + "-" + month + "-" + day);
135 141
136 - $("#times1").val("06:00");  
137 - $("#times2").val("07:00"); 142 + $("#times1").val("05:00");
  143 + $("#times2").val("23:00");
  144 + $("#times1").attr("disabled", true);
  145 + $("#times2").attr("disabled", true);
138 146
139 - $.get('/basic/lineCode2Name', function(result){  
140 - var data=[]; 147 +// $.get('/basic/lineCode2Name', function(result){
  148 +// var data=[];
141 149
142 - data.push({id: " ", text: "全部线路"});  
143 - for(var code in result){  
144 - data.push({id: code, text: result[code]});  
145 - }  
146 - console.log(data);  
147 - initPinYinSelect2('#line',data,''); 150 +// data.push({id: " ", text: "全部线路"});
  151 +// for(var code in result){
  152 +// data.push({id: code, text: result[code]});
  153 +// }
  154 +// console.log(data);
  155 +// initPinYinSelect2('#line',data,'');
148 156
149 - line = "";  
150 -// updateModel();  
151 - }); 157 +// line = "";
  158 +// // updateModel();
  159 +// });
152 160
  161 +// var obj = [];
  162 +// $.get('/user/companyData', function(result){
  163 +// obj = result;
  164 +// var options = '';
  165 +// for(var i = 0; i < obj.length; i++){
  166 +// options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  167 +// }
  168 +// if(obj.length == 1){
  169 +// $('#company1').hide();
  170 +// if(obj[0].children.length == 1)
  171 +// $('#subCompany1').hide();
  172 +// }
  173 +// $('#company').html(options);
  174 +// updateCompany();
  175 +// });
  176 +// $("#company").on("change",updateCompany);
  177 +// function updateCompany(){
  178 +// var company = $('#company').val();
  179 +// var options = '';
  180 +// for(var i = 0; i < obj.length; i++){
  181 +// if(obj[i].companyCode == company){
  182 +// var children = obj[i].children;
  183 +// for(var j = 0; j < children.length; j++){
  184 +// options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  185 +// }
  186 +// }
  187 +// }
  188 +// $('#subCompany').html(options);
  189 +// }
  190 + var fage=false;
  191 + var xlList;
153 var obj = []; 192 var obj = [];
154 - $.get('/user/companyData', function(result){  
155 - obj = result;  
156 - var options = '';  
157 - for(var i = 0; i < obj.length; i++){  
158 - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';  
159 - }  
160 - if(obj.length == 1){  
161 - $('#company1').hide();  
162 - if(obj[0].children.length == 1)  
163 - $('#subCompany1').hide();  
164 - }  
165 - $('#company').html(options);  
166 - updateCompany();  
167 - }); 193 +
  194 + $.get('/report/lineList',function(result){
  195 + xlList=result;
  196 + $.get('/user/companyData', function(result){
  197 + obj = result;
  198 + var options = '';
  199 + for(var i = 0; i < obj.length; i++){
  200 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  201 + }
  202 +
  203 + if(obj.length ==0){
  204 + $("#company1").css('display','none');
  205 + }else if(obj.length ==1){
  206 + $("#company1").css('display','none');
  207 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  208 + $('#subCompany1').css('display','none');
  209 + }
  210 + $('#company').html(options);
  211 + updateCompany();
  212 + });
  213 + })
168 $("#company").on("change",updateCompany); 214 $("#company").on("change",updateCompany);
169 function updateCompany(){ 215 function updateCompany(){
170 var company = $('#company').val(); 216 var company = $('#company').val();
@@ -178,11 +224,41 @@ @@ -178,11 +224,41 @@
178 } 224 }
179 } 225 }
180 $('#subCompany').html(options); 226 $('#subCompany').html(options);
  227 + initXl();
  228 + }
  229 +
  230 + $("#subCompany").on("change",initXl);
  231 + function initXl(){
  232 + var data=[];
  233 + data.push({id:" ", text:"全部线路"});
  234 + if(fage){
  235 + $("#line").select2("destroy").html('');
  236 + }
  237 + var fgs=$('#subCompany').val();
  238 + var gs=$('#company').val();
  239 + for(var i=0;i<xlList.length;i++){
  240 + if(gs!=""){
  241 + if(fgs!=""){
  242 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  243 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  244 + }
  245 + }else{
  246 + if(xlList[i]["gsbm"]==gs){
  247 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  248 + }
  249 + }
  250 + }
  251 + }
  252 + initPinYinSelect2('#line',data,'');
  253 + fage=true;
  254 +
  255 + line = "";
181 } 256 }
182 257
183 258
184 $("#query").on("click",jsDoQuery); 259 $("#query").on("click",jsDoQuery);
185 260
  261 + var sfqr = 0;
186 var company = $("#company").val(); 262 var company = $("#company").val();
187 var subCompany = $("#subCompany").val(); 263 var subCompany = $("#subCompany").val();
188 var lines; 264 var lines;
@@ -191,6 +267,14 @@ @@ -191,6 +267,14 @@
191 var endDate = $("#endDate").val(); 267 var endDate = $("#endDate").val();
192 var times = $("#times1").val() + "-" + $("#times2").val(); 268 var times = $("#times1").val() + "-" + $("#times2").val();
193 function jsDoQuery(pagination){ 269 function jsDoQuery(pagination){
  270 + if($("#startDate").val().trim().length == 0 || $("#endDate").val().trim().length == 0){
  271 + layer.msg("请选择日期");
  272 + return;
  273 + }
  274 + if(sfqr == 1 && ($("#times1").val().trim().length == 0 || $("#times2").val().trim().length == 0)){
  275 + layer.msg("请选择时间");
  276 + return;
  277 + }
194 var params = {}; 278 var params = {};
195 // line = $("#line").val(); 279 // line = $("#line").val();
196 startDate = $("#startDate").val(); 280 startDate = $("#startDate").val();
@@ -198,6 +282,7 @@ @@ -198,6 +282,7 @@
198 times = $("#times1").val() + "-" + $("#times2").val(); 282 times = $("#times1").val() + "-" + $("#times2").val();
199 company = $("#company").val(); 283 company = $("#company").val();
200 subCompany = $("#subCompany").val(); 284 subCompany = $("#subCompany").val();
  285 + params['sfqr'] = sfqr;
201 params['line'] = line; 286 params['line'] = line;
202 params['startDate'] = startDate; 287 params['startDate'] = startDate;
203 params['endDate'] = endDate; 288 params['endDate'] = endDate;
@@ -208,14 +293,23 @@ @@ -208,14 +293,23 @@
208 // $(".hidden").removeClass("hidden"); 293 // $(".hidden").removeClass("hidden");
209 $get('/busInterval/correctStatis', params, function(result){ 294 $get('/busInterval/correctStatis', params, function(result){
210 // 把数据填充到模版中 295 // 把数据填充到模版中
211 - var tbodyHtml = template('list_company',{list:result, type:1}); 296 +// var tbodyHtml = template('list_company',{list:result, type:1});
  297 + var tbodyHtml = "";
  298 + if(result.length != 0){
  299 + tbodyHtml = template('list_company',{list:result[0].workList[0].workList, type:3});
  300 + }else{
  301 + tbodyHtml = template('list_company',{list:result, type:3});
  302 + }
  303 +
212 // 把渲染好的模版html文本追加到表格中 304 // 把渲染好的模版html文本追加到表格中
213 - $('#forms').html(tbodyHtml); 305 +// $('#forms').html(tbodyHtml);
  306 + $('#forms').html("");
214 $('#subinfo').html(""); 307 $('#subinfo').html("");
215 - $('#lineinfo').html(""); 308 + $('#lineinfo').html(tbodyHtml);
216 $("#lines").html(""); 309 $("#lines").html("");
217 310
218 - company = result; 311 +// company = result;
  312 + lines = result[0].workList[0].workList;
219 }); 313 });
220 } 314 }
221 315
@@ -274,13 +368,24 @@ @@ -274,13 +368,24 @@
274 }); 368 });
275 }); 369 });
276 370
277 - $("#export").on("click", function(){  
278 - $get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){  
279 - window.open("/downloadFile/download?fileName=营运服务日报表"+moment(date).format("YYYYMMDD"));  
280 - });  
281 - }); 371 +// $("#export").on("click", function(){
  372 +// $get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){
  373 +// window.open("/downloadFile/download?fileName=营运服务日报表"+moment(date).format("YYYYMMDD"));
  374 +// });
  375 +// });
282 376
283 377
  378 + $("#sfqr").on("change", function(){
  379 + if($("#sfqr").val() == 0){
  380 + $("#times1").attr("disabled", true);
  381 + $("#times2").attr("disabled", true);
  382 + sfqr = 0;
  383 + }else{
  384 + $("#times1").attr("disabled", false);
  385 + $("#times2").attr("disabled", false);
  386 + sfqr = 1;
  387 + }
  388 + });
284 $("#line").on("change", function(){ 389 $("#line").on("change", function(){
285 line = $("#line").val(); 390 line = $("#line").val();
286 if(line == " ") 391 if(line == " ")
src/main/resources/static/pages/forms/statement/firstAndLastBus.html
@@ -118,32 +118,71 @@ @@ -118,32 +118,71 @@
118 day = "0" + day; 118 day = "0" + day;
119 $("#date").val(year + "-" + month + "-" + day); 119 $("#date").val(year + "-" + month + "-" + day);
120 120
121 - $.get('/basic/lineCode2Name',function(result){  
122 - var data=[]; 121 +// $.get('/basic/lineCode2Name',function(result){
  122 +// var data=[];
123 123
124 - data.push({id: " ", text: "全部线路"});  
125 - for(var code in result){  
126 - data.push({id: code, text: result[code]});  
127 - }  
128 - console.log(data);  
129 - initPinYinSelect2('#line',data,'');  
130 - }); 124 +// data.push({id: " ", text: "全部线路"});
  125 +// for(var code in result){
  126 +// data.push({id: code, text: result[code]});
  127 +// }
  128 +// console.log(data);
  129 +// initPinYinSelect2('#line',data,'');
  130 +// });
131 131
  132 +// var obj = [];
  133 +// $.get('/user/companyData', function(result){
  134 +// obj = result;
  135 +// var options = '';
  136 +// for(var i = 0; i < obj.length; i++){
  137 +// options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  138 +// }
  139 +// if(obj.length == 1){
  140 +// $('#company1').hide();
  141 +// if(obj[0].children.length == 1)
  142 +// $('#subCompany1').hide();
  143 +// }
  144 +// $('#company').html(options);
  145 +// updateCompany();
  146 +// });
  147 +// $("#company").on("change",updateCompany);
  148 +// function updateCompany(){
  149 +// var company = $('#company').val();
  150 +// var options = '';
  151 +// for(var i = 0; i < obj.length; i++){
  152 +// if(obj[i].companyCode == company){
  153 +// var children = obj[i].children;
  154 +// for(var j = 0; j < children.length; j++){
  155 +// options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  156 +// }
  157 +// }
  158 +// }
  159 +// $('#subCompany').html(options);
  160 +// }
  161 + var fage=false;
  162 + var xlList;
132 var obj = []; 163 var obj = [];
133 - $.get('/user/companyData', function(result){  
134 - obj = result;  
135 - var options = '';  
136 - for(var i = 0; i < obj.length; i++){  
137 - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';  
138 - }  
139 - if(obj.length == 1){  
140 - $('#company1').hide();  
141 - if(obj[0].children.length == 1)  
142 - $('#subCompany1').hide();  
143 - }  
144 - $('#company').html(options);  
145 - updateCompany();  
146 - }); 164 +
  165 +
  166 + $.get('/report/lineList',function(result){
  167 + xlList=result;
  168 + $.get('/user/companyData', function(result){
  169 + obj = result;
  170 + var options = '';
  171 + for(var i = 0; i < obj.length; i++){
  172 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  173 + }
  174 +
  175 + if(obj.length ==0){
  176 + $("#company1").css('display','none');
  177 + }else if(obj.length ==1){
  178 + $("#company1").css('display','none');
  179 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  180 + $('#subCompany1').css('display','none');
  181 + }
  182 + $('#company').html(options);
  183 + updateCompany();
  184 + });
  185 + })
147 $("#company").on("change",updateCompany); 186 $("#company").on("change",updateCompany);
148 function updateCompany(){ 187 function updateCompany(){
149 var company = $('#company').val(); 188 var company = $('#company').val();
@@ -157,6 +196,33 @@ @@ -157,6 +196,33 @@
157 } 196 }
158 } 197 }
159 $('#subCompany').html(options); 198 $('#subCompany').html(options);
  199 + initXl();
  200 + }
  201 +
  202 + $("#subCompany").on("change",initXl);
  203 + function initXl(){
  204 + var data=[];
  205 + if(fage){
  206 + $("#line").select2("destroy").html('');
  207 + }
  208 + var fgs=$('#subCompany').val();
  209 + var gs=$('#company').val();
  210 + data.push({id: " ", text: "全部线路"});
  211 + for(var i=0;i<xlList.length;i++){
  212 + if(gs!=""){
  213 + if(fgs!=""){
  214 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  215 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  216 + }
  217 + }else{
  218 + if(xlList[i]["gsbm"]==gs){
  219 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  220 + }
  221 + }
  222 + }
  223 + }
  224 + initPinYinSelect2('#line',data,'');
  225 + fage=true;
160 } 226 }
161 227
162 228
src/main/resources/static/pages/forms/statement/lbStatuAnaly.html
@@ -53,9 +53,9 @@ @@ -53,9 +53,9 @@
53 <span class="item-label" style="width: 80px;">分公司: </span> 53 <span class="item-label" style="width: 80px;">分公司: </span>
54 <select class="form-control" name="subCompany" id="subCompany" style="width: 140px;"></select> 54 <select class="form-control" name="subCompany" id="subCompany" style="width: 140px;"></select>
55 </div> 55 </div>
56 - <div style="display: inline-block; margin-left: 24px;">  
57 - <span class="item-label" style="width: 80px;">线路: </span>  
58 - <select class="form-control" name="line" id="line" style="width: 140px;"></select> 56 + <div style="display: inline-block; margin-left: 25px;">
  57 + <span class="item-label" style="width: 80px;">选择线路: </span>
  58 + <select class="form-control" name="line" id="line" style="width: 150px;"></select>
59 </div> 59 </div>
60 <div style="display: inline-block; margin-left: 10px"> 60 <div style="display: inline-block; margin-left: 10px">
61 <span class="item-label" style="width: 80px;">时刻类型: </span> 61 <span class="item-label" style="width: 80px;">时刻类型: </span>
@@ -72,8 +72,14 @@ @@ -72,8 +72,14 @@
72 <span class="item-label" style="width: 80px;">结束时间: </span> 72 <span class="item-label" style="width: 80px;">结束时间: </span>
73 <input class="form-control" type="text" id="endDate" style="width: 140px;"/> 73 <input class="form-control" type="text" id="endDate" style="width: 140px;"/>
74 </div> 74 </div>
75 - <div style="display: inline-block;margin-left: 10px;">  
76 - <span class="item-label" style="width: 80px;">时间段: </span> 75 + <div style="display: inline-block; margin-left: 10px;">
  76 + <select class="form-control" name="sfqr" id="sfqr" style="width: 75px;">
  77 + <option value="0">全日</option>
  78 + <option value="1">时段</option>
  79 + </select>
  80 + </div>
  81 + <div style="display: inline-block;margin-left: 12px;">
  82 + <span class="item-label" style="width: 80px;"> </span>
77 <input class="form-control" type="text" id="times1" style="width: 60px;"/> 83 <input class="form-control" type="text" id="times1" style="width: 60px;"/>
78 </div> 84 </div>
79 <div style="display: inline-block;"> 85 <div style="display: inline-block;">
@@ -141,39 +147,79 @@ @@ -141,39 +147,79 @@
141 $("#startDate").val(year + "-" + month + "-" + day); 147 $("#startDate").val(year + "-" + month + "-" + day);
142 $("#endDate").val(year + "-" + month + "-" + day); 148 $("#endDate").val(year + "-" + month + "-" + day);
143 149
144 - $("#times1").val("06:00");  
145 - $("#times2").val("07:00"); 150 + $("#times1").val("05:00");
  151 + $("#times2").val("23:00");
  152 + $("#times1").attr("disabled", true);
  153 + $("#times2").attr("disabled", true);
146 154
147 - $.get('/basic/lineCode2Name', function(result){  
148 - var data=[]; 155 +// $.get('/basic/lineCode2Name', function(result){
  156 +// var data=[];
149 157
150 - data.push({id: " ", text: "全部线路"});  
151 - for(var code in result){  
152 - data.push({id: code, text: result[code]});  
153 - }  
154 - console.log(data);  
155 - initPinYinSelect2('#line',data,''); 158 +// data.push({id: " ", text: "全部线路"});
  159 +// for(var code in result){
  160 +// data.push({id: code, text: result[code]});
  161 +// }
  162 +// console.log(data);
  163 +// initPinYinSelect2('#line',data,'');
156 164
157 - line = "";  
158 - updateModel();  
159 - }) 165 +// line = "";
  166 +// updateModel();
  167 +// })
160 168
161 - var obj = [];  
162 - $.get('/user/companyData', function(result){  
163 - obj = result;  
164 - var options = '';  
165 - for(var i = 0; i < obj.length; i++){  
166 - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';  
167 - }  
168 - if(obj.length == 1){  
169 - $('#company1').hide();  
170 - if(obj[0].children.length == 1)  
171 - $('#subCompany1').hide();  
172 - }  
173 - $('#company').html(options);  
174 - updateCompany();  
175 - }); 169 +// var obj = [];
  170 +// $.get('/user/companyData', function(result){
  171 +// obj = result;
  172 +// var options = '';
  173 +// for(var i = 0; i < obj.length; i++){
  174 +// options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  175 +// }
  176 +// if(obj.length == 1){
  177 +// $('#company1').hide();
  178 +// if(obj[0].children.length == 1)
  179 +// $('#subCompany1').hide();
  180 +// }
  181 +// $('#company').html(options);
  182 +// updateCompany();
  183 +// });
176 184
  185 +// $("#company").on("change",updateCompany);
  186 +// function updateCompany(){
  187 +// var company = $('#company').val();
  188 +// var options = '';
  189 +// for(var i = 0; i < obj.length; i++){
  190 +// if(obj[i].companyCode == company){
  191 +// var children = obj[i].children;
  192 +// for(var j = 0; j < children.length; j++){
  193 +// options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  194 +// }
  195 +// }
  196 +// }
  197 +// $('#subCompany').html(options);
  198 +// }
  199 + var fage=false;
  200 + var xlList;
  201 + var obj = [];
  202 +
  203 + $.get('/report/lineList',function(result){
  204 + xlList=result;
  205 + $.get('/user/companyData', function(result){
  206 + obj = result;
  207 + var options = '';
  208 + for(var i = 0; i < obj.length; i++){
  209 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  210 + }
  211 +
  212 + if(obj.length ==0){
  213 + $("#company1").css('display','none');
  214 + }else if(obj.length ==1){
  215 + $("#company1").css('display','none');
  216 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  217 + $('#subCompany1').css('display','none');
  218 + }
  219 + $('#company').html(options);
  220 + updateCompany();
  221 + });
  222 + })
177 $("#company").on("change",updateCompany); 223 $("#company").on("change",updateCompany);
178 function updateCompany(){ 224 function updateCompany(){
179 var company = $('#company').val(); 225 var company = $('#company').val();
@@ -187,6 +233,33 @@ @@ -187,6 +233,33 @@
187 } 233 }
188 } 234 }
189 $('#subCompany').html(options); 235 $('#subCompany').html(options);
  236 + initXl();
  237 + }
  238 +
  239 + $("#subCompany").on("change",initXl);
  240 + function initXl(){
  241 + var data=[];
  242 + if(fage){
  243 + $("#line").select2("destroy").html('');
  244 + }
  245 + var fgs=$('#subCompany').val();
  246 + var gs=$('#company').val();
  247 + for(var i=0;i<xlList.length;i++){
  248 + if(gs!=""){
  249 + if(fgs!=""){
  250 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  251 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  252 + }
  253 + }else{
  254 + if(xlList[i]["gsbm"]==gs){
  255 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  256 + }
  257 + }
  258 + }
  259 + }
  260 + initPinYinSelect2('#line',data,'');
  261 + updateModel();
  262 + fage=true;
190 } 263 }
191 264
192 var lb = 0; //标志是否有选择至少一个烂班类型 265 var lb = 0; //标志是否有选择至少一个烂班类型
@@ -217,6 +290,7 @@ @@ -217,6 +290,7 @@
217 290
218 $("#query").on("click",jsDoQuery); 291 $("#query").on("click",jsDoQuery);
219 292
  293 + var sfqr = 0;
220 var line = $("#line").val(); 294 var line = $("#line").val();
221 var startDate = $("#startDate").val(); 295 var startDate = $("#startDate").val();
222 var endDate = $("#endDate").val(); 296 var endDate = $("#endDate").val();
@@ -225,6 +299,14 @@ @@ -225,6 +299,14 @@
225 var company = $("#company").val(); 299 var company = $("#company").val();
226 var subCompany = $("#subCompany").val(); 300 var subCompany = $("#subCompany").val();
227 function jsDoQuery(pagination){ 301 function jsDoQuery(pagination){
  302 + if($("#startDate").val().trim().length == 0 || $("#endDate").val().trim().length == 0){
  303 + layer.msg("请选择日期");
  304 + return;
  305 + }
  306 + if(sfqr == 1 && ($("#times1").val().trim().length == 0 || $("#times2").val().trim().length == 0)){
  307 + layer.msg("请选择时间");
  308 + return;
  309 + }
228 var reason = $("input[name='reason']"); 310 var reason = $("input[name='reason']");
229 var params = {}; 311 var params = {};
230 // line = $("#line").val(); 312 // line = $("#line").val();
@@ -234,6 +316,7 @@ @@ -234,6 +316,7 @@
234 times = $("#times1").val() + "-" + $("#times2").val(); 316 times = $("#times1").val() + "-" + $("#times2").val();
235 company = $("#company").val(); 317 company = $("#company").val();
236 subCompany = $("#subCompany").val(); 318 subCompany = $("#subCompany").val();
  319 + params['sfqr'] = sfqr;
237 params['line'] = line; 320 params['line'] = line;
238 params['startDate'] = startDate; 321 params['startDate'] = startDate;
239 params['endDate'] = endDate; 322 params['endDate'] = endDate;
@@ -263,7 +346,16 @@ @@ -263,7 +346,16 @@
263 } 346 }
264 347
265 $("#export").on("click", function(){ 348 $("#export").on("click", function(){
  349 + if($("#startDate").val().trim().length == 0 || $("#endDate").val().trim().length == 0){
  350 + layer.msg("请选择日期");
  351 + return;
  352 + }
  353 + if(sfqr == 1 && ($("#times1").val().trim().length == 0 || $("#times2").val().trim().length == 0)){
  354 + layer.msg("请选择时间");
  355 + return;
  356 + }
266 var params = {}; 357 var params = {};
  358 + params['sfqr'] = sfqr;
267 params['line'] = line; 359 params['line'] = line;
268 params['startDate'] = startDate; 360 params['startDate'] = startDate;
269 params['endDate'] = endDate; 361 params['endDate'] = endDate;
@@ -280,6 +372,17 @@ @@ -280,6 +372,17 @@
280 }); 372 });
281 373
282 374
  375 + $("#sfqr").on("change", function(){
  376 + if($("#sfqr").val() == 0){
  377 + $("#times1").attr("disabled", true);
  378 + $("#times2").attr("disabled", true);
  379 + sfqr = 0;
  380 + }else{
  381 + $("#times1").attr("disabled", false);
  382 + $("#times2").attr("disabled", false);
  383 + sfqr = 1;
  384 + }
  385 + });
283 $("#line").on("change", function(){ 386 $("#line").on("change", function(){
284 line = $("#line").val(); 387 line = $("#line").val();
285 if(line == " ") 388 if(line == " ")
src/main/resources/static/pages/forms/statement/lineTimeAnaly.html
@@ -197,24 +197,87 @@ @@ -197,24 +197,87 @@
197 $("#startDate").val(year + "-" + month + "-" + day); 197 $("#startDate").val(year + "-" + month + "-" + day);
198 $("#endDate").val(year + "-" + month + "-" + day); 198 $("#endDate").val(year + "-" + month + "-" + day);
199 199
200 - $("#times1").val("06:00");  
201 - $("#times2").val("07:00"); 200 + $("#times1").val("05:00");
  201 + $("#times2").val("23:00");
202 202
  203 +// var obj = [];
  204 +// $.get('/user/companyData', function(result){
  205 +// obj = result;
  206 +// var options = '';
  207 +// for(var i = 0; i < obj.length; i++){
  208 +// options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  209 +// }
  210 +// if(obj.length == 1){
  211 +// $('#company1').hide();
  212 +// if(obj[0].children.length == 1)
  213 +// $('#subCompany1').hide();
  214 +// }
  215 +// $('#company').html(options);
  216 +// updateCompany();
  217 +// });
  218 +// $("#company").on("change",updateCompany);
  219 +// function updateCompany(){
  220 +// var company = $('#company').val();
  221 +// var options = '';
  222 +// for(var i = 0; i < obj.length; i++){
  223 +// if(obj[i].companyCode == company){
  224 +// var children = obj[i].children;
  225 +// for(var j = 0; j < children.length; j++){
  226 +// options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  227 +// }
  228 +// }
  229 +// }
  230 +// $('#subCompany').html(options);
  231 +// }
  232 +
  233 +// $.get('/basic/lineCode2Name',function(result){
  234 +// var data=[];
  235 +
  236 +// data.push({id: " ", text:"全部路线"});
  237 +// for(var code in result){
  238 +// data.push({id: code, text: result[code]});
  239 +// }
  240 +// console.log(data);
  241 +// initPinYinSelect2('#line',data,'');
  242 +
  243 +// line = "";
  244 +// updateModel();
  245 +
  246 +// var params = {};
  247 +// params['line'] = line;
  248 +// $get('/busInterval/getDir', params, function(result){
  249 +// dirData = createTreeData(result);
  250 +// var options = '<option value="">全部方向</option>';
  251 +// $.each(dirData, function(i, g){
  252 +// options += '<option value="'+g.name+'">'+g.name+'</option>';
  253 +// });
  254 +// $('#upDown').html(options);
  255 +// });
  256 +// });
  257 + var fage=false;
  258 + var xlList;
203 var obj = []; 259 var obj = [];
204 - $.get('/user/companyData', function(result){  
205 - obj = result;  
206 - var options = '';  
207 - for(var i = 0; i < obj.length; i++){  
208 - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';  
209 - }  
210 - if(obj.length == 1){  
211 - $('#company1').hide();  
212 - if(obj[0].children.length == 1)  
213 - $('#subCompany1').hide();  
214 - }  
215 - $('#company').html(options);  
216 - updateCompany();  
217 - }); 260 +
  261 + $.get('/report/lineList',function(result){
  262 + xlList=result;
  263 + $.get('/user/companyData', function(result){
  264 + obj = result;
  265 + var options = '';
  266 + for(var i = 0; i < obj.length; i++){
  267 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  268 + }
  269 +
  270 + if(obj.length ==0){
  271 + $("#company1").css('display','none');
  272 + }else if(obj.length ==1){
  273 + $("#company1").css('display','none');
  274 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  275 + $('#subCompany1').css('display','none');
  276 + }
  277 + $('#company').html(options);
  278 + updateCompany();
  279 + });
  280 + })
218 $("#company").on("change",updateCompany); 281 $("#company").on("change",updateCompany);
219 function updateCompany(){ 282 function updateCompany(){
220 var company = $('#company').val(); 283 var company = $('#company').val();
@@ -228,22 +291,37 @@ @@ -228,22 +291,37 @@
228 } 291 }
229 } 292 }
230 $('#subCompany').html(options); 293 $('#subCompany').html(options);
  294 + initXl();
231 } 295 }
232 296
233 - $.get('/basic/lineCode2Name',function(result){ 297 + $("#subCompany").on("change",initXl);
  298 + function initXl(){
234 var data=[]; 299 var data=[];
235 -  
236 - data.push({id: " ", text:"全部路线"});  
237 - for(var code in result){  
238 - data.push({id: code, text: result[code]}); 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"]});
  314 + }
  315 + }
  316 + }
239 } 317 }
240 - console.log(data);  
241 initPinYinSelect2('#line',data,''); 318 initPinYinSelect2('#line',data,'');
  319 + fage=true;
242 320
243 - line = "";  
244 updateModel(); 321 updateModel();
245 322
246 var params = {}; 323 var params = {};
  324 + line = data[0].id;
247 params['line'] = line; 325 params['line'] = line;
248 $get('/busInterval/getDir', params, function(result){ 326 $get('/busInterval/getDir', params, function(result){
249 dirData = createTreeData(result); 327 dirData = createTreeData(result);
@@ -253,7 +331,8 @@ @@ -253,7 +331,8 @@
253 }); 331 });
254 $('#upDown').html(options); 332 $('#upDown').html(options);
255 }); 333 });
256 - }); 334 + }
  335 +
257 336
258 $("#query").on("click", function (){ 337 $("#query").on("click", function (){
259 jsDoQuery(); 338 jsDoQuery();
@@ -268,8 +347,16 @@ @@ -268,8 +347,16 @@
268 var company = $("#company").val(); 347 var company = $("#company").val();
269 var subCompany = $("#subCompany").val(); 348 var subCompany = $("#subCompany").val();
270 function jsDoQuery(pagination){ 349 function jsDoQuery(pagination){
  350 + if($("#startDate").val().trim().length == 0 || $("#endDate").val().trim().length == 0){
  351 + layer.msg("请选择日期");
  352 + return;
  353 + }
  354 + if($("#times1").val().trim().length == 0 || $("#times2").val().trim().length == 0){
  355 + layer.msg("请选择时间");
  356 + return;
  357 + }
271 var params = {}; 358 var params = {};
272 -// line = $("#line").val(); 359 + line = $("#line").val();
273 startDate = $("#startDate").val(); 360 startDate = $("#startDate").val();
274 endDate = $("#endDate").val(); 361 endDate = $("#endDate").val();
275 model = $("#model").val(); 362 model = $("#model").val();
@@ -347,6 +434,7 @@ @@ -347,6 +434,7 @@
347 $('#upDown').html(options); 434 $('#upDown').html(options);
348 }); 435 });
349 }); 436 });
  437 +
350 $('#startDate').on("blur", function(){ 438 $('#startDate').on("blur", function(){
351 startDate = $("#startDate").val(); 439 startDate = $("#startDate").val();
352 endDate = $("#endDate").val(); 440 endDate = $("#endDate").val();
src/main/resources/static/pages/forms/statement/peopleCarPlan.html
@@ -142,16 +142,6 @@ @@ -142,16 +142,6 @@
142 initXl(); 142 initXl();
143 } 143 }
144 144
145 - /* $.get('/basic/lineCode2Name',function(result){  
146 - var data=[];  
147 -  
148 - for(var code in result){  
149 - data.push({id: code, text: result[code]});  
150 - }  
151 - initPinYinSelect2('#line',data,'');  
152 -  
153 - }) */  
154 -  
155 $("#subCompany").on("change",initXl); 145 $("#subCompany").on("change",initXl);
156 function initXl(){ 146 function initXl(){
157 var data=[]; 147 var data=[];
@@ -185,6 +175,10 @@ @@ -185,6 +175,10 @@
185 var company = $("#company").val(); 175 var company = $("#company").val();
186 var subCompany = $("#subCompany").val(); 176 var subCompany = $("#subCompany").val();
187 function jsDoQuery(pagination){ 177 function jsDoQuery(pagination){
  178 + if($("#date").val() == null || $("#date").val().trim().length == 0){
  179 + layer.msg("请选择时间");
  180 + return;
  181 + }
188 var params = {}; 182 var params = {};
189 company = $("#company").val(); 183 company = $("#company").val();
190 subCompany = $("#subCompany").val(); 184 subCompany = $("#subCompany").val();
src/main/resources/static/pages/forms/statement/scheduleAnaly.html
@@ -125,34 +125,73 @@ @@ -125,34 +125,73 @@
125 $("#startDate").val(year + "-" + month + "-" + day); 125 $("#startDate").val(year + "-" + month + "-" + day);
126 $("#endDate").val(year + "-" + month + "-" + day); 126 $("#endDate").val(year + "-" + month + "-" + day);
127 127
128 - $.get('/basic/lineCode2Name',function(result){  
129 - var data=[]; 128 +// $.get('/basic/lineCode2Name',function(result){
  129 +// var data=[];
130 130
131 - data.push({id:" ", text: "全部线路"});  
132 - for(var code in result){  
133 - data.push({id: code, text: result[code]});  
134 - }  
135 - initPinYinSelect2('#line',data,''); 131 +// data.push({id:" ", text: "全部线路"});
  132 +// for(var code in result){
  133 +// data.push({id: code, text: result[code]});
  134 +// }
  135 +// initPinYinSelect2('#line',data,'');
136 136
137 - line = "";  
138 - updateModel();  
139 - }); 137 +// line = "";
  138 +// updateModel();
  139 +// });
140 140
  141 +// var obj = [];
  142 +// $.get('/user/companyData', function(result){
  143 +// obj = result;
  144 +// var options = '';
  145 +// for(var i = 0; i < obj.length; i++){
  146 +// options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  147 +// }
  148 +// if(obj.length == 1){
  149 +// $('#company1').hide();
  150 +// if(obj[0].children.length == 1)
  151 +// $('#subCompany1').hide();
  152 +// }
  153 +// $('#company').html(options);
  154 +// updateCompany();
  155 +// });
  156 +// $("#company").on("change",updateCompany);
  157 +// function updateCompany(){
  158 +// var company = $('#company').val();
  159 +// var options = '';
  160 +// for(var i = 0; i < obj.length; i++){
  161 +// if(obj[i].companyCode == company){
  162 +// var children = obj[i].children;
  163 +// for(var j = 0; j < children.length; j++){
  164 +// options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  165 +// }
  166 +// }
  167 +// }
  168 +// $('#subCompany').html(options);
  169 +// }
  170 + var fage=false;
  171 + var xlList;
141 var obj = []; 172 var obj = [];
142 - $.get('/user/companyData', function(result){  
143 - obj = result;  
144 - var options = '';  
145 - for(var i = 0; i < obj.length; i++){  
146 - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';  
147 - }  
148 - if(obj.length == 1){  
149 - $('#company1').hide();  
150 - if(obj[0].children.length == 1)  
151 - $('#subCompany1').hide();  
152 - }  
153 - $('#company').html(options);  
154 - updateCompany();  
155 - }); 173 +
  174 +
  175 + $.get('/report/lineList',function(result){
  176 + xlList=result;
  177 + $.get('/user/companyData', function(result){
  178 + obj = result;
  179 + var options = '';
  180 + for(var i = 0; i < obj.length; i++){
  181 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  182 + }
  183 +
  184 + if(obj.length ==0){
  185 + $("#company1").css('display','none');
  186 + }else if(obj.length ==1){
  187 + $("#company1").css('display','none');
  188 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  189 + $('#subCompany1').css('display','none');
  190 + }
  191 + $('#company').html(options);
  192 + updateCompany();
  193 + });
  194 + })
156 $("#company").on("change",updateCompany); 195 $("#company").on("change",updateCompany);
157 function updateCompany(){ 196 function updateCompany(){
158 var company = $('#company').val(); 197 var company = $('#company').val();
@@ -166,6 +205,33 @@ @@ -166,6 +205,33 @@
166 } 205 }
167 } 206 }
168 $('#subCompany').html(options); 207 $('#subCompany').html(options);
  208 + initXl();
  209 + }
  210 +
  211 + $("#subCompany").on("change",initXl);
  212 + function initXl(){
  213 + var data=[];
  214 + if(fage){
  215 + $("#line").select2("destroy").html('');
  216 + }
  217 + var fgs=$('#subCompany').val();
  218 + var gs=$('#company').val();
  219 + for(var i=0;i<xlList.length;i++){
  220 + if(gs!=""){
  221 + if(fgs!=""){
  222 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  223 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  224 + }
  225 + }else{
  226 + if(xlList[i]["gsbm"]==gs){
  227 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  228 + }
  229 + }
  230 + }
  231 + }
  232 + initPinYinSelect2('#line',data,'');
  233 + updateModel();
  234 + fage=true;
169 } 235 }
170 236
171 237
src/main/resources/static/pages/forms/statement/timeAndSpeed.html
@@ -45,22 +45,10 @@ @@ -45,22 +45,10 @@
45 <select class="form-control" name="subCompany" id="subCompany" style="width: 140px;"></select> 45 <select class="form-control" name="subCompany" id="subCompany" style="width: 140px;"></select>
46 </div> 46 </div>
47 <div style="display: inline-block; margin-left: 10px;"> 47 <div style="display: inline-block; margin-left: 10px;">
48 - <span class="item-label" style="width: 80px;">线路: </span>  
49 - <select class="form-control" name="statu" id="statu" style="width: 140px;">  
50 - <option value="0">多线</option>  
51 - <option value="1">单线</option>  
52 - </select>  
53 - </div>  
54 - <div style="display: inline-block; margin-left: 0px;" id="line1">  
55 - <span class="item-label" style="width: 80px;"> - </span>  
56 - <select class="form-control" name="line" id="line" style="width: 140px;"/> 48 + <span class="item-label" style="width: 80px;">选择线路: </span>
  49 + <select class="form-control" name="line" id="line" style="width: 165px;"/>
  50 + <input type="hidden" name="statu" id="statu"/>
57 </div> 51 </div>
58 -<!-- <div style="display: inline-block; margin-left: 8px;"> -->  
59 -<!-- <span class="item-label" style="width: 80px;">方向: </span> -->  
60 -<!-- <select class="form-control" name="upDown" id="upDown" style="width: 140px;"> -->  
61 -<!-- <option value="">请先选择线路</option> -->  
62 -<!-- </select> -->  
63 -<!-- </div> -->  
64 <div style="display: inline-block; margin-left: 10px"> 52 <div style="display: inline-block; margin-left: 10px">
65 <span class="item-label" style="width: 80px;">时刻类型: </span> 53 <span class="item-label" style="width: 80px;">时刻类型: </span>
66 <select class="form-control" name="model" id="model" style="width: 165px;"> 54 <select class="form-control" name="model" id="model" style="width: 165px;">
@@ -76,6 +64,20 @@ @@ -76,6 +64,20 @@
76 <span class="item-label" style="width: 80px;">结束时间: </span> 64 <span class="item-label" style="width: 80px;">结束时间: </span>
77 <input class="form-control" type="text" id="endDate" style="width: 140px;"/> 65 <input class="form-control" type="text" id="endDate" style="width: 140px;"/>
78 </div> 66 </div>
  67 + <div style="display: inline-block; margin-left: 10px;">
  68 + <select class="form-control" name="sfqr" id="sfqr" style="width: 75px;">
  69 + <option value="0">全日</option>
  70 + <option value="1">时段</option>
  71 + </select>
  72 + </div>
  73 + <div style="display: inline-block;margin-left: 12px;">
  74 + <span class="item-label" style="width: 80px;"> </span>
  75 + <input class="form-control" type="text" id="times1" style="width: 60px;"/>
  76 + </div>
  77 + <div style="display: inline-block;">
  78 + <span class="item-label" style="width: 80px;"> - </span>
  79 + <input class="form-control" type="text" id="times2" style="width: 60px;"/>
  80 + </div>
79 <div style="display: inline-block; margin-left: 10px" id="lp1"> 81 <div style="display: inline-block; margin-left: 10px" id="lp1">
80 <span class="item-label" style="width: 80px;">路牌: </span> 82 <span class="item-label" style="width: 80px;">路牌: </span>
81 <select class="form-control" name="lp" id="lp" style="width: 140px;"></select> 83 <select class="form-control" name="lp" id="lp" style="width: 140px;"></select>
@@ -126,8 +128,17 @@ @@ -126,8 +128,17 @@
126 $("#endDate").datetimepicker({ 128 $("#endDate").datetimepicker({
127 format : 'YYYY-MM-DD', 129 format : 'YYYY-MM-DD',
128 locale : 'zh-cn' 130 locale : 'zh-cn'
129 - }); 131 + });
130 132
  133 + $("#times1").datetimepicker({
  134 + format : 'HH:mm',
  135 + locale : 'zh-cn'
  136 + });
  137 + $("#times2").datetimepicker({
  138 + format : 'HH:mm',
  139 + locale : 'zh-cn'
  140 + });
  141 +
131 var d = new Date(); 142 var d = new Date();
132 var year = d.getFullYear(); 143 var year = d.getFullYear();
133 var month = d.getMonth() + 1; 144 var month = d.getMonth() + 1;
@@ -138,22 +149,79 @@ @@ -138,22 +149,79 @@
138 day = "0" + day; 149 day = "0" + day;
139 $("#startDate").val(year + "-" + month + "-" + day); 150 $("#startDate").val(year + "-" + month + "-" + day);
140 $("#endDate").val(year + "-" + month + "-" + day); 151 $("#endDate").val(year + "-" + month + "-" + day);
  152 +
  153 + $("#times1").val("05:00");
  154 + $("#times2").val("23:00");
  155 + $("#times1").attr("disabled", true);
  156 + $("#times2").attr("disabled", true);
  157 +
  158 +// var obj = [];
  159 +// $.get('/user/companyData', function(result){
  160 +// obj = result;
  161 +// var options = '';
  162 +// for(var i = 0; i < obj.length; i++){
  163 +// options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  164 +// }
  165 +// if(obj.length == 1){
  166 +// $('#company1').hide();
  167 +// if(obj[0].children.length == 1)
  168 +// $('#subCompany1').hide();
  169 +// }
  170 +// $('#company').html(options);
  171 +// updateCompany();
  172 +// });
  173 +// $("#company").on("change",updateCompany);
  174 +// function updateCompany(){
  175 +// var company = $('#company').val();
  176 +// var options = '';
  177 +// for(var i = 0; i < obj.length; i++){
  178 +// if(obj[i].companyCode == company){
  179 +// var children = obj[i].children;
  180 +// for(var j = 0; j < children.length; j++){
  181 +// options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  182 +// }
  183 +// }
  184 +// }
  185 +// $('#subCompany').html(options);
  186 +// }
  187 +
  188 +// $.get('/basic/lineCode2Name',function(result){
  189 +// var data=[];
  190 +
  191 +// for(var code in result){
  192 +// data.push({id: code, text: result[code]});
  193 +// }
  194 +// initPinYinSelect2('#line',data,'');
141 195
  196 +// line = data[0].id;
  197 +
  198 +// updateModel();
  199 +// updateLp("");
  200 +// })
  201 + var fage=false;
  202 + var xlList;
142 var obj = []; 203 var obj = [];
143 - $.get('/user/companyData', function(result){  
144 - obj = result;  
145 - var options = '';  
146 - for(var i = 0; i < obj.length; i++){  
147 - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';  
148 - }  
149 - if(obj.length == 1){  
150 - $('#company1').hide();  
151 - if(obj[0].children.length == 1)  
152 - $('#subCompany1').hide();  
153 - }  
154 - $('#company').html(options);  
155 - updateCompany();  
156 - }); 204 +
  205 + $.get('/report/lineList',function(result){
  206 + xlList=result;
  207 + $.get('/user/companyData', function(result){
  208 + obj = result;
  209 + var options = '';
  210 + for(var i = 0; i < obj.length; i++){
  211 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  212 + }
  213 +
  214 + if(obj.length ==0){
  215 + $("#company1").css('display','none');
  216 + }else if(obj.length ==1){
  217 + $("#company1").css('display','none');
  218 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  219 + $('#subCompany1').css('display','none');
  220 + }
  221 + $('#company').html(options);
  222 + updateCompany();
  223 + });
  224 + })
157 $("#company").on("change",updateCompany); 225 $("#company").on("change",updateCompany);
158 function updateCompany(){ 226 function updateCompany(){
159 var company = $('#company').val(); 227 var company = $('#company').val();
@@ -167,49 +235,88 @@ @@ -167,49 +235,88 @@
167 } 235 }
168 } 236 }
169 $('#subCompany').html(options); 237 $('#subCompany').html(options);
  238 + initXl();
170 } 239 }
171 240
172 - $.get('/basic/lineCode2Name',function(result){ 241 + $("#subCompany").on("change",initXl);
  242 + function initXl(){
173 var data=[]; 243 var data=[];
174 -  
175 - for(var code in result){  
176 - data.push({id: code, text: result[code]}); 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"]});
  259 + }
  260 + }
  261 + }
177 } 262 }
178 initPinYinSelect2('#line',data,''); 263 initPinYinSelect2('#line',data,'');
179 - 264 + fage=true;
  265 +
  266 + $("#endDate").attr("disabled", true);
  267 + $("#endDate").val($("#startDate").val());
180 line = data[0].id; 268 line = data[0].id;
  269 + statu = 0;
181 270
182 updateModel(); 271 updateModel();
183 updateLp(""); 272 updateLp("");
184 - }) 273 + }
  274 +
185 275
186 $("#query").on("click", function (){ 276 $("#query").on("click", function (){
187 jsDoQuery(); 277 jsDoQuery();
188 }); 278 });
189 279
190 var list = []; 280 var list = [];
  281 + var sfqr = 0;
  282 + var statu = 0;
191 var line = $("#line").val(); 283 var line = $("#line").val();
192 - var statu = $("#statu").val(); 284 +// var statu = $("#statu").val();
193 var startDate = $("#startDate").val(); 285 var startDate = $("#startDate").val();
194 var endDate = $("#endDate").val(); 286 var endDate = $("#endDate").val();
  287 + var times1 = $("#times1").val();
  288 + var times2 = $("#times2").val();
195 var model = $("#model").val(); 289 var model = $("#model").val();
196 var company = $("#company").val(); 290 var company = $("#company").val();
197 var subCompany = $("#subCompany").val(); 291 var subCompany = $("#subCompany").val();
198 var lp = $("#lp").val(); 292 var lp = $("#lp").val();
199 function jsDoQuery(pagination){ 293 function jsDoQuery(pagination){
  294 + if($("#startDate").val().trim().length == 0 || $("#endDate").val().trim().length == 0){
  295 + layer.msg("请选择日期");
  296 + return;
  297 + }
  298 + if(sfqr == 1 && ($("#times1").val().trim().length == 0 || $("#times2").val().trim().length == 0)){
  299 + layer.msg("请选择时间");
  300 + return;
  301 + }
200 var params = {}; 302 var params = {};
201 line = $("#line").val(); 303 line = $("#line").val();
202 startDate = $("#startDate").val(); 304 startDate = $("#startDate").val();
203 endDate = $("#endDate").val(); 305 endDate = $("#endDate").val();
  306 + times1 = $("#times1").val();
  307 + times2 = $("#times2").val();
204 model = $("#model").val(); 308 model = $("#model").val();
205 company = $("#company").val(); 309 company = $("#company").val();
206 subCompany = $("#subCompany").val(); 310 subCompany = $("#subCompany").val();
207 lp = $("#lp").val(); 311 lp = $("#lp").val();
208 params['lp'] = lp; 312 params['lp'] = lp;
209 params['line'] = line; 313 params['line'] = line;
  314 + params['sfqr'] = sfqr;
210 params['statu'] = statu; 315 params['statu'] = statu;
211 params['startDate'] = startDate; 316 params['startDate'] = startDate;
212 params['endDate'] = endDate; 317 params['endDate'] = endDate;
  318 + params['times1'] = times1;
  319 + params['times2'] = times2;
213 params['model'] = model; 320 params['model'] = model;
214 params['company'] = company; 321 params['company'] = company;
215 params['subCompany'] = subCompany; 322 params['subCompany'] = subCompany;
@@ -252,12 +359,23 @@ @@ -252,12 +359,23 @@
252 } 359 }
253 360
254 $("#export").on("click", function(){ 361 $("#export").on("click", function(){
  362 + if($("#startDate").val().trim().length == 0 || $("#endDate").val().trim().length == 0){
  363 + layer.msg("请选择日期");
  364 + return;
  365 + }
  366 + if(sfqr == 1 && ($("#times1").val().trim().length == 0 || $("#times2").val().trim().length == 0)){
  367 + layer.msg("请选择时间");
  368 + return;
  369 + }
255 var params = {}; 370 var params = {};
256 params['lp'] = lp; 371 params['lp'] = lp;
257 params['line'] = line; 372 params['line'] = line;
  373 + params['sfqr'] = sfqr;
258 params['statu'] = statu; 374 params['statu'] = statu;
259 params['startDate'] = startDate; 375 params['startDate'] = startDate;
260 params['endDate'] = endDate; 376 params['endDate'] = endDate;
  377 + params['times1'] = times1;
  378 + params['times2'] = times2;
261 params['model'] = model; 379 params['model'] = model;
262 params['company'] = company; 380 params['company'] = company;
263 params['subCompany'] = subCompany; 381 params['subCompany'] = subCompany;
@@ -270,22 +388,29 @@ @@ -270,22 +388,29 @@
270 }); 388 });
271 389
272 390
273 - $("#lp1").hide();  
274 - $("#line1").hide();  
275 - $("#statu").on("change", function(){  
276 - statu = $("#statu").val();  
277 - if(statu == 0){  
278 - $("#line1").hide();  
279 - $("#lp1").hide(); 391 +// $("#lp1").hide();
  392 +
  393 + $("#sfqr").on("change", function(){
  394 + if($("#sfqr").val() == 0){
  395 + $("#times1").attr("disabled", true);
  396 + $("#times2").attr("disabled", true);
  397 + sfqr = 0;
280 }else{ 398 }else{
281 - $("#line1").show();  
282 - $("#lp1").show();  
283 - updateLp(""); 399 + $("#times1").attr("disabled", false);
  400 + $("#times2").attr("disabled", false);
  401 + sfqr = 1;
284 } 402 }
285 - updateModel();  
286 }); 403 });
287 $("#line").on("change", function(){ 404 $("#line").on("change", function(){
288 line = $("#line").val(); 405 line = $("#line").val();
  406 + if(line.trim().length == 0){
  407 + statu = 0;
  408 + $("#endDate").attr("disabled", true);
  409 + $("#endDate").val($("#startDate").val());
  410 + }else{
  411 + statu = 1;
  412 + $("#endDate").attr("disabled", false);
  413 + }
289 updateModel(); 414 updateModel();
290 updateLp(""); 415 updateLp("");
291 }); 416 });
@@ -297,6 +422,9 @@ @@ -297,6 +422,9 @@
297 startDate = $("#startDate").val(); 422 startDate = $("#startDate").val();
298 endDate = $("#endDate").val(); 423 endDate = $("#endDate").val();
299 updateModel(); 424 updateModel();
  425 + if($("#endDate").prop("disabled")){
  426 + $("#endDate").val($("#startDate").val());
  427 + }
300 }); 428 });
301 $('#endDate').on("blur", function(){ 429 $('#endDate').on("blur", function(){
302 startDate = $("#startDate").val(); 430 startDate = $("#startDate").val();
src/main/resources/static/pages/forms/statement/workDaily.html
@@ -111,31 +111,69 @@ @@ -111,31 +111,69 @@
111 day = "0" + day; 111 day = "0" + day;
112 $("#date").val(year + "-" + month + "-" + day); 112 $("#date").val(year + "-" + month + "-" + day);
113 113
114 - $.get('/basic/lineCode2Name',function(result){  
115 - var data=[]; 114 +// $.get('/basic/lineCode2Name',function(result){
  115 +// var data=[];
116 116
117 - data.push({id: " ", text: "全部线路"});  
118 - for(var code in result){  
119 - data.push({id: code, text: result[code]});  
120 - }  
121 - initPinYinSelect2('#line',data,'');  
122 - })  
123 - 117 +// data.push({id: " ", text: "全部线路"});
  118 +// for(var code in result){
  119 +// data.push({id: code, text: result[code]});
  120 +// }
  121 +// initPinYinSelect2('#line',data,'');
  122 +// })
  123 +// var obj = [];
  124 +// $.get('/user/companyData', function(result){
  125 +// obj = result;
  126 +// var options = '';
  127 +// for(var i = 0; i < obj.length; i++){
  128 +// options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  129 +// }
  130 +// if(obj.length == 1){
  131 +// $('#company1').hide();
  132 +// if(obj[0].children.length == 1)
  133 +// $('#subCompany1').hide();
  134 +// }
  135 +// $('#company').html(options);
  136 +// updateCompany();
  137 +// });
  138 +// $("#company").on("change",updateCompany);
  139 +// function updateCompany(){
  140 +// var company = $('#company').val();
  141 +// var options = '';
  142 +// for(var i = 0; i < obj.length; i++){
  143 +// if(obj[i].companyCode == company){
  144 +// var children = obj[i].children;
  145 +// for(var j = 0; j < children.length; j++){
  146 +// options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  147 +// }
  148 +// }
  149 +// }
  150 +// $('#subCompany').html(options);
  151 +// }
  152 + var fage=false;
  153 + var xlList;
124 var obj = []; 154 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 - }); 155 +
  156 +
  157 + $.get('/report/lineList',function(result){
  158 + xlList=result;
  159 + $.get('/user/companyData', function(result){
  160 + obj = result;
  161 + var options = '';
  162 + for(var i = 0; i < obj.length; i++){
  163 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  164 + }
  165 +
  166 + if(obj.length ==0){
  167 + $("#company1").css('display','none');
  168 + }else if(obj.length ==1){
  169 + $("#company1").css('display','none');
  170 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  171 + $('#subCompany1').css('display','none');
  172 + }
  173 + $('#company').html(options);
  174 + updateCompany();
  175 + });
  176 + })
139 $("#company").on("change",updateCompany); 177 $("#company").on("change",updateCompany);
140 function updateCompany(){ 178 function updateCompany(){
141 var company = $('#company').val(); 179 var company = $('#company').val();
@@ -149,7 +187,35 @@ @@ -149,7 +187,35 @@
149 } 187 }
150 } 188 }
151 $('#subCompany').html(options); 189 $('#subCompany').html(options);
  190 + initXl();
152 } 191 }
  192 +
  193 + $("#subCompany").on("change",initXl);
  194 + function initXl(){
  195 + var data=[];
  196 + if(fage){
  197 + $("#line").select2("destroy").html('');
  198 + }
  199 + var fgs=$('#subCompany').val();
  200 + var gs=$('#company').val();
  201 + data.push({id: " ", text: "全部线路"});
  202 + for(var i=0;i<xlList.length;i++){
  203 + if(gs!=""){
  204 + if(fgs!=""){
  205 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  206 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  207 + }
  208 + }else{
  209 + if(xlList[i]["gsbm"]==gs){
  210 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  211 + }
  212 + }
  213 + }
  214 + }
  215 + initPinYinSelect2('#line',data,'');
  216 + fage=true;
  217 + }
  218 +
153 219
154 220
155 $("#query").on("click",jsDoQuery); 221 $("#query").on("click",jsDoQuery);
@@ -159,6 +225,10 @@ @@ -159,6 +225,10 @@
159 var company = $("#company").val(); 225 var company = $("#company").val();
160 var subCompany = $("#subCompany").val(); 226 var subCompany = $("#subCompany").val();
161 function jsDoQuery(pagination){ 227 function jsDoQuery(pagination){
  228 + if($("#date").val() == null || $("#date").val().trim().length == 0){
  229 + layer.msg("请选择时间");
  230 + return;
  231 + }
162 var params = {}; 232 var params = {};
163 line = $("#line").val(); 233 line = $("#line").val();
164 date = $("#date").val(); 234 date = $("#date").val();
src/main/resources/static/pages/mforms/alllines/allline.html
@@ -43,19 +43,19 @@ @@ -43,19 +43,19 @@
43 <div class="portlet light porttlet-fit bordered"> 43 <div class="portlet light porttlet-fit bordered">
44 <div class="portlet-title"> 44 <div class="portlet-title">
45 <form class="form-inline" action="" method="post"> 45 <form class="form-inline" action="" method="post">
46 - <div style="display: inline-block; margin-left: 33px;" 46 + <div style="display: inline-block; margin-left: 24px;"
47 id="gsdmDiv_allline"> 47 id="gsdmDiv_allline">
48 <span class="item-label" style="width: 80px;">公司: </span> <select 48 <span class="item-label" style="width: 80px;">公司: </span> <select
49 class="form-control" name="company" id="gsdmAllline" 49 class="form-control" name="company" id="gsdmAllline"
50 style="width: 140px;"></select> 50 style="width: 140px;"></select>
51 </div> 51 </div>
52 - <div style="display: inline-block; margin-left: 24px;" 52 + <div style="display: inline-block; margin-left: 15px;"
53 id="fgsdmDiv_allline"> 53 id="fgsdmDiv_allline">
54 <span class="item-label" style="width: 80px;">分公司: </span> <select 54 <span class="item-label" style="width: 80px;">分公司: </span> <select
55 class="form-control" name="subCompany" id="fgsdmAllline" 55 class="form-control" name="subCompany" id="fgsdmAllline"
56 style="width: 140px;"></select> 56 style="width: 140px;"></select>
57 </div> 57 </div>
58 - <div style="display: inline-block;"> 58 + <div style="display: inline-block; margin-left: 15px;">
59 <span class="item-label" style="width: 80px;">线路: </span> <select 59 <span class="item-label" style="width: 80px;">线路: </span> <select
60 class="form-control" name="line" id="line" style="width: 120px;"></select> 60 class="form-control" name="line" id="line" style="width: 120px;"></select>
61 </div> 61 </div>
@@ -174,18 +174,80 @@ @@ -174,18 +174,80 @@
174 $('#fgsdmAllline').html(options); 174 $('#fgsdmAllline').html(options);
175 } 175 }
176 176
177 - $.get('/basic/lineCode2Name', function(result) {  
178 - var data = [];  
179 -  
180 - for ( var code in result) {  
181 - data.push({  
182 - id : code,  
183 - text : result[code]  
184 - }); 177 + var fage=false;
  178 + var xlList;
  179 + var obj = [];
  180 +
  181 + $.get('/report/lineList',function(result){
  182 + xlList=result;
  183 + $.get('/user/companyData', function(result){
  184 + obj = result;
  185 + var options = '';
  186 + for(var i = 0; i < obj.length; i++){
  187 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  188 + }
  189 +
  190 + if(obj.length ==0){
  191 + $("#gsdmDiv_allline").css('display','none');
  192 + }else if(obj.length ==1){
  193 + $("#gsdmDiv_allline").css('display','none');
  194 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  195 + $('#fgsdmDiv_allline').css('display','none');
  196 + }
  197 + $('#gsdmAllline').html(options);
  198 + updateCompany();
  199 + });
  200 + })
  201 + $("#gsdmAllline").on("change",updateCompany);
  202 + function updateCompany(){
  203 + var company = $('#gsdmAllline').val();
  204 + var options = '';
  205 + for(var i = 0; i < obj.length; i++){
  206 + if(obj[i].companyCode == company){
  207 + var children = obj[i].children;
  208 + for(var j = 0; j < children.length; j++){
  209 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  210 + }
  211 + }
185 } 212 }
186 - initPinYinSelect2('#line', data, ''); 213 + $('#fgsdmAllline').html(options);
  214 + initXl();
  215 + }
187 216
188 - }) 217 + /* $.get('/basic/lineCode2Name',function(result){
  218 + var data=[];
  219 +
  220 + for(var code in result){
  221 + data.push({id: code, text: result[code]});
  222 + }
  223 + initPinYinSelect2('#line',data,'');
  224 +
  225 + }) */
  226 +
  227 + $("#fgsdmAllline").on("change",initXl);
  228 + function initXl(){
  229 + var data=[];
  230 + if(fage){
  231 + $("#line").select2("destroy").html('');
  232 + }
  233 + var fgs=$('#fgsdmAllline').val();
  234 + var gs=$('#gsdmAllline').val();
  235 + for(var i=0;i<xlList.length;i++){
  236 + if(gs!=""){
  237 + if(fgs!=""){
  238 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  239 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  240 + }
  241 + }else{
  242 + if(xlList[i]["gsbm"]==gs){
  243 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  244 + }
  245 + }
  246 + }
  247 + }
  248 + initPinYinSelect2('#line',data,'');
  249 + fage=true;
  250 + }
189 251
190 var line; 252 var line;
191 var startDate; 253 var startDate;
@@ -205,7 +267,8 @@ @@ -205,7 +267,8 @@
205 $post( 267 $post(
206 '/mcy_forms/allline', 268 '/mcy_forms/allline',
207 { 269 {
208 - gsdmAllline:gsdmAllline,fgsdmAllline:fgsdmAllline, 270 + gsdmAllline:gsdmAllline,
  271 + fgsdmAllline:fgsdmAllline,
209 line : line, 272 line : line,
210 startDate : $("#startDate").val(), 273 startDate : $("#startDate").val(),
211 endDate : $("#endDate").val(), 274 endDate : $("#endDate").val(),
@@ -286,7 +349,7 @@ @@ -286,7 +349,7 @@
286 }) 349 })
287 350
288 } else { 351 } else {
289 - alert("请选择时间范围!"); 352 + layer.msg("请选择时间范围!");
290 } 353 }
291 }); 354 });
292 355
src/main/resources/static/pages/mforms/changetochanges/changetochange.html
@@ -144,54 +144,71 @@ @@ -144,54 +144,71 @@
144 locale : 'zh-cn' 144 locale : 'zh-cn'
145 }); 145 });
146 146
  147 + var fage=false;
  148 + var xlList;
147 var obj = []; 149 var obj = [];
148 - $.get('/user/companyData', function(result) {  
149 - obj = result;  
150 - var options = '';  
151 - for (var i = 0; i < obj.length; i++) {  
152 - options += '<option value="'+obj[i].companyCode+'">'  
153 - + obj[i].companyName + '</option>';  
154 - }  
155 - if (obj.length == 0) {  
156 - $("#gsdmDiv_change").css('display', 'none');  
157 - $('#fgsdmDiv_change').css('display', 'none');  
158 - } else if (obj.length == 1) {  
159 - $("#gsdmDiv_change").css('display', 'none');  
160 - if (obj[0].children.length == 1 || obj[0].children.length == 0)  
161 - $('#fgsdmDiv_change').css('display', 'none');  
162 - }  
163 - $('#gsdmChange').html(options);  
164 - updateCompany();  
165 - });  
166 -  
167 - $("#gsdmChange").on("change", updateCompany);  
168 - function updateCompany() { 150 +
  151 +
  152 + $.get('/report/lineList',function(result){
  153 + xlList=result;
  154 + $.get('/user/companyData', function(result){
  155 + obj = result;
  156 + var options = '';
  157 + for(var i = 0; i < obj.length; i++){
  158 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  159 + }
  160 +
  161 + if(obj.length ==0){
  162 + $("#gsdmDiv_change").css('display','none');
  163 + }else if(obj.length ==1){
  164 + $("#gsdmDiv_change").css('display','none');
  165 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  166 + $('#fgsdmDiv_change').css('display','none');
  167 + }
  168 + $('#gsdmChange').html(options);
  169 + updateCompany();
  170 + });
  171 + })
  172 + $("#gsdmChange").on("change",updateCompany);
  173 + function updateCompany(){
169 var company = $('#gsdmChange').val(); 174 var company = $('#gsdmChange').val();
170 var options = ''; 175 var options = '';
171 - for (var i = 0; i < obj.length; i++) {  
172 - if (obj[i].companyCode == company) { 176 + for(var i = 0; i < obj.length; i++){
  177 + if(obj[i].companyCode == company){
173 var children = obj[i].children; 178 var children = obj[i].children;
174 - for (var j = 0; j < children.length; j++) {  
175 - options += '<option value="'+children[j].code+'">'  
176 - + children[j].name + '</option>'; 179 + for(var j = 0; j < children.length; j++){
  180 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
177 } 181 }
178 } 182 }
179 } 183 }
180 $('#fgsdmChange').html(options); 184 $('#fgsdmChange').html(options);
  185 + initXl();
181 } 186 }
182 -  
183 - $.get('/basic/lineCode2Name', function(result) {  
184 - var data = [];  
185 -  
186 - for ( var code in result) {  
187 - data.push({  
188 - id : code,  
189 - text : result[code]  
190 - }); 187 +
  188 + $("#fgsdmChange").on("change",initXl);
  189 + function initXl(){
  190 + var data=[];
  191 + if(fage){
  192 + $("#line").select2("destroy").html('');
191 } 193 }
192 - initPinYinSelect2('#line', data, '');  
193 -  
194 - }) 194 + var fgs=$('#fgsdmChange').val();
  195 + var gs=$('#gsdmChange').val();
  196 + for(var i=0;i<xlList.length;i++){
  197 + if(gs!=""){
  198 + if(fgs!=""){
  199 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  200 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  201 + }
  202 + }else{
  203 + if(xlList[i]["gsbm"]==gs){
  204 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  205 + }
  206 + }
  207 + }
  208 + }
  209 + initPinYinSelect2('#line',data,'');
  210 + fage=true;
  211 + }
195 212
196 var line; 213 var line;
197 var startDate; 214 var startDate;
src/main/resources/static/pages/mforms/linepassengerflows/linepassengerflow.html
@@ -82,26 +82,30 @@ @@ -82,26 +82,30 @@
82 locale : 'zh-cn' 82 locale : 'zh-cn'
83 }); 83 });
84 84
  85 + var fage=false;
  86 + var xlList;
85 var obj = []; 87 var obj = [];
86 - $.get('/user/companyData', function(result){  
87 - obj = result;  
88 - var options = '';  
89 - for(var i = 0; i < obj.length; i++){  
90 - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';  
91 - }  
92 -  
93 - if(obj.length ==0){  
94 - $("#gsdmDiv_line").css('display','none');  
95 - $('#fgsdmDiv_line').css('display','none');  
96 - }else if(obj.length ==1){  
97 - $("#gsdmDiv_line").css('display','none');  
98 - if(obj[0].children.length == 1 || obj[0].children.length ==0)  
99 - $('#fgsdmDiv_line').css('display','none');  
100 - }  
101 - $('#gsdmLine').html(options);  
102 - updateCompany();  
103 - });  
104 - 88 +
  89 + $.get('/report/lineList',function(result){
  90 + xlList=result;
  91 + $.get('/user/companyData', function(result){
  92 + obj = result;
  93 + var options = '';
  94 + for(var i = 0; i < obj.length; i++){
  95 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  96 + }
  97 +
  98 + if(obj.length ==0){
  99 + $("#gsdmDiv_line").css('display','none');
  100 + }else if(obj.length ==1){
  101 + $("#gsdmDiv_line").css('display','none');
  102 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  103 + $('#fgsdmDiv_line').css('display','none');
  104 + }
  105 + $('#gsdmLine').html(options);
  106 + updateCompany();
  107 + });
  108 + })
105 $("#gsdmLine").on("change",updateCompany); 109 $("#gsdmLine").on("change",updateCompany);
106 function updateCompany(){ 110 function updateCompany(){
107 var company = $('#gsdmLine').val(); 111 var company = $('#gsdmLine').val();
@@ -115,21 +119,33 @@ @@ -115,21 +119,33 @@
115 } 119 }
116 } 120 }
117 $('#fgsdmLine').html(options); 121 $('#fgsdmLine').html(options);
  122 + initXl();
118 } 123 }
119 -  
120 -  
121 124
122 - $.get('/basic/lineCode2Name',function(result){ 125 + $("#fgsdmLine").on("change",initXl);
  126 + function initXl(){
123 var data=[]; 127 var data=[];
124 -  
125 - for(var code in result){  
126 - data.push({id: code, text: result[code]}); 128 + if(fage){
  129 + $("#line").select2("destroy").html('');
  130 + }
  131 + var fgs=$('#fgsdmLine').val();
  132 + var gs=$('#gsdmLine').val();
  133 + for(var i=0;i<xlList.length;i++){
  134 + if(gs!=""){
  135 + if(fgs!=""){
  136 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  137 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  138 + }
  139 + }else{
  140 + if(xlList[i]["gsbm"]==gs){
  141 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  142 + }
  143 + }
  144 + }
127 } 145 }
128 - console.log(data);  
129 initPinYinSelect2('#line',data,''); 146 initPinYinSelect2('#line',data,'');
130 -  
131 - })  
132 - 147 + fage=true;
  148 + }
133 149
134 var line; 150 var line;
135 var date; 151 var date;
src/main/resources/static/pages/mforms/turnoutrates/turnoutrate.html
@@ -124,26 +124,30 @@ @@ -124,26 +124,30 @@
124 locale : 'zh-cn' 124 locale : 'zh-cn'
125 }); 125 });
126 126
  127 + var fage=false;
  128 + var xlList;
127 var obj = []; 129 var obj = [];
128 - $.get('/user/companyData', function(result){  
129 - obj = result;  
130 - var options = '';  
131 - for(var i = 0; i < obj.length; i++){  
132 - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';  
133 - }  
134 -  
135 - if(obj.length ==0){  
136 - $("#gsdmDiv_turn").css('display','none');  
137 - $('#fgsdmDiv_turn').css('display','none');  
138 - }else if(obj.length ==1){  
139 - $("#gsdmDiv_turn").css('display','none');  
140 - if(obj[0].children.length == 1 || obj[0].children.length ==0)  
141 - $('#fgsdmDiv_turn').css('display','none');  
142 - }  
143 - $('#gsdmTurn').html(options);  
144 - updateCompany();  
145 - });  
146 - 130 +
  131 + $.get('/report/lineList',function(result){
  132 + xlList=result;
  133 + $.get('/user/companyData', function(result){
  134 + obj = result;
  135 + var options = '';
  136 + for(var i = 0; i < obj.length; i++){
  137 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  138 + }
  139 +
  140 + if(obj.length ==0){
  141 + $("#gsdmDiv_turn").css('display','none');
  142 + }else if(obj.length ==1){
  143 + $("#gsdmDiv_turn").css('display','none');
  144 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  145 + $('#fgsdmDiv_turn').css('display','none');
  146 + }
  147 + $('#gsdmTurn').html(options);
  148 + updateCompany();
  149 + });
  150 + })
147 $("#gsdmTurn").on("change",updateCompany); 151 $("#gsdmTurn").on("change",updateCompany);
148 function updateCompany(){ 152 function updateCompany(){
149 var company = $('#gsdmTurn').val(); 153 var company = $('#gsdmTurn').val();
@@ -157,19 +161,34 @@ @@ -157,19 +161,34 @@
157 } 161 }
158 } 162 }
159 $('#fgsdmTurn').html(options); 163 $('#fgsdmTurn').html(options);
  164 + initXl();
160 } 165 }
161 -  
162 166
163 - $.get('/basic/lineCode2Name',function(result){ 167 + $("#fgsdmTurn").on("change",initXl);
  168 + function initXl(){
164 var data=[]; 169 var data=[];
165 -  
166 - for(var code in result){  
167 - data.push({id: code, text: result[code]}); 170 + if(fage){
  171 + $("#line").select2("destroy").html('');
  172 + }
  173 + var fgs=$('#fgsdmTurn').val();
  174 + var gs=$('#gsdmTurn').val();
  175 + for(var i=0;i<xlList.length;i++){
  176 + if(gs!=""){
  177 + if(fgs!=""){
  178 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  179 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  180 + }
  181 + }else{
  182 + if(xlList[i]["gsbm"]==gs){
  183 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  184 + }
  185 + }
  186 + }
168 } 187 }
169 initPinYinSelect2('#line',data,''); 188 initPinYinSelect2('#line',data,'');
170 -  
171 - })  
172 - 189 + fage=true;
  190 + }
  191 +
173 var line; 192 var line;
174 var startDate; 193 var startDate;
175 var endDate; 194 var endDate;
src/main/resources/static/pages/report/timetable/timetable.html
@@ -196,27 +196,30 @@ @@ -196,27 +196,30 @@
196 if (!$('body').hasClass('page-sidebar-closed')) 196 if (!$('body').hasClass('page-sidebar-closed'))
197 $('.menu-toggler.sidebar-toggler').click(); 197 $('.menu-toggler.sidebar-toggler').click();
198 198
199 - 199 + var fage=false;
  200 + var xlList;
200 var obj = []; 201 var obj = [];
201 - $.get('/user/companyData', function(result){  
202 - obj = result;  
203 - var options = '';  
204 - for(var i = 0; i < obj.length; i++){  
205 - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';  
206 - }  
207 -  
208 - if(obj.length ==0){  
209 - $("#gsdmDiv_time").css('display','none');  
210 - $('#fgsdmDiv_time').css('display','none');  
211 - }else if(obj.length ==1){  
212 - $("#gsdmDiv_time").css('display','none');  
213 - if(obj[0].children.length == 1 || obj[0].children.length ==0)  
214 - $('#fgsdmDiv_time').css('display','none');  
215 - }  
216 - $('#gsdmTime').html(options);  
217 - updateCompany();  
218 - });  
219 - 202 +
  203 + $.get('/report/lineList',function(result){
  204 + xlList=result;
  205 + $.get('/user/companyData', function(result){
  206 + obj = result;
  207 + var options = '';
  208 + for(var i = 0; i < obj.length; i++){
  209 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  210 + }
  211 +
  212 + if(obj.length ==0){
  213 + $("#gsdmDiv_time").css('display','none');
  214 + }else if(obj.length ==1){
  215 + $("#gsdmDiv_time").css('display','none');
  216 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  217 + $('#fgsdmDiv_time').css('display','none');
  218 + }
  219 + $('#gsdmTime').html(options);
  220 + updateCompany();
  221 + });
  222 + })
220 $("#gsdmTime").on("change",updateCompany); 223 $("#gsdmTime").on("change",updateCompany);
221 function updateCompany(){ 224 function updateCompany(){
222 var company = $('#gsdmTime').val(); 225 var company = $('#gsdmTime').val();
@@ -230,17 +233,33 @@ @@ -230,17 +233,33 @@
230 } 233 }
231 } 234 }
232 $('#fgsdmTime').html(options); 235 $('#fgsdmTime').html(options);
  236 + initXl();
233 } 237 }
234 -  
235 - $.get('/basic/lineCode2Name',function(result){ 238 +
  239 + $("#fgsdmTime").on("change",initXl);
  240 + function initXl(){
236 var data=[]; 241 var data=[];
237 - data.push({id: "", text: "请选择"});  
238 - for(var code in result){  
239 - data.push({id: code, text: result[code]}); 242 + if(fage){
  243 + $("#line").select2("destroy").html('');
  244 + }
  245 + var fgs=$('#fgsdmTime').val();
  246 + var gs=$('#gsdmTime').val();
  247 + for(var i=0;i<xlList.length;i++){
  248 + if(gs!=""){
  249 + if(fgs!=""){
  250 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  251 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  252 + }
  253 + }else{
  254 + if(xlList[i]["gsbm"]==gs){
  255 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  256 + }
  257 + }
  258 + }
240 } 259 }
241 initPinYinSelect2('#line',data,''); 260 initPinYinSelect2('#line',data,'');
242 -  
243 - }) 261 + fage=true;
  262 + }
244 263
245 264
246 var flag = 0; 265 var flag = 0;