waybillQp.html
13.7 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
<style type="text/css">
.table-bordered {
border: 1px solid; }
.table-bordered > thead > tr > th,
.table-bordered > thead > tr > td,
.table-bordered > tbody > tr > th,
.table-bordered > tbody > tr > td,
.table-bordered > tfoot > tr > th,
.table-bordered > tfoot > tr > td {
border: 1px solid; }
.table-bordered > thead > tr > th,
.table-bordered > thead > tr > td {
border-bottom-width: 2px; }
.table > tbody + tbody {
border-top: 1px solid; }
.table {
width: 90%;
}
</style>
<div class="page-head">
<div class="page-title">
<i class="fa fa-question-circle-o" aria-hidden="true"></i>
<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;">
<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: 15px;">
<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-2">
<div class="" style="margin-top: 10px;overflow:auto;/*height: 860px*/">
<table class="table table-bordered table-hover table-checkable pre-scrollable" id="info">
<thead>
<tr class="hidden">
<th>自编号</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div class="col-md-9" id="printArea">
<div class="table-container" 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>
</div>
</div>
</div>
</div>
</div>
<script>
$(function(){
// 关闭左侧栏
if (!$('body').hasClass('page-sidebar-closed'))
$('.menu-toggler.sidebar-toggler').click();
$("#date").datetimepicker({
format : 'YYYY-MM-DD',
locale : 'zh-cn'
});
$.get('/basic/lineCode2Name',function(result){
var data=[];
for(var code in result){
data.push({id: code, text: result[code]});
}
initPinYinSelect2('#line',data,'');
})
/* $('#line').select2({
ajax: {
url: '/realSchedule/findLine',
type: 'post',
dataType: 'json',
delay: 150,
data: function(params){
return{line: params.term};
},
processResults: function (data) {
return {
results: data
};
},
cache: true
},
templateResult: function(repo){
if (repo.loading) return repo.text;
var h = '<span>'+repo.text+'</span>';
return h;
},
escapeMarkup: function (markup) { return markup; },
minimumInputLength: 1,
templateSelection: function(repo){
return repo.text;
},
language: {
noResults: function(){
return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';
},
inputTooShort : function(e) {
return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';
},
searching : function() {
return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';
}
}
});
*/
var date = '';
var line ='';
$("#query").on("click",function(){
line= $("#line").val();
date = $("#date").val();
$(".hidden").removeClass("hidden");
$get('/realSchedule/queryUserInfo',{line:line,date:date,state:3},function(result){
// 把数据填充到模版中
var tbodyHtml = template('list_info',{list:result});
// 把渲染好的模版html文本追加到表格中
$('#info tbody').html(tbodyHtml);
});
});
var params = new Array();
var jName = '';
$("#info tbody").on("click","tr",function(){
if($(this).children().size() < 1){
return;
} else if($(this).children().children().html() == "没有找到相关数据"){
return;
}
$(this).children().each(function(index){
params[index] = $(this).text();
});
var id = $("#"+params[0]).val();
$get('/realSchedule/MapByIdQp',{id:id},function(result){
// result.scheduleDate = moment(result.scheduleDate).format("YYYY/MM/DD");
var ludan_1 = template('ludan_1',{map:result});
//var ludan_4 = template('ludan_4',result);
// 把渲染好的模版html文本追加到表格中
$('#forms .ludan_1').html(ludan_1);
//$('#forms .ludan_4').html(ludan_4);
});
$get('/realSchedule/queryListWaybillQp',{clZbh:params[0],date:date,line:line},function(result){
getTime(result);
var ludan_2 = template('ludan_2',{list:result});
// 把渲染好的模版html文本追加到表格中
$('#forms .ludan_2').html(ludan_2);
});
$get('/realSchedule/findKMBCQp',{clZbh:params[0],date:date,line:line},function(result){
console.log(result);
var ludan_3 = template('ludan_3',{map:result});
$('#forms .ludan_3').html(ludan_3);
});
});
$("#export").on("click",function(){
if(params.length < 1){
return;
}
$get('/realSchedule/exportWaybillQp',{clZbh:params[0],date:date,line:line},function(result){
var fileName=date+"-"+params[0]+"-行车路单"
window.open("/downloadFile/download?fileName="+fileName);
// window.open("/downloadFile/download?fileName="+encodeURIComponent(encodeURIComponent(fileName)));
});
});
$("#print").click(function(){
$("#printArea").printArea();
});
$("#exportMore").on("click",function(){
if($("#info tbody").children().size() < 1){
return;
} else if($("#info tbody tr td").children().html() == "没有找到相关数据"){
return;
}
var param = new Array();
$("#info tbody tr").each(function(index){
param[index] = $(this).txet();
});
// $post('/realSchedule/exportWaybillQpMore',{date:date},function(result){
// window.open("/downloadFile/downloadList?fileName="+result.fileName);
// });
});
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>{{obj[1]}}<input type="hidden" id="{{obj[1]}}" value="{{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="ludan_1">
<tr>
<td colspan="17">行车路单</td>
</tr>
<tr>
<td colspan="17">路别:{{map.xlName}} 车号:{{map.clZbh}} 出场时间:{{map.fcsjActual}} 到达站名:{{map.zdzName}} 日期:{{map.scheduleDate}}</td>
</tr>
<tr>
<td colspan="2">出场存油 升</td>
<td colspan="3">加注油量 {{map.jzl}}升</td>
<td colspan="2">进场存油 升</td>
<td colspan="5">加注机油 升</td>
<td colspan="5">本日耗油 升</td>
</tr>
<tr>
<td colspan="2">调度员</td>
<td colspan="2">早班(职号)</td>
<td title={{map.zdp}}>{{map.zdpT}}</td>
<td >中班(职号)</td>
<td title={{map.zwdp}}>{{map.zwdpT}}</td>
<td colspan="3">夜班(职号)</td>
<td colspan="2" title={{map.wdp}}>{{map.wdpT}}</td>
<td colspan="2">其他</td>
<td colspan="3"> </td>
</tr>
<tr>
<td rowspan="2">车次</td>
<td rowspan="2">路牌</td>
<td colspan="2">工号</td>
<td rowspan="2">公里耗油</td>
<td colspan="2">起讫站</td>
<td colspan="5">时间</td>
<td colspan="2">误点</td>
<td rowspan="2" width="66px">里程(公里)计划</td>
<td rowspan="2" width="66px">里程(公里)实际</td>
<td rowspan="2">备注</td>
</tr>
<tr>
<td colspan="1" width="60px">司 机</td>
<td colspan="1" width="60px">售 票</td>
<td colspan="1">起点</td>
<td colspan="1">终点</td>
<td colspan="1">计发</td>
<td colspan="1">待发</td>
<td colspan="1">实发</td>
<td colspan="1">应到</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>
{{if obj.adjustExps == "子"}}
<td title="子任务" style="font-size: 20px;font-weight: bold;">
{{obj.adjustExps}}
</td>
{{/if}}
{{if obj.adjustExps != "子"}}
{{if obj.sflj == true}}
<td title="临加班次" style="font-size: 20px;font-weight: bold;">
临
</td>
{{/if}}
{{if obj.sflj == false}}
<td>
{{i+1}}
</td>
{{/if}}
{{/if}}
<td>{{obj.lpName}}</td>
<td>{{obj.jGh}}{{obj.jName}}</td>
<td>
{{if obj.sGh !=null}}
{{obj.sGh}}
{{obj.sName}}
{{/if}}
</td>
<td> </td>
<td>{{obj.qdzName}}</td>
<td>{{obj.zdzName}}</td>
<td>{{obj.fcsj}}</td>
<td>{{obj.dfsj}}</td>
<td>{{obj.fcsjActual}}</td>
<td>{{obj.zdsj}}</td>
<td>{{obj.zdsjActual}}</td>
<td>{{obj.fast}}</td>
<td>{{obj.slow}}</td>
<td>{{obj.jhlcOrig}}</td>
<td>{{obj.sjlc}}</td>
<td title="{{obj.remarks}}">
{{if obj.remarks !=""}}
<div class="caption">
<font style="font-size: 24px;font-weight: bold;">!</font>
</div>
{{/if}}
</td>
</tr>
{{/each}}
{{if list.length == 0}}
<tr>
<td colspan="15"><h6 class="muted">没有找到相关数据</h6></td>
</tr>
{{/if}}
</script>
<script type="text/html" id="ludan_3">
<tr>
<td colspan="2" title="计划营运公里+计划进出场公里(含计划空驶公里)">计划公里</td>
<td>{{map.jhlc}}</td>
<td colspan="2" title="计划营运公里">营运公里(计划)</td>
<td >{{map.yygljh}}</td>
<td title="烂班公里">损失公里</td>
<td>{{map.ssgl}}</td>
<td colspan="3" title="实际空驶公里,主要是子任务里的空驶公里">空驶公里</td>
<td colspan="1">{{map.ksgl}}</td>
<td colspan="3" title="实际营运公里+临加公里">营运公里(实际)</td>
<td colspan="2">{{map.yyglsj}}</td>
</tr>
<tr>
<td colspan="2" title="计划营运班次数">计划班次</td>
<td>{{map.jhbc}}</td>
<td colspan="2" title="计划进出场公里(不含计划空驶公里)">进出场公里(计划)</td>
<td>{{map.jhjcclc}}</td>
<td title="临加公里">加车公里</td>
<td>{{map.ljgl}}</td>
<td colspan="3" title="烂班班次数">损失班次</td>
<td colspan="1">{{map.ssbc}}</td>
<td colspan="3" title="实际进出场公里(不含实际空驶公里)">进出场公里(实际)</td>
<td colspan="2">{{map.jcclc}}</td>
</tr>
<tr>
<td colspan="2" title="实际营运班次数(计划班次-损失班次+加车班次)">实际班次</td>
<td>{{map.sjbc}}</td>
<td colspan="2" title="实际营运公里+临加公里+实际进出场公里(不含实际空驶公里)+实际空驶公里">总公里</td>
<td>{{map.zgl}}</td>
<td title="临加班次数">加车班次</td>
<td>{{map.ljbc}}</td>
<td colspan="3" title="损失公里-加车公里">实际损失公里</td>
<td colspan="1">{{map.sjssgl}}</td>
<td colspan="5"></td>
</tr>
</script>