agvTask.html
15.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
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 select-info">
<!--<ul id="myTab" class="nav nav-tabs">-->
<!--<li class="active"><a href="#tabHeader" data-toggle="tab">主表</a></li>-->
<!--<li><a href="#tabDetail" data-toggle="tab">明细</a></li>-->
<!--</ul>-->
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade in active" id="tabHeader">
<div class="col-sm-12 select-info">
<form id="task-form">
<div class="select-list">
<ul>
<li>
任务id:<input type="text" name="id"/>
</li>
<li>
单据编码:<input type="text" name="billCode"/>
</li>
<li>
容器编号:<input type="text" name="containerCode"/>
</li>
<!--<li>-->
<!--<!–入库类型:<input type="text" name="sourceCode"/>–>-->
<!--任务类型:<select name="type" th:with="type=${@dict.getType('taskType')}">-->
<!--<option value="">所有</option>-->
<!--<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option></select>-->
<!--</li>-->
<!--<li class="time" style="height: 30px">-->
<!--<label>创建时间: </label>-->
<!--<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[createdBegin]"/>-->
<!--<span>-</span>-->
<!--<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[createdEnd]"/>-->
<!--</li>-->
<!--<li>-->
<!--<!–头 状 态:<input type="text" name="firstStatus"/>–>-->
<!--头 状 态:<select name="firstStatus" th:with="firstStatus=${@dict.getType('taskStatus')}">-->
<!--<option value="">所有</option>-->
<!--<option th:each="e : ${firstStatus}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option></select>-->
<!--</li>-->
<!--<li>-->
<!--<!–尾 状 态:<input type="text" name="lastStatus"/>–>-->
<!--尾 状 态:<select name="lastStatus" th:with="lastStatus=${@dict.getType('taskStatus')}">-->
<!--<option value="">所有</option>-->
<!--<option th:each="e : ${lastStatus}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option></select>-->
<!--</li>-->
<!--<li>
出入库站台:<select name="station" th:with="stations = ${@dict.getType('station')}">
<option value="">所有</option>
<option th:each="e : ${stations}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option></select>
</li>-->
<!--<li>-->
<!--巷道:<input type="text" name="roadway"/>-->
<!--</li>-->
<!--<li>-->
<!--来源库位:<input type="text" name="sourceLocation"/>-->
<!--</li>-->
<!--<li>-->
<!--目的库位:<input type="text" name="destinationLocation"/>-->
<!--</li>-->
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('task-form')"><i class="fa fa-refresh"></i> 重置</a>
<!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="receipt:receiptHeader:export"><i class="fa fa-download"></i> 导出</a>-->
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group hidden-xs" id="toolbar" role="group">
<a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" >
<i class="fa fa-plus"></i> 新增
</a>
<a class="btn btn-outline btn-danger btn-rounded" onclick="batchCancel()" shiro:hasPermission="task:agvTask:remove">
<i class="fa fa-remove"></i>批量取消
</a>
<a class="btn btn-outline btn-success btn-rounded" onclick="batchExecute()" shiro:hasPermission="task:agvTask:execute">
<i class="fa fa-send"></i>批量执行
</a>
<a class="btn btn-outline btn-primary btn-rounded" onclick="batchComplete()" shiro:hasPermission="task:agvTask:complete">
<i class="fa fa-check"></i>批量完成
</a>
</div>
<!-- <input type="hidden" id="taskId" name="taskId" th:value="${taskId}"/>-->
<table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table>
</div>
<!-- <div class="tab-pane fade" id="tabDetail">-->
<!-- <div class="btn-group hidden-xs" id="toolbar1" role="group">-->
<!-- <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" >-->
<!-- <i class="fa fa-plus"></i> 新增-->
<!-- </a>-->
<!-- </div>-->
<!-- <table id="bootstrap-table1" data-mobile-responsive="true" class="table table-bordered table-hover"></table>-->
<!-- </div>-->
</div>
</div>
</div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
var prefix = ctx + "task/agvTask";
var cancelFlag = [[${@permission.hasPermi('task:agvTask:cancel')}]];
var executeFlag = [[${@permission.hasPermi('task:agvTask:execute')}]];
var completeFlag = [[${@permission.hasPermi('task:agvTask:complete')}]];
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
modalName: "任务管理",
sortName: "id",
sortOrder: "desc",
search: false,
clickToSelect:true,
columns: [
{
checkbox: true,
formatter:function (value,row,index){
if(row.status === 100){
return {
checked : false,
disabled: true
}
}else{
return {
checked : false,
disabled: false
}
}
}
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
// actions.push('<a class="btn btn-info btn-xs " href="#" onclick="detail(\'' + row.id + '\')"><i class="fa fa-list-ul"></i>明细</a> ');
if (row.status < 10) {
actions.push('<a class="btn btn-success btn-xs '+ executeFlag +'" href="#" onclick="execute(\'' + row.id + '\')"><i class="fa fa-send" style="padding-right: 1px;"></i>执行</a> ');
actions.push('<a class="btn btn-danger btn-xs'+cancelFlag+'" href="#" onclick="cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i>取消</a> ');
actions.push('<a class="btn btn-primary btn-xs'+completeFlag+'" href="#" onclick="complete(\'' + row.id + '\')"><i class="fa fa-check"></i>完成</a>');
}
if(row.status < 100 && row.status >=10 ){
actions.push('<a class="btn btn-primary btn-xs'+completeFlag+'" href="#" onclick="complete(\'' + row.id + '\')"><i class="fa fa-check"></i>完成</a>');
}
return actions.join('');
}
},
{
field : 'id',
title : '任务ID' ,
sortable: true
},
// {
// field : 'warehouseId',
// title : '仓库ID' ,
// visible:true
// },
{
field : 'warehouseCode',
title : '仓库编码' ,
visible:false
},
{
field : 'companyCode',
title : '货主编码' ,
visible:true
},
// {
// field : 'companyId',
// title : '货主ID' ,
// visible:false
// },
{
field : 'interactionId',
title : '交互标识' ,
visible:true
},
{
field : 'taskHeaderId',
title : '任务头标识' ,
visible:true
},
// {
// field : 'taskDetailId',
// title : '任务子标识' ,
// visible:true
// },
{
field : 'taskType',
title : '任务类型' ,
visible:true
},
{
field : 'shelfNo',
title : '货架编码' ,
visible:true
},
{
field : 'station',
title : '站台编码' ,
visible:true
},
{
field : 'fromLocationNo',
title : '源位置' ,
visible:true
},
{
field : 'toLocationNo',
title : '目的位置' ,
visible:true
},
{
field : 'orientation',
title : '方向' ,
visible:true
},
{
field : 'platform',
title : '平台' ,
visible:true
},
{
field : 'carNo',
title : '小车编号' ,
visible:true
},
// {
// field : 'state',
// title : '状态' ,
// visible:true
// },
// {
// field : 'date',
// title : '日期' ,
// visible:true
// },
]
};
$.table.init(options);
});
/*执行任务*/
function execute(id) {
$.modal.confirm("确定执行任务?", function() {
var url = ctx + 'task/agvTask/execute';
var data = { "id" : id };
$.operate.post(url, data);
});
}
/**
* 批量执行任务
*/
function batchExecute() {
var rows=$("#bootstrap-table").bootstrapTable('getSelections');
if (rows.length == 0) {
$.modal.alertWarning("请至少选择一条记录");
return;
}
$.modal.confirm("确认要下发AGV选中的" + rows.length + "条数据吗?", function() {
var url = ctx + 'task/agvTask/executes';
var ids = "";
for(var i=rows.length-1; i >= 0; i--) {
ids = ids + rows[i].id + ","
}
var data = { "ids": ids.substring(0, ids.length-1) };
$.operate.submit(url, "post", "json", data);
})
}
/*批量取消任务*/
function batchCancel() {
var rows=$("#bootstrap-table").bootstrapTable('getSelections');
if (rows.length == 0) {
$.modal.alertWarning("请至少选择一条记录");
return;
}
$.modal.confirm("确认要删除选中的" + rows.length + "条数据吗?", function() {
var url = ctx + 'task/agvTask/cancels';
var ids = "";
for(var i=0; i<rows.length; i++) {
ids = ids + rows[i].id + ","
}
var data = { "ids": ids.substring(0, ids.length-1) };
$.operate.submit(url, "post", "json", data);
})
}
/**
* 取消任务
* @param id
*/
function cancel(id) {
$.modal.confirm("确定执行任务?", function() {
var url = ctx + 'task/agvTask/cancel';
var data = { "id" : id };
$.operate.post(url, data);
});
}
/**
* 任务完成
* @param id
*/
function complete(id) {
$.modal.confirm("确定执行任务?", function() {
var url = ctx + 'task/agvTask/complete';
var data = { "id" : id };
$.operate.post(url, data);
});
}
/**
* 批量任务完成
* @param ids
*/
function batchComplete(ids) {
var rows=$("#bootstrap-table").bootstrapTable('getSelections');
if (rows.length == 0) {
$.modal.alertWarning("请至少选择一条记录");
return;
}
$.modal.confirm("确认要删除选中的" + rows.length + "条数据吗?", function() {
var url = ctx + 'task/agvTask/completes';
var ids = "";
for(var i=0; i<rows.length; i++) {
ids = ids + rows[i].id + ","
}
var data = { "ids": ids.substring(0, ids.length-1) };
$.operate.submit(url, "post", "json", data);
})
}
</script>
</body>
</html>