From a1faa94fbf85553f22da934a1abc745d89dd8667 Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期一, 19 十月 2026 17:23:49 +0800
Subject: [PATCH] fix: 取消设备核查/比对的身份限制与三张设备计划的审批功能
---
src/views/CNAS/resourceDemand/device/component/equipmentCheck.vue | 80 +++++++++++++++++++++++++++------------
1 files changed, 55 insertions(+), 25 deletions(-)
diff --git a/src/views/CNAS/resourceDemand/device/component/equipmentCheck.vue b/src/views/CNAS/resourceDemand/device/component/equipmentCheck.vue
index b409be9..dfe897f 100644
--- a/src/views/CNAS/resourceDemand/device/component/equipmentCheck.vue
+++ b/src/views/CNAS/resourceDemand/device/component/equipmentCheck.vue
@@ -17,7 +17,7 @@
<span style="width: 80px">A浠櫒鍚嶇О锛�</span>
<el-select v-model="form.adeviceId" :disabled="currentStep !== 0" class="table_input" clearable filterable
placeholder="璁惧鍚嶇О" size="small" style="width:200px" @change="(val) => changeMachineName(val, 'A')">
- <el-option v-for="item in equipOptions" :key="item.value" :label="item.label" :value="item.id">
+ <el-option v-for="item in equipOptions" :key="item.id" :label="item.label" :value="item.id">
{{ item.label + '-' + item.value }}
</el-option>
</el-select>
@@ -36,7 +36,7 @@
<span style="width: 80px">B浠櫒鍚嶇О锛�</span>
<el-select v-model="form.bdeviceId" :disabled="currentStep !== 0" class="table_input" clearable filterable
placeholder="璁惧鍚嶇О" size="small" style="width:200px" @change="(val) => changeMachineName(val, 'B')">
- <el-option v-for="item in equipOptions" :key="item.value" :label="item.label" :value="item.id">
+ <el-option v-for="item in equipOptions" :key="item.id" :label="item.label" :value="item.id">
{{ item.label + '-' + item.value }}
</el-option>
</el-select>
@@ -55,7 +55,7 @@
<span style="width: 80px">C浠櫒鍚嶇О锛�</span>
<el-select v-model="form.cdeviceId" :disabled="currentStep !== 0" class="table_input" clearable filterable
placeholder="璁惧鍚嶇О" size="small" style="width:200px" @change="(val) => changeMachineName(val, 'C')">
- <el-option v-for="item in equipOptions" :key="item.value" :label="item.label" :value="item.id">
+ <el-option v-for="item in equipOptions" :key="item.id" :label="item.label" :value="item.id">
{{ item.label + '-' + item.value }}
</el-option>
</el-select>
@@ -73,7 +73,7 @@
<el-button v-if="currentStep === 0" size="small" type="primary" @click="addTableRow">娣诲姞</el-button>
</div>
<div style="margin: 10px 0">
- <el-table ref="yearTable" :data="recordContrastDetailsList" height="300px" style="width: 100% ;"
+ <el-table ref="yearTable" :data="form.recordContrastDetailsList" height="300px" style="width: 100% ;"
border>
<el-table-column align="center" header-align="center" label="搴忓彿" type="index" width="60"></el-table-column>
<el-table-column label="鏍告煡椤圭洰" min-width="170" prop="checkItems">
@@ -127,11 +127,11 @@
</div>
</div>
<template #footer><span class="dialog-footer">
- <el-button @click="resetForm">鍙� 娑�</el-button>
- <el-button v-if="currentStep === 0 && userId == checkChargerUserId" :loading="submitFormLoading" type="primary" @click="submitCheck">纭�
+ <el-button @click="handleCancel">鍙� 娑�</el-button>
+ <el-button v-if="currentStep === 0" :loading="submitFormLoading" type="primary" @click="submitCheck">纭�
瀹�</el-button>
- <el-button v-if="currentStep === 1 && userId == reviewUserId" :loading="submitFormLoading" @click="examine(0)">涓嶉�氳繃</el-button>
- <el-button v-if="currentStep === 1 && userId == reviewUserId" :loading="submitFormLoading" type="primary" @click="examine(1)">閫�
+ <el-button v-if="currentStep === 1" :loading="submitFormLoading" @click="examine(0)">涓嶉�氳繃</el-button>
+ <el-button v-if="currentStep === 1" :loading="submitFormLoading" type="primary" @click="examine(1)">閫�
杩�</el-button>
</span></template>
</el-dialog>
@@ -147,10 +147,12 @@
} from '@/api/cnas/resourceDemand/device.js'
import { selectUserCondition } from "@/api/business/inspectionTask";
import {mapGetters} from "@/utils/store-compat";
+import draftSave from '@/mixins/draftSave'
export default {
name: "equipment-check",
// import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
components: {},
+ mixins: [draftSave],
data() {
// 杩欓噷瀛樻斁鏁版嵁
return {
@@ -177,7 +179,6 @@
planDetailsId: '',
},
equipOptions: [],
- recordContrastDetailsList: [],
userList: [],
checkChargerUserId: '',
reviewUserId: ''
@@ -200,10 +201,12 @@
this.searchInfo()
},
searchInfo() {
- getExamineRecordContrast({ planDetailsId: this.form.planDetailsId }).then(res => {
+ const planDetailsId = this.form.planDetailsId
+ getExamineRecordContrast({ planDetailsId }).then(res => {
if (res.code === 200) {
- this.form = { ...res.data }
- this.recordContrastDetailsList = this.form.recordContrastDetailsList || []
+ // 鏃犲巻鍙茶褰曟椂鎺ュ彛鍙兘杩斿洖绌猴紝planDetailsId 蹇呴』淇濈暀锛屽惁鍒欐棤娉曟彁浜�
+ this.form = { ...(res.data || {}), planDetailsId }
+ this.form.recordContrastDetailsList = this.form.recordContrastDetailsList || []
if (!this.form.reviewUserId) {
this.currentStep = 0
} else {
@@ -213,6 +216,9 @@
this.currentStep = 2
}
this.reviewUserId = this.form.reviewUserId
+ if (this.currentStep === 0) {
+ this.draftRestore('equipmentCheck', 'form', this.form.planDetailsId, 'dialogVisible')
+ }
}
}).catch(error => {
console.error(error)
@@ -220,29 +226,36 @@
},
// 璧嬪�间华鍣ㄧ紪鍙�
changeMachineName(value, type) {
- const index = this.equipOptions.findIndex(item => item.id === value)
- if (index > -1) {
- if (type === 'A') {
- this.form['adeviceNumber'] = this.equipOptions[index].value
- }
- if (type === 'B') {
- this.form['bdeviceNumber'] = this.equipOptions[index].value
- }
- if (type === 'C') {
- this.form['cdeviceNumber'] = this.equipOptions[index].value
- }
+ const item = this.equipOptions.find(device => device.id === value)
+ if (type === 'A') {
+ this.form['adeviceNumber'] = item ? item.value : ''
+ }
+ if (type === 'B') {
+ this.form['bdeviceNumber'] = item ? item.value : ''
+ }
+ if (type === 'C') {
+ this.form['cdeviceNumber'] = item ? item.value : ''
}
},
// 娣诲姞琛ㄦ牸鏁版嵁
addTableRow() {
- this.recordContrastDetailsList.push({ checkItems: '' })
+ if (!this.form.recordContrastDetailsList) {
+ this.form.recordContrastDetailsList = []
+ }
+ this.form.recordContrastDetailsList.push({ checkItems: '' })
},
submitCheck() {
- this.form.recordContrastDetailsList = this.HaveJson(this.recordContrastDetailsList)
+ const deviceIds = [this.form.adeviceId, this.form.bdeviceId, this.form.cdeviceId].filter(Boolean)
+ if (new Set(deviceIds).size !== deviceIds.length) {
+ this.$message.error('A/B/C 浠櫒涓嶈兘閫夋嫨鍚屼竴鍙拌澶�')
+ return
+ }
+ this.form.recordContrastDetailsList = this.HaveJson(this.form.recordContrastDetailsList || [])
this.submitFormLoading = true
addExamineRecordContrast(this.form).then(res => {
if (res.code == 200) {
this.$message.success('鏂板鎴愬姛')
+ this.draftClear('equipmentCheck')
this.resetForm()
}
this.submitFormLoading = false
@@ -258,6 +271,7 @@
reviewExamineRecordContrast(params).then(res => {
if (res.code == 200) {
this.$message.success('瀹℃牳鎴愬姛')
+ this.draftClear('equipmentCheck')
this.resetForm()
}
this.submitFormLoading = false
@@ -265,7 +279,23 @@
this.submitFormLoading = false
})
},
+ // 鍙栨秷鎸夐挳锛氱‘璁ゅ悗鏁翠綋娓呯┖鏈鑽夌锛涘彸涓婅鍏抽棴/鎰忓閫�鍑哄垯淇濈暀鑽夌
+ handleCancel() {
+ if (this.currentStep !== 0) {
+ this.resetForm()
+ return
+ }
+ this.$confirm('鍙栨秷鍚庢湰娆″~鍐欑殑鏁版嵁灏嗚娓呯┖锛屼笖鏃犳硶鎭㈠锛屾槸鍚︾户缁紵', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '缁х画濉啓',
+ type: 'warning'
+ }).then(() => {
+ this.draftClear('equipmentCheck')
+ this.resetForm()
+ }).catch(() => {})
+ },
resetForm() {
+ this.draftStop('equipmentCheck')
this.dialogVisible = false
this.$emit('closeDialog')
},
--
Gitblit v1.9.3