Commit 75c12b58 by 胡悦

提交

1 parent 2a9b6e7d
/*
* @Description: 售后数据
* @Author: huyue
* @Date: 2022-06-28 16:55:48
* @LastEditors: huyue
* @LastEditTime: 2022-06-28 19:13:34
*/
import Request from '../request' import Request from '../request'
var request = new Request() var request = new Request()
...@@ -6,4 +13,9 @@ const getAfterSale = params => { ...@@ -6,4 +13,9 @@ const getAfterSale = params => {
return request.get('brand/aftersale', params) return request.get('brand/aftersale', params)
} }
export default { getAfterSale } // 获取品牌售后其他信息
const aftersaleother = params => {
return request.get('brand/aftersaleother', params)
}
export default { getAfterSale, aftersaleother }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2022-06-23 15:05:21 * @Date: 2022-06-23 15:05:21
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2022-06-28 11:40:13 * @LastEditTime: 2022-06-28 19:35:21
--> -->
<template> <template>
<div> <div>
...@@ -25,18 +25,25 @@ export default { ...@@ -25,18 +25,25 @@ export default {
props: ['height'], props: ['height'],
data() { data() {
return { return {
yData: datas.Customer.valueType.value.map(item => item.name) barChart: '',
option: {},
barData: []
} }
}, },
mounted() { mounted() {
this.getChart() this.barChart = echarts.init(document.getElementById('analyzeBar'))
// resize
window.addEventListener('resize', () => {
this.echartsFunnel.resize()
})
this.init()
}, },
methods: { methods: {
init() {
this.getValueType()
},
getChart() { getChart() {
var chartDom = document.getElementById('analyzeBar') this.option = {
var myChart = echarts.init(chartDom)
var option
option = {
grid: { grid: {
left: '3%', left: '3%',
right: '4%', right: '4%',
...@@ -46,7 +53,7 @@ export default { ...@@ -46,7 +53,7 @@ export default {
}, },
yAxis: { yAxis: {
type: 'category', type: 'category',
data: this.yData, data: datas.Customer.valueType.value.map(item => item.name),
splitLine: { splitLine: {
show: false show: false
}, },
...@@ -68,7 +75,8 @@ export default { ...@@ -68,7 +75,8 @@ export default {
}, },
series: [ series: [
{ {
data: [120, 200, 150, 80, 70, 110, 130, 300], // data: [120, 200, 150, 80, 70, 110, 130, 300],
data: this.barData,
type: 'bar', type: 'bar',
barWidth: 12, barWidth: 12,
itemStyle: { itemStyle: {
...@@ -98,7 +106,29 @@ export default { ...@@ -98,7 +106,29 @@ export default {
} }
] ]
} }
option && myChart.setOption(option) this.barChart.setOption(this.option)
},
getValueType() {
const params = {
req: {
corporateGroupName: '集团1',
queryItem: 'valueanalyse',
queryTime: '2022-06-23',
queryType: 0
}
}
this.api.afterSales.aftersaleother(params).then(res => {
console.log(res)
const reqData = JSON.parse(res.data.dataList[0].distribution)
console.log(reqData)
this.barData = []
for (let i in reqData) {
this.barData.push(reqData[i])
}
console.log(this.barData)
this.getChart()
})
} }
} }
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2022-06-23 15:05:21 * @Date: 2022-06-23 15:05:21
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2022-06-28 18:41:37 * @LastEditTime: 2022-06-28 19:10:50
--> -->
<template> <template>
<div class="flow-box"> <div class="flow-box">
...@@ -112,9 +112,9 @@ export default { ...@@ -112,9 +112,9 @@ export default {
}, },
methods: { methods: {
init() { init() {
this.getSaleTrans() this.getSaletTotal()
}, },
getSaleTrans() { getSaletTotal() {
const params = { const params = {
req: { req: {
corporateGroupName: '集团1', corporateGroupName: '集团1',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!