From 29be8639dc16b5d82bddc6099b1fa5cdca75f77a Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 20 十月 2026 16:28:22 +0800
Subject: [PATCH] feat(import): 统一导入弹框与模板,修复模板日期格式及上传报错
---
src/views/CNAS/process/method/methodVerification/component/formDIa.vue | 34 ++++++++++++++++++++++++++--------
1 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/src/views/CNAS/process/method/methodVerification/component/formDIa.vue b/src/views/CNAS/process/method/methodVerification/component/formDIa.vue
index 5b8d568..d66a02c 100644
--- a/src/views/CNAS/process/method/methodVerification/component/formDIa.vue
+++ b/src/views/CNAS/process/method/methodVerification/component/formDIa.vue
@@ -1,11 +1,11 @@
<template>
<div>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false"
- :title="operationType === 'edit' ? '缂栬緫' : operationType === 'view' ? '璇︽儏' : '鏂板'"
+ :title="dialogTitle"
v-model="formDia"
width="90%" @close="closeDia">
<div v-if="operationType === 'edit'" style="text-align: right">
- <el-button :disabled="form.confirmDate" size="small" type="primary" @click="validation">楠岃瘉纭</el-button>
+ <el-button :disabled="form.confirmDate" size="small" type="primary" @click="validation">{{ verifyType === 0 ? '鍙樻洿纭' : '楠岃瘉纭' }}</el-button>
</div>
<fieldset :disabled="operationType === 'view'" class="view-fieldset">
<table border="1" cellspacing="10" class="tables">
@@ -14,7 +14,7 @@
<p>鏍囧噯鏂规硶</p>
</td>
<td>
- <p>楠岃瘉鍘熷洜</p>
+ <p>{{ verifyType === 0 ? '鍙樻洿鍘熷洜' : '楠岃瘉鍘熷洜' }}</p>
</td>
<td>
<p>涓昏鎶�鏈彉鍖�</p>
@@ -221,7 +221,7 @@
</td>
</tr>
<tr>
- <td>楠岃瘉缁撹</td>
+ <td>{{ verifyType === 0 ? '鍙樻洿缁撹' : '楠岃瘉缁撹' }}</td>
<td colspan="7">
<el-input v-model="form.verificationConclusion" :rows="2" placeholder="璇疯緭鍏ュ唴瀹�" size="small" type="textarea"></el-input>
</td>
@@ -291,12 +291,12 @@
</table>
</fieldset>
<template #footer><span class="dialog-footer">
- <el-button @click="closeDia">鍙� 娑�</el-button>
+ <el-button @click="closeDia">{{ operationType === 'view' ? '鍏抽棴' : '鍙� 娑�' }}</el-button>
<el-button v-if="operationType !== 'view'" :loading="editLoad" type="primary" @click="handleEdit">鎻� 浜�</el-button>
</span></template>
</el-dialog>
- <ViewDeviceDialog v-if="viewDeviceDialog" ref="viewDeviceDialog" @closDeviceDia="closDeviceDia" @handleDeviceInfo="handleDeviceInfo"></ViewDeviceDialog>
- <ViewTestRecord v-if="viewTestRecordDialog" ref="viewTestRecordDialog"></ViewTestRecord>
+ <ViewDeviceDialog v-if="viewDeviceDialog" ref="viewDeviceDialog" :read-only="operationType === 'view'" @closDeviceDia="closDeviceDia" @handleDeviceInfo="handleDeviceInfo"></ViewDeviceDialog>
+ <ViewTestRecord v-if="viewTestRecordDialog" ref="viewTestRecordDialog" :read-only="operationType === 'view'"></ViewTestRecord>
<ViewWorkPermitDia v-if="viewWorkPermitDia" ref="viewWorkPermitDia"></ViewWorkPermitDia>
<calibrations-file-dia v-if="calibrationsFileDia" ref="calibrationsFileDia"></calibrations-file-dia>
</div>
@@ -323,6 +323,20 @@
operationType: {
type: String,
default: () => ''
+ },
+ // 0 鏍囧噯鏂规硶鍙樻洿锛�1 鏂规硶楠岃瘉
+ verifyType: {
+ type: Number,
+ default: 1
+ }
+ },
+ computed: {
+ typeLabel() {
+ return this.verifyType === 0 ? '鏍囧噯鏂规硶鍙樻洿' : '鏂规硶楠岃瘉'
+ },
+ dialogTitle() {
+ if (this.operationType === 'view') return `鏌ョ湅${this.typeLabel}`
+ return this.operationType === 'edit' ? `缂栬緫${this.typeLabel}` : `鏂板${this.typeLabel}`
}
},
data() {
@@ -410,10 +424,11 @@
},
// 鎻愪氦
handleEdit() {
+ if (this.operationType === 'view') return
this.editLoad = true
const processMethodSearchNews = this.HaveJson(this.form)
processMethodSearchNews.confirmUser = processMethodSearchNews.confirmUser && processMethodSearchNews.confirmUser.join(',')
- processMethodSearchNews.operationType = 1
+ processMethodSearchNews.operationType = this.verifyType
if (this.operationType === 'edit') {
this.editInfo(processMethodSearchNews)
} else {
@@ -422,10 +437,12 @@
},
// 璇勫鎰忚鍕鹃�夛紙涓夐�変竴锛屽啀鐐逛竴娆″彇娑堬級
toggleReview (value, checked) {
+ if (this.operationType === 'view') return
this.form.reviewResult = checked ? value : ''
},
// 瀹℃壒鎰忚鍕鹃�夛紙涓夐�変竴锛屽啀鐐逛竴娆″彇娑堬級
toggleApproval (value, checked) {
+ if (this.operationType === 'view') return
this.form.approvalResult = checked ? value : ''
},
// 鏌ョ湅涓婂矖璇�
@@ -455,6 +472,7 @@
},
// 鎻愪氦璁惧淇℃伅
handleDeviceInfo (machineAttachmentList) {
+ if (this.operationType === 'view') return
this.viewDeviceDialog = false
this.form.machineAttachmentList = machineAttachmentList
},
--
Gitblit v1.9.3