ContentLeft.vue
3.47 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
<!--
* @Description: 1.0 太阳膜左侧内容
* @Author: huyue
* @Date: 2023-07-05 10:35:43
* @LastEditors: huyue
* @LastEditTime: 2023-07-26 17:40:58
-->
<template>
<div class="left">
<StatisticsBox :list="solarList"></StatisticsBox>
<PurchaseTrends></PurchaseTrends>
<div class="left-bottom">
<MerchantTrends class="bottom-trends"></MerchantTrends>
<div class="bottom-storage">
<StorageContent></StorageContent>
</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import PurchaseTrends from './PurchaseTrends.vue'
import MerchantTrends from './MerchantTrends.vue'
import StorageContent from './StorageContent.vue'
import { changeMixin } from '@/mixins'
import { mapActions } from 'vuex'
export default {
name: 'ContentLeft',
components: {
PurchaseTrends,
MerchantTrends,
StorageContent
},
mixins: [changeMixin],
data() {
return {
solarList: [
{
name: '总采购额',
valueName: 'amounttotal',
value: '0',
unit: '¥',
unitType: 'left',
bottomLabel: '本月采购额:',
bottemName: 'amounttotalThismonth',
bottomValue: '0',
bottomType: 'money'
},
{
name: '商城采购额',
valueName: 'amountshop',
value: '0',
unit: '¥',
unitType: 'left',
bottomLabel: '本月采购额:',
bottemName: 'amountshopThismonth',
bottomValue: '0',
rate: '51%',
rateName: 'shopRate',
bottomType: 'money'
},
{
name: '自采采购额',
valueName: 'amountself',
value: '0',
unit: '¥',
unitType: 'left',
bottomLabel: '本月采购额:',
bottemName: 'amountselfThismonth',
bottomValue: '0',
rate: '49%',
rateName: 'selfRate',
bottomType: 'money'
},
{
name: '开通商户数',
valueName: 'opentotal',
value: '0',
bottomLabel: '本月开通商户数:',
bottemName: 'openThismonth',
bottomValue: '0'
},
{
name: '采购商户数',
valueName: 'buytotal',
value: '0',
bottomLabel: '本月采购商户数:',
bottemName: 'buyThismonth',
bottomValue: '0'
}
]
}
},
mounted() {
},
methods: {
...mapActions(['setSolarTime']),
init() {
this.getSolarList()
},
async getSolarList() {
const _data = await this.api.solar.getAllPurchase({ year: this.$store.state.app.solarYear })
const _dataList = _data.data.dataList[0]
this.$bus.$emit('businessstarttime', _dataList.businessstarttime)
this.setSolarTime(_dataList.businessstarttime)
this.solarList.forEach(item => {
item.value = _dataList[item.valueName]
item.bottomValue = _dataList[item.bottemName]
if (item.rateName) item.rate = _dataList[item.rateName]
})
}
}
}
</script>
<style scoped lang='scss'>
.left {
display: flex;
flex-direction: column;
width: 64.17vw;
overflow: hidden;
// background: #091C40;
&-bottom {
display: flex;
.bottom-trends {
width: 43.33vw;
margin-right: 1.11vw;
}
.bottom-storage {
flex: 1;
}
}
}
</style>