From 418594d0a3e441eeb7df2abbd70e54a0c72284c6 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期五, 30 十月 2026 16:35:46 +0800
Subject: [PATCH] feat(order): 添加送样日期校验和权限刷新机制 - 在委托单新增表单中为送样日期添加占位提示和保存校验 - 在检验审核、检验任务、报告编制、样品接收、报告结果、用印台账等页面添加送样时间列 - 加载委托模板时清空送样日期并清除校验状态
---
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