From d67b031476d33a4a2d002ed32bc30dac34fc5493 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 25 二月 2025 15:29:45 +0800
Subject: [PATCH] 导出修改

---
 src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue |   17 ++++-------------
 1 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue b/src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue
index 5b90f8e..8dc8ee0 100644
--- a/src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue
+++ b/src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue
@@ -9,7 +9,7 @@
         <el-upload :action="action" :auto-upload="true"
           :data="{ orderId: dataVisibleIndex === 0 ? filesLookInfo.enterOrderId : filesLookInfo.quarterOrderId }"
           :on-success="handleSuccessUp" :show-file-list="false"
-          accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' :headers="headers"
+          accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' :headers="uploadHeader"
           :before-upload="beforeUpload" style="width: 80px !important;" :on-error="onError" ref='upload'>
           <el-button size="small" type="primary" style="height: 38px">闄勪欢涓婁紶</el-button>
         </el-upload>
@@ -27,7 +27,6 @@
 import file from "@/utils/file";
 import limsTable from "@/components/Table/lims-table.vue";
 import { delfile, downFile, getFileList } from "@/api/business/rawMaterialOrder";
-import { getToken } from "@/utils/auth";
 export default {
   name: "filesLookVisible",
   // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
@@ -159,13 +158,10 @@
           let url = '';
           if (res.data.type == 1) {
             url = this.javaApi + '/img/' + res.data.fileUrl
-            file.downloadIamge(url, row.fileName)
+            this.$download.saveAs(url, row.fileName);
           } else {
             url = this.javaApi + '/word/' + res.data.fileUrl
-            const link = document.createElement('a');
-            link.href = url;
-            link.download = row.fileName;
-            link.click();
+            this.$download.saveAs(url, row.fileName);
           }
         }
       }).catch(error => {
@@ -176,7 +172,7 @@
       this.upLoading = false;
       if (response.code == 200) {
         this.$message.success('涓婁紶鎴愬姛');
-        this.$refs.fileList.selectList()
+        this.getFileList()
       }
     },
     beforeUpload(file) {
@@ -221,11 +217,6 @@
     }
   },
   computed: {
-    headers() {
-      return {
-        'Authorization': "Bearer " + getToken()
-      }
-    },
     action() {
       return this.javaApi + '/insOrderPlan/uploadFile'
     }

--
Gitblit v1.9.3