From 75bbb26a8147fa6239cc46025f13a413dbf0e177 Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期四, 15 十月 2026 11:55:02 +0800
Subject: [PATCH] 方法验证模块恢复为本地版本:移除合并进来的同事 Word 表单组件(新增/编辑切换)与上岗证实时查询,恢复本地列表列、搜索与上岗证弹窗实现;人员授权下拉优化与 vite 配置等其余合并内容保留
---
/dev/null | 297 ------------------------------------------
src/views/CNAS/process/method/methodVerification/index.vue | 30 +--
src/api/cnas/process/method/methodVerification.js | 9 -
src/views/CNAS/process/method/methodVerification/component/viewWorkPermitDia.vue | 84 +++--------
4 files changed, 37 insertions(+), 383 deletions(-)
diff --git a/src/api/cnas/process/method/methodVerification.js b/src/api/cnas/process/method/methodVerification.js
index 582953e..250aafe 100644
--- a/src/api/cnas/process/method/methodVerification.js
+++ b/src/api/cnas/process/method/methodVerification.js
@@ -38,15 +38,6 @@
});
}
-// 鎸夊綋鍓嶆墍閫夋娴嬩汉鍛樺疄鏃惰鍙栦换鑱屾巿鏉冭瘉涔�
-export function getCurrentWorkFiles(query) {
- return request({
- url: '/processMethodVerify/getCurrentWorkFiles',
- method: 'get',
- params: query,
- })
-}
-
// 淇敼鏍囧噯鏂规硶楠岃瘉
export function updateMethodVerify(data) {
return request({
diff --git a/src/views/CNAS/process/method/methodVerification/component/viewWorkPermitDia.vue b/src/views/CNAS/process/method/methodVerification/component/viewWorkPermitDia.vue
index cbe7ee6..965a0d7 100644
--- a/src/views/CNAS/process/method/methodVerification/component/viewWorkPermitDia.vue
+++ b/src/views/CNAS/process/method/methodVerification/component/viewWorkPermitDia.vue
@@ -2,25 +2,23 @@
<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="fileUrl(currentInfo)" style="max-height: 90vh;overflow-y: auto;"/>
+ :fileUrl="javaApi+'/img/'+currentInfo.fileUrl" style="max-height: 90vh;overflow-y: auto;"/>
</el-dialog>
</div>
</template>
@@ -29,12 +27,11 @@
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 {
@@ -77,7 +74,7 @@
],
tableData: [],
info: {},
- currentInfo: {},
+ currentInfo:{},
lookDialogVisible: false,
};
},
@@ -86,60 +83,27 @@
},
// 鏂规硶闆嗗悎
methods: {
- fileUrl(row) {
- const image = /\.(png|jpe?g|gif|bmp|webp)$/i.test(row.fileUrl || '')
- return this.javaApi + (image ? '/img/' : '/word/') + row.fileUrl
- },
- // 涓ょ鐢ㄦ硶锛氭暟缁�=妫�娴嬩汉鍛榠d锛堝疄鏃舵煡璇級锛涜瀵硅薄=浼樺厛灞曠ず宸蹭繚瀛樼殑涓婂矖璇侊紝鍏舵鎸夊凡閫夋娴嬩汉鍛樺疄鏃舵煡璇�
- openDia(payload = {}) {
+ openDia(row) {
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 : [])
+ this.info = row
+ this.tableData = this.info.workFileList
},
- 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() {
+ closeFilesLook () {
this.filesDialogVisible = false
},
// 鏌ョ湅鏂囦欢
- handleLook(row) {
- if (!row.fileUrl) {
- this.$message.warning('璇ヤ汉鍛樺凡鏈変换鑱屾巿鏉冭褰曪紝浣嗗皻鏈笂浼犱笂宀楄瘉涔︽枃浠�')
- return
- }
+ handleLook(row){
this.currentInfo = row
this.lookDialogVisible = true
},
// 涓嬭浇
- upload(row) {
- if (!row.fileUrl) {
- this.$message.warning('璇ヤ汉鍛樺凡鏈変换鑱屾巿鏉冭褰曪紝浣嗗皻鏈笂浼犱笂宀楄瘉涔︽枃浠�')
- return
- }
+ upload (row) {
let url = '';
- 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
+ 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;
diff --git a/src/views/CNAS/process/method/methodVerification/component/wordFormDIa.vue b/src/views/CNAS/process/method/methodVerification/component/wordFormDIa.vue
deleted file mode 100644
index 7f6c3b2..0000000
--- a/src/views/CNAS/process/method/methodVerification/component/wordFormDIa.vue
+++ /dev/null
@@ -1,297 +0,0 @@
-<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>
diff --git a/src/views/CNAS/process/method/methodVerification/index.vue b/src/views/CNAS/process/method/methodVerification/index.vue
index c26f254..dd77321 100644
--- a/src/views/CNAS/process/method/methodVerification/index.vue
+++ b/src/views/CNAS/process/method/methodVerification/index.vue
@@ -3,8 +3,8 @@
<div style="display: flex;justify-content: space-between">
<div style="display: flex;">
<div style="margin-bottom: 18px;margin-right: 10px;display: flex;align-items: center;line-height: 32px;">
- <span style="width: 88px;font-size: 14px;font-weight: 700;color: var(--lims-text-2);">鏍囧噯鍚嶇О</span>
- <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="searchForm.standardName"
+ <span style="width: 88px;font-size: 14px;font-weight: 700;color: var(--lims-text-2);">鏍囧噯鏂规硶</span>
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="searchForm.methodName"
@keyup.enter="searchList"></el-input>
</div>
<div style="line-height: 30px;">
@@ -22,26 +22,24 @@
@pagination="pagination">
</limsTable>
</div>
- <component :is="isWordForm ? 'wordFormDIa' : 'formDIa'" v-if="formDIa" ref="formDIa"
- :operationType="operationType" @closeDia="closeDia" />
+ <formDIa v-if="formDIa" ref="formDIa" :operationType="operationType" @closeDia="closeDia"></formDIa>
</div>
</template>
<script>
import limsTable from '@/components/Table/lims-table.vue'
import formDIa from './component/formDIa.vue';
-import wordFormDIa from './component/wordFormDIa.vue';
import { delMethodVerify, exportMethodVerify, pagesMethodVerify } from '@/api/cnas/process/method/methodVerification'
export default {
name: 'MethodVerification',
// import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
- components: { limsTable, formDIa, wordFormDIa },
+ components: { limsTable, formDIa },
data() {
// 杩欓噷瀛樻斁鏁版嵁
return {
searchForm: {
- standardName: '',
+ methodName: '',
operationType: 1,
},
options: [
@@ -50,18 +48,18 @@
],
tableColumn: [
{
- label: '鏍囧噯鍚嶇О',
- prop: 'standardName',
+ label: '鏍囧噯鏂规硶',
+ prop: 'methodName',
minWidth: '100'
},
{
- label: '鏍囧噯缂栧彿',
- prop: 'standardCode',
+ label: '楠岃瘉鍘熷洜',
+ prop: 'verifyReason',
minWidth: '100'
},
{
- label: '楠岃瘉椤圭洰',
- prop: 'verifyItem',
+ label: '涓昏鎶�鏈彉鍖�',
+ prop: 'technologyChange',
minWidth: '100'
},
{
@@ -112,7 +110,6 @@
total: 0,
formDIa: false,
operationType: '',
- isWordForm: true,
};
},
mounted() {
@@ -123,7 +120,7 @@
// 鏌ヨ鍒楄〃
searchList() {
const entity = {
- standardName: this.searchForm.standardName,
+ methodName: this.searchForm.methodName,
operationType: this.searchForm.operationType,
}
const page = this.page
@@ -161,13 +158,12 @@
},
// 閲嶇疆鏌ヨ鏉′欢
resetSearchForm() {
- this.searchForm.standardName = '';
+ this.searchForm.methodName = '';
this.searchList()
},
openFormDia(type, row) {
this.formDIa = true
this.operationType = type
- this.isWordForm = type === 'add' || !!row?.standardCode
this.$nextTick(() => {
this.$refs.formDIa.openDia(row)
})
--
Gitblit v1.9.3