Răsfoiți Sursa

1.控制台业务数据导出

wuhp 1 an în urmă
părinte
comite
7b8272760d
2 a modificat fișierele cu 38 adăugiri și 0 ștergeri
  1. 32 0
      src/pages/business/channel.vue
  2. 6 0
      src/services/business.js

+ 32 - 0
src/pages/business/channel.vue

@@ -187,6 +187,12 @@
               @click="exportList"
               >导出</a-button
             >
+            <a-button
+                type="primary"
+                style="margin-left: 10px"
+                @click="exportDetailList"
+            >明细导出</a-button
+            >
           </a-form-item>
         </a-form>
 
@@ -222,6 +228,7 @@ import StandardTable from "@/components/table/StandardTable";
 import tree from "@/components/tree/agentChanell";
 import moment from "moment";
 import datePicker from "@/components/datePicker";
+import {detailExport} from "../../services/business";
 
 const columns = [
   {
@@ -388,6 +395,31 @@ export default {
           }
         });
     },
+
+    exportDetailList() {
+      this.$API.business
+        .detailExport({
+          ...this.formState,
+          managementSource: 1,
+          treeType: this.treeType,
+          timeType: this.timeType,
+          treeUserId: this.treeUserId
+            ? this.treeUserId
+            : this.formState.treeUserId,
+        })
+        .then((res) => {
+          if (res.data.code == 200) {
+            let url = this.process + res.data.data; // 3.创建一个临时的url指向blob对象
+            let a = document.createElement("a");
+            a.href = url;
+            a.download = "导出文件.xlsx";
+            a.click();
+            window.URL.revokeObjectURL(url);
+          } else {
+            this.$message.error(res.msg);
+          }
+        });
+    },
     async timeChange(val) {
       // console.log(val);
       this.dateType = val.dateType;

+ 6 - 0
src/services/business.js

@@ -67,6 +67,11 @@ export async function getBusinessElectricDataTotal(data) {
 export async function businessAgentExcel(data) {
     return request("/taskStatistics/getBusinessAgentExcel", METHOD.POST, data)
 }
+
+//业务数据渠道明细导出
+export async function detailExport(data) {
+    return request("/taskStatistics/detailExport", METHOD.POST, data)
+}
 //渠道导出
 export async function channelExcel(data) {
     return request("/taskStatistics/getChannelExcel", METHOD.POST, data)
@@ -93,5 +98,6 @@ export default {
     getBusinessElectricData,
     getBusinessElectricDataTotal,
     businessAgentExcel,
+    detailExport,
     channelExcel
 }