account.html
4.1 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
<link href="/pages/forms/statement/css/autocompleter.css" rel="stylesheet" type="text/css" />
<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; }
</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="">
<div class="form-group">
<label for="line">线路:</label>
<input id="line" type="text" name="xlName_eq"/>
</div>
<div class="form-group">
<label for="date">时间:</label>
<input type="text" id="date" name="scheduleDate_eq"/>
</div>
<div class="form-group">
<label for="code">内部编码:</label>
<input type="text" id="code" name="clZbh_eq"/>
</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 class="portlet-body">
<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>
</tr>
</thead>
<tbody>
</tbody>
</table>
</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'
});
var lines = new Array();
// 取得所有线路
$get('/line/all', null, function(allLine) {
// 遍历数组
$.each(allLine, function(i, e) {
var line = '{"hex":"'+e.company+'","label":"'+e.name+'"}';
var obj = jQuery.parseJSON(line);
lines[i]= obj;
});
});
// 给输入框绑定autocomplete事件
$("#line").autocompleter({
highlightMatches: true,
source: lines,
template: '{{ label }}',
hint: true,
empty: false,
limit: 5,
});
var cars = new Array();
// 取得所有线路
$get('/cars/all', null, function(allCar) {
debugger
// 遍历数组
$.each(allCar, function(i, e) {
var car = '{"hex":"'+e.company+'","label":"'+e.insideCode+'"}';
var obj = jQuery.parseJSON(car);
cars[i]= obj;
});
});
// 给输入框绑定autocomplete事件
$("#code").autocompleter({
highlightMatches: true,
source: cars,
template: '{{ label }}',
hint: true,
empty: false,
limit: 5,
});
$("#query").on("click",function(){
var line = $("#line").val();
var date = $("#date").val();
var code = $("#code").val();
$(".hidden").removeClass("hidden");
$get('/realSchedule/historyMessage',{line:line,date:date,code:code},function(result){
// 把数据填充到模版中
var tbodyHtml = template('list_forms',{list:result});
// 把渲染好的模版html文本追加到表格中
$('#forms tbody').html(tbodyHtml);
});
});
});
</script>
<script type="text/html" id="list_forms">
{{each list as obj i}}
<tr>
<td>{{i+1}}</td>
<td>{{obj.xlName}}</td>
<td>{{obj.clZbh}}</td>
<td>{{obj.company}}</td>
<td> </td>
<td> </td>
</tr>
{{/each}}
{{if list.length == 0}}
<tr>
<td colspan="6"><h6 class="muted">没有找到相关数据</h6></td>
</tr>
{{/if}}
</script>