clientMixin.js
917 Bytes
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
export default {
data() {
return {
now: new Date().format('yyyy-MM-dd'),
clientData: [],
brandList: [],
distributionRank: ''
}
},
created() {
this.getClientData()
},
methods: {
getClientData() {
const params = {
req: {
corporateGroupName: '集团1',
queryItem: this.type,
// queryTime: this.now,
queryTime: '2022-06-23',
queryType: 0
}
}
this.api.customer.overalldistribution(params).then(res => {
let distribution = JSON.parse(res.data.dataList[0].distribution)
const keys = Object.keys(distribution)
keys.forEach((item, index) => {
this.clientData.push({
name: item,
value: distribution[item]
})
})
this.distributionRank = JSON.parse(res.data.dataList[0].distributionRank)
})
}
}
}