判断字段为空问题

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

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

Loading…
Cancel
Save