Commit 72476d0b by 王志慧

commit

1 parent 647f59e8
......@@ -6,6 +6,11 @@ const overalldistribution = params => {
return request.get('brand/overalldistribution', params)
}
// 获取门店年龄/性别/购车年限
const merchantOveralldistribution = params => {
return request.get('merchant/overalldistribution', params)
}
export default {
overalldistribution
overalldistribution,
merchantOveralldistribution
}
\ No newline at end of file
// import{changeMixin} from "./changeMixin"
export default {
data() {
return {
......@@ -7,6 +8,7 @@ export default {
distributionRank: ''
}
},
// mixins: [changeMixin],
created() {
this.getClientData()
},
......@@ -32,6 +34,9 @@ export default {
})
this.distributionRank = JSON.parse(res.data.dataList[0].distributionRank)
})
},
init(newVal){
// console.log(newVal,1111111111111111111111111)
}
}
}
......@@ -2,7 +2,9 @@ export default {
data() {
return {
now: new Date().format('yyyy-MM-dd'),
salesData: []
salesData: [],
brandList: [],
typeRanking: ''
}
},
created() {
......@@ -20,18 +22,15 @@ export default {
}
}
this.api.sales.getSales(params).then(res => {
console.log(res,'salesData')
// 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]
// })
// })
// console.log(res.data.dataList[0].distributionRank)
// this.distributionRank = JSON.parse(res.data.dataList[0].distributionRank)
// console.log(this.distributionRank,'this.distributionRank')
let typeNum = JSON.parse(res.data.dataList[0].typeNum)
Object.keys(typeNum).forEach((item, index) => {
this.salesData.push({
name: item,
value: typeNum[item]
})
})
this.typeRanking = JSON.parse(res.data.dataList[0].typeRanking)
})
}
}
......
......@@ -34,7 +34,7 @@ export default {
methods:{
pieAction(data){
this.brandList=Object.keys(this.distributionRank[data.name])
}
},
}
}
</script>
......@@ -12,21 +12,29 @@
<span>客户级别</span>
</div>
<div class="flex container">
<!-- <pie-chart :id="chart.id"></pie-chart> -->
<ran-king></ran-king>
<pie-chart :id="chart.id" :list="salesData" @pieAction="pieAction"></pie-chart>
<ran-king :list="brandList"></ran-king>
</div>
</div>
</template>
<script>
import { salesMixin } from '../../mixins/index'
export default {
name: 'CustomerCategory',
mixins: [salesMixin],
data() {
return {
type: 'customerlevel',
chart: {
id: 'customerCategory-pie'
}
}
},
methods: {
pieAction(data) {
this.brandList = Object.keys(this.typeRanking[data.name])
}
}
}
</script>
......@@ -12,7 +12,7 @@
<span>进店类型</span>
</div>
<div class="container flex">
<!-- <pie-chart :id="chart.id" :list="salesData" @pieAction="pieAction"></pie-chart> -->
<pie-chart :id="chart.id" :list="salesData" @pieAction="pieAction"></pie-chart>
<ran-king :list="brandList"></ran-king>
</div>
</div>
......@@ -26,14 +26,15 @@ export default {
data() {
return {
type: 'entertype',
brandList: [],
chart: {
id: 'enterCategory-pie'
}
}
},
methods: {
pieAction(data) {}
pieAction(data) {
this.brandList=Object.keys(this.typeRanking[data.name])
}
}
}
</script>
......@@ -12,21 +12,29 @@
<span>信息来源</span>
</div>
<div class="container flex">
<!-- <pie-chart :id="chart.id"></pie-chart> -->
<ran-king></ran-king>
<pie-chart :id="chart.id" :list="salesData" @pieAction="pieAction"></pie-chart>
<ran-king :list="brandList"></ran-king>
</div>
</div>
</template>
<script>
import { salesMixin } from '../../mixins/index'
export default {
name: 'InfoFrom',
mixins: [salesMixin],
data() {
return {
type: 'infosource',
chart: {
id: 'infoFrom-pie'
}
}
},
methods: {
pieAction(data) {
this.brandList = Object.keys(this.typeRanking[data.name])
}
}
}
</script>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!