Commit 72476d0b by 王志慧

commit

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