Ver código fonte

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

molilang 3 anos atrás
pai
commit
c8a9e368f5

+ 3 - 0
src/pages/main/gridDivision/approvalExamination.vue

@@ -91,6 +91,7 @@ export default {
       opinion_visible: false,
       track_visible: false,
       opinion_form: {},
+      status:'',
       isAgree: false,
       // 单条审批id
       ids: "",
@@ -224,6 +225,7 @@ export default {
   },
   mounted() {
     this.parentId = this.$route.query.parentId;
+    this.status = this.$route.query.status;
   },
   methods: {
     // 表格数据初始化
@@ -250,6 +252,7 @@ export default {
           ? data.map((element, index) => ({
               ...element,
               No: index + 1,
+              sts:Number(this.status)
             }))
           : [];
         this.table_list && this.table_list[0].sts === "0"

+ 33 - 2
src/pages/main/gridDivision/workersList.vue

@@ -495,6 +495,7 @@ export default {
           path: "/approvalExamination",
           query: {
             parentId: row.id.toString(),
+            status: row.sts.toString(),
           },
         });
       } else {
@@ -514,6 +515,7 @@ export default {
           path: "/approvalExamination",
           query: {
             parentId: row.id.toString(),
+            status: row.sts.toString(),
           },
         });
       } else {
@@ -634,8 +636,37 @@ export default {
       }
     },
     // 附件下载
-    handleDownload(item) {
-      console.log(item);
+    handleDownload({fileCode,fileName}) {
+      console.log(fileCode,fileName);
+      this.$http({
+        url: "/market/compatt/downfile",
+        method: "post",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        responseType: "blob",
+        data: { id: fileCode, fileName: fileName },
+      }).then((response) => {
+        if (window.navigator && window.navigator.msSaveOrOpenBlob) {
+          let blob = new Blob([response.data], {
+            type: "application/vnd.ms-excel",
+          });
+          window.navigator.msSaveOrOpenBlob(blob, fileName);
+        } else {
+          /* 火狐谷歌的文件下载方式 */
+          var blob = new Blob([response.data]);
+          var downloadElement = document.createElement("a");
+          var href = window.URL.createObjectURL(blob);
+          downloadElement.href = href;
+          downloadElement.download = fileName;
+          document.body.appendChild(downloadElement);
+          downloadElement.click();
+          document.body.removeChild(downloadElement);
+          window.URL.revokeObjectURL(href);
+        }
+      });
+      // // /market/compatt/downfile
+      // console.log(item);
     },
   },
 };

+ 2 - 2
src/pages/main/performance/components/table.vue

@@ -2,7 +2,7 @@
  * @Author       : yuanrunwei
  * @Date         : 2021-11-01 18:02:58
  * @LastEditors: Please set LastEditors
- * @LastEditTime: 2022-01-12 13:58:02
+ * @LastEditTime: 2022-01-14 11:31:39
  * @FilePath     : /spfm-market-front/src/pages/main/performance/components/table.vue
 -->
 <template>
@@ -67,7 +67,7 @@
             <span
               v-for="(item, index) in scope.row[props].split(',')"
               :key="index"
-              @click="downloadFile(item)"
+              @click="downloadFile({index,rows:scope.row})"
                class="simple-table-click cursor-pointer margin-left-10"
             >
               {{ item }}