保存流程返回上一级

master
Harry Yang 2023-01-03 10:42:48 +08:00
parent eb26bcf326
commit bd84dc2db0
2 changed files with 22 additions and 31 deletions

View File

@ -354,7 +354,6 @@
</el-table> </el-table>
<el-row style="margin: 20px 0"> <el-row style="margin: 20px 0">
<el-button type="info" @click="goToSaleContractProcess">返回上一级</el-button>
<el-button type="primary" @click="submitToSaleContractProcess">保存并返回上一级</el-button> <el-button type="primary" @click="submitToSaleContractProcess">保存并返回上一级</el-button>
</el-row> </el-row>
@ -450,7 +449,6 @@
</el-table> </el-table>
<el-row style="margin: 20px 0"> <el-row style="margin: 20px 0">
<el-button type="info" @click="goToProcurementContract">返回上一级</el-button>
<el-button type="primary" @click="saveProcurementContractDetail">保存并返回上一级</el-button> <el-button type="primary" @click="saveProcurementContractDetail">保存并返回上一级</el-button>
</el-row> </el-row>
@ -587,13 +585,10 @@
return true return true
}, },
/** /**
* 保存 业务采购合同清单明细,并验证表单是否填写完整, * 保存 业务采购合同清单明细,返回上一级的表单界面
* 如果完整就到流程表单界面
*/ */
saveProcurementContractDetail() { saveProcurementContractDetail() {
if (this.checkProcurementDetails()) { this.goToProcurementContract()
this.goToProcurementContract()
}
}, },
goToContractDetail() { goToContractDetail() {
@ -936,10 +931,12 @@
this.$message({ this.$message({
showClose: true, showClose: true,
message: processForm.status === 'draft' ? '草稿保存成功' : "提交成功", message: processForm.status === 'draft' ? '草稿保存成功' : "提交成功",
type: 'success' type: 'success',
onClose: () => {
this.resetForm()
this.backLastPage()
}
}) })
this.resetForm()
this.backLastPage()
}).catch(({ response }) => { }).catch(({ response }) => {
const defaultMessage = () => { const defaultMessage = () => {
return processForm.status === 'draft' ? '草稿保存失败' : "项目提交失败" return processForm.status === 'draft' ? '草稿保存失败' : "项目提交失败"

View File

@ -472,8 +472,7 @@
</el-table> </el-table>
<el-row style="margin: 20px 0"> <el-row style="margin: 20px 0">
<el-button type="info" @click="goToSaleContractProcess">返回上一级</el-button> <el-button type="primary" @click="saveAndGoToSaleContractProcess">保存并返回上一级</el-button>
<el-button type="primary" @click="submitToSaleContractProcess">保存并返回上一级</el-button>
</el-row> </el-row>
</div> </div>
@ -570,7 +569,6 @@
</el-table> </el-table>
<el-row style="margin: 20px 0"> <el-row style="margin: 20px 0">
<el-button type="info" @click="goToProcurementContract">返回上一级</el-button>
<el-button type="primary" @click="saveProcurementContractDetail">保存并返回上一级</el-button> <el-button type="primary" @click="saveProcurementContractDetail">保存并返回上一级</el-button>
</el-row> </el-row>
@ -746,16 +744,12 @@
this.processType = saleContract this.processType = saleContract
}, },
goToProcurementContract() {
this.changeMode(procurementContractProcess)
this.processType = procurementContract
},
/** /**
* 校验不通过提示 * 校验不通过提示
* @returns {boolean} 校验通过否 * @returns {boolean} 校验通过否
*/ */
checkProcurementDetails() { checkProcurementDetails() {
// TODO FIXME 修改为提示第几行数据有问题
const emptyRows = this.procurementDetails.filter(detail => { const emptyRows = this.procurementDetails.filter(detail => {
return isNotEmpty(procurementDetailProperties.filter(property => isBlank(detail[property]))) return isNotEmpty(procurementDetailProperties.filter(property => isBlank(detail[property])))
}) })
@ -772,13 +766,11 @@
return true return true
}, },
/** /**
* 保存 业务采购合同清单明细,并验证表单是否填写完整, * 保存 业务采购合同清单明细
* 如果完整就到流程表单界面
*/ */
saveProcurementContractDetail() { saveProcurementContractDetail() {
if (this.checkProcurementDetails()) { this.changeMode(procurementContractProcess)
this.goToProcurementContract() this.processType = procurementContract
}
}, },
goToContractDetail() { goToContractDetail() {
@ -1097,10 +1089,12 @@
this.$message({ this.$message({
showClose: true, showClose: true,
message: processForm.status === 'draft' ? '草稿保存成功' : "提交成功", message: processForm.status === 'draft' ? '草稿保存成功' : "提交成功",
type: 'success' type: 'success',
onClose: () => {
this.resetForm()
this.goToHome()
}
}) })
this.resetForm()
this.goToHome()
}).catch(({ response }) => { }).catch(({ response }) => {
const defaultMessage = () => { const defaultMessage = () => {
return processForm.status === 'draft' ? '草稿保存失败' : "项目提交失败" return processForm.status === 'draft' ? '草稿保存失败' : "项目提交失败"
@ -1126,11 +1120,11 @@
} }
return true return true
}, },
submitToSaleContractProcess() { /**
// 做校验 * 保存销售合同详情数据,并返回表单界面
if (this.checkExpirationDate()) { */
this.goToSaleContractProcess() saveAndGoToSaleContractProcess() {
} this.goToSaleContractProcess()
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {