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);