From 4cb8f152743443572e9ceaed436bb6b4924046f6 Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Mon, 7 Aug 2023 18:29:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=8A=A0=E8=BD=BD=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- subpkg/companySign/companySign.vue | 45 ++++++++++-------- subpkg/personnelDetails/personnelDetails.vue | 49 +++++++++++--------- 2 files changed, 52 insertions(+), 42 deletions(-) diff --git a/subpkg/companySign/companySign.vue b/subpkg/companySign/companySign.vue index 89b6272..8f90061 100644 --- a/subpkg/companySign/companySign.vue +++ b/subpkg/companySign/companySign.vue @@ -119,27 +119,32 @@ }, // 发送合同 async addContract(data) { - uni.showLoading({ - title:'合同发送中', - mask: true - }) - let res = await Draftingcontracts({ - id: this.id - }); - this.initCompany(); - if (this.userInfo.contract.check_status == 3) { - this.timerCount = 60; - this.timer = setInterval(() => { - this.timerCount--; - if (this.timerCount == 0) { - clearInterval(this.timer); - this.initCompany(); - } - }, 1000); + try{ + uni.showLoading({ + title:'合同发送中', + mask: true + }) + let res = await Draftingcontracts({ + id: this.id + }); + this.initCompany(); + if (this.userInfo.contract.check_status == 3) { + this.timerCount = 60; + this.timer = setInterval(() => { + this.timerCount--; + if (this.timerCount == 0) { + clearInterval(this.timer); + this.initCompany(); + } + }, 1000); + } + uni.hideLoading(); + Toast('合同已发送'); + this.naviTo('/subpkg/submit/submit'); + }catch(e){ + uni.hideLoading(); + Toast('发送失败'); } - uni.hideLoading(); - Toast('合同已发送'); - this.naviTo('/subpkg/submit/submit'); }, // 发送短信 async getPostsms() { diff --git a/subpkg/personnelDetails/personnelDetails.vue b/subpkg/personnelDetails/personnelDetails.vue index 06e88b0..dd9df62 100644 --- a/subpkg/personnelDetails/personnelDetails.vue +++ b/subpkg/personnelDetails/personnelDetails.vue @@ -299,33 +299,38 @@ contract_type: data.contract_type, type: data.type }) - // Toast('合同已生成'); this.loadUserDetail(); uni.hideLoading(); + Toast('合同已生成'); }, // 发送合同 async addContract(data) { - uni.showLoading({ - title:'合同发送中', - mask: true - }) - let res = await userDraftingcontracts({ - id: this.userInfo.id - }); - // Toast('合同已发送'); - this.loadUserDetail(); - if (this.userInfo.contract.check_status == 3) { - this.timerCount = 60; - this.timer = setInterval(() => { - this.timerCount--; - if (this.timerCount == 0) { - clearInterval(this.timer); - this.loadUserDetail(); - } - }, 1000); - } - uni.hideLoading(); - this.naviTo('/subpkg/submit/submit'); + try{ + uni.showLoading({ + title:'合同发送中', + mask: true + }) + let res = await userDraftingcontracts({ + id: this.userInfo.id + }); + this.loadUserDetail(); + if (this.userInfo.contract.check_status == 3) { + this.timerCount = 60; + this.timer = setInterval(() => { + this.timerCount--; + if (this.timerCount == 0) { + clearInterval(this.timer); + this.loadUserDetail(); + } + }, 1000); + } + uni.hideLoading(); + Toast('合同已发送'); + this.naviTo('/subpkg/submit/submit'); + }catch(e){ + uni.hideLoading(); + Toast('合同发送失败'); + } }, // 发送短信 async getPostsms() {