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/wordFormDIa.vue | 297 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 297 insertions(+), 0 deletions(-)
diff --git a/src/views/CNAS/process/method/methodVerification/component/wordFormDIa.vue b/src/views/CNAS/process/method/methodVerification/component/wordFormDIa.vue
new file mode 100644
index 0000000..7f6c3b2
--- /dev/null
+++ b/src/views/CNAS/process/method/methodVerification/component/wordFormDIa.vue
@@ -0,0 +1,297 @@
+<template>
+ <div>
+ <el-dialog v-model="visible" :title="dialogTitle"
+ width="90%" :close-on-click-modal="false" @close="closeDia">
+ <div class="form-body">
+ <table class="verify-table">
+ <colgroup>
+ <col style="width: 16%"/>
+ <col style="width: 36%"/>
+ <col style="width: 16%"/>
+ <col style="width: 32%"/>
+ </colgroup>
+ <tbody>
+ <tr>
+ <th>鏍囧噯鍚嶇О</th>
+ <td>
+ <el-input v-model="form.standardName"/>
+ </td>
+ <th>鏍囧噯缂栧彿</th>
+ <td>
+ <el-input v-model="form.standardCode"/>
+ </td>
+ </tr>
+ <tr>
+ <th>楠岃瘉椤圭洰</th>
+ <td colspan="3">
+ <el-input v-model="form.verifyItem"/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <table class="verify-table content-table">
+ <colgroup>
+ <col style="width: 16%"/>
+ <col style="width: 36%"/>
+ <col style="width: 36%"/>
+ <col style="width: 12%"/>
+ </colgroup>
+ <thead>
+ <tr>
+ <th>楠岃瘉鍐呭</th>
+ <th>鏂规硶瑕佹眰</th>
+ <th>瀹為獙瀹よ兘鍔�</th>
+ <th>鏄惁婊¤冻</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr v-for="(item, index) in content.checks" :key="item.key">
+ <th>{{ index < 7 ? `${index + 1}. ${item.label}` : item.label }}</th>
+ <td>
+ <el-input v-model="item.requirement" type="textarea" :rows="3"/>
+ </td>
+ <td>
+ <el-input v-model="item.capability" type="textarea" :rows="3"/>
+ <div v-if="item.key === 'personnel'" class="row-extra">
+ <span>妫�娴嬩汉鍛�</span>
+ <el-select v-model="form.confirmUser" multiple :multiple-limit="5" placeholder="璇烽�夋嫨妫�娴嬩汉鍛�">
+ <el-option v-for="user in userList" :key="user.id" :label="user.name" :value="user.id"/>
+ </el-select>
+ <el-link v-if="operationType === 'edit'" type="primary" @click="viewWorkPermit">鏌ョ湅涓婂矖璇�</el-link>
+ </div>
+ <div v-if="item.key === 'equipment'" class="row-extra">
+ <el-link type="primary" @click="viewDevice">鏌ョ湅璁惧</el-link>
+ <el-link v-if="operationType === 'edit'" type="primary" @click="viewCalibrationsFileDia">鏌ョ湅鏍″噯璇佷功
+ </el-link>
+ </div>
+ </td>
+ <td class="choice-cell">
+ <el-radio-group v-model="item.satisfied">
+ <el-radio :value="1">鏄�</el-radio>
+ <el-radio :value="0">鍚�</el-radio>
+ </el-radio-group>
+ </td>
+ </tr>
+ <tr>
+ <th>楠岃瘉缁撹</th>
+ <td colspan="3">
+ <el-input v-model="content.conclusion" type="textarea" :rows="4"/>
+ </td>
+ </tr>
+ <tr v-for="decision in decisions" :key="decision.key">
+ <th>{{ decision.label }}</th>
+ <td colspan="3">
+ <div class="decision-row">
+ <el-radio-group v-model="content[decision.key]">
+ <el-radio value="鍚屾剰浣跨敤">鍚屾剰浣跨敤</el-radio>
+ <el-radio value="涓嶈兘浣跨敤">涓嶈兘浣跨敤</el-radio>
+ <el-radio value="闄愬埗浣跨敤">闄愬埗浣跨敤</el-radio>
+ </el-radio-group>
+ <span>{{ decision.personLabel }}</span>
+ <el-input v-model="content[decision.personKey]" class="person-input"/>
+ <span>鏃ユ湡</span>
+ <el-date-picker v-model="content[decision.dateKey]" type="date" value-format="YYYY-MM-DD"
+ placeholder="閫夋嫨鏃ユ湡"/>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <div v-if="operationType === 'edit'" class="attachments">
+ <span>闄勪欢1 鍘熷璁板綍銆侀檮浠�2 楠岃瘉缁撴灉</span>
+ <el-button size="small" @click="viewTestRecord">鏌ョ湅鍙婁笂浼犻檮浠�</el-button>
+ </div>
+ </div>
+ <template #footer>
+ <el-button @click="closeDia">鍙栨秷</el-button>
+ <el-button v-if="operationType !== 'view'" :loading="loading" type="primary" @click="submit">鎻愪氦</el-button>
+ </template>
+ </el-dialog>
+ <ViewDeviceDialog v-if="deviceVisible" ref="device" @closDeviceDia="deviceVisible = false"
+ @handleDeviceInfo="setDevices"/>
+ <ViewTestRecord v-if="recordVisible" ref="record"/>
+ <ViewWorkPermitDia v-if="permitVisible" ref="permit"/>
+ <CalibrationsFileDia v-if="calibrationVisible" ref="calibration"/>
+ </div>
+</template>
+
+<script>
+import ViewDeviceDialog from './ViewDeviceDialog.vue'
+import ViewTestRecord from './ViewTestRecord.vue'
+import ViewWorkPermitDia from './viewWorkPermitDia.vue'
+import CalibrationsFileDia from './calibrationsFileDia.vue'
+import {addMethodVerify, getMethodVerifyOne, updateMethodVerify} from '@/api/cnas/process/method/methodVerification'
+import {selectUserCondition} from '@/api/cnas/process/method/methodVerification'
+
+const labels = [
+ ['personnel', '浜哄憳鑳藉姏'], ['equipment', '妫�娴嬭澶�'], ['reagents', '璇曞墏瑕佹眰'],
+ ['conditions', '璇曢獙鏉′欢'], ['sample', '鏍峰搧澶勭疆'], ['steps', '璇曢獙姝ラ'],
+ ['processing', '鏁版嵁澶勭悊'], ['qualityControl', '璐ㄩ噺鎺у埗鏂规硶'], ['result', '鏂规硶楠岃瘉缁撴灉']
+]
+const decisions = [
+ {key: 'reviewDecision', label: '璇勫鎰忚', personKey: 'reviewer', personLabel: '璇勫浜哄憳', dateKey: 'reviewDate'},
+ {
+ key: 'approvalDecision',
+ label: '瀹℃壒鎰忚',
+ personKey: 'approver',
+ personLabel: '鎶�鏈礋璐d汉',
+ dateKey: 'approvalDate'
+ }
+]
+
+function emptyContent() {
+ return {
+ checks: labels.map(([key, label]) => ({key, label, requirement: '', capability: '', satisfied: null})),
+ conclusion: '',
+ reviewDecision: '',
+ reviewer: '',
+ reviewDate: '',
+ approvalDecision: '',
+ approver: '',
+ approvalDate: ''
+ }
+}
+
+export default {
+ name: 'MethodVerificationWordForm',
+ components: {ViewDeviceDialog, ViewTestRecord, ViewWorkPermitDia, CalibrationsFileDia},
+ props: {operationType: {type: String, default: 'add'}},
+ computed: {
+ dialogTitle() {
+ if (this.operationType === 'view') return '鏌ョ湅鏂规硶楠岃瘉'
+ return this.operationType === 'edit' ? '缂栬緫鏂规硶楠岃瘉' : '鏂板鏂规硶楠岃瘉'
+ }
+ },
+ data() {
+ return {
+ visible: false, loading: false, decisions,
+ form: {standardName: '', standardCode: '', verifyItem: '', confirmUser: [], machineAttachmentList: []},
+ content: emptyContent(), info: {}, userList: [],
+ deviceVisible: false, recordVisible: false, permitVisible: false, calibrationVisible: false
+ }
+ },
+ methods: {
+ openDia(row = {}) {
+ this.visible = true
+ this.info = row || {}
+ selectUserCondition().then(res => {
+ if (res.code === 200) this.userList = res.data || []
+ })
+ if (this.operationType !== 'add') this.load(row)
+ },
+ load(row) {
+ getMethodVerifyOne({methodVerifyId: row.methodVerifyId}).then(res => {
+ if (res.code !== 200) return
+ this.form = {...res.data, confirmUser: res.data.confirmUser ? res.data.confirmUser.split(',').map(Number) : []}
+ try {
+ const saved = JSON.parse(res.data.verificationContent || '{}')
+ const defaults = emptyContent()
+ this.content = {
+ ...defaults, ...saved, checks: defaults.checks.map(item => ({
+ ...item, ...(saved.checks || []).find(check => check.key === item.key)
+ }))
+ }
+ } catch (_) {
+ this.content = emptyContent()
+ this.$message.error('楠岃瘉鍐呭鏍煎紡閿欒锛岃鑱旂郴绠$悊鍛�')
+ }
+ })
+ },
+ submit() {
+ if (!this.form.standardName?.trim() || !this.form.standardCode?.trim() || !this.form.verifyItem?.trim()) {
+ this.$message.warning('璇峰~鍐欐爣鍑嗗悕绉般�佹爣鍑嗙紪鍙峰拰楠岃瘉椤圭洰')
+ return
+ }
+ this.loading = true
+ const payload = {
+ ...this.form, operationType: 1,
+ confirmUser: (this.form.confirmUser || []).join(','),
+ verificationContent: JSON.stringify(this.content)
+ }
+ const request = this.operationType === 'edit' ? updateMethodVerify : addMethodVerify
+ request(payload).then(res => {
+ if (res.code === 200) {
+ this.$message.success('鎿嶄綔鎴愬姛');
+ this.closeDia()
+ }
+ }).finally(() => {
+ this.loading = false
+ })
+ },
+ openChild(flag, refName, data) {
+ this[flag] = true
+ this.$nextTick(() => this.$refs[refName]?.openDia(data))
+ },
+ viewWorkPermit() {
+ if (!this.form.confirmUser?.length) {
+ this.$message.warning('璇峰厛閫夋嫨妫�娴嬩汉鍛�')
+ return
+ }
+ this.openChild('permitVisible', 'permit', this.form.confirmUser)
+ },
+ viewDevice() {
+ this.openChild('deviceVisible', 'device', this.form)
+ },
+ viewCalibrationsFileDia() {
+ this.openChild('calibrationVisible', 'calibration', this.form)
+ },
+ viewTestRecord() {
+ this.openChild('recordVisible', 'record', this.info)
+ },
+ setDevices(list) {
+ this.deviceVisible = false;
+ this.form.machineAttachmentList = list
+ },
+ closeDia() {
+ this.visible = false;
+ this.$emit('closeDia')
+ }
+ }
+}
+</script>
+
+<style scoped>
+.form-body {
+ max-height: 70vh;
+ overflow: auto;
+}
+
+.verify-table {
+ width: 100%;
+ border-collapse: collapse;
+ margin-bottom: 14px;
+ table-layout: fixed;
+}
+
+.verify-table th, .verify-table td {
+ border: 1px solid #c5cbd0;
+ padding: 10px;
+ vertical-align: middle;
+}
+
+.verify-table th {
+ background: #f5f7f8;
+ font-weight: 500;
+ text-align: center;
+}
+
+.choice-cell {
+ text-align: center;
+}
+
+.row-extra, .decision-row, .attachments {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ flex-wrap: wrap;
+ margin-top: 8px;
+}
+
+.person-input {
+ width: 140px;
+}
+
+.attachments {
+ margin: 16px 0;
+}
+</style>
--
Gitblit v1.9.3