判断字段为空问题

master
e 3 years ago
parent 0bcbf95952
commit 3fb67521fb
  1. 25
      src/views/Program.vue

@ -281,13 +281,13 @@ export default {
return; return;
} else { } else {
for (let i = 0; i < this.tableData.length; i++) { for (let i = 0; i < this.tableData.length; i++) {
if (!this.tableData[i].required) { if (this.tableData[i].isSubject && !this.tableData[i].required) {
this.$message.warning(`${i + 1}项,规则要求不能为空`); this.$message.warning(`${i + 1}项,规则要求不能为空`);
return; return;
} else if (!this.tableData[i].result) { } else if (this.tableData[i].isSubject && !this.tableData[i].result) {
this.$message.warning(`${i + 1}项,规则结果不能为空`); this.$message.warning(`${i + 1}项,规则结果不能为空`);
return; return;
} else if (!this.tableData[i].isSave) { } else if (this.tableData[i].isSubject && !this.tableData[i].isSave) {
this.$message.warning(`${i + 1}项,未保存`); this.$message.warning(`${i + 1}项,未保存`);
return; return;
} }
@ -295,14 +295,17 @@ export default {
} }
let tempArr = []; let tempArr = [];
this.tableData.forEach(i => { this.tableData.forEach(i => {
let obj = { if (i.isSubject) {
id: i.id ? i.id : "", let obj = {
bcId: i.bcId, id: i.id ? i.id : "",
required: i.required, bcId: i.bcId,
result: i.result, required: i.required,
resultOperation: i.resultOperation result: i.result,
}; resultOperation: i.resultOperation,
tempArr.push(obj) ruleOperation: i.ruleOperation
};
tempArr.push(obj)
}
}); });
this.formData.bcJudgmentRuleList = tempArr; this.formData.bcJudgmentRuleList = tempArr;
if (this.isAdd) { // if (this.isAdd) { //

Loading…
Cancel
Save