Просмотр исходного кода

fix:业务数据优化及添加导出功能

刘恒 1 год назад
Родитель
Сommit
ddae23139f

+ 5 - 5
src/components/datePicker/index.vue

@@ -70,7 +70,7 @@ export default {
   },
   created() {},
   mounted() {
-    console.log(this.$props.form)
+ 
     if(this.$props.form!=undefined){
       this.timeType=this.$props.form?.timeType
       this.dateType=this.$props.form?.dateType
@@ -120,16 +120,16 @@ export default {
       if (type == 2) {
         this.$emit("getList", {
           dateType: undefined,
-          signingTimeStart: this.signingTime[0]|| moment().format("YYYY-MM-DD"),
-          signingTimeEnd: this.signingTime[1]|| moment().format("YYYY-MM-DD"),
+          signingTimeStart: this.signingTime[0] || '',
+          signingTimeEnd: this.signingTime[1] || '',
           timeType:this.timeType
 
         });
       } else {
         this.$emit("getList", {
           dateType: undefined,
-          enterTimeStart: this.enterTime[0]|| moment().format("YYYY-MM-DD"),
-          enterTimeEnd: this.enterTime[1]|| moment().format("YYYY-MM-DD"),
+          enterTimeStart: this.enterTime[0]|| '',
+          enterTimeEnd: this.enterTime[1]|| '',
           timeType:this.timeType
 
         });

+ 0 - 1
src/components/tree/allTree.vue

@@ -9,7 +9,6 @@
       :checkable="checkable"
       @check="onCheck"
       v-model="checkList"
-      :checkStrictly="true"
       :expanded-keys="expandedKeys"
       @expand="onExpand"
       ref="tree"

+ 27 - 3
src/pages/business/agent.vue

@@ -186,6 +186,7 @@
             "
           >
             <a-button type="primary" @click="getList">查询</a-button>
+            <a-button type="primary" style="margin-left: 10px;" @click="exportList">导出</a-button>
           </a-form-item>
         </a-form>
 
@@ -197,7 +198,7 @@
           @clear="onClear"
           @change="onChange"
           :loading="loading"
-           :scroll="{ x: 'calc(1500px + 50%)', y: 400 }"
+           :scroll="{ x: 'calc(1500px + 50%)', y: 700 }"
         >
           <div slot="operation" slot-scope="{ text, record }">
             <a-button type="link" @click="watchMessage({ text, record })"
@@ -320,7 +321,9 @@ export default {
       dateType:"",
       timeType:"",
       userTreeData:[],
-      treeData:[]
+      treeData:[],
+      process: process.env.VUE_APP_API_BASE_URL,
+
     };
   },
   created() {},
@@ -331,8 +334,29 @@ export default {
     // this.$refs.treeManage.getUserTree();
   },
   methods: {
+    exportList(){
+      this.$API.business.businessAgentExcel({
+        ...this.formState,
+          managementSource: 2,
+          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);
+          }
+      })
+     
+    },
     timeChange(val) {
-      // console.log(val);
+      console.log(val);
       this.dateType=val.dateType
       this.timeType=val.timeType
       this.formState = { ...val };

+ 26 - 1
src/pages/business/channel.vue

@@ -174,6 +174,8 @@
             "
           >
             <a-button type="primary" @click="getList">查询</a-button>
+            <a-button type="primary" style="margin-left: 10px;" @click="exportList">导出</a-button>
+
           </a-form-item>
         </a-form>
 
@@ -186,7 +188,7 @@
             @clear="onClear"
             @change="onChange"
             :loading="loading"
-            :scroll="{ x: 'calc(1500px + 50%)', y: 400 }"
+            :scroll="{ x: 'calc(1500px + 50%)', y: 700 }"
           >
             <div slot="operation" slot-scope="{ text, record }">
               <a-button type="link" @click="watchMessage({ text, record })"
@@ -339,6 +341,8 @@ export default {
       timeType:"",
       treeData: [],
       userTreeData: [],
+      process: process.env.VUE_APP_API_BASE_URL,
+
     };
   },
   created() {},
@@ -349,6 +353,27 @@ export default {
     // this.getUserTree()
   },
   methods: {
+    exportList(){
+      this.$API.business.channelExcel({
+        ...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

+ 1 - 1
src/pages/business/message.vue

@@ -131,7 +131,7 @@
           @clear="onClear"
           @change="onChange"
           :loading="loading"
-           :scroll="{ x: 'calc(1500px + 50%)', y: 400 }"
+           :scroll="{ x: 'calc(1500px + 50%)', y: 700 }"
         >
           <div slot="insuranceCompany" slot-scope="{ record }">
             <img :src="record.logo" alt="" style="width: 24px; height: auto" />

+ 1 - 1
src/pages/business/orderMessage.vue

@@ -154,7 +154,7 @@
           @clear="onClear"
           @change="onChange"
           :loading="loading"
-           :scroll="{ x: 'calc(1500px + 50%)', y: 400 }"
+           :scroll="{ x: 'calc(1500px + 50%)', y: 700 }"
         >
           <div slot="insuranceCompany" slot-scope="{ record }">
             <img :src="record.logo" alt="" style="width: 24px; height: auto" />

+ 1 - 1
src/pages/business/sales.vue

@@ -153,7 +153,7 @@
           @clear="onClear"
           @change="onChange"
           :loading="loading"
-          :scroll="{ x: 'calc(1500px + 50%)', y: 400 }"
+          :scroll="{ x: 'calc(1500px + 50%)', y: 700 }"
         >
         
         <div slot="distributionAmountRate" slot-scope="{ text }">

+ 11 - 1
src/services/business.js

@@ -59,6 +59,14 @@ export async function getBusinessElectricData(data) {
 export async function getBusinessElectricDataTotal(data) {
     return request("/taskStatistics/getBusinessElectricDataTotal", METHOD.POST, data)
 }
+//代理人导出
+export async function businessAgentExcel(data) {
+    return request("/taskStatistics/getBusinessAgentExcel", METHOD.POST, data)
+}
+//渠道导出
+export async function channelExcel(data) {
+    return request("/taskStatistics/getChannelExcel", METHOD.POST, data)
+}
 
 
 
@@ -78,5 +86,7 @@ export default {
     getBusinessOrderDataDetails,
     getBusinessOrderDataTotal,
     getBusinessElectricData,
-    getBusinessElectricDataTotal
+    getBusinessElectricDataTotal,
+    businessAgentExcel,
+    channelExcel
 }