Commit 8160387437fca829f30108c37ee21dc2570d5bc6
1 parent
7807abcf
任务状态高亮
Showing
3 changed files
with
242 additions
and
183 deletions
ant-design-vue-jeecg/src/views/system/task/AgvTaskList.vue
... | ... | @@ -49,24 +49,26 @@ |
49 | 49 | <!-- 操作按钮区域 --> |
50 | 50 | <div class="table-operator"> |
51 | 51 | <a-button v-has="'agvTask:add'" @click="handleAdd" type="primary" icon="plus">新增</a-button> |
52 | - <a-button v-has="'agvTask:export'" type="primary" icon="download" @click="handleExportXls('AGV任务')">导出</a-button> | |
53 | - <a-upload v-has="'agvTask:import'" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> | |
52 | + <a-button v-has="'agvTask:export'" type="primary" icon="download" @click="handleExportXls('AGV任务')">导出 | |
53 | + </a-button> | |
54 | + <a-upload v-has="'agvTask:import'" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" | |
55 | + :action="importExcelUrl" @change="handleImportExcel"> | |
54 | 56 | <a-button type="primary" icon="import">导入</a-button> |
55 | 57 | </a-upload> |
56 | -<!-- <a-dropdown v-if="selectedRowKeys.length > 0">--> | |
57 | -<!-- <a-menu slot="overlay">--> | |
58 | -<!-- <a-menu-item key="1" v-has="'agvTask:delete'" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>--> | |
59 | -<!-- </a-menu>--> | |
60 | -<!-- <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>--> | |
61 | -<!-- </a-dropdown>--> | |
58 | + <!-- <a-dropdown v-if="selectedRowKeys.length > 0">--> | |
59 | + <!-- <a-menu slot="overlay">--> | |
60 | + <!-- <a-menu-item key="1" v-has="'agvTask:delete'" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>--> | |
61 | + <!-- </a-menu>--> | |
62 | + <!-- <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>--> | |
63 | + <!-- </a-dropdown>--> | |
62 | 64 | </div> |
63 | 65 | |
64 | 66 | <!-- table区域-begin --> |
65 | 67 | <div> |
66 | -<!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">--> | |
67 | -<!-- <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a> 项--> | |
68 | -<!-- <a style="margin-left: 24px" @click="onClearSelected">清空</a>--> | |
69 | -<!-- </div>--> | |
68 | + <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">--> | |
69 | + <!-- <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a> 项--> | |
70 | + <!-- <a style="margin-left: 24px" @click="onClearSelected">清空</a>--> | |
71 | + <!-- </div>--> | |
70 | 72 | |
71 | 73 | <a-table |
72 | 74 | ref="table" |
... | ... | @@ -81,12 +83,20 @@ |
81 | 83 | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
82 | 84 | class="j-table-force-nowrap" |
83 | 85 | @change="handleTableChange"> |
86 | + | |
87 | + <span slot="status_dictText" slot-scope="status_dictText"> | |
88 | + <a-tag :key="status_dictText" :color="getStatusColor(status_dictText)"> | |
89 | + {{ status_dictText }} | |
90 | + </a-tag> | |
91 | + </span> | |
92 | + | |
84 | 93 | <template slot="htmlSlot" slot-scope="text"> |
85 | 94 | <div v-html="text"></div> |
86 | 95 | </template> |
87 | 96 | <template slot="imgSlot" slot-scope="text"> |
88 | 97 | <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> |
89 | - <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> | |
98 | + <img v-else :src="getImgView(text)" height="25px" alt="" | |
99 | + style="max-width:80px;font-size: 12px;font-style: italic;"/> | |
90 | 100 | </template> |
91 | 101 | <template slot="fileSlot" slot-scope="text"> |
92 | 102 | <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> |
... | ... | @@ -101,12 +111,14 @@ |
101 | 111 | </template> |
102 | 112 | |
103 | 113 | <span slot="action" slot-scope="text, record"> |
104 | - <a v-if="record.status == 1" v-has="'agvTask:executeTask'" @click="executeAgvTask(record)">执行<a-divider type="vertical"/></a> | |
105 | - <a-popconfirm v-if="record.status < 100" title="确定删除吗?" v-has="'agvTask:delete'" @confirm="() => handleDelete(record.id)"> | |
114 | + <a v-if="record.status == 1" v-has="'agvTask:executeTask'" @click="executeAgvTask(record)">执行<a-divider | |
115 | + type="vertical"/></a> | |
116 | + <a-popconfirm v-if="record.status < 100" title="确定删除吗?" v-has="'agvTask:delete'" | |
117 | + @confirm="() => handleDelete(record.id)"> | |
106 | 118 | <a>删除 <a-divider type="vertical"/></a> |
107 | 119 | </a-popconfirm> |
108 | 120 | <a-dropdown> |
109 | - <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> | |
121 | + <a class="ant-dropdown-link">更多 <a-icon type="down"/></a> | |
110 | 122 | <a-menu slot="overlay"> |
111 | 123 | <a-menu-item> |
112 | 124 | <a @click="handleDetail(record)">详情</a> |
... | ... | @@ -127,181 +139,193 @@ |
127 | 139 | |
128 | 140 | <script> |
129 | 141 | |
130 | - import '@/assets/less/TableExpand.less' | |
131 | - import { mixinDevice } from '@/utils/mixin' | |
132 | - import { JeecgListMixin } from '@/mixins/JeecgListMixin' | |
133 | - import AgvTaskModal from './modules/AgvTaskModal' | |
134 | - import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' | |
135 | - import {executeAgv} from '@/api/api' | |
136 | - import {completeAgv, cancelAgv} from '@/api/api' | |
142 | +import '@/assets/less/TableExpand.less' | |
143 | +import {mixinDevice} from '@/utils/mixin' | |
144 | +import {JeecgListMixin} from '@/mixins/JeecgListMixin' | |
145 | +import AgvTaskModal from './modules/AgvTaskModal' | |
146 | +import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' | |
147 | +import {executeAgv} from '@/api/api' | |
148 | +import {completeAgv, cancelAgv} from '@/api/api' | |
137 | 149 | |
138 | - export default { | |
139 | - name: 'AgvTaskList', | |
140 | - mixins:[JeecgListMixin, mixinDevice], | |
141 | - components: { | |
142 | - AgvTaskModal | |
143 | - }, | |
144 | - data () { | |
145 | - return { | |
146 | - description: 'AGV任务管理页面', | |
147 | - isorter: { | |
148 | - column: 'status', | |
149 | - order: 'asc', | |
150 | +export default { | |
151 | + name: 'AgvTaskList', | |
152 | + mixins: [JeecgListMixin, mixinDevice], | |
153 | + components: { | |
154 | + AgvTaskModal | |
155 | + }, | |
156 | + data() { | |
157 | + return { | |
158 | + description: 'AGV任务管理页面', | |
159 | + isorter: { | |
160 | + column: 'status', | |
161 | + order: 'asc', | |
162 | + }, | |
163 | + // 表头 | |
164 | + columns: [ | |
165 | + { | |
166 | + title: '任务ID', | |
167 | + align: "center", | |
168 | + dataIndex: 'id', | |
169 | + sorter: true, | |
150 | 170 | }, |
151 | - // 表头 | |
152 | - columns: [ | |
153 | - { | |
154 | - title: '任务ID', | |
155 | - align: "center", | |
156 | - dataIndex: 'id', | |
157 | - sorter: true, | |
158 | - }, | |
159 | - { | |
160 | - title:'任务类型', | |
161 | - align:"center", | |
162 | - dataIndex: 'taskType_dictText' | |
163 | - }, | |
164 | - { | |
165 | - title:'容器编码', | |
166 | - align:"center", | |
167 | - dataIndex: 'containerCode' | |
168 | - }, | |
169 | - { | |
170 | - title:'小车编码', | |
171 | - align:"center", | |
172 | - dataIndex: 'carno' | |
173 | - }, | |
174 | - { | |
175 | - title:'优先级', | |
176 | - align:"center", | |
177 | - dataIndex: 'priority' | |
178 | - }, | |
179 | - { | |
180 | - title:'状态', | |
181 | - align:"center", | |
182 | - dataIndex: 'status_dictText' | |
183 | - }, | |
184 | - { | |
185 | - title:'起始点位', | |
186 | - align:"center", | |
187 | - dataIndex: 'fromPort' | |
188 | - }, | |
189 | - { | |
190 | - title:'目标点位', | |
191 | - align:"center", | |
192 | - dataIndex: 'toPort' | |
193 | - }, | |
194 | - { | |
195 | - title:'创建人', | |
196 | - align:"center", | |
197 | - dataIndex: 'createBy' | |
198 | - }, | |
199 | - { | |
200 | - title:'创建日期', | |
201 | - align:"center", | |
202 | - dataIndex: 'createTime' | |
203 | - }, | |
204 | - { | |
205 | - title:'更新人', | |
206 | - align:"center", | |
207 | - dataIndex: 'updateBy' | |
208 | - }, | |
209 | - { | |
210 | - title:'更新日期', | |
211 | - align:"center", | |
212 | - dataIndex: 'updateTime' | |
213 | - }, | |
214 | - { | |
215 | - title: '操作', | |
216 | - dataIndex: 'action', | |
217 | - align:"center", | |
218 | - fixed:"right", | |
219 | - width:147, | |
220 | - scopedSlots: { customRender: 'action' } | |
221 | - } | |
222 | - ], | |
223 | - url: { | |
224 | - list: "/task/agvTask/list", | |
225 | - delete: "/task/agvTask/delete", | |
226 | - deleteBatch: "/task/agvTask/deleteBatch", | |
227 | - exportXlsUrl: "/task/agvTask/exportXls", | |
228 | - importExcelUrl: "task/agvTask/importExcel", | |
229 | - | |
171 | + { | |
172 | + title: '任务类型', | |
173 | + align: "center", | |
174 | + dataIndex: 'taskType_dictText' | |
230 | 175 | }, |
231 | - dictOptions:{}, | |
232 | - superFieldList:[], | |
233 | - } | |
234 | - }, | |
235 | - created() { | |
176 | + { | |
177 | + title: '容器编码', | |
178 | + align: "center", | |
179 | + dataIndex: 'containerCode' | |
180 | + }, | |
181 | + { | |
182 | + title: '小车编码', | |
183 | + align: "center", | |
184 | + dataIndex: 'carno' | |
185 | + }, | |
186 | + { | |
187 | + title: '优先级', | |
188 | + align: "center", | |
189 | + dataIndex: 'priority' | |
190 | + }, | |
191 | + { | |
192 | + title: '任务状态', | |
193 | + align: "center", | |
194 | + dataIndex: 'status_dictText', | |
195 | + scopedSlots: {customRender: 'status_dictText'} | |
196 | + }, | |
197 | + { | |
198 | + title: '起始点位', | |
199 | + align: "center", | |
200 | + dataIndex: 'fromPort' | |
201 | + }, | |
202 | + { | |
203 | + title: '目标点位', | |
204 | + align: "center", | |
205 | + dataIndex: 'toPort' | |
206 | + }, | |
207 | + { | |
208 | + title: '创建人', | |
209 | + align: "center", | |
210 | + dataIndex: 'createBy' | |
211 | + }, | |
212 | + { | |
213 | + title: '创建日期', | |
214 | + align: "center", | |
215 | + dataIndex: 'createTime' | |
216 | + }, | |
217 | + { | |
218 | + title: '更新人', | |
219 | + align: "center", | |
220 | + dataIndex: 'updateBy' | |
221 | + }, | |
222 | + { | |
223 | + title: '更新日期', | |
224 | + align: "center", | |
225 | + dataIndex: 'updateTime' | |
226 | + }, | |
227 | + { | |
228 | + title: '操作', | |
229 | + dataIndex: 'action', | |
230 | + align: "center", | |
231 | + fixed: "right", | |
232 | + width: 147, | |
233 | + scopedSlots: {customRender: 'action'} | |
234 | + } | |
235 | + ], | |
236 | + url: { | |
237 | + list: "/task/agvTask/list", | |
238 | + delete: "/task/agvTask/delete", | |
239 | + deleteBatch: "/task/agvTask/deleteBatch", | |
240 | + exportXlsUrl: "/task/agvTask/exportXls", | |
241 | + importExcelUrl: "task/agvTask/importExcel", | |
242 | + | |
243 | + }, | |
244 | + dictOptions: {}, | |
245 | + superFieldList: [], | |
246 | + } | |
247 | + }, | |
248 | + created() { | |
236 | 249 | this.getSuperFieldList(); |
250 | + }, | |
251 | + computed: { | |
252 | + importExcelUrl: function () { | |
253 | + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; | |
237 | 254 | }, |
238 | - computed: { | |
239 | - importExcelUrl: function(){ | |
240 | - return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; | |
241 | - }, | |
255 | + }, | |
256 | + methods: { | |
257 | + getStatusColor(status) { | |
258 | + const colors = { | |
259 | + '生成任务': 'green', | |
260 | + '下发任务': 'blue', | |
261 | + '开始执行': 'orange', | |
262 | + '取货完成': 'purple', | |
263 | + '任务完成': 'grey', | |
264 | + default: 'default' | |
265 | + }; | |
266 | + return colors[status] || colors.default; | |
242 | 267 | }, |
243 | - methods: { | |
244 | - initDictConfig(){ | |
245 | - }, | |
246 | - executeAgvTask(record) { | |
247 | - this.loading = true; | |
248 | - this.model = Object.assign({}, record); | |
249 | - executeAgv(this.model.id).then((res) => { | |
250 | - this.loading = false; | |
251 | - if (res.success) { | |
252 | - this.$message.success(res.message); | |
253 | - } else { | |
254 | - this.$message.error(res.message); | |
255 | - } | |
256 | - this.searchQuery(); | |
257 | - }); | |
258 | - }, | |
259 | - completeAgvTask(record) { | |
260 | - this.loading = true; | |
261 | - this.model = Object.assign({}, record); | |
262 | - completeAgv(this.model.id).then((res) => { | |
263 | - this.loading = false; | |
264 | - if (res.success) { | |
265 | - this.$message.success(res.message); | |
266 | - } else { | |
267 | - this.$message.error(res.message); | |
268 | - } | |
269 | - this.searchQuery(); | |
270 | - }); | |
271 | - }, | |
272 | - cancelAgvTask(record) { | |
273 | - this.loading = true; | |
274 | - this.model = Object.assign({}, record); | |
275 | - cancelAgv(this.model.id).then((res) => { | |
276 | - this.loading = false; | |
277 | - if (res.success) { | |
278 | - this.$message.success(res.message); | |
279 | - } else { | |
280 | - this.$message.error(res.message); | |
281 | - } | |
282 | - this.searchQuery(); | |
283 | - }); | |
284 | - }, | |
285 | - getSuperFieldList(){ | |
286 | - let fieldList=[]; | |
287 | - fieldList.push({type:'string',value:'warehouseCode',text:'仓库编码',dictCode:''}) | |
288 | - fieldList.push({type:'string',value:'zoneCode',text:'库区',dictCode:''}) | |
289 | - fieldList.push({type:'int',value:'taskType',text:'任务类型',dictCode:'agv_task_type'}) | |
290 | - fieldList.push({type:'string',value:'containerCode',text:'容器编码',dictCode:''}) | |
291 | - fieldList.push({type:'string',value:'carno',text:'小车编码',dictCode:''}) | |
292 | - fieldList.push({type:'int',value:'priority',text:'优先级',dictCode:''}) | |
293 | - fieldList.push({type:'int',value:'status',text:'状态',dictCode:'agv_task_status'}) | |
294 | - fieldList.push({type:'string',value:'fromPort',text:'起始点位',dictCode:''}) | |
295 | - fieldList.push({type:'string',value:'toPort',text:'目标点位',dictCode:''}) | |
296 | - fieldList.push({type:'string',value:'createBy',text:'创建人',dictCode:''}) | |
297 | - fieldList.push({type:'datetime',value:'createTime',text:'创建日期'}) | |
298 | - fieldList.push({type:'string',value:'updateBy',text:'更新人',dictCode:''}) | |
299 | - fieldList.push({type:'datetime',value:'updateTime',text:'更新日期'}) | |
300 | - this.superFieldList = fieldList | |
301 | - } | |
268 | + initDictConfig() { | |
269 | + }, | |
270 | + executeAgvTask(record) { | |
271 | + this.loading = true; | |
272 | + this.model = Object.assign({}, record); | |
273 | + executeAgv(this.model.id).then((res) => { | |
274 | + this.loading = false; | |
275 | + if (res.success) { | |
276 | + this.$message.success(res.message); | |
277 | + } else { | |
278 | + this.$message.error(res.message); | |
279 | + } | |
280 | + this.searchQuery(); | |
281 | + }); | |
282 | + }, | |
283 | + completeAgvTask(record) { | |
284 | + this.loading = true; | |
285 | + this.model = Object.assign({}, record); | |
286 | + completeAgv(this.model.id).then((res) => { | |
287 | + this.loading = false; | |
288 | + if (res.success) { | |
289 | + this.$message.success(res.message); | |
290 | + } else { | |
291 | + this.$message.error(res.message); | |
292 | + } | |
293 | + this.searchQuery(); | |
294 | + }); | |
295 | + }, | |
296 | + cancelAgvTask(record) { | |
297 | + this.loading = true; | |
298 | + this.model = Object.assign({}, record); | |
299 | + cancelAgv(this.model.id).then((res) => { | |
300 | + this.loading = false; | |
301 | + if (res.success) { | |
302 | + this.$message.success(res.message); | |
303 | + } else { | |
304 | + this.$message.error(res.message); | |
305 | + } | |
306 | + this.searchQuery(); | |
307 | + }); | |
308 | + }, | |
309 | + getSuperFieldList() { | |
310 | + let fieldList = []; | |
311 | + fieldList.push({type: 'string', value: 'warehouseCode', text: '仓库编码', dictCode: ''}) | |
312 | + fieldList.push({type: 'string', value: 'zoneCode', text: '库区', dictCode: ''}) | |
313 | + fieldList.push({type: 'int', value: 'taskType', text: '任务类型', dictCode: 'agv_task_type'}) | |
314 | + fieldList.push({type: 'string', value: 'containerCode', text: '容器编码', dictCode: ''}) | |
315 | + fieldList.push({type: 'string', value: 'carno', text: '小车编码', dictCode: ''}) | |
316 | + fieldList.push({type: 'int', value: 'priority', text: '优先级', dictCode: ''}) | |
317 | + fieldList.push({type: 'int', value: 'status', text: '状态', dictCode: 'agv_task_status'}) | |
318 | + fieldList.push({type: 'string', value: 'fromPort', text: '起始点位', dictCode: ''}) | |
319 | + fieldList.push({type: 'string', value: 'toPort', text: '目标点位', dictCode: ''}) | |
320 | + fieldList.push({type: 'string', value: 'createBy', text: '创建人', dictCode: ''}) | |
321 | + fieldList.push({type: 'datetime', value: 'createTime', text: '创建日期'}) | |
322 | + fieldList.push({type: 'string', value: 'updateBy', text: '更新人', dictCode: ''}) | |
323 | + fieldList.push({type: 'datetime', value: 'updateTime', text: '更新日期'}) | |
324 | + this.superFieldList = fieldList | |
302 | 325 | } |
303 | 326 | } |
327 | +} | |
304 | 328 | </script> |
305 | 329 | <style scoped> |
306 | - @import '~@assets/less/common.less'; | |
330 | +@import '~@assets/less/common.less'; | |
307 | 331 | </style> |
308 | 332 | \ No newline at end of file |
... | ... |
ant-design-vue-jeecg/src/views/system/task/CircleTaskHeaderList.vue
... | ... | @@ -113,6 +113,13 @@ |
113 | 113 | :customRow="clickThenSelect" |
114 | 114 | @change="handleTableChange"> |
115 | 115 | |
116 | + | |
117 | + <span slot="status_dictText" slot-scope="status_dictText"> | |
118 | + <a-tag :key="status_dictText" :color="getStatusColor(status_dictText)"> | |
119 | + {{ status_dictText }} | |
120 | + </a-tag> | |
121 | + </span> | |
122 | + | |
116 | 123 | <span slot="zoneCode" slot-scope="zoneCode"> |
117 | 124 | <a-tag :key="zoneCode" color=blue> |
118 | 125 | {{ solutionZoneCode(zoneCode) }} |
... | ... | @@ -240,6 +247,7 @@ export default { |
240 | 247 | title: '任务状态', |
241 | 248 | align: "center", |
242 | 249 | dataIndex: 'status_dictText', |
250 | + scopedSlots: {customRender: 'status_dictText'} | |
243 | 251 | }, |
244 | 252 | { |
245 | 253 | title: '异常信息', |
... | ... | @@ -314,6 +322,16 @@ export default { |
314 | 322 | } |
315 | 323 | }, |
316 | 324 | methods: { |
325 | + getStatusColor(status) { | |
326 | + const colors = { | |
327 | + '生成任务': 'green', | |
328 | + '下发任务': 'blue', | |
329 | + '到达拣选站台': 'orange', | |
330 | + '任务完成': 'grey', | |
331 | + default: 'default' | |
332 | + }; | |
333 | + return colors[status] || colors.default; | |
334 | + }, | |
317 | 335 | initDictConfig() { |
318 | 336 | }, |
319 | 337 | clickThenSelect(record) { |
... | ... |
ant-design-vue-jeecg/src/views/system/task/TransferTaskHeaderList.vue
... | ... | @@ -113,6 +113,12 @@ |
113 | 113 | :customRow="clickThenSelect" |
114 | 114 | @change="handleTableChange"> |
115 | 115 | |
116 | + <span slot="status_dictText" slot-scope="status_dictText"> | |
117 | + <a-tag :key="status_dictText" :color="getStatusColor(status_dictText)"> | |
118 | + {{ status_dictText }} | |
119 | + </a-tag> | |
120 | + </span> | |
121 | + | |
116 | 122 | <span slot="zoneCode" slot-scope="zoneCode"> |
117 | 123 | <a-tag :key="zoneCode" color=blue> |
118 | 124 | {{ solutionZoneCode(zoneCode) }} |
... | ... | @@ -247,6 +253,7 @@ export default { |
247 | 253 | title: '任务状态', |
248 | 254 | align: "center", |
249 | 255 | dataIndex: 'status_dictText', |
256 | + scopedSlots: {customRender: 'status_dictText'} | |
250 | 257 | }, |
251 | 258 | { |
252 | 259 | title: '异常信息', |
... | ... | @@ -321,6 +328,16 @@ export default { |
321 | 328 | } |
322 | 329 | }, |
323 | 330 | methods: { |
331 | + getStatusColor(status) { | |
332 | + const colors = { | |
333 | + '生成任务': 'green', | |
334 | + '下发任务': 'blue', | |
335 | + '到达拣选站台': 'orange', | |
336 | + '任务完成': 'grey', | |
337 | + default: 'default' | |
338 | + }; | |
339 | + return colors[status] || colors.default; | |
340 | + }, | |
324 | 341 | initDictConfig() { |
325 | 342 | }, |
326 | 343 | clickThenSelect(record) { |
... | ... |