【修改】增加邮寄联系人信息
This commit is contained in:
@@ -494,6 +494,73 @@
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
<!-- 邮寄信息 begin-->
|
||||
<a-divider orientation="left">邮寄信息</a-divider>
|
||||
<a-row>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="邮寄单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<company-select
|
||||
placeholder="请选择邮寄单位"
|
||||
:disabled="checkFlag || detailFlag"
|
||||
v-decorator="['companyContact',validatorRules.company]"
|
||||
@change="companyContactChange"></company-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="邮寄联系人" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-select
|
||||
placeholder="请选择邮寄联系人"
|
||||
show-search
|
||||
allowClear
|
||||
:disabled="checkFlag || detailFlag"
|
||||
v-decorator="['postContactId']"
|
||||
option-filter-prop="children"
|
||||
:filter-option="filterOption"
|
||||
@change="selectContact"
|
||||
>
|
||||
<a-select-option v-for="item in contactsList" :key="item.id" :value="item.id">{{
|
||||
item.name
|
||||
}}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="手机号" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input
|
||||
placeholder="请输入手机号"
|
||||
:maxLength='11'
|
||||
disabled
|
||||
v-decorator="[ 'postContactPhone']"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-row>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="邮寄地址" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input
|
||||
placeholder="请输入邮寄地址"
|
||||
:maxLength='50'
|
||||
disabled
|
||||
v-decorator="[ 'postContactAddress']"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="邮编" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input
|
||||
placeholder="请输入邮编"
|
||||
disabled
|
||||
@change="(e) => {e.target.value = e.target.value.replace(/[^0-9]/g,'')}"
|
||||
:maxLength="6"
|
||||
v-decorator="[ 'contactPostCode']"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<!-- 邮寄信息 end-->
|
||||
<!-- 审核历史 -->
|
||||
<div v-show="detailFlag">
|
||||
<a-divider orientation="left">审核信息</a-divider>
|
||||
@@ -533,7 +600,8 @@ import {
|
||||
} from '@/api/standardsAssociationApi'
|
||||
import JUpload from '@/components/standardsAssociation/JUpload'
|
||||
import PreViewImgModal from './PreViewImgModal'
|
||||
import { commonMemberCost, vipMemberCost,upgradeVip } from '@api/incomePaymentsApi'
|
||||
import { commonMemberCost, vipMemberCost,upgradeVip,queryContactInfoByMemberId,queryContactList,queryPostInfoById } from '@api/incomePaymentsApi'
|
||||
import CompanySelect from '@comp/customSelect/CompanySelect'
|
||||
export default {
|
||||
name: 'PaymentInfoModal',
|
||||
components: {
|
||||
@@ -541,7 +609,8 @@ export default {
|
||||
JImageUpload,
|
||||
JUpload,
|
||||
JDictSelectTag,
|
||||
PreViewImgModal
|
||||
PreViewImgModal,
|
||||
CompanySelect
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -565,6 +634,11 @@ export default {
|
||||
},
|
||||
confirmLoading: false,
|
||||
validatorRules: {
|
||||
company: {
|
||||
rules: [{ required: true, message: '请选择单位' }],
|
||||
validateTrigger: ['blur', 'change'],
|
||||
initialValue: {}
|
||||
},
|
||||
paymentMethod: {
|
||||
rules: [{
|
||||
required: true, message: '请选择缴费方式'
|
||||
@@ -747,6 +821,7 @@ export default {
|
||||
endTime: '',
|
||||
// 申请证书
|
||||
selectedRowKeys: [],
|
||||
contactsList:[],
|
||||
count: 2,
|
||||
// 证书列表
|
||||
columns: [
|
||||
@@ -905,6 +980,9 @@ export default {
|
||||
this.loadMember()
|
||||
// 查找审核信息
|
||||
this.getCheckInfo(record.id)
|
||||
// 回显邮寄信息
|
||||
const incomeCompanyInfo = await this.getIncomeCompanyInfo(this.memberId)
|
||||
this.setPostContactInfo(incomeCompanyInfo)
|
||||
var type = this.model.paymentTime
|
||||
// 缴费时长选择
|
||||
this.changgeType(type)
|
||||
@@ -964,6 +1042,9 @@ export default {
|
||||
// 获取会员信息
|
||||
await this.loadMember()
|
||||
this.visible = true
|
||||
// 回显邮寄信息
|
||||
const incomeCompanyInfo = await this.getIncomeCompanyInfo(this.memberId)
|
||||
this.setPostContactInfo(incomeCompanyInfo)
|
||||
// 获取会员 类型 1年 五年的
|
||||
// let type = this.model.paymentTime
|
||||
// 新增 设置 初始缴费金额
|
||||
@@ -1005,6 +1086,111 @@ export default {
|
||||
this.validateCompanyName()
|
||||
})
|
||||
},
|
||||
// 下拉框的搜索
|
||||
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
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('close')
|
||||
this.visible = false
|
||||
|
||||
Reference in New Issue
Block a user