Selaa lähdekoodia

1.小订单渠道代理人导出

wuhp 1 vuosi sitten
vanhempi
commit
927d61463c
2 muutettua tiedostoa jossa 57 lisäystä ja 0 poistoa
  1. 29 0
      src/pages/quote/smallorders/agent.vue
  2. 28 0
      src/pages/quote/smallorders/channel.vue

+ 29 - 0
src/pages/quote/smallorders/agent.vue

@@ -60,6 +60,10 @@
           </div>
         </div>
       </div>
+      <div style="padding: 10px; display: flex; justify-content: flex-end">
+        <a-button type="primary" @click="exportList">导出</a-button>
+      </div>
+
       <div style="display: flex; flex: 1">
         <!-- <div style="width: 300px; height: 900px; overflow-y: auto">
           <a-tree :tree-data="treeData" :replaceFields="replaceFields"></a-tree>
@@ -252,6 +256,7 @@ export default {
         title: "userName",
         key: "id",
       },
+      process: process.env.VUE_APP_API_BASE_URL,
     };
   },
   mounted() {
@@ -261,6 +266,30 @@ export default {
     // }, 1000);
   },
   methods: {
+    exportList() {
+      this.$API.quote
+          .quotationDetailsExcel({
+            // pageNum: this.pagination.current,
+            // pageSize: this.pagination.defaultPageSize,
+            dateType: this.formState.dateType,
+            beginDate: this.formState.beginDate,
+            endDate: this.formState.endDate,
+            managementSource:2,
+            deptId: this.deptId,
+          })
+          .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);
+            }
+          });
+    },
     getAgentTree() {
       this.$API.quote
         .getAgentTree({

+ 28 - 0
src/pages/quote/smallorders/channel.vue

@@ -60,6 +60,9 @@
           </div>
         </div>
       </div>
+      <div style="padding: 10px; display: flex; justify-content: flex-end">
+        <a-button type="primary" @click="exportList">导出</a-button>
+      </div>
       <div style="display: flex">
         <!-- <div style="width: 300px; height: 900px; overflow-y: auto">
           <a-tree :tree-data="treeData" :replaceFields="replaceFields"></a-tree>
@@ -201,6 +204,7 @@ export default {
         showTotal: (total) => `共 ${total} 条数据`,
       },
       loading: false,
+      process: process.env.VUE_APP_API_BASE_URL,
       wholeList: [],
       provinceList: [],
       cityList: [],
@@ -221,6 +225,30 @@ export default {
     // }, 1000);
   },
   methods: {
+    exportList() {
+      this.$API.quote
+          .quotationDetailsExcel({
+            // pageNum: this.pagination.current,
+            // pageSize: this.pagination.defaultPageSize,
+            dateType: this.formState.dateType,
+            beginDate: this.formState.beginDate,
+            managementSource:1,
+            endDate: this.formState.endDate,
+            deptId: this.deptId,
+          })
+          .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);
+            }
+          });
+    },
     // getAgentTree(id) {
     //   this.$API.quote
     //     .getAgentTree({