importDetail.vue
2.72 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
<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="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>
export default {
name: 'index',
data() {
return {
size: 'small',
detailTaskStatusEnum: {
0: {
label: '待执行',
color: '#C6C6C6'
},
2: {
label: '失败',
color: '#EB4E4E'
},
1: {
label: '成功',
color: '#2CCA74'
}
},
getListApi: this.$apis.beforeSale.getTaskDetailListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
pageSizes: [10, 20, 30, 40, 50],
searchForm: {},
tableParams: {
listName: 'list',
tableOption: null,
tableColumns: [
{
label: '门店名称',
prop: 'merchantName',
width: 260,
line: 1
},
{
label: '客户名称',
prop: 'customerName',
width: 200
},
{
label: '车架号',
prop: 'vin',
width: 240,
line: 1
},
{
label: '产品名称',
prop: 'packageName',
width: 280,
line: 1
},
{
label: '服务期限',
prop: 'servicePeriod',
formatter: cell => {
return cell.servicePeriod ? cell.servicePeriod + '年' : '--'
}
},
{
label: '任务状态',
addHtml: 'taskStatusSlot'
},
{
label: '任务状态描述',
prop: 'failReason',
width: 280,
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>