mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-22 00:06:45 +08:00
feat(ebiz): 新增受益人信息同步功能
- 新增 `disableSyncApplicant` 属性控制是否允许同步投保人信息 - 当勾选“同投保人”时,禁用相关字段的编辑功能 - 实现 `syncToApplicant` 方法用于同步投保人数据至当前用户信息 - 监听 `applicant` 变化并在启用同步时自动更新用户信息 - 修改多个字段(如姓名、证件号、出生日期等)的只读逻辑依赖于 `asAppntAddress` 状态 - 更新客户选择器组件以支持 `readonly` 状态并防止重复触发 - 调整部分 UI 组件结构和事件绑定方式提升一致性与可维护性
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
right-icon="arrow"
|
right-icon="arrow"
|
||||||
@click="toSelect('7')"
|
@click="toSelect('7')"
|
||||||
/>
|
/>
|
||||||
<div class="relative border-bt fs14 p10 flex align-center">
|
<div v-if="this.disableSyncApplicant" class="relative border-bt fs14 p10 flex align-center">
|
||||||
<van-checkbox v-model="userInfo.asAppntAddress" :disabled="Insured" @change="asAppntAddress">
|
<van-checkbox v-model="userInfo.asAppntAddress" :disabled="Insured" @change="asAppntAddress">
|
||||||
同投保人
|
同投保人
|
||||||
</van-checkbox>
|
</van-checkbox>
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
v-model="userInfo.name"
|
v-model="userInfo.name"
|
||||||
v-validate="'required|salename'"
|
v-validate="'required|salename'"
|
||||||
:parentShowPicker.sync="customerShowPicker"
|
:parentShowPicker.sync="customerShowPicker"
|
||||||
:readonly="isInsured && nameLimit"
|
:readonly="userInfo.asAppntAddress"
|
||||||
label="姓名"
|
label="姓名"
|
||||||
name="姓名"
|
name="姓名"
|
||||||
required
|
required
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
<van-field
|
<van-field
|
||||||
v-model="userInfo.idNo"
|
v-model="userInfo.idNo"
|
||||||
v-validate="'required'"
|
v-validate="'required'"
|
||||||
:readonly="isInsured && idNoLimit"
|
:readonly="userInfo.asAppntAddress"
|
||||||
clearable
|
clearable
|
||||||
label="证件号码"
|
label="证件号码"
|
||||||
maxlength="18"
|
maxlength="18"
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
ref="birthday"
|
ref="birthday"
|
||||||
v-validate="'required'"
|
v-validate="'required'"
|
||||||
:flag="true"
|
:flag="true"
|
||||||
:readonly="isInsured && birthdayLimit"
|
:readonly="userInfo.asAppntAddress"
|
||||||
:value.sync="userInfo.birthday"
|
:value.sync="userInfo.birthday"
|
||||||
label="出生日期"
|
label="出生日期"
|
||||||
name="出生日期"
|
name="出生日期"
|
||||||
@@ -74,7 +74,8 @@
|
|||||||
v-validate="'required'"
|
v-validate="'required'"
|
||||||
:defaultDate="new Date()"
|
:defaultDate="new Date()"
|
||||||
:flag="true"
|
:flag="true"
|
||||||
:readonly="isInsured"
|
:max-date="new Date()"
|
||||||
|
:readonly="userInfo.asAppntAddress"
|
||||||
:value.sync="userInfo.certificateValidate"
|
:value.sync="userInfo.certificateValidate"
|
||||||
label="证件起始日期"
|
label="证件起始日期"
|
||||||
name="证件起始日期"
|
name="证件起始日期"
|
||||||
@@ -86,7 +87,7 @@
|
|||||||
ref="certiexpiredate"
|
ref="certiexpiredate"
|
||||||
:defaultDate="new Date()"
|
:defaultDate="new Date()"
|
||||||
:flag="certiexpiredateShow"
|
:flag="certiexpiredateShow"
|
||||||
:readonly="isInsured"
|
:readonly="userInfo.asAppntAddress"
|
||||||
:required="isRequired"
|
:required="isRequired"
|
||||||
:v-validate="{ required: certiexpiredateRequired }"
|
:v-validate="{ required: certiexpiredateRequired }"
|
||||||
:value.sync="userInfo.certiexpiredate"
|
:value.sync="userInfo.certiexpiredate"
|
||||||
@@ -96,11 +97,17 @@
|
|||||||
@confirm="onDateConfirm($event, '1')"
|
@confirm="onDateConfirm($event, '1')"
|
||||||
></FieldDatePicter>
|
></FieldDatePicter>
|
||||||
<div class="border-bt relative fs14 p10 flex align-center">
|
<div class="border-bt relative fs14 p10 flex align-center">
|
||||||
<van-checkbox v-model="userInfo.effectiveDateType" :disabled="effectiveDateTypeAble" class="fr" @change="effectiveDataTypeChange">长期 </van-checkbox>
|
<van-checkbox
|
||||||
|
v-model="userInfo.effectiveDateType"
|
||||||
|
:disabled="effectiveDateTypeAble || this.userInfo.asAppntAddress"
|
||||||
|
class="fr"
|
||||||
|
@change="effectiveDataTypeChange"
|
||||||
|
>长期
|
||||||
|
</van-checkbox>
|
||||||
</div>
|
</div>
|
||||||
<select-radio
|
<select-radio
|
||||||
v-validate="'required'"
|
v-validate="'required'"
|
||||||
:disabled="isInsured && sexLimit"
|
:disabled="userInfo.asAppntAddress"
|
||||||
:radios="sexRadio"
|
:radios="sexRadio"
|
||||||
:value.sync="userInfo.sex"
|
:value.sync="userInfo.sex"
|
||||||
label="性别"
|
label="性别"
|
||||||
@@ -116,7 +123,7 @@
|
|||||||
readonly
|
readonly
|
||||||
required
|
required
|
||||||
right-icon="arrow"
|
right-icon="arrow"
|
||||||
@click="setMarriageStatus('10')"
|
@click="() => !userInfo.asAppntAddress && setMarriageStatus('10')"
|
||||||
/>
|
/>
|
||||||
<van-field
|
<van-field
|
||||||
v-validate="'required'"
|
v-validate="'required'"
|
||||||
@@ -127,7 +134,7 @@
|
|||||||
readonly
|
readonly
|
||||||
required
|
required
|
||||||
right-icon="arrow"
|
right-icon="arrow"
|
||||||
@click="toSelect('1')"
|
@click="() => !userInfo.asAppntAddress && toSelect('1')"
|
||||||
/>
|
/>
|
||||||
<van-field
|
<van-field
|
||||||
v-model="areaStr"
|
v-model="areaStr"
|
||||||
@@ -138,9 +145,18 @@
|
|||||||
readonly
|
readonly
|
||||||
required
|
required
|
||||||
right-icon="arrow"
|
right-icon="arrow"
|
||||||
@click="isAreaListShow = true"
|
@click="() => !userInfo.asAppntAddress && (isAreaListShow = true)"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
v-model="userInfo.village"
|
||||||
|
v-validate="'required'"
|
||||||
|
:readonly="userInfo.asAppntAddress"
|
||||||
|
clearable
|
||||||
|
label=""
|
||||||
|
maxlength="30"
|
||||||
|
name="详细地址"
|
||||||
|
placeholder="请输入详细地址"
|
||||||
/>
|
/>
|
||||||
<van-field v-model="userInfo.village" v-validate="'required'" clearable label="" maxlength="30" name="详细地址" placeholder="请输入详细地址" />
|
|
||||||
<!-- <div class="pl10 pt10 pb10 pr10 address fs14">-->
|
<!-- <div class="pl10 pt10 pb10 pr10 address fs14">-->
|
||||||
<!-- <van-checkbox v-model="withRootUser.value">同投保人地址</van-checkbox>-->
|
<!-- <van-checkbox v-model="withRootUser.value">同投保人地址</van-checkbox>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
@@ -159,7 +175,7 @@
|
|||||||
<van-field
|
<van-field
|
||||||
v-model="userInfo.mobile"
|
v-model="userInfo.mobile"
|
||||||
v-validate="'required|mobile'"
|
v-validate="'required|mobile'"
|
||||||
:readonly="isInsured && mobileLimit"
|
:readonly="userInfo.asAppntAddress"
|
||||||
clearable
|
clearable
|
||||||
label="联系电话"
|
label="联系电话"
|
||||||
maxlength="11"
|
maxlength="11"
|
||||||
@@ -185,6 +201,7 @@
|
|||||||
<occupation-picker
|
<occupation-picker
|
||||||
v-validate="'required'"
|
v-validate="'required'"
|
||||||
:chooseName.sync="userInfo.occupationName"
|
:chooseName.sync="userInfo.occupationName"
|
||||||
|
:disabled="userInfo.asAppntAddress"
|
||||||
:healthGrade.sync="userInfo.healthGrade"
|
:healthGrade.sync="userInfo.healthGrade"
|
||||||
:lifeGrade.sync="userInfo.lifeGrade"
|
:lifeGrade.sync="userInfo.lifeGrade"
|
||||||
:parentShowPicker.sync="occupationShowPicker"
|
:parentShowPicker.sync="occupationShowPicker"
|
||||||
@@ -197,16 +214,7 @@
|
|||||||
@on-click="selectClick('2')"
|
@on-click="selectClick('2')"
|
||||||
@on-choose="chooseOccupation"
|
@on-choose="chooseOccupation"
|
||||||
/>
|
/>
|
||||||
<van-field
|
<van-field v-model="userInfo.bnfOrder" v-validate="'required|onlyNumber'" label="受益顺序" maxlength="1" name="受益顺序" placeholder="请输入" required />
|
||||||
v-model="userInfo.bnfOrder"
|
|
||||||
v-validate="'required|onlyNumber'"
|
|
||||||
label="受益顺序"
|
|
||||||
maxlength="1"
|
|
||||||
name="受益顺序"
|
|
||||||
placeholder="请输入"
|
|
||||||
readonly
|
|
||||||
required
|
|
||||||
/>
|
|
||||||
<van-field
|
<van-field
|
||||||
v-model="userInfo.bnfLot"
|
v-model="userInfo.bnfLot"
|
||||||
v-validate="'required|onlyNumber'"
|
v-validate="'required|onlyNumber'"
|
||||||
@@ -257,7 +265,8 @@ import { idToData } from './js/verification'
|
|||||||
import { selectComp } from './js/methods'
|
import { selectComp } from './js/methods'
|
||||||
import getAreaName from '@/assets/js/utils/getAreaNameForSale'
|
import getAreaName from '@/assets/js/utils/getAreaNameForSale'
|
||||||
import { getOrderDetail, checkAppointBnf } from '@/api/ebiz/sale/sale'
|
import { getOrderDetail, checkAppointBnf } from '@/api/ebiz/sale/sale'
|
||||||
import { insured } from '@/views/ebiz/saleFlowProImprove/js/state'
|
import { user } from '@/views/ebiz/saleFlowProImprove/js/enum'
|
||||||
|
import { applicant, insured } from '@/views/ebiz/saleFlowProImprove/js/state'
|
||||||
|
|
||||||
let relationToInsured = [
|
let relationToInsured = [
|
||||||
{ id: 2, text: '配偶' },
|
{ id: 2, text: '配偶' },
|
||||||
@@ -348,14 +357,18 @@ export default {
|
|||||||
isInsured: false, //是投保人本人,
|
isInsured: false, //是投保人本人,
|
||||||
Insured: false, //投保人本人按钮是否置灰
|
Insured: false, //投保人本人按钮是否置灰
|
||||||
idLimit: false, //证件起止日期是否只读
|
idLimit: false, //证件起止日期是否只读
|
||||||
saleInsuredPersonInfo: JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')), //被保人信息
|
saleInsuredPersonInfo: insured, //被保人信息
|
||||||
branchType: '',
|
branchType: '',
|
||||||
subTask: this.task
|
subTask: this.task
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: ['beneficiary', 'task'],
|
props: ['beneficiary', 'task', 'disableSyncApplicant'],
|
||||||
inject: ['nextStepProcesserContainer'],
|
inject: ['nextStepProcesserContainer'],
|
||||||
computed: {
|
computed: {
|
||||||
|
user() {
|
||||||
|
return user
|
||||||
|
},
|
||||||
|
applicant: () => applicant,
|
||||||
relationToAppnt: {
|
relationToAppnt: {
|
||||||
get() {
|
get() {
|
||||||
const { relationToAppnt } = DataDictionary
|
const { relationToAppnt } = DataDictionary
|
||||||
@@ -485,7 +498,7 @@ export default {
|
|||||||
},
|
},
|
||||||
selectClick(index) {
|
selectClick(index) {
|
||||||
// 同被保险人不允许编辑
|
// 同被保险人不允许编辑
|
||||||
if (this.isInsured) {
|
if (this.isInsured || this.userInfo.asAppntAddress) {
|
||||||
this.$toast('同被保险人不允许编辑')
|
this.$toast('同被保险人不允许编辑')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@@ -523,7 +536,7 @@ export default {
|
|||||||
//弹框选择
|
//弹框选择
|
||||||
toSelect(pickerType, valueKey) {
|
toSelect(pickerType, valueKey) {
|
||||||
//同被保险人不允许编辑
|
//同被保险人不允许编辑
|
||||||
if (this.isInsured) {
|
if (this.userInfo.asAppntAddress && pickerType !== '7') {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
//pickerType 1、国家地区 2、证件类型 3、文化程度 4、有无社保 5、税收居民身份 6、婚姻状况
|
//pickerType 1、国家地区 2、证件类型 3、文化程度 4、有无社保 5、税收居民身份 6、婚姻状况
|
||||||
@@ -731,6 +744,8 @@ export default {
|
|||||||
},
|
},
|
||||||
//选择客户
|
//选择客户
|
||||||
chooseCustomer(data) {
|
chooseCustomer(data) {
|
||||||
|
if (this.userInfo.asAppntAddress) return false
|
||||||
|
|
||||||
this.customerShowPicker = false
|
this.customerShowPicker = false
|
||||||
this.$jump({
|
this.$jump({
|
||||||
flag: 'navigation',
|
flag: 'navigation',
|
||||||
@@ -1228,6 +1243,16 @@ export default {
|
|||||||
goScan() {
|
goScan() {
|
||||||
this.isScan = true
|
this.isScan = true
|
||||||
},
|
},
|
||||||
|
syncToApplicant() {
|
||||||
|
// 进行同步 投保人信息
|
||||||
|
const applicant = this.applicant
|
||||||
|
const ignoreKeys = []
|
||||||
|
for (const key in this.userInfo) {
|
||||||
|
if (ignoreKeys.includes(key)) continue
|
||||||
|
if (!this.userInfo.hasOwnProperty(key) || !applicant.hasOwnProperty(key)) continue
|
||||||
|
this.userInfo[key] = applicant[key]
|
||||||
|
}
|
||||||
|
},
|
||||||
//勾选投保人
|
//勾选投保人
|
||||||
asAppntAddress(val) {
|
asAppntAddress(val) {
|
||||||
if (val) {
|
if (val) {
|
||||||
@@ -1240,56 +1265,55 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.isInsured = true
|
this.isInsured = true
|
||||||
let params = {
|
|
||||||
orderNo: this.$route.query.orderNo
|
|
||||||
}
|
|
||||||
getOrderDetail(params).then(res => {
|
|
||||||
if (res.result == 0) {
|
|
||||||
let insuredDetail = res.orderDTO.appntDTO
|
|
||||||
this.userInfo.name = insuredDetail.name //姓名
|
|
||||||
this.nameLimit = Boolean(insuredDetail.name)
|
|
||||||
this.userInfo.sex = insuredDetail.sex //性别
|
|
||||||
this.sexLimit = Boolean(insuredDetail.sex)
|
|
||||||
this.userInfo.nativeplace = insuredDetail.nativeplace //国家地区
|
|
||||||
this.userInfo.birthday = insuredDetail.birthday //出生日期
|
|
||||||
this.birthdayLimit = Boolean(insuredDetail.birthday)
|
|
||||||
this.userInfo.idType = insuredDetail.idType //证件类型
|
|
||||||
this.userInfo.idNo = insuredDetail.idNo //证件号码
|
|
||||||
this.idNoLimit = Boolean(insuredDetail.idNo)
|
|
||||||
this.userInfo.certificateValidate = insuredDetail.certificateValidate //证件起始日期
|
|
||||||
this.userInfo.certiexpiredate = insuredDetail.certiexpiredate == '9999-12-31' ? '' : insuredDetail.certiexpiredate //证件截止日期
|
|
||||||
this.userInfo.effectiveDateType = insuredDetail.certiexpiredate == '9999-12-31' //是否长期
|
|
||||||
this.userInfo.mobile = insuredDetail.mobile
|
|
||||||
this.mobileLimit = Boolean(insuredDetail.mobile)
|
|
||||||
this.userInfo.marriage = insuredDetail.marriage
|
|
||||||
if (this.userInfo.marriage == 1) {
|
|
||||||
this.userInfo.marriageStatus = '已婚'
|
|
||||||
} else if (this.userInfo.marriage == 2) {
|
|
||||||
this.userInfo.marriageStatus = '未婚'
|
|
||||||
} else if (this.userInfo.marriage == 3) {
|
|
||||||
this.userInfo.marriageStatus = '离异'
|
|
||||||
} else if (this.userInfo.marriage == 4) {
|
|
||||||
this.userInfo.marriageStatus = '丧偶'
|
|
||||||
}
|
|
||||||
let age = utilsAge.getAge(insuredDetail.birthday, new Date())
|
|
||||||
this.effectiveDateTypeAble = age <= 45
|
|
||||||
if (age > 45) {
|
|
||||||
this.userInfo.effectiveDateType = true
|
|
||||||
}
|
|
||||||
this.idLimit = true
|
|
||||||
this.userInfo.occupationCode = insuredDetail.occupationCode //职业类别编码
|
|
||||||
this.userInfo.occupationName = insuredDetail.occupationName //职业类别名称
|
|
||||||
|
|
||||||
this.areaStr = getAreaName([{ code: insuredDetail.homeProvince }, { code: insuredDetail.homeCity }, { code: insuredDetail.homeArea }])
|
// this.syncToApplicant()
|
||||||
this.userInfo.province = insuredDetail.homeProvince
|
// getOrderDetail(params).then(res => {
|
||||||
this.userInfo.city = insuredDetail.homeCity
|
// if (res.result == 0) {
|
||||||
this.userInfo.area = insuredDetail.homeArea
|
// let insuredDetail = res.orderDTO.appntDTO
|
||||||
this.userInfo.village = insuredDetail.homeAddress
|
// this.userInfo.name = insuredDetail.name //姓名
|
||||||
|
// this.nameLimit = Boolean(insuredDetail.name)
|
||||||
this.userInfo.yearSalary = insuredDetail.averageAnnualIncome
|
// this.userInfo.sex = insuredDetail.sex //性别
|
||||||
this.userInfo.averageAnnualIncome = insuredDetail.averageAnnualIncome
|
// this.sexLimit = Boolean(insuredDetail.sex)
|
||||||
}
|
// this.userInfo.nativeplace = insuredDetail.nativeplace //国家地区
|
||||||
})
|
// this.userInfo.birthday = insuredDetail.birthday //出生日期
|
||||||
|
// this.birthdayLimit = Boolean(insuredDetail.birthday)
|
||||||
|
// this.userInfo.idType = insuredDetail.idType //证件类型
|
||||||
|
// this.userInfo.idNo = insuredDetail.idNo //证件号码
|
||||||
|
// this.idNoLimit = Boolean(insuredDetail.idNo)
|
||||||
|
// this.userInfo.certificateValidate = insuredDetail.certificateValidate //证件起始日期
|
||||||
|
// this.userInfo.certiexpiredate = insuredDetail.certiexpiredate == '9999-12-31' ? '' : insuredDetail.certiexpiredate //证件截止日期
|
||||||
|
// this.userInfo.effectiveDateType = insuredDetail.certiexpiredate == '9999-12-31' //是否长期
|
||||||
|
// this.userInfo.mobile = insuredDetail.mobile
|
||||||
|
// this.mobileLimit = Boolean(insuredDetail.mobile)
|
||||||
|
// this.userInfo.marriage = insuredDetail.marriage
|
||||||
|
// if (this.userInfo.marriage == 1) {
|
||||||
|
// this.userInfo.marriageStatus = '已婚'
|
||||||
|
// } else if (this.userInfo.marriage == 2) {
|
||||||
|
// this.userInfo.marriageStatus = '未婚'
|
||||||
|
// } else if (this.userInfo.marriage == 3) {
|
||||||
|
// this.userInfo.marriageStatus = '离异'
|
||||||
|
// } else if (this.userInfo.marriage == 4) {
|
||||||
|
// this.userInfo.marriageStatus = '丧偶'
|
||||||
|
// }
|
||||||
|
// let age = utilsAge.getAge(insuredDetail.birthday, new Date())
|
||||||
|
// this.effectiveDateTypeAble = age <= 45
|
||||||
|
// if (age > 45) {
|
||||||
|
// this.userInfo.effectiveDateType = true
|
||||||
|
// }
|
||||||
|
// this.idLimit = true
|
||||||
|
// this.userInfo.occupationCode = insuredDetail.occupationCode //职业类别编码
|
||||||
|
// this.userInfo.occupationName = insuredDetail.occupationName //职业类别名称
|
||||||
|
//
|
||||||
|
// this.areaStr = getAreaName([{ code: insuredDetail.homeProvince }, { code: insuredDetail.homeCity }, { code: insuredDetail.homeArea }])
|
||||||
|
// this.userInfo.province = insuredDetail.homeProvince
|
||||||
|
// this.userInfo.city = insuredDetail.homeCity
|
||||||
|
// this.userInfo.area = insuredDetail.homeArea
|
||||||
|
// this.userInfo.village = insuredDetail.homeAddress
|
||||||
|
//
|
||||||
|
// this.userInfo.yearSalary = insuredDetail.averageAnnualIncome
|
||||||
|
// this.userInfo.averageAnnualIncome = insuredDetail.averageAnnualIncome
|
||||||
|
// }
|
||||||
|
// })
|
||||||
} else {
|
} else {
|
||||||
this.isInsured = false
|
this.isInsured = false
|
||||||
this.userInfo.relationToInsured = ''
|
this.userInfo.relationToInsured = ''
|
||||||
@@ -1410,6 +1434,15 @@ export default {
|
|||||||
idToText: filter.idToText
|
idToText: filter.idToText
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
applicant: {
|
||||||
|
deep: true,
|
||||||
|
immediate: true,
|
||||||
|
handler() {
|
||||||
|
if (!this.userInfo.asAppntAddress) return
|
||||||
|
|
||||||
|
this.syncToApplicant()
|
||||||
|
}
|
||||||
|
},
|
||||||
userInfo: {
|
userInfo: {
|
||||||
deep: true,
|
deep: true,
|
||||||
handler(value, oldValue) {
|
handler(value, oldValue) {
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
<DesignateBeneficiary
|
<DesignateBeneficiary
|
||||||
ref="beneficiaryRef"
|
ref="beneficiaryRef"
|
||||||
:beneficiary.sync="beneficiary"
|
:beneficiary.sync="beneficiary"
|
||||||
|
:disableSyncApplicant="index < 1"
|
||||||
:task="`saveBeneficiary_saveOtherBeneficiary-${generateRandomId()}`"
|
:task="`saveBeneficiary_saveOtherBeneficiary-${generateRandomId()}`"
|
||||||
@scaned="getIdentityInfo($event, index)"
|
@scaned="getIdentityInfo($event, index)"
|
||||||
@syncBeneficiary="handleSyncBeneficiary($event, index)"
|
@syncBeneficiary="handleSyncBeneficiary($event, index)"
|
||||||
|
|||||||
@@ -121,7 +121,6 @@
|
|||||||
@click="toSelect('10')"
|
@click="toSelect('10')"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{{ userInfo.nativeplace }}
|
|
||||||
<van-field
|
<van-field
|
||||||
v-validate="'required'"
|
v-validate="'required'"
|
||||||
:value="userInfo.nativeplace | idToText('nativeplace')"
|
:value="userInfo.nativeplace | idToText('nativeplace')"
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="customer-picker">
|
<div id="customer-picker">
|
||||||
<van-field
|
<van-field
|
||||||
:label="label"
|
|
||||||
v-model="name"
|
v-model="name"
|
||||||
@input="onChange"
|
:label="label"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
|
:readonly="readonly"
|
||||||
:required="required"
|
:required="required"
|
||||||
:right-icon="$assetsUrl + 'images/avatar.png'"
|
:right-icon="$assetsUrl + 'images/avatar.png'"
|
||||||
@click-right-icon="chooseCustomer"
|
|
||||||
:readonly="readonly"
|
|
||||||
@blur="handleFieldBlur"
|
@blur="handleFieldBlur"
|
||||||
|
@input="onChange"
|
||||||
|
@click-right-icon="chooseCustomer"
|
||||||
/>
|
/>
|
||||||
<van-popup v-model="showPicker" position="bottom" round style="max-height: 95%">
|
<van-popup v-model="showPicker" position="bottom" round style="max-height: 95%">
|
||||||
<customer @on-choose="choose" :code="code" :name="name" :life="life" :health="health"></customer>
|
<customer :code="code" :health="health" :life="life" :name="name" @on-choose="choose"></customer>
|
||||||
</van-popup>
|
</van-popup>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -47,8 +47,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => {
|
default: () => {}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
//选项对象中,文字对应的 key
|
//选项对象中,文字对应的 key
|
||||||
valueKey: {
|
valueKey: {
|
||||||
@@ -119,11 +118,11 @@ export default {
|
|||||||
choose(data) {
|
choose(data) {
|
||||||
this.name = data.customerName
|
this.name = data.customerName
|
||||||
this.showPicker = false
|
this.showPicker = false
|
||||||
this.$emit("update:parentShowPicker", false)
|
this.$emit('update:parentShowPicker', false)
|
||||||
this.$emit('on-choose', data)
|
this.$emit('on-choose', data)
|
||||||
},
|
},
|
||||||
chooseCustomer() {
|
chooseCustomer() {
|
||||||
if (this.disabled) {
|
if (this.disabled || this.readonly) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.showPicker = true
|
this.showPicker = true
|
||||||
@@ -135,7 +134,7 @@ export default {
|
|||||||
},
|
},
|
||||||
handleFieldBlur() {
|
handleFieldBlur() {
|
||||||
// console.log(this.name)
|
// console.log(this.name)
|
||||||
this.$emit("update:value", this.name)
|
this.$emit('update:value', this.name)
|
||||||
this.$emit('blur', this.name)
|
this.$emit('blur', this.name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user