diff --git a/src/main/resources/templates/admin/business/process-edit.ftl b/src/main/resources/templates/admin/business/process-edit.ftl
index 5e1ff5f..a677373 100644
--- a/src/main/resources/templates/admin/business/process-edit.ftl
+++ b/src/main/resources/templates/admin/business/process-edit.ftl
@@ -334,7 +334,7 @@
-
+
@@ -588,6 +588,16 @@
}
return true
},
+
+ checkExpirationDate() {
+ const emptyRows = this.incomeDetails.filter(detail => isBlank(detail.expirationDate))
+ if (isNotEmpty(emptyRows)) {
+ const indexString = emptyRows.map(detail => detail.index).join(",")
+ this.$message.error("在合同清单明细中第 '" + indexString + "' 行的质保期未填写")
+ return false
+ }
+ return true
+ },
/**
* 保存 业务采购合同清单明细,返回上一级的表单界面
*/
@@ -670,8 +680,9 @@
this.initForm({ ...form, ...process, ...contract, applyDeptId })
this.projectSelected = true
this.processType = process.processType
+ let indexCounter = 1;
this.incomeDetails = incomeDetails && incomeDetails.map(detail => ({
- ...detail, type: computeType(detail.type)
+ ...detail, type: computeType(detail.type), index: indexCounter++ // 用于记录序号,展示或者定位
}))
this.fileList = attachments.map(item => ({
diff --git a/src/main/resources/templates/admin/business/process-new.ftl b/src/main/resources/templates/admin/business/process-new.ftl
index ad73f16..c212949 100644
--- a/src/main/resources/templates/admin/business/process-new.ftl
+++ b/src/main/resources/templates/admin/business/process-new.ftl
@@ -109,7 +109,8 @@
-
+
@@ -829,7 +830,8 @@
return
}
fetch("${base}/process/projects?q=" + q)
- .then(res => res.json())
+ .then(checkStatus)
+ .then(parseJSON)
.then(data => {
if (data.length === 0) {
callback([])
@@ -839,8 +841,16 @@
callback(data)
}
})
- .catch(err => {
- this.$message.error('项目搜索失败');
+ .catch(({ response }) => {
+ if (response) {
+ parseJSON(response)
+ .then(json => {
+ this.$message.error(json.message || "项目搜索失败")
+ })
+ }
+ else {
+ this.$message.error("项目搜索失败")
+ }
})
},
/**
@@ -860,7 +870,8 @@
})
fetch("${base}/process/projects/" + id + "?processType=" + this.processType)
- .then(res => res.json())
+ .then(checkStatus)
+ .then(parseJSON)
.then(data => {
const { incomeDetails, procurementDetails, ...form } = data
if (!form.projectNo || !form.projectName) {
@@ -892,8 +903,9 @@
this.initForm(form)
this.projectSelected = true
+ let indexCounter = 1;
this.incomeDetails = incomeDetails && incomeDetails.map(detail => ({
- ...detail, type: computeType(detail.type)
+ ...detail, type: computeType(detail.type), index: indexCounter++ // 用于记录序号,展示或者定位
}))
let rowKey = 0
@@ -906,9 +918,18 @@
this.rowKeyCounter = rowKey
})
- .catch(err => {
- this.$message.error("项目'" + name + "'加载失败");
+ .catch(({ response }) => {
+ if (response) {
+ parseJSON(response)
+ .then(json => {
+ this.$message.error(json.message || "项目'" + name + "'加载失败")
+ })
+ }
+ else {
+ this.$message.error("项目'" + name + "'加载失败")
+ }
})
+
.finally(() => loading.close())
},
clearProjectProcess() {
@@ -1118,8 +1139,8 @@
checkExpirationDate() {
const emptyRows = this.incomeDetails.filter(detail => isBlank(detail.expirationDate))
if (isNotEmpty(emptyRows)) {
- const row = emptyRows[0]
- this.$message.error("合同清单明细 名称为:'" + row.name + "' 类别为:'" + row.type + "' 的质保期未填写")
+ const indexString = emptyRows.map(detail => detail.index).join(",")
+ this.$message.error("在合同清单明细中第 '" + indexString + "' 行的质保期未填写")
return false
}
return true