detail.vue
3.18 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
<template>
<div class="container">
<div class="global-title">任务详情</div>
<div class="main">
<GLTable :pageSizes="pageSizes" ref="tableRef" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn" :getListApi="getListApi">
<div slot="shelfStatusSlot" slot-scope="scope">
<span class="status" :style="{ 'background-color': detailShelfStatusEnum[scope.scope.shelfStatus].color }"></span>
{{ detailShelfStatusEnum[scope.scope.shelfStatus] ? detailShelfStatusEnum[scope.scope.shelfStatus].label : '--' }}
</div>
<div slot="taskStatusSlot" slot-scope="scope">
<span class="status" :style="{ 'background-color': detailTaskStatusEnum[scope.scope.taskStatus].color }"></span>
{{ detailTaskStatusEnum[scope.scope.taskStatus] ? detailTaskStatusEnum[scope.scope.taskStatus].label : '--' }}
</div>
</GLTable>
</div>
</div>
</template>
<script>
import util from '@/util/util'
import { detailShelfStatusEnum, detailTaskStatusEnum } from './constant'
export default {
name: 'index',
data() {
return {
size: 'small',
detailTaskStatusEnum,
detailShelfStatusEnum,
getListApi: this.$apis.task.getDetailApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
pageSizes: [10, 20, 30, 40, 50],
searchForm: {},
tableParams: {
listName: 'list',
tableOption: null,
tableColumns: [
{
label: '门店名称',
prop: 'merchantName',
width: 200,
line: 1
},
{
label: '门店ID',
prop: 'merchantId'
},
{
label: '产品编号',
prop: 'skuCode',
width: 200
},
{
label: '产品名称',
prop: 'skuName',
width: 200,
line: 1
},
{
label: '数量',
prop: 'orderCount'
},
{
label: '单价(元)',
prop: 'unitPrice',
formatter: cell => {
return cell.unitPrice ? (cell.unitPrice / 100).toFixed(0) : 0
}
},
{
label: '商品状态',
addHtml: 'shelfStatusSlot'
},
{
label: '商品状态描述',
prop: 'failReason',
width: 200,
line: 1
},
{
label: '任务状态',
addHtml: 'taskStatusSlot'
},
{
label: '任务状态描述',
prop: 'taskFailReason',
width: 200,
line: 1
}
]
}
}
},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm = { taskId: this.$route.params.id }
resolve()
})
}
}
}
</script>
<style lang="scss" scoped>
.container {
background-color: #fff;
.main {
padding: 20px;
}
}
.status {
width: 6px;
height: 6px;
display: inline-block;
border-radius: 50%;
background-color: antiquewhite;
margin-right: 8px;
vertical-align: middle;
}
</style>