瀏覽代碼

报表-订单统计 接口

liangy 3 年之前
父節點
當前提交
38d07814a8

+ 2 - 2
src/api/reportForms/order-statistics.js

@@ -8,6 +8,6 @@ const externalList = params => getAction('/report/soSoDetails/getSO_SOMainReport
 const depChart = params => getAction('/report/soSoDetails/QuerySO_SOMainReportBycustomer', params)
 
 // 外部 客户 统计图
-const cusChart= params => getAction('/report/soSoDetails/QuerySO_SOMainReportBydepartment', params)
+const cusChart = params => getAction('/report/soSoDetails/QuerySO_SOMainReportBydepartment', params)
 
-export { externalList }
+export { externalList, depChart }

+ 48 - 38
src/views/reportForms/order-statistics/chart/external/customerChart.vue

@@ -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')
+    //   }
+    // }
     // }
   }
 }

+ 8 - 9
src/views/reportForms/order-statistics/chart/external/departmentChart.vue

@@ -30,6 +30,7 @@ export default {
 
   mounted() {
     this.getDepChartData()
+    console.log('部门');
     // this.initEcharts()
   },
   methods: {
@@ -37,7 +38,6 @@ export default {
     getDepChartData() {
       depChart(this.queryParam).then(res => {
         if (res.result) {
-          console.log('');
           res.result.records.forEach(item => {
             this.departmentArr.push(item.departmentArr)
             this.realQuantityArr.push(item.realQuantityArr)
@@ -49,7 +49,6 @@ export default {
         //2、后图
         this.$nextTick(() => {
           this.initEcharts()
-          console.log('111')
         })
       })
     },
@@ -104,8 +103,8 @@ export default {
           axisPointer: {
             type: 'shadow'
           },
-          data: ['业务一部', '业务二部', '业务三部', '业务四部', '业务五部', '业务六部', '业务七部']
-          // data: this.departmentArr
+          // data: ['业务一部', '业务二部', '业务三部', '业务四部', '业务五部', '业务六部', '业务七部']
+          data: this.departmentArr
         },
         yAxis: [
           {
@@ -149,8 +148,8 @@ export default {
               // }
             },
             barWidth: '30%',
-            data: [5635464, 4230466, 7498980, 6546765, 9222342, 1655143, 5055143]
-            // data: this.realQuantityArr
+            // data: [5635464, 4230466, 7498980, 6546765, 9222342, 1655143, 5055143]
+            data: this.realQuantityArr
           },
           {
             name: '本币金额',
@@ -160,8 +159,8 @@ export default {
               //   // return value + ' ml'
               // }
             },
-            data: [7237455, 5158676, 7864656, 6744645, 9543645, 4446511, 6564992]
-            // data: this.localMoneyArr
+            // data: [7237455, 5158676, 7864656, 6744645, 9543645, 4446511, 6564992]
+            data: this.localMoneyArr
           }
         ]
       }
@@ -170,7 +169,7 @@ export default {
       window.addEventListener('resize', () => {
         if (myChart) {
           myChart.resize()
-          // console.log('eee')
+          console.log('eee')
         }
       })
     }