succeed.vue
8.36 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
<template>
<div class="succeed-container">
<div class="succeed-title flex font-20 color-3 fw5">
<span class="groupName text-hide">{{ groupName }}</span>
<span class="color39 font-16 m-l-8">- {{ customeStatus == 2 ? '成功到店' : '战败分析' }}</span>
</div>
<div class="succeed-content">
<div class="succeed-wrap m-b-16">
<div class="title-info">客户分布</div>
<div class="succeed-wrap-info">
<template v-if="pieData.length > 0">
<pieChart :color="styleColor" id="customerRef" :list="pieData" :centerData="centerData"></pieChart>
</template>
<template v-else>
<empty></empty>
</template>
</div>
</div>
<div class="succeed-wrap m-b-16">
<div class="title-info">跟进频次</div>
<div class="succeed-wrap-frequency flex-between">
<div class="succeed-wrap-frequency-single">
<div class="font-16 color-3 bold line-24">{{ getFollowResultDetail.averageFollows ? getFollowResultDetail.averageFollows : 0 }}次/人</div>
<div class="font-12 color-2f m-t-6 line-18">平均跟进</div>
</div>
<div class="succeed-wrap-frequency-single">
<div class="font-16 color-3 bold line-24">{{ getFollowResultDetail.mostFollows ? getFollowResultDetail.mostFollows : 0 }}次</div>
<div class="font-12 color-2f m-t-6 line-18">最多跟进</div>
</div>
<div class="succeed-wrap-frequency-single">
<div class="font-16 color-3 bold line-24">{{ getFollowResultDetail.leastFollows ? getFollowResultDetail.leastFollows : 0 }}次</div>
<div class="font-12 color-2f m-t-6">最少跟进</div>
</div>
</div>
</div>
<div class="succeed-wrap m-b-16" v-if="customeStatus == 2">
<div class="title-info">
预约与到店
<div class="flex fact-wrap">
<div class="fact flex">
<div class="reserved"></div>
预约到店
</div>
<div class="fact flex m-l-16">
<div class="arrive"></div>
实际到店
</div>
</div>
</div>
<div class="succeed-wrap-order-info">
<template v-if="getFollowResultDetail.appointmentDailyCharts&&getFollowResultDetail.appointmentDailyCharts.length>0">
<lineChart id="orderRef" :lineData="lineData"></lineChart>
</template>
<template v-else>
<empty></empty>
</template>
</div>
</div>
<div class="succeed-wrap m-b-16" v-if="customeStatus == 1 && reasonBar.length">
<div class="title-info">原因统计</div>
<barChart color="#3975C6" id="reasonRef" :list="reasonBar"></barChart>
</div>
<div class="succeed-wrap m-b-16" v-if="markingBar.length">
<div class="title-info">企微营销</div>
<barChart color="#3975C6" id="markingRef" :list="markingBar"></barChart>
</div>
</div>
</div>
</template>
<script>
import { solicitApi } from '@/api'
import pieChart from '../solicit/components/pie.vue'
import lineChart from '../solicit/components/line.vue'
import barChart from '../solicit/components/bar.vue'
export default {
components: {
pieChart,
lineChart,
barChart
},
data() {
return {
styleColor: ['#3975C6', '#FDB757'],
appointmentDailyCharts: '',
pieData: [],
centerData: {},
followList: [],
customeStatus: 1,
getFollowResultDetail: {},
groupId: '',
groupName: '',
reasonBar: [],
markingBar: [],
lineData: []
}
},
created() {
this.followList = this.$constants.FOLLOWLIST
this.customeStatus = this.$route.query.status
this.groupId = this.$route.query.groupId
this.groupName = this.$route.query.groupName
this.getFollowResult()
this.deliveredStatistics()
},
methods: {
deliveredStatistics() {
const { activityId, staffId } = this.$store.state.solicit
var params = {
id: activityId,
groupId: this.groupId,
typeFlag: this.customeStatus,
staffId
}
solicitApi.deliveredStatistics(params).then(res => {
const { delivered, received, undelivered, viewed } = res.data
this.markingBar = [
{ value: +received, text: '已领取' },
{ value: +viewed, text: '已查阅' },
{ value: +delivered, text: '已送达' },
{ value: +undelivered, text: '未送达' }
]
})
},
// 跟进结果-成功到店与战败分析
getFollowResult() {
const { activityId, staffId } = this.$store.state.solicit
var params = {
activityId,
groupId: this.groupId,
customerFollowStatus: this.customeStatus == 2 ? 1 : 0,
staffId
}
solicitApi.getFollowResult(params).then(res => {
this.getFollowResultDetail = res.data
const { joinEntmicroCustomerNums, notYetJoinEntmicroCustomerNums, followResultsAnalyzeVos, appointmentDailyCharts, successDailyCharts } = this.getFollowResultDetail
if (joinEntmicroCustomerNums || notYetJoinEntmicroCustomerNums) {
this.pieData = [
{
const: 'const',
text: ' 企微客户 (人)',
value: joinEntmicroCustomerNums
},
{
const: 'const',
text: '非企微客户 (人)',
value: notYetJoinEntmicroCustomerNums
}
]
this.centerData = {
text: '企微占比',
rate: parseInt((joinEntmicroCustomerNums / (joinEntmicroCustomerNums + notYetJoinEntmicroCustomerNums)) * 100) + '%'
}
}
if (appointmentDailyCharts) {
const appointmentDaily = appointmentDailyCharts.map((item, index) => {
return {
date: item.dailyDate,
value: item.times,
type: '预约到店'
}
})
const successDaily = successDailyCharts.map((item, index) => {
return {
date: item.dailyDate,
value: item.times,
type: '实际到店'
}
})
this.lineData = [...appointmentDaily, ...successDaily]
}
if (followResultsAnalyzeVos) {
const followResultList = window.localStorage.getItem('followResultList') ? JSON.parse(window.localStorage.getItem('followResultList'), '', null) : []
this.reasonBar = followResultsAnalyzeVos.map(item => {
return { value: item.times, text: followResultList.find(follow => follow.dictValue == item.followResult).dictLabel }
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.succeed-container {
.succeed-title {
height: 52px;
background: #ffffff;
box-shadow: 0px 1px 0px 0px #e9e9e9;
padding: 11px 16px;
box-sizing: border-box;
.groupName{
max-width: 200px;
display: inline-block;
}
}
.succeed-content {
padding: 12px;
.succeed-wrap {
background: #fff;
box-shadow: 0px 3px 10px 0px rgba(223, 228, 234, 0.81);
border-radius: 4px;
.title-info {
position: relative;
}
.title-info::before {
content: '';
width: 3px;
height: 14px;
background: #fff;
border-radius: 1.5px;
margin-right: 13px;
display: inline-block;
}
&-order-info {
height: 180px;
box-sizing: border-box;
}
&-info {
height: 160px;
box-sizing: border-box;
}
&-frequency {
padding: 24px 45px;
height: 96px;
box-sizing: border-box;
&-single {
width: auto;
div {
text-align: center;
}
}
}
.fact-wrap {
position: absolute;
right: 16px;
top: 13px;
.fact {
font-size: 12px;
font-weight: 400;
color: rgba(47, 64, 86, 0.7);
line-height: 18px;
}
.reserved {
width: 8px;
height: 3px;
background: #fa7c0b;
border-radius: 2px;
margin-right: 6px;
}
.arrive {
width: 8px;
height: 3px;
background: #3975c6;
border-radius: 2px;
margin-right: 6px;
display: inline-block;
}
}
}
}
}
</style>