shifday.html
6.42 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
<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;
text-align: center; }
.table > tbody + tbody {
border-top: 1px solid; }
</style>
<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="" method="post">
<!-- <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_shif">
<span class="item-label" style="width: 80px;">公司: </span>
<select class="form-control" name="company" id="gsdmShif" style="width: 140px;"></select>
</div>
<div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_shif">
<span class="item-label" style="width: 80px;">分公司: </span>
<select class="form-control" name="subCompany" id="fgsdmShif" style="width: 140px;"></select>
</div> -->
<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">
<input class="btn btn-default" type="button" id="query" value="筛选"/>
<input class="btn btn-default" type="button" id="export" value="导出"/>
</div>
</form>
</div>
<div style="display: none">
<h3>数据显示</h3>
<a>驾驶员 售票员 路牌</a>
<a>售票员 路牌 车辆</a>
<a>车辆 人员 车辆</a>
<a>驾驶员</a>
<a>售票员</a>
<a>路牌</a>
<a>车辆</a>
</div>
<div class="portlet-body" style="text-align:center">
<div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
<table class="table table-bordered table-hover table-checkable" id="forms">
<thead>
<tr>
<th>驾驶员</th>
<th>售票员</th>
<th>路牌</th>
<th>车辆</th>
<th>计划里程</th>
<th>实际计划里程</th>
<th>运营</th>
<th>空驶里程</th>
<th>抽减里程</th>
<th>增加里程</th>
<th>总里程</th>
<th>计划班次</th>
<th>实际计划班次</th>
<th>抽减班次</th>
<th>增加班次</th>
<th>实际班次</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<script>
$(function(){
var reqCodeMap = {"0xA1": '请求恢复运营', "0xA2": '申请调档', "0xA3": '出场请求', "0xA5": '进场请求', "0xA7": '加油请求', "0x50": '车辆故障', "0x70": '路阻报告', "0x60": '事故报告', "0x11": '扣证纠纷', "0x12" : '报警'};
// 关闭左侧栏
if (!$('body').hasClass('page-sidebar-closed'))
$('.menu-toggler.sidebar-toggler').click();
$("#date").datetimepicker({
format : 'YYYY-MM-DD',
locale : 'zh-cn'
});
var obj = [];
$.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_shif").css('display','none');
$('#fgsdmDiv_shif').css('display','none');
}else if(obj.length ==1){
$("#gsdmDiv_shif").css('display','none');
if(obj[0].children.length == 1 || obj[0].children.length ==0)
$('#fgsdmDiv_shif').css('display','none');
}
$('#gsdmShif').html(options);
updateCompany();
});
$("#gsdmShif").on("change",updateCompany);
function updateCompany(){
var company = $('#gsdmShif').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>';
}
}
}
$('#fgsdmShif').html(options);
}
$.get('/basic/lineCode2Name',function(result){
var data=[];
for(var code in result){
data.push({id: code, text: result[code]});
}
initPinYinSelect2('#line',data,'');
})
$("#query").on("click",function(){
var line = $("#line").val();
var date = $("#date").val();
/* var gsdmShif = $("#gsdmShif").val();
var fgsdmShif = $("#fgsdmShif").val(); */
$post('/mcy_forms/shifday',{/* gsdmShif:gsdmShif,fgsdmShif:fgsdmShif, */line:line,date:date},function(result){
$.each(result, function(i, obj) {
obj.requestType = reqCodeMap[obj.requestType];
});
// 把数据填充到模版中
var tbodyHtml = template('shifday',{list:result});
// 把渲染好的模版html文本追加到表格中
$('#forms tbody').html(tbodyHtml);
});
});
});
</script>
<script type="text/html" id="shifday">
{{each list as obj i}}
<tr>
<td>{{obj.jName}}</td>
<td>{{obj.sName}}</td>
<td>{{obj.lpName}}</td>
<td>{{obj.carPlate}}</td>
<td>{{obj.jhlc}}</td>
<td>{{obj.sjjhlc}}</td>
<td>{{obj.yygl}}</td>
<td>{{obj.emptMileage}}</td>
<td>{{obj.remMileage}}</td>
<td>{{obj.addMileage}}</td>
<td>{{obj.totalm}}</td>
<td>{{obj.jhbc}}</td>
<td>{{obj.sjjhbc}}</td>
<td>{{obj.cjbc}}</td>
<td>{{obj.ljbc}}</td>
<td>{{obj.sjbc}}</td>
</tr>
{{/each}}
{{if list.length == 0}}
<tr>
<td colspan="16"><h6 class="muted">没有找到相关数据</h6></td>
</tr>
{{/if}}
</script>
</script>