PurchaseProgress.vue
2.14 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
<!--
* @Description:
* @Author: huyue
* @Date: 2023-07-07 17:34:48
* @LastEditors: huyue
* @LastEditTime: 2023-07-17 14:29:07
-->
<template>
<div class="purchase-progress-box">
<box-title title="商城采购进度分析"></box-title>
<RightViewContent v-if="progressData.length" class="content-box" :chart="progressChart" :listData="progressData" :legentList="progressLegend" :legendColors="progressChart.colors"></RightViewContent>
<div v-else class="empty">
<Empty></Empty>
</div>
</div>
</template>
<script>
import RightViewContent from './RightViewContent.vue'
import { changeMixin } from '@/mixins'
export default {
name: 'PurchaseProgress',
mixins: [changeMixin],
components: {
RightViewContent
},
data() {
return {
// 采购进度饼图结构
progressChart: {
id: 'progress',
keys: ['progress', 'purchaseamount'],
height: '16.34vh',
colors: ['#4FA0FF', '#7CFFB2', '#FDF006']
},
// 采购进度数据
progressData: [],
progressLegend: [
{
name: 'progress',
width: '5vw'
},
{
name: 'rate',
type: 'decimal',
width: '2.4vw'
},
{
name: 'purchaseamount',
hasIcon: '¥',
type: 'number',
width: '5.5vw'
}
]
}
},
mounted() {},
methods: {
init() {
this.getBugProgress()
},
// 获取商品采购进度占比
getBugProgress() {
this.api.solar.getBugProgress({ year: this.$store.state.app.solarYear }).then(res => {
if (!res.code === '0') {
this.openMessage('获取采购进度占比失败')
return
}
this.progressData = res.data.dataList || []
})
}
}
}
</script>
<style lang="scss" scoped>
.purchase-progress-box {
width: 100%;
background: #061422;
box-shadow: inset 0 0 20px 0 #3d57ff69;
height: 25vh;
margin-bottom: 1.78vh;
.content-box {
// padding: 2.78vh 1.39vw 2.78vh 0;
margin-right: 1.54vw;
height: 21.67vh;
}
.empty {
height: 21.67vh;
display: flex;
align-items: center;
}
}
</style>