From a1e4d36f3ab3eb2e10373adfffebda4430e0ea3f Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期二, 27 十月 2026 09:41:51 +0800
Subject: [PATCH] feat(device): 核查计划检查日期精确到日;提前审核增加归档提醒;删除放开至未开始/待批准行
---
src/views/CNAS/resourceDemand/device/component/equipmentVerificationPlan.vue | 68 +++++++++++++++++++++++++++++----
1 files changed, 59 insertions(+), 9 deletions(-)
diff --git a/src/views/CNAS/resourceDemand/device/component/equipmentVerificationPlan.vue b/src/views/CNAS/resourceDemand/device/component/equipmentVerificationPlan.vue
index b79641d..6c5e8d8 100644
--- a/src/views/CNAS/resourceDemand/device/component/equipmentVerificationPlan.vue
+++ b/src/views/CNAS/resourceDemand/device/component/equipmentVerificationPlan.vue
@@ -51,6 +51,7 @@
width="70"></el-table-column>
<el-table-column label="璁惧缂栧彿" min-width="170" prop="deviceNumber"></el-table-column>
<el-table-column label="璁惧鍚嶇О" min-width="180" prop="deviceName" show-overflow-tooltip></el-table-column>
+ <el-table-column label="璁惧鍨嬪彿" min-width="120" prop="deviceModel" show-overflow-tooltip></el-table-column>
<el-table-column label="鏍告煡鏃堕棿" min-width="120" prop="checkTime"
:formatter="formatCheckMonth"></el-table-column>
<el-table-column label="鏍告煡鎸囨爣" min-width="140" prop="checkIndex"> </el-table-column>
@@ -89,7 +90,7 @@
@click="handleRecord(scope.row)">瀹℃牳</el-button>
<el-button v-if="scope.row.recordStatus === 2 || scope.row.recordStatus === 3"
size="small" link type="primary" @click="handleDown(scope.row)">瀵煎嚭</el-button>
- <el-button v-if="scope.row.recordStatus === 0 && scope.row.recordContrastStatus === 0"
+ <el-button v-if="scope.row.recordStatus === 0 || scope.row.recordStatus === 1"
size="small" link type="danger" @click="deleteFun1(scope.row.planDetailsId)">鍒犻櫎</el-button>
</template>
</el-table-column>
@@ -107,16 +108,20 @@
<div class="form-section-title">鍩烘湰淇℃伅</div>
<el-row :gutter="12">
<el-col :span="12">
- <el-form-item label="浠櫒鍚嶇О锛�" prop="deviceName">
+ <el-form-item label="璁惧鍚嶇О锛�" prop="deviceName">
<el-input v-model="form.deviceName" disabled size="small"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="妫�鏌ユ棩鏈燂細" prop="checkTime">
- <el-date-picker v-model="form.checkTime" :disabled="operationType === 'view'" clearable
- format="YYYY-MM" placeholder="閫夋嫨妫�鏌ユ棩鏈�" size="small" style="width:100%" type="month"
- value-format="YYYY-MM">
- </el-date-picker>
+ <el-input v-if="operationType === 'view'" :model-value="formatCheckMonth(null, null, form.checkTime)"
+ disabled size="small"></el-input>
+ <template v-else>
+ <el-date-picker v-model="checkTimeEditValue" clearable format="YYYY-MM-DD" placeholder="閫夋嫨妫�鏌ユ棩鏈�"
+ size="small" style="width:100%" type="date" value-format="YYYY-MM-DD">
+ </el-date-picker>
+ <div v-if="isMonthOnlyCheckTime" class="check-time-tip">绯荤粺鐧昏鍙埌鏈堜唤锛岄�夋嫨鍏蜂綋鏃ユ湡鍚庡皢鎸夋棩淇濆瓨</div>
+ </template>
</el-form-item>
</el-col>
<el-col :span="8">
@@ -212,7 +217,7 @@
</div>
</el-form>
<template #footer><span class="dialog-footer">
- <el-button @click="resetForm">鍙� 娑�</el-button>
+ <el-button @click="handleCancel">鍙� 娑�</el-button>
<el-button :loading="submitFormLoading" type="primary" @click="submitForm"
v-if="operationType !== 'view'">纭� 璁�</el-button>
</span></template>
@@ -471,7 +476,10 @@
this.$nextTick(() => {
this.form = this.HaveJson(row)
if (this.operationType !== 'view') {
- this.draftRestore('equipmentVerificationPlan', 'form', this.form.planDetailsId, 'dialogVisible')
+ const rowDeviceName = this.form.deviceName
+ this.draftRestore('equipmentVerificationPlan', 'form', this.form.planDetailsId, 'dialogVisible',
+ // 璁惧鍚嶇О鏄鐢ㄥ瓧娈碉紝鑽夌閲屼负绌鸿鏄庢槸琚〃鍗曢噸缃竻绌虹殑搴熻崏绋匡紝鐩存帴涓㈠純
+ draft => !!draft.deviceName || !rowDeviceName)
}
})
},
@@ -496,7 +504,7 @@
},
// 鏄庣粏-鍒犻櫎
deleteFun1(id) {
- this.$confirm('鍒犻櫎鍚庯紝鑻ヨ璁惧杩樻湁瀹℃牳閫氳繃鐨勬牳鏌ヨ褰曪紝妗f鐨勬渶杩戞牳鏌ユ棩鏈熷皢鍥為��鍒版渶杩戜竴娆″畬鎴愯褰曪紱鑻ユ病鏈夛紝鍒欐竻绌烘。妗堢殑鏍告煡鏃ユ湡鍜屾牳鏌ュ懆鏈熴�傛槸鍚︾户缁�?', '鎻愮ず', {
+ this.$confirm('鍒犻櫎鍚庯紝璇ヨ鏈鏍哥殑鏍告煡璁板綍鍙婇檮浠朵細涓�骞跺垹闄わ紱鑻ヨ璁惧杩樻湁瀹℃牳閫氳繃鐨勬牳鏌ヨ褰曪紝妗f鐨勬渶杩戞牳鏌ユ棩鏈熷皢鍥為��鍒版渶杩戜竴娆″畬鎴愯褰曪紱鑻ユ病鏈夛紝鍒欐竻绌烘。妗堢殑鏍告煡鏃ユ湡鍜屾牳鏌ュ懆鏈熴�傛槸鍚︾户缁�?', '鎻愮ず', {
confirmButtonText: '纭畾',
cancelButtonText: '鍙栨秷',
type: 'warning'
@@ -518,7 +526,28 @@
this.saveDocx(res, '浠櫒璁惧鏈熼棿鏍告煡璁″垝琛�.docx')
}).catch(() => { })
},
+ // 鏈鏄惁鏈夋敼鍔紙鍚墦寮�鏃舵仮澶嶇殑鑽夌锛�
+ hasUnsavedEdit() {
+ const state = this.draftStates && this.draftStates['equipmentVerificationPlan']
+ return !!state && this.draftSnapshot(state) !== state.baseline
+ },
+ // 鍙栨秷锛氭棤缂栬緫鐩存帴閫�鍑猴紱鏈夌紪杈戝厛纭锛岀‘璁ゅ悗涓㈠純鑽夌閫�鍑�
+ handleCancel() {
+ if (this.operationType === 'view' || !this.hasUnsavedEdit()) {
+ this.dialogVisible = false
+ return
+ }
+ this.$confirm('鏄惁纭鍙栨秷缂栬緫锛熸湰娆$紪杈戣褰曚笉淇濆瓨锛�', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '缁х画缂栬緫',
+ type: 'warning'
+ }).then(() => {
+ this.draftClear('equipmentVerificationPlan')
+ this.dialogVisible = false
+ }).catch(() => { })
+ },
resetForm() {
+ // 鍙充笂瑙掑叧闂椂 close 浜嬩欢鍏堜簬鏄鹃殣鐩戝惉瑙﹀彂锛屽厛鎶婅崏绋垮瓨涓嬪啀閲嶇疆琛ㄥ崟锛岄伩鍏嶉噸缃悗鐨勭┖鍐呭琚瓨鎴愯崏绋�
this.draftStop('equipmentVerificationPlan')
this.$refs.modelForm.resetFields();
this.dialogVisible = false
@@ -625,6 +654,19 @@
}
return list
},
+ // 鏃ユ湡鎺т欢鍙帴鍙� YYYY-MM-DD锛涚郴缁熺櫥璁扮殑寰呮牳鏌ヨ鍙湁骞存湀锛屾湭鏀规棩鏈熸椂涓嶈兘鎶娾�滄棩鈥濆啓杩涜〃鍗�
+ checkTimeEditValue: {
+ get() {
+ const val = this.form.checkTime || ''
+ return /^\d{4}-\d{2}$/.test(val) ? `${val}-01` : val
+ },
+ set(val) {
+ this.form.checkTime = val || ''
+ }
+ },
+ isMonthOnlyCheckTime() {
+ return /^\d{4}-\d{2}$/.test(this.form.checkTime || '')
+ },
},
}
</script>
@@ -712,6 +754,14 @@
margin-bottom: 12px;
}
+.check-time-tip {
+ width: 100%;
+ font-size: 12px;
+ line-height: 1.4;
+ color: #909399;
+ margin-top: 2px;
+}
+
.export-panel {
border: 1px solid #e4e7ed;
border-radius: 6px;
--
Gitblit v1.9.3