Browse Source

Merge branch 'master' of https://git.agilestar.cn/spfm-group/spfm-market-front

noob 3 years ago
parent
commit
36e81c163b
2 changed files with 71 additions and 1 deletions
  1. 14 1
      src/pages/main/performance/department.vue
  2. 57 0
      src/pages/main/performance/reply.vue

+ 14 - 1
src/pages/main/performance/department.vue

@@ -451,10 +451,23 @@ export default {
     },
     // 编辑按钮
     handleEdit(row) {
-      console.log(row, "row");
       this.visible = true;
       this.edit_visible = true;
       this.edit_form = row;
+      // 暂时的处理先调接口
+      this.$http({
+        url: "/market/CMKIssued/CMKIssuedProcessByUser",
+        method: "post",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        data: { id: this.edit_form.id },
+      }).then(({ data: { reviewType } }) => {
+        console.log(reviewType, "res");
+        if (reviewType) {
+          this.type = reviewType;
+        }
+      });
     },
     // 查看按钮
     handleCheck(row) {

+ 57 - 0
src/pages/main/performance/reply.vue

@@ -5,6 +5,7 @@
         :form="table_form"
         :handle="table_handle"
         @search="handleSearch"
+        @download="handleDownload"
       ></simple-form>
       <simple-table
         :list="table_list"
@@ -141,6 +142,62 @@ export default {
       //     index = index + 1;
       // }
     },
+    handleDownload() {
+      this.$http({
+        url: "/market/CMKIssued/exportCMKIssuedReplyStatistics",
+        method: "get",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        responseType: "blob",
+        data: {
+          ...this.table_search,
+          time: this.table_search.time ? this.table_search.time : "",
+        },
+      }).then((response) => {
+        if (window.navigator && window.navigator.msSaveOrOpenBlob) {
+          let blob = new Blob([response.data], {
+            type: "application/vnd.ms-excel",
+          });
+          window.navigator.msSaveOrOpenBlob(
+            blob,
+            this.dataBody.table.tabName + ".xlsx"
+          );
+        } else {
+          /* 火狐谷歌的文件下载方式 */
+          var blob = new Blob([response.data]);
+          var downloadElement = document.createElement("a");
+          var href = window.URL.createObjectURL(blob);
+          downloadElement.href = href;
+          downloadElement.download = this.dataBody.table.tabName + ".xlsx";
+          document.body.appendChild(downloadElement);
+          downloadElement.click();
+          document.body.removeChild(downloadElement);
+          window.URL.revokeObjectURL(href);
+        }
+      });
+
+      //   this.$http({
+      //     url: "/CMKIssued/exportCMKIssuedReplyStatistics",
+      //     method: "post",
+      //     headers: {
+      //       "Content-Type": "application/json",
+      //     },
+      //     data: {
+      //       ...this.table_search,
+      //       time: this.table_search.time ? this.table_search.time : "",
+      //     },
+      //     responseType: "blob", // 解决下载的文件乱码空白等问题
+      //   }).then(({ data }) => {
+      //     console.log(data,'data');
+      //     let url = window.URL.createObjectURL(new Blob([data]));
+      //     let a = document.createElement("a");
+      //     a.setAttribute("href", url);
+      //     //   a.setAttribute('download', scope.row.fileName)
+      //     a.click();
+      //   });
+      console.log("我下载了");
+    },
     handleSearch(data) {
       let obj = {
         ...data,