waybill.html
21.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
<link rel="stylesheet" type="text/css" href="/assets/css/formTable/waybill.css" />
<div class="page-head">
<div class="page-title">
<h1>行车路单</h1>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="portlet light porttlet-fit bordered">
<div class="portlet-title">
<form class="form-inline" action="">
<div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_xcld">
<span class="item-label" style="width: 80px;">公司: </span>
<select class="form-control" name="company" id="gsdmXcld" style="width: 180px;"></select>
</div>
<div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_xcld">
<span class="item-label" style="width: 80px;">分公司: </span>
<select class="form-control" name="subCompany" id="fgsdmXcld" style="width: 180px;"></select>
</div>
<div style="margin-top: 2px"></div>
<div style="display: inline-block; margin-left: 33px;">
<span class="item-label" style="width: 80px;">线路: </span>
<select class="form-control" name="line" id="line" style="width: 180px;"></select>
</div>
<div style="display: inline-block;margin-left: 24px;">
<span class="item-label" style="width: 80px;"> 时间: </span>
<input class="form-control" type="text" id="date" style="width: 180px;"/>
</div>
<div class="form-group" style="display: inline-block;margin-left: 15px;">
<input class="btn btn-default" type="button" id="query" value="查询"/>
<input class="btn btn-default" type="button" id="export" value="导出"/>
<input class="btn btn-default" type="button" id="print" value="打印"/>
<input class="btn btn-default" type="button" id="exportMore" value="批量导出"/>
</div>
</form>
</div>
<div class="portlet-body">
<div class="row">
<div class="col-md-3" style="width: 24%">
<div class="" id="left_height" style="margin-top: 10px;overflow:auto;">
<table class="table table-bordered table-hover table-checkable pre-scrollable" id="info">
<thead>
<tr class="hidden">
<th class="rypx" style="cursor:pointer;width:120px">人员</th>
<th class="zbhpx" style="cursor:pointer ">自编号</th>
<th class="lppx" style="cursor:pointer ">路牌</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div class="col-md-9" style="width: 76%" id="printArea">
<!-- <div class="table-container" id="xcld_height" style="margin-top: 10px;overflow:auto;min-width: 906px;">
<table class="table table-bordered table-checkable" id="forms">
<tbody class="ludan_1">
</tbody>
<tbody class="ludan_2">
</tbody>
<tbody class="ludan_3">
</tbody>
<tbody class="ludan_4">
</tbody>
</table>
</div>-->
<div id="left_div">
<div id="left_div1">
<table id="left_table1"></table>
</div>
<div id="left_div2">
<table id="left_table2"></table>
</div>
</div>
<!-- overflow:auto;min-width: 906px; -->
<div style="width: 100%;">
<div style="" id="staticfw" >
<div id="right_divx">
<table class="table table-bordered table-hover table-checkable" id="forms">
<tbody class="ludan_1">
</tbody>
</table>
</div>
</div>
<div id="right_div2">
<table class="table table-bordered table-hover table-checkable" id="">
<tbody class="staticlfwy">
</tbody>
</table>
</div>
</div>
<div id="left_divy">
<div id="left_div1y">
<table id="left_table1y"></table>
</div>
<div id="left_div2y">
<table id="left_table2y"></table>
</div>
</div>
<div id="right_divy">
<div id="staticfwy" >
<div id="right_divxy">
<table class="table table-bordered table-hover table-checkable" id="fdx2">
<tbody class="stx">
</tbody>
</table>
</div>
</div>
<div class="table-container" id="right_div2y">
<table class="table table-bordered table-hover table-checkable" id="headTable"
style="margin-bottom: 0px;display: none;">
<thead>
<tr>
<td rowspan="2" style="min-width:20px;max-width:20px;">车次</td>
<td colspan="2">工号</td>
<td rowspan="2" style="min-width:30px;max-width:30px;">公里耗油</td>
<td colspan="2">起讫站</td>
<td colspan="4">时间</td>
<td colspan="2">误点</td>
<td rowspan="2" style="min-width:50px;max-width:50px;">里程(公里)计划</td>
<td rowspan="2" style="min-width:116px;max-width:116px;">备注</td>
</tr>
<tr>
<td colspan="1" style="min-width:95px;max-width:95px;">司 机</td>
<td colspan="1" style="min-width:95px;max-width:95px;">售 票</td>
<td colspan="1" style="min-width:116px;max-width:116px;">起点</td>
<td colspan="1" style="min-width:116px;max-width:116px;">终点</td>
<td colspan="1" style="min-width:50px;max-width:50px;">计发</td>
<td colspan="1" style="min-width:50px;max-width:20px;">实发</td>
<td colspan="1" style="min-width:50px;max-width:50px;">应到</td>
<td colspan="1" style="min-width:50px;max-width:50px;">实到</td>
<td colspan="1" style="min-width:26px;max-width:26px;">快</td>
<td colspan="1" style="min-width:26px;max-width:26px;">慢</td>
</tr>
</thead>
</table>
<div id="overDiv" style="overflow: auto;max-height: 500px;width: 100%">
<table class="table table-bordered table-hover table-checkable" id="formsnc" style="margin-bottom: 0px">
<tbody class="ludan_2">
</tbody>
<!-- <tbody class="ludan_3"> -->
<!-- </tbody> -->
<!-- <tbody class="ludan_4"> -->
<!-- </tbody> -->
</table>
</div>
</div>
</div>
<div style="width: 100%;">
<div>
<div>
<table class="table table-bordered table-hover table-checkable" id="formsBottom">
<tbody class="ludan_3">
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(function(){
var fage=false;
// 关闭左侧栏
if (!$('body').hasClass('page-sidebar-closed'))
$('.menu-toggler.sidebar-toggler').click();
$("#date").datetimepicker({
format : 'YYYY-MM-DD',
locale : 'zh-cn'
});
$("#left_height").height($(window).height()-100);
$("#xcld_height").height($(window).height()-100);
var d = new Date();
var year = d.getFullYear();
var month = d.getMonth() + 1;
var day = d.getDate();
if(month < 10)
month = "0" + month;
if(day < 10)
day = "0" + day;
$("#date").val(year + "-" + month + "-" + day);
var obj = [];
var xlList;
$.get('/report/lineList',function(result){
xlList=result;
$.get('/user/companyData', function(result){
obj = result;
var options = '';
for(var i = 0; i < obj.length; i++){
options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
}
if(obj.length ==0){
$("#gsdmDiv_xcld").css('display','none');
}else if(obj.length ==1){
$("#gsdmDiv_xcld").css('display','none');
if(obj[0].children.length == 1 || obj[0].children.length ==0)
$('#fgsdmDiv_xcld').css('display','none');
}
$('#gsdmXcld').html(options);
updateCompany();
});
});
$("#gsdmXcld").on("change",updateCompany);
function updateCompany(){
var company = $('#gsdmXcld').val();
var options = '';
for(var i = 0; i < obj.length; i++){
if(obj[i].companyCode == company){
var children = obj[i].children;
for(var j = 0; j < children.length; j++){
options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
}
}
}
$('#fgsdmXcld').html(options);
// initXl();
}
// $("#fgsdmXcld").on("change",initXl);
/* function initXl(){
var data=[];
if(fage){
$("#line").select2("destroy").html('');
}
var fgs=$('#fgsdmXcld').val();
var gs=$('#gsdmXcld').val();
for(var i=0;i<xlList.length;i++){
if(gs!=""){
if(fgs!=""){
if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
}
}else{
if(xlList[i]["gsbm"]==gs){
data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
}
}
}
}
initPinYinSelect2('#line',data,'');
fage=true;
} */
var tempData = {};
$.get('/report/lineList',function(xlList){
var data = [];
// data.push({id: " ", text: "全部线路"});
$.get('/user/companyData', function(result){
for(var i = 0; i < result.length; i++){
var companyCode = result[i].companyCode;
var children = result[i].children;
for(var j = 0; j < children.length; j++){
var code = children[j].code;
for(var k=0;k < xlList.length;k++ ){
if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
}
}
}
}
initPinYinSelect2('#line',data,'');
});
});
$("#line").on("change", function(){
if($("#line").val() == " "){
$("#gsdmXcld").attr("disabled", false);
$("#fgsdmXcld").attr("disabled", false);
} else {
var temp = tempData[$("#line").val()].split(":");
$("#gsdmXcld").val(temp[0]);
updateCompany();
$("#fgsdmXcld").val(temp[1]);
$("#gsdmXcld").attr("disabled", true);
$("#fgsdmXcld").attr("disabled", true);
}
});
var date = '';
var line = '';
var lineName;
$("#query").on("click",function(){
$("#left_height").height($(window).height()-100);
line = $("#line").val();
date = $("#date").val();
lineName = $('#line option:selected').text();
$(".hidden").removeClass("hidden");
$get('/realSchedule/queryUserInfo',{line:line,date:date,state:2},function(result){
// 把数据填充到模版中
var tbodyHtml = template('list_info',{list:result});
// 把渲染好的模版html文本追加到表格中
$('#info tbody').html(tbodyHtml);
});
});
var type="desc";
$(".rypx").on("click",function(){
line = $("#line").val();
date = $("#date").val();
$(".hidden").removeClass("hidden");
$get('/realSchedule/queryUserInfoPx',{line:line,date:date,state:"jGh",type:type},function(result){
if(type=="desc"){
type ="asc";
}else{
type ="desc";
}
// 把数据填充到模版中
var tbodyHtml = template('list_info_px',{list:result});
// 把渲染好的模版html文本追加到表格中
$('#info tbody').html(tbodyHtml);
});
})
$(".zbhpx").on("click",function(){
line = $("#line").val();
date = $("#date").val();
$(".hidden").removeClass("hidden");
$get('/realSchedule/queryUserInfoPx',{line:line,date:date,state:"clZbh",type:type},function(result){
if(type=="desc"){
type ="asc";
}else{
type ="desc";
}
// 把数据填充到模版中
var tbodyHtml = template('list_info_px',{list:result});
// 把渲染好的模版html文本追加到表格中
$('#info tbody').html(tbodyHtml);
});
})
$(".lppx").on("click",function(){
line = $("#line").val();
date = $("#date").val();
$(".hidden").removeClass("hidden");
$get('/realSchedule/queryUserInfoPx',{line:line,date:date,state:"lpName",type:type},function(result){
if(type=="desc"){
type ="asc";
}else{
type ="desc";
}
// 把数据填充到模版中
var tbodyHtml = template('list_info_px',{list:result});
// 把渲染好的模版html文本追加到表格中
$('#info tbody').html(tbodyHtml);
});
})
var params = new Array();
var jName = '';
var jGh = '';
$("#info tbody").on("click","tr",function(){
if($(this).children().size() < 2){
return;
}
$("#xcld_height").height($(window).height()-100);
$(this).children().each(function(index){
params[index] = $(this).text();
});
jName = params[0].split("\\")[0];
jGh = params[0].split("\\")[1];
var id = params[3];
var obj = $(this);
$get('/realSchedule/MapById',{id:id},function(result){
result.scheduleDate = moment(result.scheduleDate).format("YYYY/MM/DD");
var ludan_1 = template('ludan_1',result);
// 把渲染好的模版html文本追加到表格中
$('#forms .ludan_1').html(ludan_1);
$get('/realSchedule/queryListWaybill',{jGh:jGh,clZbh:params[1],lpName:params[2],date:date,line:line},function(result){
getTime(result);
var ludan_2 = template('ludan_2',{list:result});
// 把渲染好的模版html文本追加到表格中
$('#formsnc .ludan_2').html(ludan_2);
$("#headTable").show();
var width = $("#forms").width() + 1.5;//加1是边框
var scrollBarWidth = $('#overDiv')[0].offsetWidth - $('#overDiv')[0].scrollWidth;//滚动条宽度
$("#overDiv").css('width', width + scrollBarWidth + "px");
});
});
$get('/realSchedule/findKMBC',{jGh:jGh,clZbh:params[1],lpName:params[2],date:date,line:line},function(result){
var ludan_3 = template('ludan_3',result);
$('#formsBottom .ludan_3').html(ludan_3);
$("#info tbody tr").css('background-color', '');
obj.css('background-color', '#99CCFF');
});
});
$("#export").on("click",function(){
if(params.length < 1){
return;
}
var i = layer.load(2);
$get('/realSchedule/exportWaybill',{jName:jName,jGh:jGh,clZbh:params[1],lpName:params[2],date:date,line:line},function(result){
var fileName=date+"-"+jName+"-"+params[1]+"-"+params[2]+"-行车路单";
window.open("/downloadFile/download?fileName="+encodeURIComponent(fileName));
layer.close(i);
});
});
$("#print").click(function(){
$("#printArea").printArea();
});
$("#exportMore").on("click",function(){
if($("#info tbody tr td").length <= 1)
return;
var i = layer.load(2);
var param = new Array();
$("#info tbody tr").each(function(index){
param[index] = new Array();
$(this).children().each(function(i){
if(i<3){
param[index][i] = $(this).text().split("\\")[0];
if(i==0){
param[index][3] = $(this).text().split("\\")[1];
}
}
});
});
// $get('/realSchedule/exportWaybillMore',{date:date,line:line,strs:JSON.stringify(param)},function(result){
// window.open("/downloadFile/downloadList?fileName="+result.fileName); //下载压缩包
$get('/busInterval/exportWaybillMore',{date:date,line:line,lineName:lineName,strs:JSON.stringify(param)},function(result){
window.open("/downloadFile/download?fileName="+result.fileName);
layer.close(i);
});
});
function getTime(list){
$.each(list, function(i, obj) {
if(obj.zdsj != null && obj.zdsjActual != null ){
var zdsjActual = (obj.zdsjActual).split(":");
var zdsj = (obj.zdsj).split(":");
if(zdsjActual[0]*60+Number(zdsjActual[1]) > zdsj[0]*60+Number(zdsj[1])){
if(zdsjActual[0]*60+Number(zdsjActual[1]) - zdsj[0]*60+Number(zdsj[1]) > 1000){
obj["fast"] = (zdsj[0]*60+Number(zdsj[1])) - (zdsjActual[0]*60+Number(zdsjActual[1])) + 1440;
} else {
obj["slow"] = (zdsjActual[0]*60+Number(zdsjActual[1])) - (zdsj[0]*60+Number(zdsj[1]));
}
}
else if(zdsjActual[0]*60+Number(zdsjActual[1]) < zdsj[0]*60+Number(zdsj[1])){
if((zdsj[0]*60+Number(zdsj[1])) - (zdsjActual[0]*60+Number(zdsjActual[1])) > 1000){
obj["slow"] = (zdsjActual[0]*60+Number(zdsjActual[1])) - (zdsj[0]*60+Number(zdsj[1])) + 1440;
} else {
obj["fast"] = (zdsj[0]*60+Number(zdsj[1])) - (zdsjActual[0]*60+Number(zdsjActual[1]));
}
}
}
});
}
});
</script>
<script type="text/html" id="list_info">
{{each list as obj i}}
<tr>
<td width="45%">{{obj[4]}}\{{obj[1]}}</td>
<td width="32%">{{obj[2]}}</td>
<td width="20%">{{obj[3]}}</td>
<td width="3%" hidden="true">{{obj[0]}}</td>
</tr>
{{/each}}
{{if list.length == 0}}
<tr>
<td colspan="3"><h6 class="muted">没有找到相关数据</h6></td>
</tr>
{{/if}}
</script>
<script type="text/html" id="list_info_px">
{{each list as obj i}}
<tr>
<td width="45%">{{obj.jName}}\{{obj.jGh}}</td>
<td width="32%">{{obj.clZbh}}</td>
<td width="23%">{{obj.lpName}}</td>
<td hidden="true">{{obj.id}}</td>
</tr>
{{/each}}
{{if list.length == 0}}
<tr>
<td colspan="3"><h6 class="muted">没有找到相关数据</h6></td>
</tr>
{{/if}}
</script>
<script type="text/html" id="ludan_1">
<tr>
<td colspan="14">行车路单</td>
</tr>
<tr>
<td colspan="14">路别:{{xlName}} 路牌:{{lpName}} 车号:{{clZbh}}({{plate}}) 出场时间:{{fcsjActual}} 到达站名:{{zdzName}} 当班调派:{{dbdp}} 日期:{{scheduleDate}}</td>
</tr>
<tr>
{{if type==0}}
<td colspan="2">出场存油 {{ccyl}}升</td>
<td colspan="2">加注量 {{jzl}}升</td>
<td colspan="2">进场存油 {{jcyl}}升</td>
<td colspan="2">加注机油 升</td>
<td colspan="3">{{rylx}}</td>
<td colspan="3">本日耗油 {{yh}}升</td>
{{/if}}
{{if type==1}}
<td colspan="2">出场存电 {{ccyl}}%</td>
<td colspan="2">充电量 {{jzl}}度</td>
<td colspan="2">进场存电 {{jcyl}}%</td>
<td colspan="4">加注机油 升</td>
<td colspan="4">本日耗电 {{yh}}度</td>
{{/if}}
{{if type==2}}
<td colspan="2">出场存电 {{ccyl_}}%<br/>出场存油{{ccyl}}升</td>
<td colspan="2">充电量 {{jzl_}}度<br/>加注量{{jzl}}升</td>
<td colspan="2">进场存电 {{jcyl_}}%<br/>进场存油 {{jcyl}}升</td>
<td colspan="4">加注机油 升</td>
<td colspan="4">本日耗电 {{yh_}}度<br/>本日耗油 {{yh}}升</td>
{{/if}}
</tr>
<tr>
<td rowspan="2">调度章</td>
<td colspan="1"> </td>
<td rowspan="2">早班</td>
<td colspan="1"> </td>
<td rowspan="2">夜班</td>
<td colspan="1"> </td>
<td rowspan="2" colspan="2">交叉</td>
<td colspan="2"> </td>
<td rowspan="2">其他</td>
<td colspan="1"> </td>
<td colspan="1"> </td>
<td colspan="1"> </td>
</tr>
<tr>
<td colspan="1"> </td>
<td colspan="1"> </td>
<td colspan="1"> </td>
<td colspan="2"> </td>
<td colspan="1"> </td>
<td colspan="1"> </td>
<td colspan="1"> </td>
</tr>
</script>
<script type="text/html" id="ludan_2">
{{each list as obj i}}
<tr>
<td style="min-width:20px;max-width:20px">{{obj.adjustExps}}</td>
<td style="min-width:95px;max-width:95px">{{obj.jGh}}{{obj.jName}}</td>
<td style="min-width:95px;max-width:95px">
{{if obj.sGh !=null}}
{{obj.sGh}}{{obj.sName}}
{{/if}}
</td>
<td style="min-width:30px;max-width:30px"> </td>
<td style="min-width:116px;max-width:116px">{{obj.qdzName}}</td>
<td style="min-width:116px;max-width:116px">{{obj.zdzName}}</td>
<td style="min-width:50px;max-width:50px">{{obj.fcsj}}</td>
<td style="min-width:50px;max-width:50px">{{obj.fcsjActual}}</td>
<td style="min-width:50px;max-width:50px">{{obj.zdsj}}</td>
<td style="min-width:50px;max-width:50px">{{obj.zdsjActual}}</td>
<td style="min-width:26px;max-width:26px">{{obj.fast}}</td>
<td style="min-width:26px;max-width:26px">{{obj.slow}}</td>
<td style="min-width:50px;max-width:50px">
{{if obj.zdsjActual!=null}}
{{obj.jhlc}}
{{/if}}
</td>
<td style="min-width:116px;max-width:116px;">
{{obj.remarks}}
</td>
</tr>
{{/each}}
{{if list.length == 0}}
<tr>
<td colspan="14"><h6 class="muted">没有找到相关数据</h6></td>
</tr>
{{/if}}
</script>
<script type="text/html" id="ludan_3">
<tr>
<td colspan="2">计划班次</td>
<td>{{jhbc}}</td>
<td colspan="2">计划公里</td>
<td>{{jhlc}}</td>
<td colspan="2">烂班班次</td>
<td>{{cjbc}}</td>
<td colspan="3"> 烂班公里</td>
<td colspan="2">{{remMileage}}</td>
</tr>
<tr>
<td colspan="2">临加班次</td>
<td>{{ljbc}}</td>
<td colspan="2">临加公里</td>
<td>{{addMileage}}</td>
<td colspan="2">实际班次</td>
<td>{{sjbc}}</td>
<td colspan="3">营运公里</td>
<td colspan="2">{{yygl}}</td>
</tr>
<tr>
<td colspan="2">空驶公里</td>
<td>{{zkslc}}</td>
<td colspan="2">加油里程</td>
<td>{{jylc}}</td>
<td colspan="2">总公里</td>
<td>{{realMileage2}}</td>
<td colspan="3"></td>
<td colspan="2"></td>
</tr>
</script>