From 3f021b8b955401af2088a618594641e50339b5e8 Mon Sep 17 00:00:00 2001 From: jiangweiguo <1578967617@qq.com> Date: Thu, 22 Aug 2024 17:35:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A1=E6=89=B9=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BottomBtn/index.vue | 67 +++++++++++------------------- 1 file changed, 25 insertions(+), 42 deletions(-) diff --git a/src/components/BottomBtn/index.vue b/src/components/BottomBtn/index.vue index 8d140f5..8782b37 100644 --- a/src/components/BottomBtn/index.vue +++ b/src/components/BottomBtn/index.vue @@ -106,50 +106,33 @@ export default { hanleCancel() { this.isShow = false }, - handleConfirm() { + handleConfirm(key) { this.$nextTick(() => { - this.$refs.form.validate().then(() => { + if (key == 2) { let obj = { id: this.accessId, - reason: this.form.reason + reason: '' } this.$loading(true, 'loadingSb') - if (this.key == 2) { - /* approveTask(obj) - .then(() => { - this.$EventBus.$emit('handleResetLive', 'company-myTrips') - this.$EventBus.$emit('handleResetLive', 'company-myClaim') - history.back() - this.$loading(false, 'loadingSb') - }) - .catch(() => { - this.$loading(false, 'loadingSb') - }) - } else { - rejectTask(obj) - .then(() => { - this.$EventBus.$emit('handleResetLive', 'company-myTrips') - this.$EventBus.$emit('handleResetLive', 'company-myClaim') - history.back() - this.$loading(false, 'loadingSb') - }) - .catch(() => { - this.$loading(false, 'loadingSb') - }) */ - - approveTask(obj) - .then(() => { - this.$forceCloseLoading() - this.$EventBus.$emit('handleResetLive', 'company-myTrips') - this.$EventBus.$emit('handleResetLive', 'company-myClaim') - history.back() - this.$loading(false, 'loadingSb') - }) - .catch(() => { - this.$forceCloseLoading() - this.$loading(false, 'loadingSb') - }) - } else { + approveTask(obj) + .then(() => { + this.$forceCloseLoading() + this.$EventBus.$emit('handleResetLive', 'company-myTrips') + this.$EventBus.$emit('handleResetLive', 'company-myClaim') + history.back() + this.$loading(false, 'loadingSb') + }) + .catch(() => { + this.$forceCloseLoading() + this.$loading(false, 'loadingSb') + }) + } else { + this.$refs.form.validate().then(() => { + let obj = { + id: this.accessId, + reason: this.form.reason + } + this.$loading(true, 'loadingSb') rejectTask(obj) .then(() => { this.$forceCloseLoading() @@ -162,8 +145,8 @@ export default { this.$forceCloseLoading() this.$loading(false, 'loadingSb') }) - } - }) + }) + } }) }, handleSubmit(key) { @@ -172,7 +155,7 @@ export default { this.title = '同意' this.form.reason = '已同意' // 无需原因,直接同意 - this.handleConfirm() + this.handleConfirm(2) } else if (key == 3) { this.key = key this.title = '驳回'