From d2fc9ad9817eab3d3bb277dd971cc828bb810dce Mon Sep 17 00:00:00 2001 From: caiyiling <1321909229@qq.com> Date: Tue, 9 Jul 2024 16:27:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=B0=83=E7=A0=94=E8=A1=A8?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/research-mobile/detail.vue | 44 +++++++++++++++------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/src/views/research-mobile/detail.vue b/src/views/research-mobile/detail.vue index c29e60d9..0426970a 100644 --- a/src/views/research-mobile/detail.vue +++ b/src/views/research-mobile/detail.vue @@ -123,32 +123,34 @@ export default { this.submit(type) } }, - submit(type) { - // 是否确认提交 - this.$confirm(this.userTypeEnumInt === 0 ? this.$t('trials:researchForm:message:submitWarning') : this.$t('trials:researchForm:message:submitWarning2'), { - type: 'warning', - distinguishCancelAndClose: true - }).then(() => { - this.loading = true + async submit(type) { + try { + const confirm = await this.$confirm( + this.userTypeEnumInt === 0 ? this.$t('trials:researchForm:message:submitWarning') : this.$t('trials:researchForm:message:submitWarning2'), + { + type: 'warning', + distinguishCancelAndClose: true + } + ) + if (confirm !== 'confirm') return var param = { TrialId: this.trialId, TrialSiteSurveyId: this.trialSiteSurveyId } - trialSurveySubmit(param).then((res) => { - this.loading = false - if (res.IsSuccess) { - this.initPage() - if (this.userTypeEnumInt !== 0) { - this.$emit('refreshPage') - } - if (type === 'approve') { - this.$message.success(this.$t('common:message:approvedSuccessfully')) - } else { - this.$message.success(this.$t('trials:researchForm:message:savedSuccessfully')) - } + const res = await trialSurveySubmit(param) + this.loading = false + if (res.IsSuccess) { + this.initPage() + if (type === 'approve') { + this.$message.success(this.$t('common:message:approvedSuccessfully')) + } else { + this.$message.success(this.$t('trials:researchForm:message:savedSuccessfully')) } - }).catch(() => { this.loading = false }) - }).catch(() => {}) + } + } catch (e) { + this.loading = false + console.log(e) + } }, // 退出 handleBack() {