depositDetailDialog.vue
6.11 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
<!-- 激励池明细 -->
<template>
<baseDialog :dialog-config="dialogConfig" :is-show.sync="visible"
@handleClick="handleAddConfirm">
<div class="dialog-content">
<div class="header">
<div class="header-right">
<span>{{ detailInfo.commissionMonthStr }}月提成构成:</span>
<span class="cycle">{{ detailRow.cycle }}</span>
</div>
</div>
<div class="content">
<div class="content-item">
<div class="content-item-header">
<span>{{ detailInfo.merchantName }}</span>
<span>{{ detailInfo.merchantId }}</span>
</div>
<div class="content-item-body" v-if="detailInfo.commissionRecord">
<div class="left-line">
<div class="line" :style="{'top': (48 * (idx + 1) + 63) + 'px'}" v-for="(v, idx) in detailInfo.commissionRecord.allocationDetailList" :key="idx"></div>
</div>
<div class="content-item-body-title">
<span>{{ detailInfo.staffName }} | </span>
<span>{{ detailInfo.sceneType == 1 ? '轻改' : detailInfo.sceneType == 2 ? '会员权益/升级' : '-'}} | </span>
<span>产值贡献{{ detailInfo.totalPrice }}元 | </span>
<span>{{ detailInfo.jobTypeStr }} | </span>
<span>周期渗透率{{ !isEmpty(detailInfo.commissionRecord.penetrationRate) ? `${detailInfo.commissionRecord.penetrationRate}%` : '-' }} | </span>
<span>提成系数{{ !isEmpty(detailInfo.commissionRecord.calculateValue) ? `${detailInfo.commissionRecord.calculateValue}%` : '-' }} | </span>
</div>
<d2-table :hasPage="false"
:tableData="detailInfo.commissionRecord.allocationDetailList"
:table-params="tableParams">
</d2-table>
</div>
<div class="content-item-footer">
<span>激励池实存:</span>
<span class="amount">{{ detailInfo.actualJlcPrice }}元</span>
</div>
</div>
</div>
</div>
</baseDialog>
</template>
<script>
import { getIncentivePoolDetailApi } from '@api/resident'
import { Util } from '@/common/util'
import { staffLevelList } from '@/common/constants'
import { filterStr } from '../../inStoreManage/util.js'
export default {
name: 'DepositDetailDialog',
data() {
return {
dialogConfig: {
title: '激励池明细',
width: '1080px'
},
detailInfo: {
},
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
tableColumns: [
{
label: '分配实体',
prop: 'allocationType',
formatter: (row) => {
return ['个人', '导师', '督导', '激励池'][row.allocationType - 1] || '-'
}
},
{
label: '分配人',
prop: 'staffName'
},
{
label: '比例',
prop: 'commissionRatio',
width: 80,
formatter: (row) => {
return row.commissionRatio ? `${row.commissionRatio}%` : '-'
}
},
{
label: '关联时间',
prop: '',
formatter: (row) => {
return row.startTime && row.endTime ? Util.dateFormate(row.startTime, 'MM月DD日') + '至' + Util.dateFormate(row.endTime, 'MM月DD日') : '-'
}
},
{
label: '应分金额',
prop: 'commissionPrice',
width: 100,
formatter: (row) => {
return row.commissionPrice ? `¥${row.commissionPrice}` : '-'
}
}
]
}
}
},
props: {
depositDetailVisible: {
type: Boolean,
default: false
},
detailRow: {
type: Object,
default: () => ({})
}
},
computed: {
visible: {
get() {
return this.depositDetailVisible
},
set(newVal) {
this.$emit('dialogClose', { flag: newVal, attrName: 'depositDetailVisible' })
}
}
},
mounted() {
this.getIncentivePoolDetail()
},
methods: {
handleAddConfirm() {
this.$emit('dialogClose')
},
isEmpty(data) {
return (data ?? '') === ''
},
getIncentivePoolDetail() {
getIncentivePoolDetailApi({ id: this.detailRow.id }).then(res => {
if (res) {
res.commissionMonthStr = res?.commissionMonth ? res?.commissionMonth.split('-')[1] : '-'
res.jobTypeStr = filterStr(res?.jobType, staffLevelList, res?.hireType)
}
this.detailInfo = res || {}
})
}
}
}
</script>
<style lang="scss" scoped>
.dialog-content{
max-height: calc(68vh - 60px);
overflow: auto;
.header{
height: 40px;
display: flex;
align-items: center;
.header-left{
color: #333333;
font-weight: bold;
margin-right: 24px;
}
.header-right{
color: #333333;
font-weight: 600;
font-size: 14px;
.cycle{
color: #2A58AD;
}
}
}
.content{
.content-item{
.content-item-header{
height: 42px;
line-height: 42px;
background: #F5F7FA;
color: #000000;
padding: 0 16px;
font-weight: bold;
border-bottom: 1px solid #E7E7E7;
}
.content-item-body{
padding: 0 36px;
position: relative;
.left-line{
position: absolute;
left: 15px;
width: 1px;
height: calc(100% - 24px);
background: #E7E7E7;
.line{
width: 21px;
height: 1px;
background: #E7E7E7;
position: absolute;
left: 0;
}
}
.content-item-body-title{
color: #1D1D1D;
padding: 12px 0;
}
::v-deep .el-table th {
background: #F5F7FA;
}
::v-deep .el-table__row{
height: 48px;
}
}
.content-item-footer{
color: #333333;
font-weight: bold;
padding: 16px;
.amount{
font-size: 16px;
color: #2A58AD;
}
}
}
}
}
</style>