explainDialog.vue
6.01 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
<template>
<d2-dialog :title="title" mode="mid" v-if="isVisible" :is-visible.sync="isVisible" width="750px" no-cancel btn-ok-label="关闭" :before-close="handleClose" @confirmDialog="handleConfirm" @closeDialog="handleClose">
<div class="explain-title">示例规则定义</div>
<div v-if="diffExplain == 'performanceConfig'">
<div class="mb10">提成配置中,高产值,成交率以及均客单为联动配置,需请完整填写,无提成时填无,请将此三项全部填无。根据员工每月单店完成(升级订单) 的订单产值累计,匹配符合的奖励规则进行每单奖励计算。</div>
<div v-for="(item, index) in commissionConfigArr" :key="index">
<div>{{ item.title }}</div>
<d2-table :table-data="item.tableData" :table-params="item.tableParams" :has-page="false"></d2-table>
</div>
</div>
<d2-table v-else :table-data="tableData" :table-params="tableParams" :has-page="false"></d2-table>
<template>
<div class="explain-title mt20">示例业务场景</div>
<div class="business-info" v-html="infoHtml"></div>
</template>
</d2-dialog>
</template>
<script>
import { deepClone } from '@/common/util'
export default {
data() {
return {
tableParams: {
tableColumns: [
{
label: '区间开始值/元',
prop: 'startValue'
},
{
label: '区间结束值/元',
prop: 'endValue'
},
{
label: '提成比例',
prop: 'calculateValue'
}
]
},
tableData: [],
commissionConfigArr: [{
title: '高产值比例配置',
name: 'outputBonus',
tableData: [],
tableParams: {}
}, {
title: '成交率系数配置',
name: 'upgradeRateBonus',
tableData: [],
tableParams: {}
}, {
title: '均客单系数配置',
name: 'averagePriceBonus',
tableData: [],
tableParams: {}
}]
}
},
props: {
isExplain: {
type: Boolean,
default: false
},
diffExplain: {
type: String,
default: ''
}
},
computed: {
title() {
const titleObj = {
performanceConfig: '工资绩效示例说明',
tutorBonusConfigs: '导师附加提成示例说明'
}
return titleObj[this.diffExplain]
},
infoHtml() {
const infoObj = {
performanceConfig: `<div class='mb10'>员工A在某个月中单店完成产值20000元,按高产值奖励规则,奖励值落点区间在0-80000,则提成比例为产值4%;根据该员工的当月成交率为45%,均可单价为2000计算,则整体提成系数为0.8*0.8=0.64</div>
<div class='mb10'>汇总计算员工A在该月份获得的提成为=20000*5%*0.8*0.8=640元。</div>`,
tutorBonusConfigs: `<div class='mb10'>1、员工a入职时间为8月18日,对应0-3个月内的导师提成比例为20%,假如第一个月内员工a产生订单产值40000元,根据业绩配置该员工提成为4000元,则其关联导师的导师提成激励为4000*20%=800元,计入次月导师的月份最终工资</div>
<div class='mb10'>2、员工a到11月18日为满三个月,12月份初计算导师提成时,按11.1-11.18的学员提成20%和11.19-11.30的学员提成10%计算为该导师的11月总导师激励提成</div>
<div class='mb10'>3、删除解绑学员时不影响订单提成规则,如8月18日关联导师,8月20日解绑学员时,导师在9月初将计算8.18-8.20该学员的订单提成比例,并入导师提成激励计算到9月初发放的最终工资中。</div>
<div class='mb10'>4、按导师学员的绑定关系计算,区间月份含当月,0即为第一个月份,0-3代表前三个月,4-6代表第四到第六个月整,以此类推</div>`
}
return infoObj[this.diffExplain]
},
isVisible() {
return this.isExplain
}
},
watch: {
diffExplain(newVal) {
if (newVal == 'performanceConfig') {
this.commissionConfigArr.forEach(val => {
val.tableParams = deepClone(this.tableParams)
switch (val.name) {
case 'outputBonus':
val.tableData = [
{ startValue: 0, endValue: 80000, calculateValue: '4%' },
{ startValue: 80000.01, endValue: '--', calculateValue: '5%' }
]
val.tableParams.tableColumns[2].label = '提成比例'
break
case 'upgradeRateBonus':
val.tableData = [
{ startValue: 0, endValue: '50%', calculateValue: 0.8 },
{ startValue: '50.01%', endValue: '55%', calculateValue: 1.0 },
{ startValue: '55.01%', endValue: '100%', calculateValue: 1.1 }
]
val.tableParams.tableColumns[2].label = '提成系数'
break
case 'averagePriceBonus':
val.tableData = [
{ startValue: 0, endValue: 3000, calculateValue: 0.8 },
{ startValue: 3000.01, endValue: '--', calculateValue: 1.0 }
]
val.tableParams.tableColumns[2].label = '提成系数'
break
}
})
} else { // 导师附加提成
this.tableData = [
{ startValue: 0, endValue: 3, calculateValue: '20%' },
{ startValue: 4, endValue: 6, calculateValue: '10%' }
]
this.tableParams.tableColumns[0].label = '区间开始值/月(含当月)'
this.tableParams.tableColumns[1].label = '区间结束值/月'
this.tableParams.tableColumns[2].label = '提成比例'
}
}
},
methods: {
handleConfirm() {
this.$emit('handleClose')
},
handleClose() {
this.$emit('handleClose')
}
}
}
</script>
<style lang="scss">
.explain-title {
font-weight: 600;
font-size: 16px;
color: #333333;
margin-bottom: 10px;
}
.business-info {
font-size: 14px;
color: #333333;
line-height: 18px;
}
.mb10 {
margin-bottom: 10px;
}
.mt20 {
margin-top: 20px;
}
</style>