diff --git a/src/main/resources/templates/admin/business/process-edit.ftl b/src/main/resources/templates/admin/business/process-edit.ftl index f01c053..b0bb7d9 100644 --- a/src/main/resources/templates/admin/business/process-edit.ftl +++ b/src/main/resources/templates/admin/business/process-edit.ftl @@ -480,7 +480,6 @@ const procurementDetailProperties = [ "spec", - "amount", "purchaseList", "amountCurrent", "supplierName", @@ -574,16 +573,32 @@ * @returns {boolean} 校验通过否 */ checkProcurementDetails() { - const emptyRows = this.procurementDetails.filter(detail => { + let row = 1; + const emptyRowIndex = [] + + const containsEmpty = detail => { return isNotEmpty(procurementDetailProperties.filter(property => isBlank(detail[property]))) + } + + this.procurementDetails.forEach(detail => { + if (containsEmpty(detail)) { + emptyRowIndex.push(row) + } + row++; + const { children } = detail + if (children) { + children.forEach(childDetail => { + if (containsEmpty(childDetail)) { + emptyRowIndex.push(row) + } + // 每个children都加1 + row++; + }) + } }) - if (isNotEmpty(emptyRows)) { - this.procurementDetails.forEach(detail => { - const properties = procurementDetailProperties.filter(property => isBlank(detail[property])) - console.log(properties) - }) - const row = emptyRows[0] - this.$message.error("合同清单明细 费用项目为:'" + row.feeType + "' 采购类别为:'" + row.category + "' 的数据未填写") + if (isNotEmpty(emptyRowIndex)) { + const indexString = emptyRowIndex.join(",") + this.$message.error("在合同清单明细中第 '" + indexString + "' 行中的数据未填写完整") return false } return true @@ -871,6 +886,9 @@ } if (!validStatus) { + if (isEmpty(document.getElementsByClassName('el-message'))) { + this.$message.error("表单填写不完整,不能提交"); + } return false } @@ -883,7 +901,9 @@ const detail = budgetCostIdMap.get(budgetCostId) const ret = [] const map = detail => { - const ret = { id: detail.id } + const ret = { + id: detail.id, amount: detail.amount + } procurementDetailProperties.forEach(property => { ret[property] = detail[property] }) diff --git a/src/main/resources/templates/admin/business/process-new.ftl b/src/main/resources/templates/admin/business/process-new.ftl index 0cdb0da..42adcba 100644 --- a/src/main/resources/templates/admin/business/process-new.ftl +++ b/src/main/resources/templates/admin/business/process-new.ftl @@ -506,7 +506,7 @@