diff --git a/src/api/incomePaymentsApi.js b/src/api/incomePaymentsApi.js index b497dcc..b583541 100644 --- a/src/api/incomePaymentsApi.js +++ b/src/api/incomePaymentsApi.js @@ -56,9 +56,18 @@ const judgeInternalEnterprise = (param) => getAction('/company/payCompanyManagem // 国际研讨会-判断当前的邀请码是否可用 const judgeMeetingCode = (param) => getAction('/meeting/payMeetingSituation/validInvitationCode', param) + // 通过会员id拿到邮寄企业的信息 +const queryContactInfoByMemberId = (params) => getAction('/company/payCompanyManagement/listMeeting', params) +// 通过企业id查询企业的联系人 +const queryContactList = (params) => getAction('/company/payContactsManagement/queryByCompanyMeeting', params) +// 通过联系人id查询邮寄信息 +const queryPostInfoById = (params) => getAction('/company/payContactsManagement/queryByIdMeeting', params) export { queryCommonProjectById, + queryContactInfoByMemberId, + queryContactList, + queryPostInfoById, getMeetInfoById, getSingUpUserInfo, getContactUserInfo, diff --git a/src/components/customSelect/BusinessSelect.vue b/src/components/customSelect/BusinessSelect.vue new file mode 100644 index 0000000..470df9d --- /dev/null +++ b/src/components/customSelect/BusinessSelect.vue @@ -0,0 +1,127 @@ + + + + + diff --git a/src/components/customSelect/CompanySelect.vue b/src/components/customSelect/CompanySelect.vue new file mode 100644 index 0000000..545adc9 --- /dev/null +++ b/src/components/customSelect/CompanySelect.vue @@ -0,0 +1,87 @@ + + + + + diff --git a/src/views/standardsAssociation/PaymentInfo/modules/CertificatePaymentInfoModal.vue b/src/views/standardsAssociation/PaymentInfo/modules/CertificatePaymentInfoModal.vue index 631449a..f78ef10 100644 --- a/src/views/standardsAssociation/PaymentInfo/modules/CertificatePaymentInfoModal.vue +++ b/src/views/standardsAssociation/PaymentInfo/modules/CertificatePaymentInfoModal.vue @@ -253,6 +253,74 @@ + + 邮寄信息 + + + + + + + + + + + + {{ + item.name + }} + + + + + + + + + + + + + + + + + + + + + + + + + +
审核信息 @@ -277,6 +345,8 @@ import JUpload from '@/components/standardsAssociation/JUpload' import JImageUpload from '@/components/standardsAssociation/JImageUpload' import JDictSelectTag from '@/components/standardsAssociation/JDictSelectTag' import { getMemberInfoById, getCertificateById, getCheckInfo, getByMemberTime } from '@/api/standardsAssociationApi' +import {queryContactInfoByMemberId, queryContactList, queryPostInfoById} from '@api/incomePaymentsApi' +import CompanySelect from '@comp/customSelect/CompanySelect' export default { name: 'CertificatePaymentInfoModal', @@ -284,7 +354,8 @@ export default { JDate, JImageUpload, JUpload, - JDictSelectTag + JDictSelectTag, + CompanySelect }, data() { return { @@ -296,6 +367,7 @@ export default { width: 1100, visible: false, model: {}, + contactsList:[], labelCol: { xs: { span: 24 }, sm: { span: 5 } @@ -572,7 +644,7 @@ export default { this.form.setFieldsValue(pick(this.model, 'billNumber', 'companyName', 'paymentType', 'validPeriod', 'paymentTime', 'paymentAmount', 'certificatesNum', 'submissionTime', 'checkTime', 'paymentStatus', 'paymentMethod', 'paymentRecord', 'invoiceRequirements', 'headerName', 'taxNumber', 'invoiceAddress', 'invoicePhone', 'depositBank', 'bankAccount', 'checkMember', 'checkMemberId', 'memberId', 'certificate', 'address', 'postcode', 'serviceCharge', 'paymentMark')) }) }, - detail(record) { + async detail(record) { this.paymentMethodFlag = record.paymentMethod this.detailFlag = true this.form.resetFields() @@ -586,11 +658,15 @@ export default { this.loadMember() this.model.certificate = this.certificate } + this.getCertificateById(record.certificateId) this.getCheckInfo(record.id) var type = this.model.paymentTime this.changgeType(type) this.visible = true + // 回显邮寄信息 + const incomeCompanyInfo = await this.getIncomeCompanyInfo(this.memberId) + this.setPostContactInfo(incomeCompanyInfo) this.model.memberId = this.memberId if (this.model.certificatesNum > 0) { this.certificatesFlag = true @@ -655,6 +731,111 @@ export default { this.paymentMethodFlag = '' this.submitFlag = true }, + // 下拉框的搜索 + filterOption(input, option) { + return ( + option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 + ) + }, + /** + * 回显邮寄信息 如果列表没有 默认为该企业的邮寄信息 + * */ + async setPostContactInfo(incomeCompanyInfo) { + let companyContact + if (this.model.postCompanyId) { + // 用列表的回显 + companyContact = { + id: this.model.postCompanyId, + companyName: this.model.postCompanyName + } + } else { + companyContact = { + id: incomeCompanyInfo.id, + companyName: incomeCompanyInfo.companyName + } + } + // 回显邮寄单位 + this.form.setFieldsValue({ + 'companyContact': companyContact + }) + // 查询邮寄单位下的联系人列表 + this.contactsList = await this.getContactList({ companyId: companyContact.id }) + // 回显 邮寄联系人 + if (this.model.postCompanyId) { + this.$nextTick(() => { + this.form.setFieldsValue({ + 'postContactId': this.model.postContactId, + 'postContactPhone': this.model.postContactPhone, + 'contactPostCode': this.model.contactPostCode, + 'postContactAddress': this.model.postContactAddress + }) + }) + } else { + // 获取当前企业的默认邮寄联系人 + const initPersonInfo = await this.getContactList({ memberId: this.memberId }) + this.form.setFieldsValue({ + 'postContactId': initPersonInfo[0].id + }) + // 回显邮寄联系人信息 + this.selectContact(initPersonInfo[0].id) + } + }, + /** + * 通过会员id查询对应的来款企业的信息 + * */ + getIncomeCompanyInfo(memberId) { + return new Promise(resolve => { + queryContactInfoByMemberId({ memberId }).then(res => { + if (res.success) { + resolve(res.result.records[0]) + } + }) + }) + }, + /** + * 选择邮寄单位 + * */ + async companyContactChange(val) { + // 清空 邮寄信息 + this.form.resetFields(['postContactId', 'postContactPhone', 'contactPostCode', 'postContactAddress']) + this.contactsList = [] + this.contactsList = await this.getContactList({ companyId: val.id }) + }, + /** + * 查询公司联系人列表 + * @param param 传入memberid 查询的事默认值 传入companyId 查询所有的联系人 + * */ + getContactList(param) { + return new Promise(resolve => { + queryContactList(param).then(res => { + if (res.success) { + resolve(res.result) + } + }) + }) + }, + /** + * 选择邮寄联系人 + * */ + selectContact(val) { + if (!val) { + // 清除邮寄联系人信息 + this.form.resetFields(['postContactPhone', 'contactPostCode', 'postContactAddress']) + } + queryPostInfoById({ id: val }).then(res => { + if (res.success) { + const contactInfo = res.result + // 回显邮寄联系人的信息 + this.$nextTick(() => { + this.form.setFieldsValue({ + 'postContactPhone': contactInfo.phone, + 'contactPostCode': contactInfo.postalCode, + 'postContactAddress': contactInfo.contactAddress + }) + }) + } + }) + }, handleOk() { const that = this // 触发表单验证 diff --git a/src/views/standardsAssociation/PaymentInfo/modules/CombinationPaymentModal.vue b/src/views/standardsAssociation/PaymentInfo/modules/CombinationPaymentModal.vue index b6d68e3..e5bfcc4 100644 --- a/src/views/standardsAssociation/PaymentInfo/modules/CombinationPaymentModal.vue +++ b/src/views/standardsAssociation/PaymentInfo/modules/CombinationPaymentModal.vue @@ -265,6 +265,72 @@ + + 邮寄信息 + + + + + + + + + + + + {{ + item.name + }} + + + + + + + + + + + + + + + + + + + + + + + + + +