From fad4f0dc06401c03d9cda6ccc9f98538973bf0e1 Mon Sep 17 00:00:00 2001 From: bb_pan Date: Wed, 24 Sep 2025 21:14:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=90=E6=96=99=E7=AB=99-=E9=80=80=E6=96=99?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=90=8E=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../toolsBack/back/component/addReturn.vue | 89 +++++++++++-------- 1 file changed, 53 insertions(+), 36 deletions(-) diff --git a/src/views/materialsStation/toolsBack/back/component/addReturn.vue b/src/views/materialsStation/toolsBack/back/component/addReturn.vue index 54d4ffcb..684d017a 100644 --- a/src/views/materialsStation/toolsBack/back/component/addReturn.vue +++ b/src/views/materialsStation/toolsBack/back/component/addReturn.vue @@ -336,7 +336,7 @@ export default { teamId: null, proId: null, agreementId: null, //协议id - agreementIds:[], + agreementIds: [], agreementCode: null, //协议code // companyId: '', //登录信息中取 // createBy: '', //用户名 @@ -668,42 +668,59 @@ export default { this.$message.error('退料数量不能为空!') return } - this.queryParams.backApplyInfo = { - id: this.rowId, - backPerson: this.queryParams.backPerson, - phone: this.queryParams.phone, - remark: this.queryParams.remark, - agreementIds: this.queryParams.agreementIds, - isBack, - taskId: this.queryParams.taskId, - createBy: sessionStorage.getItem('userName') - } - if (this.rowId != '') { - let params = { - backApplyInfo: this.queryParams.backApplyInfo, - backApplyDetailsList: this.queryParams.equipmentList + // 弹框二次确认 + this.$confirm(`是否确认${isBack == 1 ? '退料' : '暂存'}`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(async () => { + const loading = this.$loading() + try { + this.queryParams.backApplyInfo = { + id: this.rowId, + backPerson: this.queryParams.backPerson, + phone: this.queryParams.phone, + remark: this.queryParams.remark, + agreementIds: this.queryParams.agreementIds, + isBack, + taskId: this.queryParams.taskId, + createBy: sessionStorage.getItem('userName') + } + if (this.rowId != '') { + let params = { + backApplyInfo: this.queryParams.backApplyInfo, + backApplyDetailsList: this.queryParams.equipmentList + } + if (params.backApplyInfo.signUrl) delete params.backApplyInfo.signUrl + const res = await editBackApply(params) + if (res.code == 200) { + this.$message({ type: 'success', message: res.msg }) + setTimeout(() => { + // this.$emit('goBackPage') + // 刷新页面 + this.$tab.refreshPage({ path: '/materialsStation/toolsBack/back' }) + }, 500) + } + } else { + let params = { + backApplyInfo: this.queryParams.backApplyInfo, + backApplyDetailsList: this.queryParams.equipmentList + } + const res = await addBackApply(params) + if (res.code == 200) { + this.$message({ type: 'success', message: res.msg }) + setTimeout(() => { + // this.$emit('goBackPage') + this.$tab.refreshPage({ path: '/materialsStation/toolsBack/back' }) + }, 500) + } + } + } catch (error) { + console.log('🚀 ~ handleAdd ~ error:', error) + } finally { + loading.close() } - if (params.backApplyInfo.signUrl) delete params.backApplyInfo.signUrl - const res = await editBackApply(params) - if (res.code == 200) { - this.$message({ type: 'success', message: res.msg }) - setTimeout(() => { - this.$emit('goBackPage') - }, 1000) - } - } else { - let params = { - backApplyInfo: this.queryParams.backApplyInfo, - backApplyDetailsList: this.queryParams.equipmentList - } - const res = await addBackApply(params) - if (res.code == 200) { - this.$message({ type: 'success', message: res.msg }) - setTimeout(() => { - this.$emit('goBackPage') - }, 1000) - } - } + }) } }) },