fix:andon报警异常类型

This commit is contained in:
17630416519 2026-01-07 13:23:05 +08:00
parent 0140a9f834
commit 8e58b9a54b
2 changed files with 48 additions and 10 deletions

View File

@ -264,9 +264,10 @@ export default {
},
//
handleReceiverChange(val, index) {
const selectedOption = this.alarmContactOptions.find(option => option.value === val);
//
const selectedOptions = this.alarmContactOptions.filter(option => val.includes(option.value));
this.form[`receiver${index}`] = val;
this.form[`receiver${index}Name`] = selectedOption ? selectedOption.label : undefined;
this.form[`receiver${index}Name`] = selectedOptions.map(option => option.label).join(',');
},
//
resetQuery() {
@ -332,6 +333,20 @@ export default {
this.form = {
...data,
};
//
if (data.receiver1) {
this.form.receiver1 = data.receiver1.split(',');
}
if (data.receiver2) {
this.form.receiver2 = data.receiver2.split(',');
}
if (data.receiver3) {
this.form.receiver3 = data.receiver3.split(',');
}
if (data.receiver4) {
this.form.receiver4 = data.receiver4.split(',');
}
}
});
},
@ -340,14 +355,35 @@ export default {
this.$refs["form"].validate((valid) => {
if (valid) {
console.log(JSON.stringify(this.form));
let data={
let data = {
...this.form,
receiver1:this.form.receiver1.join(','),
receiver2:this.form.receiver2.join(',') ,
receiver3:this.form.receiver3.join(',') ,
receiver4:this.form.receiver4.join(',') ,
receiver1: Array.isArray(this.form.receiver1) ? this.form.receiver1.join(',') : this.form.receiver1,
receiver2: Array.isArray(this.form.receiver2) ? this.form.receiver2.join(',') : this.form.receiver2,
receiver3: Array.isArray(this.form.receiver3) ? this.form.receiver3.join(',') : this.form.receiver3,
receiver4: Array.isArray(this.form.receiver4) ? this.form.receiver4.join(',') : this.form.receiver4,
//
receiver1Name: Array.isArray(this.form.receiver1) ?
this.form.receiver1.map(id => {
const option = this.alarmContactOptions.find(opt => opt.value == id);
return option ? option.label : '';
}).join(',') : this.form.receiver1Name,
receiver2Name: Array.isArray(this.form.receiver2) ?
this.form.receiver2.map(id => {
const option = this.alarmContactOptions.find(opt => opt.value == id);
return option ? option.label : '';
}).join(',') : this.form.receiver2Name,
receiver3Name: Array.isArray(this.form.receiver3) ?
this.form.receiver3.map(id => {
const option = this.alarmContactOptions.find(opt => opt.value == id);
return option ? option.label : '';
}).join(',') : this.form.receiver3Name,
receiver4Name: Array.isArray(this.form.receiver4) ?
this.form.receiver4.map(id => {
const option = this.alarmContactOptions.find(opt => opt.value == id);
return option ? option.label : '';
}).join(',') : this.form.receiver4Name,
}
if (this.form.id != undefined && this.opertype === 2) {
updateAndonAlarmTypeDict(data)
.then((res) => {

View File

@ -481,6 +481,7 @@ export default {
this.open = false;
this.reset(); //
this.getLeftList();
this.processingData = []
})
.catch((err) => {
@ -533,7 +534,8 @@ export default {
message: '响应成功!'
});
this.form.status = '已响应'
this.getLeftList();
this.processingData = res.data.result
// this.getLeftList();
}
})
@ -583,7 +585,7 @@ export default {
message: '处理完毕!'
});
this.form.status = '已处理'
this.getLeftList();
this.processingData = res.data.result
}
})