EquityTop.vue
2.49 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
<template>
<div>
<div class="pie-box">
<TotalBill :totalBillData="numProportion" :totalNum="totalNum"></TotalBill>
<TotalMerchant :totalMerchantData="merProportion" :totalMerchant="totalMerchant"></TotalMerchant>
</div>
<div class="pie-box">
<ActiveMerchant :activeMerchantData="activeMerchantData" :totalActiveMerchant="totalActiveMerchant"></ActiveMerchant>
<InactiveMerchant :inactiveMerchantData="inactiveMerchantData" :totalInactiveMerchant="totalInactiveMerchant"></InactiveMerchant>
</div>
</div>
</template>
<script>
import TotalBill from './components/TotalBill.vue'
import TotalMerchant from './components/TotalMerchant.vue'
import ActiveMerchant from './components/ActiveMerchant.vue'
import InactiveMerchant from './components/InactiveMerchant.vue'
export default {
name: 'EquityTop',
components: {
TotalBill,
TotalMerchant,
ActiveMerchant,
InactiveMerchant
},
data() {
return {
totalNum: 0,
totalMerchant: 0,
totalActiveMerchant: 0,
totalInactiveMerchant: 0,
merProportion: [],
numProportion: [],
activeMerchantData: [],
inactiveMerchantData: [],
month: ''
}
},
created() {
this.$bus.$on('selectMonthChange', val => {
if (val === '全部') val = ''
this.month = val
this.getWholesaleNum()
this.getWholesaleOpenCloseNum()
})
this.getWholesaleNum()
this.getWholesaleOpenCloseNum()
},
mounted() {},
methods: {
async getWholesaleNum() {
const params = {
statMonth: this.month
}
const _result = await this.api.equity.getWholesaleNum(params)
const { merProportion, numProportion, totalNum, totalMerchant } = _result.data.dataList[0]
this.merProportion = merProportion
this.numProportion = numProportion
this.totalNum = totalNum
this.totalMerchant = totalMerchant
},
async getWholesaleOpenCloseNum() {
const params = {
statMonth: this.month
}
const _result = await this.api.equity.getWholesaleOpenCloseNum(params)
const { closeProportion, openProportion, closeNum, openNum } = _result.data.dataList[0]
console.log(openNum, closeNum);
this.activeMerchantData = openProportion
this.inactiveMerchantData = closeProportion
this.totalActiveMerchant = openNum
this.totalInactiveMerchant = closeNum
}
}
}
</script>
<style lang="scss" scoped>
.pie-box {
display: flex;
justify-content: space-between;
margin-bottom: 1.78vh;
}
</style>