Kaynağa Gözat

统计导出

xgb 1 ay önce
ebeveyn
işleme
36798db437

+ 16 - 7
src/api/hisStore/statistics.js

@@ -31,10 +31,19 @@ export function storePayment(query) {
   });
 }
 
- export function storeOrderStatistics(params) {
-    return request({
-      url: '/store/store/statistics/storeOrderStatistics',
-      method: 'get',
-      params
-    });
-  }
+export function storeOrderStatistics(params) {
+  return request({
+    url: '/store/store/statistics/storeOrderStatistics',
+    method: 'get',
+    params
+  });
+}
+
+
+export function exportExcel(params) {
+  return request({
+    url: '/store/store/statistics/export',
+    method: 'get',
+    params
+  });
+}

+ 40 - 8
src/views/hisStore/statistics/storeOrderStatistics.vue

@@ -187,7 +187,7 @@
 
 <script>
 import OrderSummaryTable from '../components/OrderSummaryTable';
-import { storeOrderStatistics } from "@/api/hisStore/statistics";
+import { storeOrderStatistics,exportExcel } from "@/api/hisStore/statistics";
 import { getUserListByDeptId} from "@/api/company/companyUser";
 import echarts from 'echarts'
 import resize from '../../dashboard/mixins/resize'
@@ -336,15 +336,47 @@ export default {
         }
       });
     },
-    handleExport() {
-      var data;
-      if (this.userIds != undefined) {
-        data = { type: this.value, userIds: this.userIds + "", deptId: this.deptId }
+    exportExcel() {
+      var data={};
+      if(this.value){
+        data.type = this.value
+      }
+      if(this.userIds){
+        data.companyUserId = this.userIds
+      }
+
+      if(this.summaryType){
+        data.summaryType = this.summaryType
       }
-      else {
-        data = { type: this.value, deptId: this.deptId }
+
+      if(this.queryType){
+        data.queryType = this.queryType
+      }
+      if(this.amountType){
+        data.amountType = this.amountType
+      }
+
+      if(this.dateRange && this.dateRange.length>0){
+        data.type = null
+        data.startTime = this.dateRange[0]
+        data.endTime = this.dateRange[1]
+      }
+      if(this.orderType){
+        data.orderType = this.orderType
+      }
+      if(this.orderMedium){
+        data.orderMedium = this.orderMedium
+      }
+      if(this.companyId){
+        data.companyId = this.companyId
+      }
+      if(this.deptId){
+        data.deptId = this.deptId
+      }
+      if(this.summaryType){
+        data.summaryType = this.summaryType
       }
-      exportVoiceLogs(data).then((response) => {
+      exportExcel(data).then((response) => {
         console.log(response)
         this.download(response.msg);
       });