From a52ac50ffc5f3b369eb689dd734bfb8a4bb988a4 Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期四, 15 十月 2026 11:41:48 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/views/CNAS/process/method/methodVerification/component/viewWorkPermitDia.vue | 86 ++++++++++++++++++++++++++++++------------
1 files changed, 61 insertions(+), 25 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..cbe7ee6 100644
--- a/src/views/CNAS/process/method/methodVerification/component/viewWorkPermitDia.vue
+++ b/src/views/CNAS/process/method/methodVerification/component/viewWorkPermitDia.vue
@@ -2,23 +2,25 @@
<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>
@@ -27,11 +29,12 @@
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,27 +86,60 @@
},
// 鏂规硶闆嗗悎
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) {
+ upload(row) {
+ if (!row.fileUrl) {
+ this.$message.warning('璇ヤ汉鍛樺凡鏈変换鑱屾巿鏉冭褰曪紝浣嗗皻鏈笂浼犱笂宀楄瘉涔︽枃浠�')
+ return
+ }
let url = '';
- if(row.type==1){
- url = this.javaApi+'/img/'+row.fileUrl
- file.downloadIamge(url,row.fileName)
- }else{
- url = this.javaApi+'/word/'+row.fileUrl
+ if (/\.(png|jpe?g|gif|bmp|webp)$/i.test(row.fileUrl || '')) {
+ 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;
--
Gitblit v1.9.3