Browse Source

事物管理里任务导出

caojunjie 2 years ago
parent
commit
984289ea8b

+ 1 - 1
src/api/workManagement/mainProject.js

@@ -167,4 +167,4 @@ export function updateProjectItem(data) {
     method: 'post',
     data:data
   })
-}
+}

+ 8 - 2
src/views/workManagement/task/configuration/mainList.json

@@ -151,10 +151,16 @@
       "width": 120
     },
     {
+      "label": "提成比例",
+      "prop": "proportion",
+      "overHidden": true,
+      "cell": true,
+      "width": 120
+    },
+    {
       "label": "提成",
       "prop": "commission",
       "overHidden": true,
-      "cell": true,
       "width": 120
     },
     {
@@ -236,4 +242,4 @@
       "overHidden": true
     }
   ]
-}
+}

+ 43 - 14
src/views/workManagement/task/index.vue

@@ -72,6 +72,7 @@ import { updateItemStatus } from "@/api/workManagement/mainProject";
 import { getUserList } from "@/api/workManagement/mainProject";
 import { saveMessage } from "@/api/logs";
 import { getGoodsDescList } from "@/api/standAlone/saleLeads";
+import {getToken} from "@/util/auth";
 export default {
   name: "customerInformation",
   data() {
@@ -248,21 +249,49 @@ export default {
       this.exportLoading = true
       let searchParams = Object.assign({}, this.search);
       let param = this.paramsAdjustment(searchParams)
-      getFlowList(1, 10000, param).then(res => {
-        const fileData = this.deepClone(res.data.data.records)
-        fileData.map(item => {
-          item.cornId = item.cornName
+
+        let config = { params: { ...this.search } }
+        if (config.params) {
+            for (const propName of Object.keys(config.params)) {
+                const value = config.params[propName];
+                if (value !== null && typeof (value) !== "undefined") {
+                    if (value instanceof Array) {
+                        for (const key of Object.keys(value)) {
+                            let params = propName + '[' + key + ']';
+                            config.params[params] = value[key]
+                        }
+                        delete config.params[propName]
+                    }
+                }
+            }
+        }
+        config.params.status = '1,4,5'
+        config.params.deptid = ''
+        config.params.branch = 'Y'
+        console.log(config.params)
+        const routeData = this.$router.resolve({
+            path: '/api/trade-project/project/itemTask/export',      //跳转目标下载地址
+            query: {
+                ...config.params    //括号内是要传递给新窗口的参数
+            }
         })
-        const fileColumn = this.deepClone(option.column)
-        fileColumn.shift();
-        this.$Export.excel({
-          title: "任务",
-          columns: fileColumn,
-          data: fileData,
-        });
-      }).finally(() => {
-        this.exportLoading = false
-      })
+        window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
+
+      // getFlowList(1, 10000, param).then(res => {
+      //   const fileData = this.deepClone(res.data.data.records)
+      //   fileData.map(item => {
+      //     item.cornId = item.cornName
+      //   })
+      //   const fileColumn = this.deepClone(option.column)
+      //   fileColumn.shift();
+      //   this.$Export.excel({
+      //     title: "任务",
+      //     columns: fileColumn,
+      //     data: fileData,
+      //   });
+      // }).finally(() => {
+      //   this.exportLoading = false
+      // })
     },
     //完工
     completion(row) {