判断字段为空问题

master
e 3 years ago
parent 0bcbf95952
commit 3fb67521fb
  1. 11
      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 => {
if (i.isSubject) {
let obj = { let obj = {
id: i.id ? i.id : "", id: i.id ? i.id : "",
bcId: i.bcId, bcId: i.bcId,
required: i.required, required: i.required,
result: i.result, result: i.result,
resultOperation: i.resultOperation resultOperation: i.resultOperation,
ruleOperation: i.ruleOperation
}; };
tempArr.push(obj) tempArr.push(obj)
}
}); });
this.formData.bcJudgmentRuleList = tempArr; this.formData.bcJudgmentRuleList = tempArr;
if (this.isAdd) { // if (this.isAdd) { //

Loading…
Cancel
Save