record.vue
5.1 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
<template>
<div class="record-layout">
<div class="timeline" v-if="recordList.length">
<div v-for="(item, index) in recordList" :key="index" class="timeline-item">
<!-- 内容 -->
<div class="step">
{{ getStepText(item.status, 'text') }}
<div class="status" :style="{ color: examineStatusClass[item.status] }">
{{ getStepText(item.status, 'status') }}
</div>
<span v-if="item.rejectedStatus">
<span style="display: inline-block; margin: 0 8px;">至</span>
<span>{{ getRejectText(item.rejectedStatus, 'rejectedStatus') }}</span>
</span>
</div>
<div class="details">
<div class="detail-row" v-if="item.rejectCause">
<span>驳回原因:</span>
<span class="word-break">{{
formatOpinionText(
item.rejectCause,
) || "-"
}}</span>
</div>
<div class="detail-row">
<span>审核人:</span>
<span>{{ item.reviewedBy }}</span>
</div>
<div class="detail-row">
<span>审核时间:</span>
<span>{{ item.reviewedDate }}</span>
</div>
<div v-if="item.remark" class="detail-row">
<span>备注:</span>
<span class="remark word-break">{{
formatOpinionText(
item.remark,
) || "-"
}}</span>
</div>
</div>
<!-- 圆点 -->
<div class="dot" v-if="index != 0"></div>
<img class="highlight" v-else src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/equity/highlight.png" />
<!-- 线 -->
<div class="line" v-if="index < recordList.length - 1"></div>
</div>
</div>
<div v-else class="no-data">
<img src="@/assets/images/no-data.png" />
<span class="no-data-text">暂无数据</span>
</div>
</div>
</template>
<script>
import { parseTime } from '@/utils/tools.js'
export default {
name: 'record',
props: {
recordList: {
type: Array,
default: () => ([])
}
},
data() {
return {
statusForShow: {
2: { text: '运营审核', status: '通过' },
4: { text: '运营审核', status: '驳回' },
5: { text: '商务审核', status: '通过' },
6: { text: '商务审核', status: '驳回' },
7: { text: '调拨驳回', status: '驳回' }
},
examineStatusClass: {
2: '#35C376',
4: '#F24724',
5: '#35C376',
6: '#F24724',
7: '#F24724',
8: '#35C376',
9: '#F24724'
},
rejectedForShow: {
1: { rejectedStatus: '调拨商户' },
2: { rejectedStatus: '运营审核' },
3: { rejectedStatus: '商务审核' }
}
}
},
methods: {
formatOpinionText(opinion) {
const s = String(opinion == null ? "-" : opinion);
return s.replace(/\\r\\n/g, "\n").replace(/\\n/g, "\n");
},
getStepText(status, key) {
const mapping = this.statusForShow[status]
return mapping ? mapping[key] : ''
},
getRejectText(status, key) {
const mapping = this.rejectedForShow[status]
return mapping ? mapping[key] : ''
},
formatReviewTime(timestamp) {
if (!timestamp) return '-'
return parseTime(timestamp, '{y}-{m}-{d} {h}:{i}:{s}')
},
// 可添加接口请求逻辑
fetchRecordData() {
// 示例:axios.get('/api/audit/record')
// .then(res => {
// this.recordList = res.data;
// });
}
},
mounted() {
// this.fetchRecordData();
}
}
</script>
<style scoped lang="scss">
.record-layout {
// padding: 0 20px 20px;
.no-data {
display: flex;
flex-direction: column;
align-items: center;
justify-items: center;
img {
width: 72px;
height: 72px;
}
.no-data-text {
color: #999ea8;
font-size: 12px;
}
}
}
.dot {
width: 10px;
height: 10px;
border-radius: 50%;
background: #8eb2fb;
position: absolute;
left: 3px;
top: 9px;
z-index: 99;
}
.highlight {
width: 16px;
height: 16px;
position: absolute;
left: 0px;
top: 4px;
z-index: 99;
}
.line {
position: absolute;
top: 16px;
left: 7.5px;
width: 1.5px;
height: 94%;
background-color: #d6e4ff;
}
.timeline-item {
padding: 4px 0 12px 30px;
font-size: 14px;
position: relative;
}
.step {
font-weight: bold;
color: #333333;
margin-bottom: 8px;
}
.status {
margin-left: 6px;
display: inline-block;
}
.detail-row {
display: flex;
margin-bottom: 8px;
font-size: 14px;
color: #666;
}
.detail-row :nth-child(1) {
display: inline-block;
width: 84px;
color: #999999;
margin-right: 9px;
}
.detail-row :nth-child(2) {
color: #333333;
width: calc(100% - 84px);
}
.word-break {
white-space: pre-wrap;
word-break: break-word;
}
</style>