taskModel_host.vue
13.6 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
<template>
<div class="app-container">
<div class="app-container-father">
<div class="dv-container-left">
<div class="dv-container-left-component">
<div class="component-left">任务号:</div>
<div class="component-right">
<el-input v-model="queryConfig.taskNumber" />
</div>
</div>
<div class="dv-container-left-component">
<div class="component-left">远程任务号:</div>
<div class="component-right">
<el-input v-model="queryConfig.remoteTask" />
</div>
</div>
<div class="dv-container-left-component">
<div class="component-left">容器号:</div>
<div class="component-right">
<el-input v-model="queryConfig.barcode" />
</div>
</div>
<div class="dv-container-left-component">
<div class="component-left">起点:</div>
<div class="component-right">
<el-input v-model="queryConfig.from" />
</div>
</div>
<div class="dv-container-left-component">
<div class="component-left">终点:</div>
<div class="component-right">
<el-input v-model="queryConfig.to" />
</div>
</div>
<div class="dv-container-left-component">
<div class="component-left">任务状态:</div>
<div class="component-right">
<el-select v-model="value" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
</div>
<div class="dv-container-left-component">
<div class="component-left">开始时间:</div>
<div class="component-right">
<el-date-picker
v-model="form.startTime"
type="datetime"
placeholder="选择日期时间"
/>
</div>
</div>
<div class="dv-container-left-component">
<div class="component-left">结束时间:</div>
<div class="component-right">
<el-date-picker
v-model="form.endTime"
type="datetime"
placeholder="选择日期时间"
/>
</div>
</div>
<!-- button -->
<div class="button-container">
<el-button class="T1" @click="btnAction()">查询</el-button>
<el-button class="T1" @click="btnAdd()">新增</el-button>
<el-button class="T1">删除</el-button>
</div>
<div class="button-container">
<el-button class="T1">下发</el-button>
<el-button class="T1">导出</el-button>
</div>
<div class="button-containerTwo">
<el-button class="T1" type="danger">强制完成</el-button>
<el-button class="T1" type="warning">维护</el-button>
</div>
</div>
<div class="dv-container-right">
<el-table
v-loading="listLoading"
:data="sysTable"
element-loading-text="Loading"
border
fit
:row-class-name="getRowClassName"
@row-click="handleRowClick"
>
<el-table-column align="center" label="内部ID" width="95">
<template slot-scope="scope">
{{ scope.row.id }}
</template>
</el-table-column>
<el-table-column label="远程任务号">
<template slot-scope="scope">
{{ scope.row.remoteTask }}
</template>
</el-table-column>
<el-table-column label="远程前置任务号">
<template slot-scope="scope">
{{ scope.row.preRemoteTask }}
</template>
</el-table-column>
<el-table-column label="容器号">
<template slot-scope="scope">
{{ scope.row.barcode }}
</template>
</el-table-column>
<el-table-column label="任务类型">
<template slot-scope="scope">
{{ scope.row.type }}
</template>
</el-table-column>
<el-table-column label="任务状态">
<template slot-scope="scope">
{{ scope.row.status }}
</template>
</el-table-column>
<el-table-column label="起点">
<template slot-scope="scope">
{{ scope.row.from }}
</template>
</el-table-column>
<el-table-column label="终点">
<template slot-scope="scope">
{{ scope.row.to }}
</template>
</el-table-column>
<el-table-column label="途径点">
<template slot-scope="scope">
{{ scope.row.approachPoint }}
</template>
</el-table-column>
<el-table-column label="当前节点">
<template slot-scope="scope">
{{ scope.row.current }}
</template>
</el-table-column>
<el-table-column label="优先级">
<template slot-scope="scope">
{{ scope.row.priority }}
</template>
</el-table-column>
<el-table-column label="阶段">
<template slot-scope="scope">
{{ scope.row.mStage }}
</template>
</el-table-column>
<el-table-column label="任务回传">
<template slot-scope="scope">
{{ scope.row.commit }}
</template>
</el-table-column>
<el-table-column label="长">
<template slot-scope="scope">
{{ scope.row.length }}
</template>
</el-table-column>
<el-table-column label="宽">
<template slot-scope="scope">
{{ scope.row.width }}
</template>
</el-table-column>
<el-table-column label="高">
<template slot-scope="scope">
{{ scope.row.height }}
</template>
</el-table-column>
<el-table-column label="重">
<template slot-scope="scope">
{{ scope.row.weight }}
</template>
</el-table-column>
<el-table-column label="货物类型">
<template slot-scope="scope">
{{ scope.row.goodsType }}
</template>
</el-table-column>
<el-table-column label="仓库">
<template slot-scope="scope">
{{ scope.row.warehouseCode }}
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<div class="pagination-container">
<el-pagination
background
layout="prev, pager, next"
:current-page="queryConfig.currentPage"
:page-size="queryConfig.pageSize"
:total="total"
@current-change="handleCurrentChange"
/>
</div>
</div>
<el-dialog title="新增" :visible.sync="dialogFormVisible">
<div class="container">
<div class="box">
<div class="inner-left">任务类型:</div>
<div class="inner-right">
<el-select v-model="elDialog.taskType" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
</div>
<div class="box">
<div class="inner-left">优先级:</div>
<div class="inner-right">
<el-input v-model="elDialog.priority" />
</div>
</div>
<div class="box">
<div class="inner-left">容器号:</div>
<div class="inner-right">
<el-input v-model="elDialog.barcode" />
</div>
</div>
<div class="box">
<div class="inner-left">起点:</div>
<div class="inner-right">
<el-input v-model="elDialog.from" />
</div>
</div>
<div class="box">
<div class="inner-left">途径点:</div>
<div class="inner-right">
<el-input v-model="elDialog.approachPoint" />
</div>
</div>
<div class="box">
<div class="inner-left">终点:</div>
<div class="inner-right">
<el-input v-model="elDialog.to" />
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="dialogFormVisible = false">创 建</el-button>
<el-button @click="dialogFormVisible = false">取 消</el-button>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
import { getHostType, getTableList } from '@/api/table'
export default {
data() {
return {
sysTable: [],
// 查询条件
queryConfig: {
currentPage: 1,
pageSize: 15,
taskNumber: '',
remoteTask: '',
barcode: '',
from: '',
to: ''
},
// 新增条件
elDialog: {
taskType: '',
priority: '',
barcode: '',
from: '',
approachPoint: '',
to: ''
},
total: 0,
listLoading: false,
dialogFormVisible: false,
name: '',
options: [
{
value: '',
label: '全部'
}
],
value: '',
form: {
startTime: this.$moment()
.subtract(7, 'days')
.format('YYYY-MM-DD 00:00:00'),
endTime: this.$moment().add(1, 'days').format('YYYY-MM-DD 23:59:59')
},
selectedRow: null
}
},
created() {
this.fetchData()
this.getTableList()
},
methods: {
btnAction() {
this.getTableList()
},
btnAdd() {
this.dialogFormVisible = true
},
handleRowClick(row) {
this.selectedRow = row // 保存当前行的数据
},
getRowClassName(row) {
return this.selectedRow === row ? 'highlight-row' : '' // 判断当前行是否为选中行
},
// 状态数据
fetchData() {
const params = {
Code: 'MTaskStatus'
}
getHostType(params).then((response) => {
response.data.dictDetails.forEach((x) => {
this.options.push({ value: x.code, label: x.name })
})
})
},
// 表格数据
getTableList() {
const params = {
pageNumber: this.queryConfig.currentPage,
perPageCount: this.queryConfig.pageSize,
queryConfig: {
taskNo: '',
remoteTask: '',
barcode: '',
from: '',
to: '',
taskStatus: '',
begin: this.form.startTime,
end: this.form.endTime
}
}
getTableList(params).then((response) => {
this.total = response.data.totalCount
this.sysTable = response.data.data
})
},
handleCurrentChange(page) {
this.queryConfig.currentPage = page
this.getTableList()
}
}
}
</script>
<style scoped lang="scss">
.app-container-father {
width: 100%;
height: 100%;
margin: 0px;
padding: 0px;
display: flex;
.dv-container-left {
width: 20%;
background-color: #eeeeee;
height: 88vh;
// border-radius: 7px;
box-shadow: 5px 0 10px rgba(0, 0, 0, 0.3);
.dv-container-left-component {
width: 100%;
display: flex;
.component-left {
width: 40%;
height: 60px;
display: flex;
justify-content: flex-end;
align-items: center;
}
.component-right {
width: 57%;
height: 60px;
display: flex;
justify-content: center;
align-items: center;
}
}
.button-container {
width: 90%;
margin: auto;
display: flex;
justify-content: center;
align-items: center;
.T1 {
width: 88px;
margin-top: 10px;
border:1px solid #B3D8FF;
}
}
.button-containerTwo {
width: 90%;
margin: 20px auto;
display: flex;
justify-content: center;
align-items: center;
.T1 {
width: 50%;
font-size: 16px;
margin-top: 10px;
}
}
}
.dv-container-right {
width: 79%;
height: 88vh;
margin-left: 1%;
.pagination-container {
text-align: right; /* 使分页组件靠右 */
margin-top: 20px; /* 添加顶部间距 */
}
}
.container {
width: 100%; /* 大 div 宽度 */
display: flex; /* 使用 Flexbox 布局 */
flex-wrap: wrap; /* 允许换行 */
padding: 10px; /* 内边距 */
box-sizing: border-box; /* 包含内边距在内 */
}
.box {
width: 50%; /* 小 div 宽度为 50% */
height: 50px; /* 小 div 高度 */
margin: 5px 0; /* 上下外边距 */
display: flex; /* 嵌套使用 Flexbox */
}
.inner-left {
width: 40%; /* 内部左侧 div 宽度为 50% */
height: 100%; /* 高度为 100% */
display: flex; /* 使用 Flexbox */
justify-content: flex-end; /* 内容靠右 */
align-items: center; /* 垂直居中 */
padding-right: 5px; /* 右侧内边距 */
}
.inner-right {
width: 50%; /* 内部右侧 div 宽度为 50% */
height: 100%; /* 高度为 100% */
display: flex; /* 使用 Flexbox */
justify-content: flex-start; /* 内容靠左 */
align-items: center; /* 垂直居中 */
padding-left: 5px; /* 左侧内边距 */
}
.highlight-row {
background-color: red !important; /* 高亮当前行 */
color: white; /* 可选:改变字体颜色以提高可读性 */
}
}
</style>