line.html
11.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
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
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org"
xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('线路档案信息')" />
</head>
<body class="gray-bg">
<div class="container-div" id="context">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li><label>公司:</label> <input type="text" name="company" />
</li>
<li><label>分公司:</label> <input type="text" name="fCompany" />
</li>
<li><label>线路名称:</label> <input type="text" name="lineName" />
</li>
<li>
<el-button size="mini" type="primary" icon="el-icon-search" onClick="$.table.search();">搜索</el-button>
<el-button size="mini" icon="el-icon-refresh" onClick="$.form.reset();">重置</el-button>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<el-button plain size="mini" type="primary" icon="el-icon-plus" onClick="add(this);" shiro:hasPermission="system:line:add">新增</el-button>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">选择显示的列</h4>
</div>
<div class="modal-body" id="cols" style="float: left;">
<input type="checkbox" onClick="checkAll(this);" id="checkboxForAll"/><label>全选</label><br />
<br />
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" data-dismiss="modal" onClick="initTable();">提交更改</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
<script th:inline="javascript">
function add(obj){
if($(obj)[0].className.indexOf("disabled") == -1)
$.operate.add();
}
new Vue({
el: '#context',
data: function() {
return { visible: false }
}
})
var dicts = [[${@dict.getType('')}]];
function queryParams(params) {
var search = $.table.queryParams(params);
search.examineStatus ='true';
search.examineType='0';
return search;
}
function createTable(objs){
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
queryParams: queryParams,
modalName: "线路档案信息",
columns: [],
onDblClickRow:function (row,index){
edit(row.id);
}
};
if(objs.length > 0){
options.columns[0] = {checkbox:true};
options.columns[1] = {visible:false,field:"id"};
}
for(var i = 0;i< objs.length;i++){
if(!objs)continue;
var col = {
field: objs[i].field,
title: objs[i].title,
align: 'center',
formatter: function(value, row, index) {
if(this.field == "roadType" || this.field == "busType"){
if(value != null){
var arr = value.split(",");
value = "";
for(var i in arr){
for(var j in dicts[this.field]){
if(dicts[this.field][j].dictValue == arr[i]){
value += dicts[this.field][j].dictLabel + ","
break;
}
}
}
return $.table.tooltip(value.substring(0,value.length -1), 5);
}
}
if(this.field == "isLogicDelete" || this.field == "inoutDistrict"|| this.field == "isMetro" || this.field == "hasTimelists"){
for(var j in dicts["trueFalse"]){
if(dicts["trueFalse"][j].dictValue == value){
value = dicts["trueFalse"][j].dictLabel;
break;
}
}
}
if(dicts[this.field]){
for(var j in dicts[this.field]){
if(dicts[this.field][j].dictValue == value){
value = dicts[this.field][j].dictLabel;
break;
}
}
}
return $.table.tooltip(value, 5);
}
}
options.columns.push(col);
}
$.table.init(options);
}
function checkAll(obj){
var objs = $("#cols input");
if(obj.checked == false){
for(var i in objs){
objs[i].checked = false;
}
}else{
for(var i in objs){
objs[i].checked = true;
}
}
}
var editFlag = [[${@permission.hasPermi('system:lineReport:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:lineReport:remove')}]];
var prefix = ctx + "system/lineAdd";
$(function() {
var allDicts = {};
for(var i in dicts){
if(!allDicts[dicts[i].dictType]){
allDicts[dicts[i].dictType] = [];
}
allDicts[dicts[i].dictType].push(dicts[i]);
}
dicts = allDicts;
var cols = [{
field: 'lineName',
title: '线路名称',
},
{
field: 'company',
title: '公司'
},
{
field: 'fCompany',
title: '分公司'
},
{
field: 'pLineId',
title: '主线路id'
},
{
field: 'serviceType',
title: '营运方式'
},
{
field: 'lineLevel',
title: '线路属性'
},
{
field: 'lineType',
title: '线路属性'
},
{
field: 'district',
title: '区属'
},
{
field: 'inoutDistrict',
title: '是否区内'
},
{
field: 'serviceState',
title: '营运状态'
},
{
field: 'busType',
title: '车辆类型'
},
{
field: 'airConditionerType',
title: '是否空调'
},
{
field: 'sellTicketType',
title: '售票类型'
},
{
field: 'serviceTime',
title: '运营时间'
},
{
field: 'lineDistance',
title: '线路长度'
},
{
field: 'lineCode',
title: '线路编码'
},
{
field: 'warrantYear',
title: '授权年限'
},
{
field: 'warrantStartTime',
title: '授权起始日期'
},
{
field: 'warrantEndTime',
title: '授权结束日期'
},
{
field: 'planCancelTime',
title: '撤销日期'
},
{
field: 'cancelTime',
title: '实际撤销日期'
},
{
field: 'cancelReason',
title: '撤销原因'
},
{
field: 'remark',
title: '备注'
},
{
field: 'isLogicDelete',
title: '是否逻辑删除'
},
{
field: 'updateBy',
title: '更新人'
},
{
field: 'updateTime',
title: '更新时间'
},
{
field: 'timeSchedule',
title: '行车作业计划表报备时间'
},
{
field: 'park',
title: '停车场'
},
{
field: 'isWarrant',
title: '是否权证'
},
{
field: 'isWarrantStartTime',
title: '权证开通日期'
},
{
field: 'isWarrantEndTime',
title: '权证到期日期'
},
{
field: 'roadType',
title: '道路类型'
},
{
field: 'ticketPrice',
title: '票价'
},
{
field: 'firstStation',
title: '首站'
},
{
field: 'startEnd',
title: '起讫站'
},
{
field: 'firstTime',
title: '首战时间'
},
{
field: 'lastStation',
title: '末站'
},
{
field: 'lastTime',
title: '末站首战时间'
},
{
field: 'mileageUp',
title: '上行里程数'
},
{
field: 'mileageDown',
title: '下行里程数'
},
{
field: 'averageMileage',
title: '平均里程数'
},
{
field: 'stationUp',
title: '站级数(上行)'
},
{
field: 'stationDown',
title: '站级数(下行)'
},{
field: 'travelTimeUp',
title: '行驶时间(上行)'
},{
field: 'travelTimeDown',
title: '行驶时间(下行)'
},{
field: 'travelIntervalUp',
title: '行驶间隔(高峰)'
},{
field: 'travelIntervalDown',
title: '行驶间隔(低谷)'
},{
field: 'warrantVehiclesLarge',
title: '经营权证(大巴)'
}, {
field: 'warrantVehiclesMiddle',
title: '经营权证(中巴)'
},{
field: 'vehiclesNumber',
title: '实际配车数'
}, {
field: 'numberVehiclesLarge',
title: '实际车辆数(大巴)'
}, {
field: 'numberVehiclesMiddle',
title: '实际车辆数(中巴)'
},{
field: 'carPlate',
title: '车辆自编号'
},{
field: 'numberPerson',
title: '线路总配人数'
},{
field: 'numberPersonDriver',
title: '人数司机'
}, {
field: 'numberPersonSales',
title: '售票员数'
},{
field: 'busEvNumber',
title: '新能源车数'
},{
field: 'directions',
title: '线路走向'
},{
field: 'numberOfManage',
title: '经营权证数'
},{
field: 'halfwayStation',
title: '站点名称'
},{
field: 'fullCustomerPercent',
title: '高峰系数'
},{
field: 'lowCustomerPercent',
title: '低谷系数'
}, {
field: 'divideLevel',
title: '间隔等级'
},{
field: 'hasTimelists',
title: '是否挂牌'
},{
field: 'isMetro',
title: '是否轨交末班车衔接'
},{
field: 'metroTime',
title: '轨交时间'
},{
field: 'coldBonusType',
title: '冷僻线路补贴类型'
}];
createTable(cols);
});
function edit(id) {
table.set();
if($.common.isEmpty(id) && table.options.type == table_type.bootstrapTreeTable) {
var row = $("#" + table.options.id).bootstrapTreeTable('getSelections')[0];
if ($.common.isEmpty(row)) {
$.modal.alertWarning("请至少选择一条记录");
return;
}
var url = table.options.updateUrl.replace("{id}", row[table.options.uniqueId]);
open("修改" + table.options.modalName, url);
} else {
open(id,"修改" + table.options.modalName, $.operate.editUrl(id));
}
}
function open(id,title, url, width, height, callback) {
// 如果是移动端,就使用自适应大小弹窗
if ($.common.isMobile()) {
width = 'auto';
height = 'auto';
}
if ($.common.isEmpty(title)) {
title = false;
}
if ($.common.isEmpty(url)) {
url = "/404.html";
}
if ($.common.isEmpty(width)) {
width = 800;
}
if ($.common.isEmpty(height)) {
height = ($(window).height() - 50);
}
if ($.common.isEmpty(callback)) {
callback = function(index, layero) {
var iframeWin = layero.find('iframe')[0];
iframeWin.contentWindow.submitHandler(index, layero);
}
}
layer.open({
type: 2,
area: [width + 'px', height + 'px'],
fix: false,
//不固定
maxmin: true,
shade: 0.3,
title: title,
content: url,
btn: ['修改', '删除'],
// 弹层外区域关闭
shadeClose: true,
yes: callback,
btn2: function(index, layero){
$.operate.remove(id)
}
});
}
</script>
<style>
.col_checkbox {
width: 33%;
float: left;
}
</style>
</body>
</html>