|
|
|
@ -384,6 +384,20 @@ export default {
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
handleDelete(row) {
|
|
|
|
handleDelete(row) {
|
|
|
|
const shutReasonIds = row.shutReasonId || this.ids;
|
|
|
|
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;
|
|
|
|
const reasonCode = row.reasonCode || this.ids;
|
|
|
|
this.$modal.confirm('是否确认删除停机原因信息编号为"' + reasonCode + '"的数据项?').then(function() {
|
|
|
|
this.$modal.confirm('是否确认删除停机原因信息编号为"' + reasonCode + '"的数据项?').then(function() {
|
|
|
|
return delShutReason(shutReasonIds);
|
|
|
|
return delShutReason(shutReasonIds);
|
|
|
|
|