|
@@ -5,43 +5,52 @@
|
|
|
|
|
|
<script>
|
|
|
import * as echarts from 'echarts'
|
|
|
-// import { cusChart } from '@api/reportForms/order-statistics.js'
|
|
|
+import { cusChart } from '@api/reportForms/order-statistics.js'
|
|
|
|
|
|
export default {
|
|
|
name: 'DepartmentChart', // 部门统计图
|
|
|
data() {
|
|
|
return {
|
|
|
+ queryParam: {
|
|
|
+ vendorType: '外部',
|
|
|
+ pageNo: '',
|
|
|
+ startYearMonth: '',
|
|
|
+ endYearMonth: '',
|
|
|
+ department: '',
|
|
|
+ customer: ''
|
|
|
+ },
|
|
|
// newData: {
|
|
|
- // departmentArr: [],
|
|
|
- //realQuantityArr: []
|
|
|
- // localMoneyArr: []
|
|
|
+ customerArr: [],
|
|
|
+ realQuantityArr: [],
|
|
|
+ localMoneyArr: []
|
|
|
// }
|
|
|
}
|
|
|
},
|
|
|
|
|
|
mounted() {
|
|
|
- // this.getChartData()
|
|
|
- this.initEcharts()
|
|
|
+ this.getChartData()
|
|
|
+ console.log('客户')
|
|
|
+ // this.initEcharts()
|
|
|
},
|
|
|
methods: {
|
|
|
// 1、先获取 chart 数据
|
|
|
getChartData() {
|
|
|
- // depChart().then(res => {
|
|
|
- // if (res.success) {
|
|
|
- // if (res.result) {
|
|
|
- // res.result.forEach(item => {
|
|
|
- // this.departmentArr.push(item.departmentArr)
|
|
|
- // this.realQuantityArr.push(item.realQuantityArr)
|
|
|
- // this.localMoneyArr.push(item.localMoneyArr)
|
|
|
- // })
|
|
|
- // console.log('返回的数组', this.departmentArr, this.realQuantityArr, this.localMoneyArr)
|
|
|
- // }
|
|
|
- // }
|
|
|
- // //2、执行chart
|
|
|
- // this.$nextTick(() => {
|
|
|
- // this.initEcharts()
|
|
|
- // })
|
|
|
- // })
|
|
|
+ cusChart().then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ if (res.result) {
|
|
|
+ res.result.records.forEach(item => {
|
|
|
+ this.customertArr.push(item.customerArr)
|
|
|
+ this.realQuantityArr.push(item.realQuantityArr)
|
|
|
+ this.localMoneyArr.push(item.localMoneyArr)
|
|
|
+ })
|
|
|
+ console.log('返回的数组', this.customerArr, this.realQuantityArr, this.localMoneyArr)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //2、执行chart
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.initEcharts()
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
initEcharts() {
|
|
@@ -100,8 +109,8 @@ export default {
|
|
|
axisPointer: {
|
|
|
type: 'shadow'
|
|
|
},
|
|
|
- data: ['FD', 'PMK', 'AUCHAN', 'BIOWORLD', 'CB', 'DUNNES', 'EVA-L']
|
|
|
- // data: this.departmentArr
|
|
|
+ // data: ['FD', 'PMK', 'AUCHAN', 'BIOWORLD', 'CB', 'DUNNES', 'EVA-L']
|
|
|
+ data: this.customerArr
|
|
|
},
|
|
|
yAxis: [
|
|
|
{
|
|
@@ -145,8 +154,8 @@ export default {
|
|
|
// }
|
|
|
// },
|
|
|
barWidth: '30%',
|
|
|
- data: [90000, 40000, 87666, 65555, 26347, 87687, 26546]
|
|
|
- // data: this.dyeLossRateArr
|
|
|
+ // data: [90000, 40000, 87666, 65555, 26347, 87687, 26546]
|
|
|
+ data: this.dyeLossRateArr
|
|
|
},
|
|
|
{
|
|
|
name: '本币金额',
|
|
@@ -156,7 +165,8 @@ export default {
|
|
|
// // return value + ' ml'
|
|
|
// }
|
|
|
},
|
|
|
- data: [22443, 68176, 71276, 50176, 70176, 68976, 38276]
|
|
|
+ // data: [22443, 68176, 71276, 50176, 70176, 68976, 38276]
|
|
|
+ data: this.localMoneyArr
|
|
|
}
|
|
|
]
|
|
|
}
|
|
@@ -167,19 +177,19 @@ export default {
|
|
|
myChart.resize()
|
|
|
}
|
|
|
})
|
|
|
- },
|
|
|
+ }
|
|
|
|
|
|
// watch: {
|
|
|
- // 3、监听数据变化
|
|
|
- // newData: {
|
|
|
- // deep: true,
|
|
|
- // handler() {
|
|
|
- // 数据变化,执行
|
|
|
- // const { cvenNameArr, dyeLossRateArr } = this.newData
|
|
|
- // this.initEcharts(cvenNameArr, dyeLossRateArr)
|
|
|
- // console.log('333')
|
|
|
- // }
|
|
|
- // }
|
|
|
+ // 3、监听数据变化
|
|
|
+ // newData: {
|
|
|
+ // deep: true,
|
|
|
+ // handler() {
|
|
|
+ // 数据变化,执行
|
|
|
+ // const { cvenNameArr, dyeLossRateArr } = this.newData
|
|
|
+ // this.initEcharts(cvenNameArr, dyeLossRateArr)
|
|
|
+ // console.log('333')
|
|
|
+ // }
|
|
|
+ // }
|
|
|
// }
|
|
|
}
|
|
|
}
|