From d24b0242bc36e9c1ecda722780f875c37e91417f Mon Sep 17 00:00:00 2001 From: fengachen <373943794@qq.com> Date: Mon, 11 Jul 2022 16:13:51 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=BC=80=E5=8F=91=E3=80=91=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=BC=9A=E5=91=98=E7=BC=B4=E8=B4=B9=E5=B7=B2=E6=9C=89?= =?UTF-8?q?=E7=BC=B4=E8=B4=B9=E7=9A=84=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/standardsAssociationApi.js | 3 + .../PaymentInfo/modules/PaymentInfoModal.vue | 130 +++++++++++------- 2 files changed, 87 insertions(+), 46 deletions(-) diff --git a/src/api/standardsAssociationApi.js b/src/api/standardsAssociationApi.js index f2cfb82..fbbc45f 100644 --- a/src/api/standardsAssociationApi.js +++ b/src/api/standardsAssociationApi.js @@ -63,6 +63,8 @@ const getCertificateByMemberId = (params) => getAction('/vinCertificate/vinCerti const getMemberInfoById = (params) => getAction('/memberInfo/memberInfo/queryById', params) const getCheckInfo = (params) => getAction('/paymentInfo/paymentCheckinfo/queryByPaymentId', params) const getByMemberTime = (params) => getAction('/threshold/thresholdSetting/getByMemberTime', params) +// 判断会员是否有未审核的缴费 +const judgeMemberNotApprove = (params) => getAction('/paymentInfo/existNotApproved', params) // 会员下载缴费通知单 const downNewestNotice = (params) => getAction('/approvalDocumentNumber/approvalDocumentNumber/queryLatest', params) /****会员缴费 列表页所用接口-结束 ****/ @@ -94,6 +96,7 @@ export { getMemberInfoById, getCheckInfo, getByMemberTime, + judgeMemberNotApprove, downNewestNotice, getCertificateById, diff --git a/src/views/standardsAssociation/PaymentInfo/modules/PaymentInfoModal.vue b/src/views/standardsAssociation/PaymentInfo/modules/PaymentInfoModal.vue index 3420af2..2591667 100644 --- a/src/views/standardsAssociation/PaymentInfo/modules/PaymentInfoModal.vue +++ b/src/views/standardsAssociation/PaymentInfo/modules/PaymentInfoModal.vue @@ -512,7 +512,8 @@ import { getMemberInfoById, getCheckInfo, getByMemberTime, - downNewestNotice + downNewestNotice, + judgeMemberNotApprove } from '@/api/standardsAssociationApi' import JUpload from '@/components/standardsAssociation/JUpload' import PreViewImgModal from './PreViewImgModal' @@ -1005,57 +1006,80 @@ export default { this.initVal = 1 }, handleOk() { - console.log(1111) + const that = this // 触发表单验证 - that.form.validateFields({ force: true }, (err, values) => { + that.form.validateFields({ force: true }, async (err, values) => { if (!err) { - that.confirmLoading = true - let httpurl = '' - let method = '' - if (!this.model.id) { - httpurl += this.url.add - method = 'post' - } else { - if (this.checkFlag) { - httpurl += this.url.check - } else { - httpurl += this.url.edit - } - method = 'put' + // 判断会员是否有未审核的缴费 + let flag = await this.judgeMemberNotApproveFunc(this.memberId) + if(flag === 'true' ){ + // 提示 + that.$confirm({ + title: '确认提交', + content: '当前已有待审核缴费订单,为避免重复提交,请确认是否再次提交缴费订单?', + onOk:function () { + that.handleSubmit(values) + }, + onCancel:function (){ + that.handleCancel() + return + } + }) + }else { + this.handleSubmit(values) } - if (Number(this.checkResult) === 0) { - this.checkResult = 2 - this.model.paymentStatus = 2 - } else if (Number(this.checkResult) === 1) { - this.checkResult = 2 - this.model.paymentStatus = 3 - } else { - this.model.paymentStatus = 1 - } - const formData = Object.assign(this.model, values) - if (this.typeFlag) { - formData.paymentType = 1 - } else { - formData.paymentType = 0 - } - // 客户要去掉网员服务费字段,但是后端没有去掉校验,所以前端写死 - formData.serviceCharge = 0 - that.confirmLoading = false - // return - httpAction(httpurl, formData, method).then((res) => { - if (res.success) { - that.$message.success(res.message) - that.$emit('ok') - that.close() - } else { - that.$message.warning(res.message) - } - }).finally(() => { - that.confirmLoading = false - }) + } }) + + }, + handleSubmit(values){ + const that = this + that.confirmLoading = true + let httpurl = '' + let method = '' + if (!this.model.id) { + httpurl += this.url.add + method = 'post' + } else { + if (this.checkFlag) { + httpurl += this.url.check + } else { + httpurl += this.url.edit + } + method = 'put' + } + if (Number(this.checkResult) === 0) { + this.checkResult = 2 + this.model.paymentStatus = 2 + } else if (Number(this.checkResult) === 1) { + this.checkResult = 2 + this.model.paymentStatus = 3 + } else { + this.model.paymentStatus = 1 + } + const formData = Object.assign(this.model, values) + if (this.typeFlag) { + formData.paymentType = 1 + } else { + formData.paymentType = 0 + } + // 客户要去掉网员服务费字段,但是后端没有去掉校验,所以前端写死 + formData.serviceCharge = 0 + that.confirmLoading = false + // return + httpAction(httpurl, formData, method).then((res) => { + if (res.success) { + that.$message.success(res.message) + that.$emit('ok') + that.close() + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.confirmLoading = false + }) }, handleTemp() { const that = this @@ -1229,6 +1253,20 @@ export default { } }, + /** + * 判断会员是否有未审核的缴费 + * */ + judgeMemberNotApproveFunc(id) { + return new Promise(resolve => { + const param = { + memberId: id + } + judgeMemberNotApprove(param).then(res => { + resolve(res.message) + }) + }) + }, + /* 选择发票*/ invoiceRequirementsChange(value) { this.currentSelectInvoiceType = Number(value)