|
1
2
3
4
5
6
7
|
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
|
8
|
<a-form-item :label="$t('task.taskId') ">
|
|
9
|
<a-input :placeholder="$t('task.inputTaskId') " v-model="queryParam.id"></a-input>
|
|
10
11
12
|
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
|
13
|
<a-form-item :label="$t('task.taskType') ">
|
|
14
|
<j-dict-select-tag :placeholder="$t('task.inputTaskType') " v-model="queryParam.taskType" dictCode="task_type"/>
|
|
15
16
17
|
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
|
18
19
|
<a-form-item :label="$t('task.containerCode') ">
<a-input :placeholder="$t('task.inputTaskType') " v-model="queryParam.containerCode"></a-input>
|
|
20
21
|
</a-form-item>
</a-col>
|
|
22
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
|
23
24
|
<a-form-item :label="$t('task.taskStatus') ">
<j-dict-select-tag :placeholder="$t('task.inputTaskStatus') " v-model="queryParam.status" dictCode="task_header_status"/>
|
|
25
26
27
|
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
|
28
29
|
<a-form-item :label="$t('task.fromStationCode') ">
<a-input :placeholder="$t('task.inputFromStationCode') " v-model="queryParam.fromPort"></a-input>
|
|
30
31
32
|
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
|
33
34
|
<a-form-item :label="$t('task.toStationCode') ">
<a-input :placeholder="$t('task.toStationCode') " v-model="queryParam.toPort"></a-input>
|
|
35
36
|
</a-form-item>
</a-col>
|
|
37
38
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
|
39
40
|
<a-button id="search" type="primary" @click="searchQuery" icon="search">{{ $t('button.search') }}</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">{{ $t('button.reset') }}</a-button>
|
|
41
42
43
44
45
46
47
48
49
|
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
|
|
50
51
52
53
54
|
<a-button v-has="'agvTask:add'" @click="handleAdd" type="primary" icon="plus">{{ $t('button.new') }}</a-button>
<a-button v-has="'agvTask:export'" type="primary" icon="download" @click="handleExportXls('AGV任务')">{{ $t('button.export') }}</a-button>
<a-upload v-has="'agvTask:import'" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">{{ $t('button.import') }}</a-button>
<j-super-query :fieldList="superFieldList" v-has="'taskHeader:superQuery'" @handleSuperQuery="handleSuperQuery"/>
|
|
55
|
</a-upload>
|
|
56
57
|
<!-- <a-dropdown v-if="selectedRowKeys.length > 0">-->
<!-- <a-menu slot="overlay">-->
|
|
58
|
<!-- <a-menu-item key="1" v-has="'agvTask:delete'" @click="batchDel"><a-icon type="delete"/>{{$t('button.delete')}}</a-menu-item>-->
|
|
59
|
<!-- </a-menu>-->
|
|
60
|
<!-- <a-button style="margin-left: 8px">{{$t('button.multiSelectActions')}} <a-icon type="down" /></a-button>-->
|
|
61
|
<!-- </a-dropdown>-->
|
|
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
</div>
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
|
|
79
80
81
82
83
84
85
|
<span slot="status_dictText" slot-scope="status_dictText">
<a-tag :key="status_dictText" :color="getStatusColor(status_dictText)">
{{ status_dictText }}
</a-tag>
</span>
|
|
86
|
<span slot="action" slot-scope="text, record">
|
|
87
88
|
<a v-if="record.status == 1" v-has="'agvTask:executeTask'" @click="executeAgvTask(record)">
<a-button type="primary">执行</a-button><a-divider type="vertical"/></a>
|
|
89
|
<a-popconfirm v-if="record.status < 100" :title="$t('button.deletingIt')" v-has="'agvTask:delete'"
|
|
90
|
@confirm="() => handleDelete(record.id)">
|
|
91
|
<a><a-button type="danger">{{$t('button.cancel')}}</a-button><a-divider type="vertical"/></a>
|
|
92
|
</a-popconfirm>
|
|
93
|
<a-dropdown>
|
|
94
|
<a class="ant-dropdown-link">{{$t('button.more')}} <a-icon type="down"/></a>
|
|
95
96
|
<a-menu slot="overlay">
<a-menu-item>
|
|
97
|
<a @click="handleDetail(record)">{{$t('button.details')}}</a>
|
|
98
|
</a-menu-item>
|
|
99
|
<a-menu-item v-has="'agvTask:edit'">
|
|
100
|
<a @click="handleEdit(record)">{{$t('button.edit')}}</a>
|
|
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<agv-task-modal ref="modalForm" @ok="modalFormOk"></agv-task-modal>
</a-card>
</template>
<script>
|
|
115
116
117
118
119
120
121
|
import '@/assets/less/TableExpand.less'
import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import AgvTaskModal from './modules/AgvTaskModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
import {executeAgv} from '@/api/api'
import {completeAgv, cancelAgv} from '@/api/api'
|
|
122
|
import { translateResultMessage } from '@/api/api'
|
|
123
|
|
|
124
125
126
127
128
129
130
131
132
|
export default {
name: 'AgvTaskList',
mixins: [JeecgListMixin, mixinDevice],
components: {
AgvTaskModal
},
data() {
return {
description: 'AGV任务管理页面',
|
|
133
|
firstLoad:0,
|
|
134
135
136
137
138
139
140
|
isorter: {
column: 'status',
order: 'asc',
},
// 表头
columns: [
{
|
|
141
|
title: 'ID',
|
|
142
143
144
|
align: "center",
dataIndex: 'id',
sorter: true,
|
|
145
|
},
|
|
146
|
{
|
|
147
|
title: this.$t('task.taskType'),
|
|
148
|
align: "center",
|
|
149
|
dataIndex: 'taskType_dictText',
|
|
150
|
scopedSlots: {customRender: 'taskType_dictText'},
|
|
151
|
},
|
|
152
|
{
|
|
153
|
title: this.$t('task.containerCode'),
|
|
154
155
156
157
|
align: "center",
dataIndex: 'containerCode'
},
{
|
|
158
|
title: this.$t('task.carNo'),
|
|
159
160
161
162
|
align: "center",
dataIndex: 'carno'
},
{
|
|
163
|
title: this.$t('task.priority'),
|
|
164
165
166
167
|
align: "center",
dataIndex: 'priority'
},
{
|
|
168
|
title: this.$t('task.taskStatus'),
|
|
169
170
|
align: "center",
dataIndex: 'status_dictText',
|
|
171
|
scopedSlots: {customRender: 'status_dictText'},
|
|
172
173
|
},
{
|
|
174
|
title: this.$t('task.fromStationCode'),
|
|
175
176
177
178
|
align: "center",
dataIndex: 'fromPort'
},
{
|
|
179
|
title: this.$t('task.toStationCode'),
|
|
180
181
182
183
|
align: "center",
dataIndex: 'toPort'
},
{
|
|
184
|
title: this.$t('system.createBy'),
|
|
185
186
187
188
|
align: "center",
dataIndex: 'createBy'
},
{
|
|
189
|
title: this.$t('system.createTime'),
|
|
190
191
192
193
|
align: "center",
dataIndex: 'createTime'
},
{
|
|
194
|
title: this.$t('system.updater'),
|
|
195
196
197
198
|
align: "center",
dataIndex: 'updateBy'
},
{
|
|
199
|
title: this.$t('system.updateTime'),
|
|
200
201
202
203
|
align: "center",
dataIndex: 'updateTime'
},
{
|
|
204
|
title: this.$t('system.options'),
|
|
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
|
dataIndex: 'action',
align: "center",
fixed: "right",
width: 147,
scopedSlots: {customRender: 'action'}
}
],
url: {
list: "/task/agvTask/list",
delete: "/task/agvTask/delete",
deleteBatch: "/task/agvTask/deleteBatch",
exportXlsUrl: "/task/agvTask/exportXls",
importExcelUrl: "task/agvTask/importExcel",
},
dictOptions: {},
superFieldList: [],
}
},
created() {
|
|
225
|
this.getSuperFieldList();
|
|
226
|
},
|
|
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
|
mounted() {
if(this.firstLoad == 0) {
this.firstLoad = 1;
return;
}
//页面没加载完,此时methods里的方法找不到,使用定时器模拟点击
let timeSearch=setInterval(()=>{
let eleSearch= document.getElementById("search");
if (eleSearch!=null){
//调用成功,清除定时器
clearInterval(timeSearch)
eleSearch.click();
}
},200)
},
|
|
242
243
244
|
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
|
|
245
|
},
|
|
246
247
|
},
methods: {
|
|
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
|
handleTableChange(pagination, filters, sorter) {
//分页、排序、筛选变化时触发
if (Object.keys(sorter).length > 0) {
this.isorter.column = sorter.field;
this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
}
//这种筛选方式只支持单选
if (filters && Object.keys(filters).length > 0 && filters.taskType_dictText) {
this.filters.taskType = filters.taskType_dictText[0];
}
if (filters && Object.keys(filters).length > 0 && filters.status_dictText) {
this.filters.status = filters.status_dictText[0];
}
this.ipagination = pagination;
this.loadData();
},
|
|
264
265
266
267
268
269
270
|
getStatusColor(status) {
const colors = {
'生成任务': 'green',
'下发任务': 'blue',
'开始执行': 'orange',
'取货完成': 'purple',
'任务完成': 'grey',
|
|
271
|
default: 'blue'
|
|
272
273
|
};
return colors[status] || colors.default;
|
|
274
|
},
|
|
275
276
277
278
279
280
281
282
|
initDictConfig() {
},
executeAgvTask(record) {
this.loading = true;
this.model = Object.assign({}, record);
executeAgv(this.model.id).then((res) => {
this.loading = false;
if (res.success) {
|
|
283
|
this.$message.success(translateResultMessage(res, res.message))
|
|
284
|
} else {
|
|
285
|
this.$message.error(translateResultMessage(res, res.message))
|
|
286
287
288
289
290
291
292
293
294
295
|
}
this.searchQuery();
});
},
completeAgvTask(record) {
this.loading = true;
this.model = Object.assign({}, record);
completeAgv(this.model.id).then((res) => {
this.loading = false;
if (res.success) {
|
|
296
|
this.$message.success(translateResultMessage(res, res.message))
|
|
297
|
} else {
|
|
298
|
this.$message.error(translateResultMessage(res, res.message))
|
|
299
300
301
302
303
304
305
306
307
308
|
}
this.searchQuery();
});
},
cancelAgvTask(record) {
this.loading = true;
this.model = Object.assign({}, record);
cancelAgv(this.model.id).then((res) => {
this.loading = false;
if (res.success) {
|
|
309
|
this.$message.success(translateResultMessage(res, res.message))
|
|
310
|
} else {
|
|
311
|
this.$message.error(translateResultMessage(res, res.message))
|
|
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
|
}
this.searchQuery();
});
},
getSuperFieldList() {
let fieldList = [];
fieldList.push({type: 'string', value: 'warehouseCode', text: '仓库编码', dictCode: ''})
fieldList.push({type: 'string', value: 'zoneCode', text: '库区', dictCode: ''})
fieldList.push({type: 'int', value: 'taskType', text: '任务类型', dictCode: 'agv_task_type'})
fieldList.push({type: 'string', value: 'containerCode', text: '容器编码', dictCode: ''})
fieldList.push({type: 'string', value: 'carno', text: '小车编码', dictCode: ''})
fieldList.push({type: 'int', value: 'priority', text: '优先级', dictCode: ''})
fieldList.push({type: 'int', value: 'status', text: '状态', dictCode: 'agv_task_status'})
fieldList.push({type: 'string', value: 'fromPort', text: '起始点位', dictCode: ''})
fieldList.push({type: 'string', value: 'toPort', text: '目标点位', dictCode: ''})
fieldList.push({type: 'string', value: 'createBy', text: '创建人', dictCode: ''})
fieldList.push({type: 'datetime', value: 'createTime', text: '创建日期'})
fieldList.push({type: 'string', value: 'updateBy', text: '更新人', dictCode: ''})
fieldList.push({type: 'datetime', value: 'updateTime', text: '更新日期'})
this.superFieldList = fieldList
|
|
332
333
|
}
}
|
|
334
|
}
|
|
335
336
|
</script>
<style scoped>
|
|
337
|
@import '~@assets/less/common.less';
|
|
338
|
</style>
|