From e5454b769d44a34af423bf87ac8a740bf8c20341 Mon Sep 17 00:00:00 2001
From: Crunchy <3114200645@qq.com>
Date: 星期二, 29 四月 2025 13:25:29 +0800
Subject: [PATCH] Merge branch 'dev' into dev_tides

---
 src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue |   41 +++++++++--------------------------------
 1 files changed, 9 insertions(+), 32 deletions(-)

diff --git a/src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue b/src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue
index 5b90f8e..bfbebb4 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>
@@ -23,15 +23,12 @@
 </template>
 
 <script>
-import ValueTable from "@/components/Table/value-table.vue";
-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";
+import { delFile, downFile, getFileList } from "@/api/business/rawMaterialOrder";
 export default {
   name: "filesLookVisible",
   // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
-  components: { limsTable, ValueTable },
+  components: { limsTable },
   props: {
     filesDialogVisible: {
       type: Boolean,
@@ -155,19 +152,7 @@
     // 涓嬭浇
     handleDown(row) {
       downFile({ id: row.id, }).then(res => {
-        if (res.code === 200) {
-          let url = '';
-          if (res.data.type == 1) {
-            url = this.javaApi + '/img/' + res.data.fileUrl
-            file.downloadIamge(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(res.data.fileUrl, row.fileName);
       }).catch(error => {
 
       })
@@ -176,7 +161,9 @@
       this.upLoading = false;
       if (response.code == 200) {
         this.$message.success('涓婁紶鎴愬姛');
-        this.$refs.fileList.selectList()
+        this.getFileList()
+      } else {
+        this.$message.error(response.msg);
       }
     },
     beforeUpload(file) {
@@ -208,24 +195,14 @@
         cancelButtonText: "鍙栨秷",
         type: "warning"
       }).then(() => {
-        delfile({ id: row.id }).then(res => {
-          if (res.code === 500) {
-            return
-          }
+        delFile({ id: row.id }).then(res => {
           this.$message.success('鍒犻櫎鎴愬姛')
-          this.getList()
-        }).catch(e => {
-          this.$message.error('鍒犻櫎澶辫触')
+          this.getFileList()
         })
       }).catch(() => { })
     }
   },
   computed: {
-    headers() {
-      return {
-        'Authorization': "Bearer " + getToken()
-      }
-    },
     action() {
       return this.javaApi + '/insOrderPlan/uploadFile'
     }

--
Gitblit v1.9.3