commission-tier-help-preview.vue
7.02 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
<template>
<div class="tier-help-preview">
<div class="tier-help-preview__toolbar">
<span class="tier-help-preview__label">页面效果预览</span>
<el-button type="text" size="small" :disabled="!enabled" @click="dialogVisible = true">
查看弹窗内容
</el-button>
</div>
<div class="phone-mock">
<div class="phone-mock__status">个人中心 · 健康师</div>
<div class="phone-mock__body">
<div class="mock-card">
<div class="mock-card__header">
<div class="mock-card__title">
<span class="mock-card__line"></span>
<span>提成缺口</span>
<i v-if="enabled" class="el-icon-question mock-card__icon"></i>
</div>
<span class="mock-card__action">查看战队 ></span>
</div>
<div class="mock-card__hint">距下一档还差 ¥12,235.30,达成后提成由 3% 升至 4%</div>
<div class="mock-card__grid">
<div class="mock-card__item">
<span class="mock-card__item-label">队开单业绩</span>
<span class="mock-card__item-value">¥23,764.70</span>
</div>
<div class="mock-card__item">
<span class="mock-card__item-label">当前档</span>
<span class="mock-card__item-value">3%</span>
</div>
</div>
</div>
<div v-if="!enabled" class="phone-mock__off-tip">关闭后:问号不显示,员工无法查看档位说明弹窗</div>
</div>
</div>
<el-dialog
title="提成档位说明(弹窗预览)"
:visible.sync="dialogVisible"
width="520px"
append-to-body
custom-class="tier-help-preview-dialog"
>
<div class="tier-dialog">
<p class="tier-dialog__sub">按战队开单业绩合计对照(与算薪一致)</p>
<div
v-for="section in sections"
:key="section.key"
class="tier-section"
:class="{ active: section.key === previewKey }"
>
<div class="tier-section__head">
<span class="tier-section__title">{{ section.title }}</span>
<el-tag v-if="section.key === previewKey" size="mini" type="success">当前适用(示例:单人)</el-tag>
</div>
<p class="tier-section__desc">{{ section.desc }}</p>
<el-table :data="section.rows" size="mini" border class="tier-section__table">
<el-table-column :label="section.leftHeader" prop="threshold" min-width="220" />
<el-table-column label="提成比例" prop="rate" width="100" align="right" />
</el-table>
</div>
</div>
<span slot="footer">
<el-button type="primary" size="small" @click="dialogVisible = false">我知道了</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
const SECTIONS = [
{
key: 'three',
title: '3人及以上战队',
desc: '按战队开单合计直接对照,不按日均折算。',
leftHeader: '战队开单业绩',
rows: [
{ threshold: '≥ 15万元', rate: '7%' },
{ threshold: '≥ 12万元', rate: '6%' },
{ threshold: '≥ 9万元', rate: '5%' },
{ threshold: '≥ 6万元', rate: '4%' },
{ threshold: '≥ 3万元', rate: '3%' },
{ threshold: '< 3万元', rate: '0%' }
]
},
{
key: 'two',
title: '2人战队',
desc: '按战队开单合计直接对照,不按日均折算。',
leftHeader: '战队开单业绩',
rows: [
{ threshold: '≥ 8万元', rate: '6%' },
{ threshold: '≥ 6万元', rate: '5%' },
{ threshold: '≥ 4万元', rate: '4%' },
{ threshold: '≥ 2万元', rate: '3%' },
{ threshold: '< 2万元', rate: '0%' }
]
},
{
key: 'one',
title: '单人(或被剔除出战队)',
desc: '按个人开单业绩对照;实际门槛 = 标准月门槛 ÷ 当月天数 × 在店天数。',
leftHeader: '标准月门槛',
rows: [
{ threshold: '≥ 6万元(按在店天数折算)', rate: '6%' },
{ threshold: '≥ 4万元(按在店天数折算)', rate: '5%' },
{ threshold: '≥ 2万元(按在店天数折算)', rate: '4%' },
{ threshold: '≥ 1万元(按在店天数折算)', rate: '3%' },
{ threshold: '< 1万元(按在店天数折算)', rate: '0%' }
]
}
]
export default {
name: 'CommissionTierHelpPreview',
props: {
enabled: {
type: Boolean,
default: true
}
},
data() {
return {
dialogVisible: false,
sections: SECTIONS,
previewKey: 'one'
}
}
}
</script>
<style lang="scss" scoped>
.tier-help-preview {
margin-top: 16px;
}
.tier-help-preview__toolbar {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
}
.tier-help-preview__label {
font-size: 13px;
color: #606266;
font-weight: 600;
}
.phone-mock {
width: 320px;
border: 1px solid #e4e7ed;
border-radius: 20px;
overflow: hidden;
background: linear-gradient(180deg, #e8f5e9 0%, #f5f7fa 120px);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}
.phone-mock__status {
padding: 10px 16px 6px;
font-size: 12px;
color: #558b2f;
text-align: center;
}
.phone-mock__body {
padding: 0 14px 16px;
}
.mock-card {
background: rgba(255, 255, 255, 0.92);
border-radius: 14px;
padding: 14px;
border: 1px solid rgba(67, 160, 71, 0.12);
}
.mock-card__header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
}
.mock-card__title {
display: flex;
align-items: center;
gap: 6px;
font-size: 14px;
font-weight: 700;
color: #1b5e20;
}
.mock-card__line {
width: 4px;
height: 14px;
border-radius: 2px;
background: #43a047;
}
.mock-card__icon {
color: #43a047;
font-size: 16px;
}
.mock-card__action {
font-size: 12px;
color: #43a047;
}
.mock-card__hint {
font-size: 12px;
color: #667085;
line-height: 1.5;
margin-bottom: 12px;
}
.mock-card__grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
}
.mock-card__item {
background: #f8faf8;
border-radius: 10px;
padding: 10px;
}
.mock-card__item-label {
display: block;
font-size: 11px;
color: #909399;
margin-bottom: 4px;
}
.mock-card__item-value {
font-size: 13px;
font-weight: 700;
color: #2e7d32;
}
.phone-mock__off-tip {
margin-top: 10px;
font-size: 12px;
color: #f56c6c;
text-align: center;
}
.tier-dialog__sub {
margin: 0 0 12px;
font-size: 13px;
color: #909399;
}
.tier-section {
background: #f8faf8;
border: 1px solid #e8f0e9;
border-radius: 8px;
padding: 12px;
margin-bottom: 12px;
}
.tier-section.active {
background: #f1f8e9;
border-color: rgba(67, 160, 71, 0.45);
}
.tier-section__head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
margin-bottom: 6px;
}
.tier-section__title {
font-size: 14px;
font-weight: 700;
color: #303133;
}
.tier-section__desc {
margin: 0 0 10px;
font-size: 12px;
color: #909399;
line-height: 1.5;
}
.tier-section__table {
width: 100%;
}
</style>