diff --git a/src/views/workCenter/annualRevisionPlanActivelyReport/RevisionPlanActivelyReportFlow.vue b/src/views/workCenter/annualRevisionPlanActivelyReport/RevisionPlanActivelyReportFlow.vue index d30d5560..b3e42665 100644 --- a/src/views/workCenter/annualRevisionPlanActivelyReport/RevisionPlanActivelyReportFlow.vue +++ b/src/views/workCenter/annualRevisionPlanActivelyReport/RevisionPlanActivelyReportFlow.vue @@ -614,7 +614,7 @@ export default { return infoJsonStr }, // 保存快照 - saveParamJsonStr () { + saveParamJsonStr (callback) { // 流程信息表单 const processInfoForm = this.processInfoForm.getFieldsValue() // 流程审批信息 @@ -701,9 +701,12 @@ export default { params.infoJsonStr = infoJsonStr params.taskId = this.$route.query.taskId params.prcType = ProcessType.ES_ANNUAL_REPORT.value - saveSnapShot(params).then(res => { - if (!res.success) { - console.log(res.message) + saveSnapShot(params).then(async res => { + if (res.success) { + callback && await callback() + } else { + this.$message.warning(res.message) + this.loading = false } }) }, @@ -741,18 +744,29 @@ export default { // 快照JSON param.common.infoJsonStr = this.getParamJsonStr() } - func(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - if (this.$route.query.taskId) { - await this.saveParamJsonStr() + if (this.$route.query.taskId) { + this.saveParamJsonStr(() => { + func(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) + }) + } else { + func(param).then(async res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false } - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } - }) + }) + } } else { this.switchValue = 'base' } @@ -810,16 +824,17 @@ export default { } param.common = approvalValues param.common.taskId = this.$route.query.taskId - activelyReportAgree(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - // 保存快照 - await this.saveParamJsonStr() - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } + // 保存快照 + this.saveParamJsonStr(() => { + activelyReportAgree(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) }) } else { this.switchValue = 'base' @@ -839,16 +854,17 @@ export default { const param = {} param.common = Object.assign({}, values) param.common.taskId = this.$route.query.taskId - activelyReportAgree(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - // 保存快照 - await this.saveParamJsonStr() - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } + // 保存快照 + this.saveParamJsonStr(() => { + activelyReportAgree(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) }) } }) @@ -868,16 +884,17 @@ export default { const param = {} param.common = Object.assign({}, values) param.common.taskId = this.$route.query.taskId - activelyReportReject(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - // 保存快照 - await this.saveParamJsonStr() - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } + // 保存快照 + this.saveParamJsonStr(() => { + activelyReportReject(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) }) } }) diff --git a/src/views/workCenter/annualRevisionPlanStandardizationInit/RevisionPlanStandardizationInitFlow.vue b/src/views/workCenter/annualRevisionPlanStandardizationInit/RevisionPlanStandardizationInitFlow.vue index 88901e80..4435e873 100644 --- a/src/views/workCenter/annualRevisionPlanStandardizationInit/RevisionPlanStandardizationInitFlow.vue +++ b/src/views/workCenter/annualRevisionPlanStandardizationInit/RevisionPlanStandardizationInitFlow.vue @@ -442,7 +442,7 @@ export default { return infoJsonStr }, // 保存快照 - saveParamJsonStr () { + saveParamJsonStr (callback) { // 流程信息表单 const processInfoForm = this.processInfoForm.getFieldsValue() // 流程审批信息 @@ -460,9 +460,12 @@ export default { }) params.taskId = this.$route.query.taskId params.prcType = ProcessType.ES_ANNUAL_INIT.value - saveSnapShot(params).then(res => { - if (!res.success) { - console.log(res.message) + saveSnapShot(params).then(async res => { + if (res.success) { + callback && await callback() + } else { + this.$message.warning(res.message) + this.loading = false } }) }, @@ -497,18 +500,30 @@ export default { // 快照JSON param.common.infoJsonStr = this.getParamJsonStr() } - func(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - if (this.$route.query.taskId) { - await this.saveParamJsonStr() + if (this.$route.query.taskId) { + // 先保存快照再提交 + this.saveParamJsonStr(() => { + func(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) + }) + } else { + func(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false } - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } - }) + }) + } } else { this.switchValue = 'base' } @@ -555,16 +570,17 @@ export default { param.common.taskId = this.$route.query.taskId param.dataList = data.dataSource this.loading = true - standardizationInitAgree(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - // 保存快照 - await this.saveParamJsonStr() - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } + // 保存快照 + this.saveParamJsonStr(() => { + standardizationInitAgree(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) }) } else { this.switchValue = 'base' @@ -587,16 +603,17 @@ export default { param.common.taskId = this.$route.query.taskId param.dataList = data.dataSource this.loading = true - standardizationInitAgree(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - // 保存快照 - await this.saveParamJsonStr() - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } + // 保存快照 + this.saveParamJsonStr(() => { + standardizationInitAgree(param).then(async res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) }) } }) @@ -617,16 +634,17 @@ export default { param.common = Object.assign({}, values) param.common.taskId = this.$route.query.taskId console.log(param, this.$route.query.taskId) - standardizationInitReject(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - // 保存快照 - await this.saveParamJsonStr() - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } + // 保存快照 + this.saveParamJsonStr(() => { + standardizationInitReject(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) }) } }) diff --git a/src/views/workCenter/enterpriseStandardAnnul/EnterpriseStandardAnnulFlow.vue b/src/views/workCenter/enterpriseStandardAnnul/EnterpriseStandardAnnulFlow.vue index aa657f73..bc4d003b 100644 --- a/src/views/workCenter/enterpriseStandardAnnul/EnterpriseStandardAnnulFlow.vue +++ b/src/views/workCenter/enterpriseStandardAnnul/EnterpriseStandardAnnulFlow.vue @@ -395,7 +395,7 @@ export default { return infoJsonStr }, // 保存快照 - saveParamJsonStr () { + saveParamJsonStr (callback) { // 流程信息表单 const processInfoForm = this.processInfoForm.getFieldsValue() // 流程审批信息 @@ -413,9 +413,12 @@ export default { }) params.taskId = this.$route.query.taskId params.prcType = ProcessType.ES_ABOLISH.value - saveSnapShot(params).then(res => { - if (!res.success) { - console.log(res.message) + saveSnapShot(params).then(async res => { + if (res.success) { + callback && await callback() + } else { + this.$message.warning(res.message) + this.loading = false } }) }, @@ -453,18 +456,30 @@ export default { // 快照JSON paramObj.common.infoJsonStr = this.getParamJsonStr() } - func(paramObj).then(async res => { - if (res.success) { - this.$message.success(res.message) - if (this.$route.query.taskId) { - await this.saveParamJsonStr() + if (this.$route.query.taskId) { + // 保存快照后同意 + this.saveParamJsonStr(() => { + func(paramObj).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) + }) + } else { + func(paramObj).then(async res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false } - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } - }) + }) + } } else { this.switchValue = 'base' } @@ -510,16 +525,17 @@ export default { const param = {} param.common = Object.assign({}, values) param.common.taskId = this.$route.query.taskId - enStandardAnnulAgree(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - // 保存快照 - await this.saveParamJsonStr() - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } + // 保存快照 + this.saveParamJsonStr(() => { + enStandardAnnulAgree(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) }) } }) @@ -539,18 +555,19 @@ export default { const param = {} param.common = Object.assign({}, values) param.common.taskId = this.$route.query.taskId - enStandardAnnulReject(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - // 保存快照 - await this.saveParamJsonStr() - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } - }).finally(() => { - this.validatorRules.commitText.rules[0].required = false + // 保存快照 + this.saveParamJsonStr(() => { + enStandardAnnulReject(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }).finally(() => { + this.validatorRules.commitText.rules[0].required = false + }) }) } }) diff --git a/src/views/workCenter/enterpriseStandardChange/EnterpriseStandardChangeFlow.vue b/src/views/workCenter/enterpriseStandardChange/EnterpriseStandardChangeFlow.vue index 8967b47f..6a71a5be 100644 --- a/src/views/workCenter/enterpriseStandardChange/EnterpriseStandardChangeFlow.vue +++ b/src/views/workCenter/enterpriseStandardChange/EnterpriseStandardChangeFlow.vue @@ -430,7 +430,7 @@ export default { return infoJsonStr }, // 保存快照 - saveParamJsonStr () { + saveParamJsonStr (callback) { // 流程信息表单 const processInfoForm = this.processInfoForm.getFieldsValue() // 流程审批信息 @@ -452,9 +452,12 @@ export default { }) params.taskId = this.$route.query.taskId params.prcType = ProcessType.ES_CHANGE.value - saveSnapShot(params).then(res => { - if (!res.success) { - console.log(res.message) + saveSnapShot(params).then(async res => { + if (res.success) { + callback && await callback() + } else { + this.$message.warning(res.message) + this.loading = false } }) }, @@ -498,18 +501,29 @@ export default { // 快照JSON param.common.infoJsonStr = this.getParamJsonStr() } - func(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - if (this.$route.query.taskId) { - await this.saveParamJsonStr() + if (this.$route.query.taskId) { + this.saveParamJsonStr(() => { + func(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) + }) + } else { + func(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false } - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } - }) + }) + } } else { this.switchValue = 'base' } @@ -555,16 +569,17 @@ export default { const param = {} param.common = Object.assign({}, values) param.common.taskId = this.$route.query.taskId - enStandardChangeAgree(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - // 保存快照 - await this.saveParamJsonStr() - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } + // 保存快照 + this.saveParamJsonStr(() => { + enStandardChangeAgree(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) }) } }) @@ -584,18 +599,19 @@ export default { const param = {} param.common = Object.assign({}, values) param.common.taskId = this.$route.query.taskId - enStandardChangeReject(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - // 保存快照 - await this.saveParamJsonStr() - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } - }).finally(() => { - this.validatorRules.commitText.rules[0].required = false + // 保存快照 + this.saveParamJsonStr(() => { + enStandardChangeReject(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }).finally(() => { + this.validatorRules.commitText.rules[0].required = false + }) }) } }) diff --git a/src/views/workCenter/enterpriseStandardInitChange/PlanApprovalChangeFlow.vue b/src/views/workCenter/enterpriseStandardInitChange/PlanApprovalChangeFlow.vue index a00aba97..df22ef52 100644 --- a/src/views/workCenter/enterpriseStandardInitChange/PlanApprovalChangeFlow.vue +++ b/src/views/workCenter/enterpriseStandardInitChange/PlanApprovalChangeFlow.vue @@ -944,7 +944,7 @@ export default { return infoJsonStr }, // 保存快照 - saveParamJsonStr () { + saveParamJsonStr (callback) { // 流程信息表单 const processInfoForm = this.processInfoForm.getFieldsValue() // 业务基本信息-申请类型和项目类别 @@ -996,9 +996,12 @@ export default { }) params.taskId = this.$route.query.taskId params.prcType = ProcessType.ES_INIT_CHANGE.value - saveSnapShot(params).then(res => { - if (!res.success) { - console.log(res.message) + saveSnapShot(params).then(async res => { + if (res.success) { + callback && await callback() + } else { + this.$message.warning(res.message) + this.loading = false } }) }, @@ -1105,35 +1108,63 @@ export default { // 快照JSON param.common.infoJsonStr = this.getParamJsonStr() } - func(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - if (this.$route.query.taskId) { - await this.saveParamJsonStr() - } - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - if (res.message === this.$t('workCenter.enterpriseInitChangePlan.existingNumber')) { - // 已经存在编号,重新生成 - if ([ProjectType.ENACT.value, ProjectType.MODIFY.value, ProjectType.MERGE.value].includes(this.formInline.projectType)) { - // 是制定修订或者合并,重新获取企标编号 - this.loading = true - if (this.$refs.approvalBaseInfo) { - await this.$refs.approvalBaseInfo.getEnStandardNo() - } else if (this.$refs.changeBaseInfo) { - await this.$refs.changeBaseInfo.getEnStandardNo() + if (this.$route.query.taskId) { + this.saveParamJsonStr(() => { + func(param).then(async res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + if (res.message === this.$t('workCenter.enterpriseInitChangePlan.existingNumber')) { + // 已经存在编号,重新生成 + if ([ProjectType.ENACT.value, ProjectType.MODIFY.value, ProjectType.MERGE.value].includes(this.formInline.projectType)) { + // 是制定修订或者合并,重新获取企标编号 + this.loading = true + if (this.$refs.approvalBaseInfo) { + await this.$refs.approvalBaseInfo.getEnStandardNo() + } else if (this.$refs.changeBaseInfo) { + await this.$refs.changeBaseInfo.getEnStandardNo() + } + setTimeout(() => { + this.loading = false + // 提示顺序号已重新生成 + this.$message.success(this.$t('workCenter.enterpriseInitChangePlan.numberReset')) + }, 500) + } + } + } + }) + }) + } else { + func(param).then(async res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + if (res.message === this.$t('workCenter.enterpriseInitChangePlan.existingNumber')) { + // 已经存在编号,重新生成 + if ([ProjectType.ENACT.value, ProjectType.MODIFY.value, ProjectType.MERGE.value].includes(this.formInline.projectType)) { + // 是制定修订或者合并,重新获取企标编号 + this.loading = true + if (this.$refs.approvalBaseInfo) { + await this.$refs.approvalBaseInfo.getEnStandardNo() + } else if (this.$refs.changeBaseInfo) { + await this.$refs.changeBaseInfo.getEnStandardNo() + } + setTimeout(() => { + this.loading = false + // 提示顺序号已重新生成 + this.$message.success(this.$t('workCenter.enterpriseInitChangePlan.numberReset')) + }, 500) } - setTimeout(() => { - this.loading = false - // 提示顺序号已重新生成 - this.$message.success(this.$t('workCenter.enterpriseInitChangePlan.numberReset')) - }, 500) } } - } - }) + }) + } }) }) }) @@ -1149,16 +1180,17 @@ export default { param.common = Object.assign({}, approvalValues) param.common.taskId = this.$route.query.taskId param.flowUser = Object.assign({}, values) - enterprisePlanApprovalAgree(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - // 保存快照 - await this.saveParamJsonStr() - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } + // 保存快照 + this.saveParamJsonStr(() => { + enterprisePlanApprovalAgree(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) }) } else { this.switchValue = 'base' @@ -1246,16 +1278,17 @@ export default { return } this.loading = true - enterprisePlanApprovalAgree(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - // 保存快照 - await this.saveParamJsonStr() - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } + // 保存快照 + this.saveParamJsonStr(() => { + enterprisePlanApprovalAgree(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) }) }) }, @@ -1274,18 +1307,19 @@ export default { const param = {} param.common = Object.assign({}, values) param.common.taskId = this.$route.query.taskId - enterprisePlanApprovalReject(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - // 保存快照 - await this.saveParamJsonStr() - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } - }).finally(() => { - this.validatorRules.commitText.rules[0].required = false + // 保存快照 + this.saveParamJsonStr(() => { + enterprisePlanApprovalReject(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }).finally(() => { + this.validatorRules.commitText.rules[0].required = false + }) }) } }) @@ -1300,16 +1334,17 @@ export default { const param = {} param.common = Object.assign({}, values) param.common.taskId = this.$route.query.taskId - enterprisePlanApprovalAgree(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - // 保存快照 - await this.saveParamJsonStr() - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } + // 保存快照 + this.saveParamJsonStr(() => { + enterprisePlanApprovalAgree(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) }) } }) diff --git a/src/views/workCenter/enterpriseStandardRecheck/EnterpriseStandardRecheckFlow.vue b/src/views/workCenter/enterpriseStandardRecheck/EnterpriseStandardRecheckFlow.vue index 47151bf0..a96f2b42 100644 --- a/src/views/workCenter/enterpriseStandardRecheck/EnterpriseStandardRecheckFlow.vue +++ b/src/views/workCenter/enterpriseStandardRecheck/EnterpriseStandardRecheckFlow.vue @@ -452,7 +452,7 @@ export default { return infoJsonStr }, // 保存快照 - saveParamJsonStr () { + saveParamJsonStr (callback) { // 流程信息表单 const processInfoForm = this.processInfoForm.getFieldsValue() // 流程审批信息 @@ -470,9 +470,12 @@ export default { }) params.taskId = this.$route.query.taskId params.prcType = ProcessType.ES_RECHECK.value - saveSnapShot(params).then(res => { - if (!res.success) { - console.log(res.message) + saveSnapShot(params).then(async res => { + if (res.success) { + callback && await callback() + } else { + this.$message.warning(res.message) + this.loading = false } }) }, @@ -510,18 +513,29 @@ export default { // 快照JSON paramObj.common.infoJsonStr = this.getParamJsonStr() } - func(paramObj).then(async res => { - if (res.success) { - this.$message.success(res.message) - if (this.$route.query.taskId) { - await this.saveParamJsonStr() + if (this.$route.query.taskId) { + this.saveParamJsonStr(() => { + func(paramObj).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) + }) + } else { + func(paramObj).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false } - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } - }) + }) + } } else { this.switchValue = 'base' } @@ -566,16 +580,17 @@ export default { param.common.taskId = this.$route.query.taskId param.data = Object.assign({}, data.formInline) console.log(param) - enStandardRecheckAgree(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - // 保存快照 - await this.saveParamJsonStr() - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } + // 保存快照 + this.saveParamJsonStr(() => { + enStandardRecheckAgree(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) }) } else { this.switchValue = 'base' @@ -595,16 +610,17 @@ export default { const param = {} param.common = Object.assign({}, values) param.common.taskId = this.$route.query.taskId - enStandardRecheckAgree(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - // 保存快照 - await this.saveParamJsonStr() - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } + // 保存快照 + this.saveParamJsonStr(() => { + enStandardRecheckAgree(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) }) } }) @@ -624,18 +640,19 @@ export default { const param = {} param.common = Object.assign({}, values) param.common.taskId = this.$route.query.taskId - enStandardRecheckReject(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - // 保存快照 - await this.saveParamJsonStr() - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } - }).finally(() => { - this.validatorRules.commitText.rules[0].required = false + // 保存快照 + this.saveParamJsonStr(() => { + enStandardRecheckReject(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }).finally(() => { + this.validatorRules.commitText.rules[0].required = false + }) }) } }) diff --git a/src/views/workCenter/enterpriseStandardRevision/EnterpriseStandardRevisionFlow.vue b/src/views/workCenter/enterpriseStandardRevision/EnterpriseStandardRevisionFlow.vue index 5b71c352..60caa681 100644 --- a/src/views/workCenter/enterpriseStandardRevision/EnterpriseStandardRevisionFlow.vue +++ b/src/views/workCenter/enterpriseStandardRevision/EnterpriseStandardRevisionFlow.vue @@ -580,7 +580,7 @@ export default { return infoJsonStr }, // 保存快照 - saveParamJsonStr () { + saveParamJsonStr (callback) { // 流程信息表单 const processInfoForm = this.processInfoForm.getFieldsValue() // 流程审批信息 @@ -598,9 +598,12 @@ export default { }) params.taskId = this.$route.query.taskId params.prcType = ProcessType.ES_EDIT.value - saveSnapShot(params).then(res => { - if (!res.success) { - console.log(res.message) + saveSnapShot(params).then(async res => { + if (res.success) { + callback && await callback() + } else { + this.$message.warning(res.message) + this.loading = false } }) }, @@ -655,18 +658,29 @@ export default { // 快照JSON param.common.infoJsonStr = this.getParamJsonStr() } - func(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - if (this.$route.query.taskId) { - await this.saveParamJsonStr() + if (this.$route.query.taskId) { + this.saveParamJsonStr(() => { + func(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) + }) + } else { + func(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false } - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } - }) + }) + } } else { this.switchValue = 'base' } @@ -721,16 +735,17 @@ export default { param.common.taskId = this.$route.query.taskId param.data = data this.loading = true - enStandardEditAgree(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - // 保存快照 - await this.saveParamJsonStr() - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } + // 保存快照 + this.saveParamJsonStr(() => { + enStandardEditAgree(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) }) } else { this.switchValue = 'base' @@ -747,16 +762,17 @@ export default { param.common.taskId = this.$route.query.taskId param.data = data this.loading = true - enStandardEditAgree(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - // 保存快照 - await this.saveParamJsonStr() - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } + // 保存快照 + this.saveParamJsonStr(() => { + enStandardEditAgree(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) }) } else { this.switchValue = 'base' @@ -780,16 +796,17 @@ export default { param.common = Object.assign({}, values) param.common.taskId = this.$route.query.taskId param.data = data - enStandardEditAgree(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - // 保存快照 - await this.saveParamJsonStr() - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } + // 保存快照 + this.saveParamJsonStr(() => { + enStandardEditAgree(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) }) } } else { @@ -798,16 +815,17 @@ export default { const param = {} param.common = Object.assign({}, values) param.common.taskId = this.$route.query.taskId - enStandardEditAgree(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - // 保存快照 - await this.saveParamJsonStr() - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } + // 保存快照 + this.saveParamJsonStr(() => { + enStandardEditAgree(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) }) } } @@ -828,18 +846,19 @@ export default { const param = {} param.common = Object.assign({}, values) param.common.taskId = this.$route.query.taskId - enStandardEditReject(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - // 保存快照 - await this.saveParamJsonStr() - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } - }).finally(() => { - this.validatorRules.commitText.rules[0].required = false + // 保存快照 + this.saveParamJsonStr(() => { + enStandardEditReject(param).then(async res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }).finally(() => { + this.validatorRules.commitText.rules[0].required = false + }) }) } }) diff --git a/src/views/workCenter/enterpriseStandardSealSave/EnterpriseStandardSealSaveFlow.vue b/src/views/workCenter/enterpriseStandardSealSave/EnterpriseStandardSealSaveFlow.vue index 7c7cfb93..d49c7a06 100644 --- a/src/views/workCenter/enterpriseStandardSealSave/EnterpriseStandardSealSaveFlow.vue +++ b/src/views/workCenter/enterpriseStandardSealSave/EnterpriseStandardSealSaveFlow.vue @@ -397,7 +397,7 @@ export default { return infoJsonStr }, // 保存快照 - saveParamJsonStr () { + saveParamJsonStr (callback) { // 流程信息表单 const processInfoForm = this.processInfoForm.getFieldsValue() // 流程审批信息 @@ -415,9 +415,12 @@ export default { }) params.taskId = this.$route.query.taskId params.prcType = ProcessType.ES_ARCHIVE.value - saveSnapShot(params).then(res => { - if (!res.success) { - console.log(res.message) + saveSnapShot(params).then(async res => { + if (res.success) { + callback && await callback() + } else { + this.$message.warning(res.message) + this.loading = false } }) }, @@ -455,18 +458,29 @@ export default { // 快照JSON paramObj.common.infoJsonStr = this.getParamJsonStr() } - func(paramObj).then(async res => { - if (res.success) { - this.$message.success(res.message) - if (this.$route.query.taskId) { - await this.saveParamJsonStr() + if (this.$route.query.taskId) { + this.saveParamJsonStr(() => { + func(paramObj).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) + }) + } else { + func(paramObj).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false } - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } - }) + }) + } } else { this.switchValue = 'base' } @@ -512,16 +526,17 @@ export default { const param = {} param.common = Object.assign({}, values) param.common.taskId = this.$route.query.taskId - enStandardSealSaveAgree(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - // 保存快照 - await this.saveParamJsonStr() - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } + // 保存快照 + this.saveParamJsonStr(() => { + enStandardSealSaveAgree(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) }) } }) @@ -541,18 +556,19 @@ export default { const param = {} param.common = Object.assign({}, values) param.common.taskId = this.$route.query.taskId - enStandardSealSaveReject(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - // 保存快照 - await this.saveParamJsonStr() - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } - }).finally(() => { - this.validatorRules.commitText.rules[0].required = false + // 保存快照 + this.saveParamJsonStr(() => { + enStandardSealSaveReject(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }).finally(() => { + this.validatorRules.commitText.rules[0].required = false + }) }) } }) diff --git a/src/views/workCenter/enterpriseStandardStartUse/EnterpriseStandardStartUseFlow.vue b/src/views/workCenter/enterpriseStandardStartUse/EnterpriseStandardStartUseFlow.vue index e7a44ae5..a7bd828e 100644 --- a/src/views/workCenter/enterpriseStandardStartUse/EnterpriseStandardStartUseFlow.vue +++ b/src/views/workCenter/enterpriseStandardStartUse/EnterpriseStandardStartUseFlow.vue @@ -395,7 +395,7 @@ export default { return infoJsonStr }, // 保存快照 - saveParamJsonStr () { + saveParamJsonStr (callback) { // 流程信息表单 const processInfoForm = this.processInfoForm.getFieldsValue() // 流程审批信息 @@ -413,9 +413,12 @@ export default { }) params.taskId = this.$route.query.taskId params.prcType = ProcessType.ES_ENABLE.value - saveSnapShot(params).then(res => { - if (!res.success) { - console.log(res.message) + saveSnapShot(params).then(async res => { + if (res.success) { + callback && await callback() + } else { + this.$message.warning(res.message) + this.loading = false } }) }, @@ -453,18 +456,30 @@ export default { // 快照JSON paramObj.common.infoJsonStr = this.getParamJsonStr() } - func(paramObj).then(async res => { - if (res.success) { - this.$message.success(res.message) - if (this.$route.query.taskId) { - await this.saveParamJsonStr() + if (this.$route.query.taskId) { + // 先保存快照再提交 + this.saveParamJsonStr(() => { + func(paramObj).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) + }) + } else { + func(paramObj).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false } - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } - }) + }) + } } else { this.switchValue = 'base' } @@ -510,16 +525,17 @@ export default { const param = {} param.common = Object.assign({}, values) param.common.taskId = this.$route.query.taskId - enStandardStartUseAgree(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - // 保存快照 - await this.saveParamJsonStr() - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } + // 保存快照 + this.saveParamJsonStr(() => { + enStandardStartUseAgree(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }) }) } }) @@ -539,18 +555,19 @@ export default { const param = {} param.common = Object.assign({}, values) param.common.taskId = this.$route.query.taskId - enStandardStartUseReject(param).then(async res => { - if (res.success) { - this.$message.success(res.message) - // 保存快照 - await this.saveParamJsonStr() - this.goBack() - } else { - this.$message.warning(res.message) - this.loading = false - } - }).finally(() => { - this.validatorRules.commitText.rules[0].required = false + // 保存快照 + this.saveParamJsonStr(() => { + enStandardStartUseReject(param).then(res => { + if (res.success) { + this.$message.success(res.message) + this.goBack() + } else { + this.$message.warning(res.message) + this.loading = false + } + }).finally(() => { + this.validatorRules.commitText.rules[0].required = false + }) }) } })