Ranking.vue
3.96 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
<template>
<div class="ranking-wrap" v-if="fastData.length > 0">
<template v-for="item in fastData">
<div class="ranking-line flex" :key="item.icon">
<div :class="['sprite-icon', ' icon-' + item.icon]"></div>
<div class="small-text">
{{ item.text }}
<template v-if="item.info">
<span>{{ item.info }}</span>
</template>
<template v-else>
<span>{{ item.value(reportData) }}</span>
</template>
</div>
</div>
</template>
</div>
</template>
<script type='text/ecmascript-6'>
import { mapState } from 'vuex'
export default {
name: 'Ranking',
data() {
return {
fastData: []
}
},
mounted() {},
computed: {
...mapState({
reportData: state => state.report.reportData,
tabIndex: state => state.report.tabIndex,
userInfo: state => state.report.userInfo
})
},
watch: {
reportData() {
this.initFastData()
}
},
methods: {
initFastData() {
let {
userInfo: { accountLevel }
} = this
this.fastData = []
let text = '-'
if (this.tabIndex == 1) {
//增长速度最快业务1商城订单2直播订单3活动订单4会员套餐5精品升级6权益提单
let { fastOrderSource } = this.reportData
if (fastOrderSource) {
text =
fastOrderSource == 7
? '商城订单'
: fastOrderSource == 2
? '直播订单'
: fastOrderSource == 3
? '活动订单'
: fastOrderSource == 4
? '门店服务套餐'
: fastOrderSource == 5
? '精品升级'
: '权益提单'
}
// console.log(fastOrderSource)
// console.log(text)
if (accountLevel !== 4) {
this.fastData.push(
{ text: '增长速度最快的业务:', info: text, icon: 'rank' },
{
text: '产值排行榜冠军店:',
value: obj => {
return obj.mostProductionValueMerchantName ? obj.mostProductionValueMerchantName : '-'
},
icon: 'helmet'
}
)
} else {
this.fastData.push({ text: '增长速度最快的业务:', info: text, icon: 'masonry' })
}
} else {
if (accountLevel !== 4) {
this.fastData.push(
{
text: '企微客户占比最高的门店:',
value: obj => {
return obj.newlyQyHighestRatioMerchant ? obj.newlyQyHighestRatioMerchant : '-'
},
icon: 'proportion'
},
{
text: '企微增长速度最快的门店:',
value: obj => {
return obj.newlyQyFastestGrowthMerchant ? obj.newlyQyFastestGrowthMerchant : '-'
},
icon: 'speed'
},
{
text: '企微客户数最多的门店:',
value: obj => {
return obj.newlyQyMostMerchant ? obj.newlyQyMostMerchant : '-'
},
icon: 'client'
}
)
} else {
this.fastData.push({
text: '企业微信客户占比:',
value: obj => {
return obj.qyCustomerRatio ? (obj.qyCustomerRatio * 100).toFixed(0) + '%' : '-'
},
icon: 'qycustomer'
})
}
}
}
}
}
</script>
<style lang='scss'>
.ranking-wrap {
width: 345px;
height: auto;
background: #ffffff;
box-shadow: 0px 5px 8px 0px rgba(182, 188, 197, 0.15);
border-radius: 4px;
padding: 0 20px;
box-sizing: border-box;
.ranking-line {
height: 56px;
border-bottom: 1px solid rgba(57, 117, 198, 0.09);
&:last-child {
border-bottom: 1px solid #ffffff;
}
}
.sprite-icon {
margin-right: 10px;
}
.small-text {
color: #666666;
span {
color: #333333;
}
}
}
</style>