From 0a40c5890d13d9f2de5c3ab663876afecbfbefbe Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期三, 28 十月 2026 17:57:46 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/CNAS/process/method/methodVerification/component/viewWorkPermitDia.vue |   88 ++++++++++++++++++++++++++++---------------
 1 files changed, 57 insertions(+), 31 deletions(-)

diff --git a/src/views/CNAS/process/method/methodVerification/component/viewWorkPermitDia.vue b/src/views/CNAS/process/method/methodVerification/component/viewWorkPermitDia.vue
index 965a0d7..ce2f5dd 100644
--- a/src/views/CNAS/process/method/methodVerification/component/viewWorkPermitDia.vue
+++ b/src/views/CNAS/process/method/methodVerification/component/viewWorkPermitDia.vue
@@ -2,36 +2,39 @@
   <div>
     <el-dialog v-model="filesDialogVisible" title="鏌ョ湅涓婂矖璇�" width="80%" @closed="closeFilesLook">
       <div>
+        <el-alert v-if="!tableLoading && tableData.length === 0" type="info" :closable="false"
+                  title="鎵�閫夋娴嬩汉鍛樻殏鏃犱换鑱屾巿鏉冭褰曪紝璇锋牳瀵硅浠昏亴浜哄憳涓庢娴嬩汉鍛樻槸鍚︿负鍚屼竴浜恒��"/>
         <limsTable
-          ref="yearTable"
-          :column="columnData"
-          :height="'calc(100vh - 400px)'"
-          :highlightCurrentRow="true"
-          :table-data="tableData"
-          :table-loading="tableLoading"
-          style="margin-top: 0.5em;">
+            ref="yearTable"
+            :column="columnData"
+            :height="'calc(100vh - 400px)'"
+            :highlightCurrentRow="true"
+            :table-data="tableData"
+            :table-loading="tableLoading"
+            style="margin-top: 0.5em;">
         </limsTable>
       </div>
     </el-dialog>
     <el-dialog
-      v-model="lookDialogVisible"
-      fullscreen
-      title="鏌ョ湅闄勪欢" top="5vh" width="800px">
+        v-model="lookDialogVisible"
+        fullscreen
+        title="鏌ョ湅闄勪欢" top="5vh" width="800px">
       <filePreview v-if="lookDialogVisible" :currentFile="{}"
-                   :fileUrl="javaApi+'/img/'+currentInfo.fileUrl" style="max-height: 90vh;overflow-y: auto;"/>
+                   :fileUrl="fileUrl(currentInfo)" style="max-height: 90vh;overflow-y: auto;"/>
     </el-dialog>
   </div>
 </template>
 
 <script>
-import file from '@/utils/file';
+
 import filePreview from '@/components/Preview/filePreview.vue';
 import limsTable from '@/components/Table/lims-table.vue'
+import {getCurrentWorkFiles} from '@/api/cnas/process/method/methodVerification'
 
 export default {
   name: 'viewWorkPermitDia',
   // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
-  components: { filePreview, limsTable },
+  components: {filePreview, limsTable},
   data() {
     // 杩欓噷瀛樻斁鏁版嵁
     return {
@@ -74,7 +77,7 @@
       ],
       tableData: [],
       info: {},
-      currentInfo:{},
+      currentInfo: {},
       lookDialogVisible: false,
     };
   },
@@ -83,32 +86,55 @@
   },
   // 鏂规硶闆嗗悎
   methods: {
-    openDia(row) {
-      this.filesDialogVisible = true
-      this.info = row
-      this.tableData = this.info.workFileList
+    fileUrl(row) {
+      const image = /\.(png|jpe?g|gif|bmp|webp)$/i.test(row.fileUrl || '')
+      return this.javaApi + (image ? '/img/' : '/word/') + row.fileUrl
     },
-    closeFilesLook () {
+    // 涓ょ鐢ㄦ硶锛氭暟缁�=妫�娴嬩汉鍛榠d锛堝疄鏃舵煡璇級锛涜瀵硅薄=浼樺厛灞曠ず宸蹭繚瀛樼殑涓婂矖璇侊紝鍏舵鎸夊凡閫夋娴嬩汉鍛樺疄鏃舵煡璇�
+    openDia(payload = {}) {
+      this.filesDialogVisible = true
+      this.tableData = []
+      if (Array.isArray(payload)) {
+        this.loadCurrentFiles(payload)
+        return
+      }
+      this.info = payload || {}
+      if (Array.isArray(payload.workFileList) && payload.workFileList.length) {
+        this.tableData = payload.workFileList
+        return
+      }
+      this.loadCurrentFiles(Array.isArray(payload.confirmUser) ? payload.confirmUser : [])
+    },
+    loadCurrentFiles(userIds) {
+      if (!userIds.length) return
+      this.tableLoading = true
+      getCurrentWorkFiles({userIds: userIds.join(',')}).then(res => {
+        if (res.code === 200) this.tableData = res.data || []
+      }).catch(() => {
+        this.$message.error('涓婂矖璇佽鍙栧け璐ワ紝璇风◢鍚庨噸璇�')
+      }).finally(() => {
+        this.tableLoading = false
+      })
+    },
+    closeFilesLook() {
       this.filesDialogVisible = false
     },
     // 鏌ョ湅鏂囦欢
-    handleLook(row){
+    handleLook(row) {
+      if (!row.fileUrl) {
+        this.$message.warning('璇ヤ汉鍛樺凡鏈変换鑱屾巿鏉冭褰曪紝浣嗗皻鏈笂浼犱笂宀楄瘉涔︽枃浠�')
+        return
+      }
       this.currentInfo = row
       this.lookDialogVisible = true
     },
     // 涓嬭浇
-    upload (row) {
-      let url = '';
-      if(row.type==1){
-        url = this.javaApi+'/img/'+row.fileUrl
-        file.downloadIamge(url,row.fileName)
-      }else{
-        url = this.javaApi+'/word/'+row.fileUrl
-        const link = document.createElement('a');
-        link.href = url;
-        link.download = row.fileName;
-        link.click();
+    upload(row) {
+      if (!row.fileUrl) {
+        this.$message.warning('璇ヤ汉鍛樺凡鏈変换鑱屾巿鏉冭褰曪紝浣嗗皻鏈笂浼犱笂宀楄瘉涔︽枃浠�')
+        return
       }
+      return this.$download.attachment({ fileUrl: row.fileUrl }, row.fileName)
     },
   },
 };

--
Gitblit v1.9.3