Business.vue
3.31 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
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: huyue
* @LastEditTime: 2023-08-28 10:37:35
* @FilePath: \dj-data-view\src\views\saas\business.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="business-wrap flex">
<div class="business-data">
<!-- <business-view :businessNum="businessNum"></business-view> -->
<StatisticsBox class="business-box" :list="list.slice(0,3)"></StatisticsBox>
<StatisticsBox class="business-box second-box" :list="list.slice(3,5)"></StatisticsBox>
</div>
<div class="business-category">
<Category :categoryData="categoryData"></Category>
</div>
</div>
</template>
<script>
import Category from './Category'
export default {
components: {
Category
},
name: 'Business',
data() {
return {
categoryData: [],
list: [
{
name: '累计展业门店数',
valueName: 'totalNum',
value: 0
},
{
name: '当年新增门店数',
valueName: 'increnum',
value: 0
},
{
name: '客单价',
valueName: 'atv',
value: 0
},
{
name: '当月产值',
valueName: 'outputValuethismonth',
value: 0
},
{
name: '当年产值',
valueName: 'outputValuethisyear',
value: 0
}
]
}
},
created() {
this.getSaasValueaddedTransformationOverview()
},
methods: {
toFixNum(val) {
return (val * 100).toFixed(2) + '%'
},
getSaasValueaddedTransformationOverview() {
this.api.operational.getSaasValueaddedTransformationOverview().then(res => {
if (res.code === '0') {
const _data = res.data.dataList[0]
this.list.forEach(item => {
item.value = _data[item.valueName]
})
this.categoryData = [
{
name: '精品类',
value: _data.equity
},
{
name: '权益类',
value: _data.membrane
},
{
name: '续保类',
value: _data.electronics
}
]
}
})
}
}
}
</script>
<style lang="scss" scoped>
.business-wrap {
height: 14.15vh;
margin: 0.98vh 0.83vw;
// margin-bottom: 0.98vh;
// margin-top: 0.98vh;
justify-content: space-between;
.business-data {
margin-right: 4px;
// margin-top: 0.98vh;
width: 38.06vw;
height: 100%;
/deep/{
.business-box.statistics {
height: 6.83vh;
box-sizing: border-box;
.statistics-item {
margin-right: 0.28vw;
.statistics-top {
.statistics-name {
margin-bottom: 0;
font-size: 12px;
}
.statistics-price-number {
font-size: 24px;
}
}
}
}
}
.second-box {
margin-top: 0.29vh;
}
}
.business-category {
width: 13.89vw;
height: 100%;
}
}
</style>