From 9440d4a1b24d235c209c560003216f60b6aae7e2 Mon Sep 17 00:00:00 2001 From: "zangch@mesnac.com" Date: Fri, 6 Feb 2026 17:55:42 +0800 Subject: [PATCH] =?UTF-8?q?feat(dms/shutDownReason):=20=E5=8E=9F=E5=9B=A0?= =?UTF-8?q?=E7=BC=96=E5=8F=B7reasonCode=E4=B8=BAR001=E7=9A=84=E4=B8=8D?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E8=A2=AB=E5=88=A0=E9=99=A4=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加对固定原因编号 R001 的删除限制检查 - 实现单条记录删除时的原因编号验证 - 实现批量删除时的原因编号验证 - 添加相应的警告提示信息 - 确保 R001 编号数据不会被意外删除 --- src/views/dms/shutReason/index.vue | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/views/dms/shutReason/index.vue b/src/views/dms/shutReason/index.vue index e9bfcfa..3a8241c 100644 --- a/src/views/dms/shutReason/index.vue +++ b/src/views/dms/shutReason/index.vue @@ -384,6 +384,20 @@ export default { /** 删除按钮操作 */ handleDelete(row) { const shutReasonIds = row.shutReasonId || this.ids; + // 防止删除固定原因编号 R001 + if (row && row.reasonCode === 'R001') { + this.$modal.msgWarning('原因编号 R001 不允许删除'); + return; + } + if (!row && Array.isArray(this.ids) && this.ids.length) { + const selectedReasonCodes = this.shutReasonList + .filter(item => this.ids.includes(item.shutReasonId)) + .map(item => item.reasonCode); + if (selectedReasonCodes.includes('R001')) { + this.$modal.msgWarning('原因编号 R001 不允许删除'); + return; + } + } const reasonCode = row.reasonCode || this.ids; this.$modal.confirm('是否确认删除停机原因信息编号为"' + reasonCode + '"的数据项?').then(function() { return delShutReason(shutReasonIds);