feat: 投被信息录入信息变动方式同步

二者信息都是在内容补充完整之后进行校验, 校验完整之后开始同步
This commit is contained in:
hz
2025-10-31 15:45:08 +08:00
parent fc74b94034
commit 40a983cfc3
2 changed files with 116 additions and 95 deletions

View File

@@ -88,9 +88,12 @@
:readonly="idLimit" :readonly="idLimit"
></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" @change="effectiveDataTypeChange">长期</van-checkbox> <van-checkbox v-model="userInfo.effectiveDateType" :disabled="effectiveDateTypeAble"
@change="effectiveDataTypeChange">长期
</van-checkbox>
</div> </div>
<select-radio required :radios="sexRadio" label="性别" name="性别" v-validate="'required'" :value.sync="userInfo.sex"></select-radio> <select-radio required :radios="sexRadio" label="性别" name="性别" v-validate="'required'"
:value.sync="userInfo.sex"></select-radio>
<FieldDatePicter <FieldDatePicter
v-validate="'required'" v-validate="'required'"
label="出生日期" label="出生日期"
@@ -145,7 +148,6 @@
placeholder="请输入" placeholder="请输入"
v-validate="'required|mobileLength11|mobileStartWith1|mobile'" v-validate="'required|mobileLength11|mobileStartWith1|mobile'"
maxlength="11" maxlength="11"
@blur="save"
/> />
<van-field <van-field
v-model="userInfo.email" v-model="userInfo.email"
@@ -155,7 +157,6 @@
placeholder="请输入" placeholder="请输入"
v-validate="Number(branchType) !== 14 ? 'required|' : '' + 'email'" v-validate="Number(branchType) !== 14 ? 'required|' : '' + 'email'"
clearable clearable
@blur="save"
/> />
<p class="email-tip" v-if="branchType == '14'">用于接收电子保单及相关服务通知</p> <p class="email-tip" v-if="branchType == '14'">用于接收电子保单及相关服务通知</p>
@@ -185,7 +186,7 @@
style="border-bottom: 1px solid #eee;display: flex;justify-content: space-between;align-items: center;" style="border-bottom: 1px solid #eee;display: flex;justify-content: space-between;align-items: center;"
v-if="manageComCode == '45'" v-if="manageComCode == '45'"
> >
<van-radio-group @change="save" v-model="userInfo.isNewPeopleFlag" class="flex"> <van-radio-group v-model="userInfo.isNewPeopleFlag" class="flex">
<label> <label>
<i class="red">*</i> <i class="red">*</i>
新市民身份 新市民身份
@@ -241,7 +242,7 @@
name="有无社保" name="有无社保"
required required
:value.sync="userInfo.medical" :value.sync="userInfo.medical"
@change="save"
/> />
<van-field <van-field
:value="userInfo.taxResidentId | idToText('taxIdentity')" :value="userInfo.taxResidentId | idToText('taxIdentity')"
@@ -301,7 +302,7 @@
v-validate="'required|onlyNumber'" v-validate="'required|onlyNumber'"
clearable clearable
maxlength="5" maxlength="5"
@blur="save"
/> />
<!-- <van-field--> <!-- <van-field-->
<!-- v-model="userInfo.liabilitiesMoney"--> <!-- v-model="userInfo.liabilitiesMoney"-->
@@ -360,7 +361,6 @@
v-validate="'required'" v-validate="'required'"
:value.sync="userInfo.isAsync" :value.sync="userInfo.isAsync"
v-if="branchType != '14'" v-if="branchType != '14'"
@radioChange="save"
/> />
<SearchField <SearchField
:isAsync="userInfo.isAsync == 1" :isAsync="userInfo.isAsync == 1"
@@ -391,7 +391,7 @@
v-validate="'required|homeAddressNum|homeAddressCh'" v-validate="'required|homeAddressNum|homeAddressCh'"
clearable clearable
maxlength="30" maxlength="30"
@blur="save"
style="font-size: 3.5vw" style="font-size: 3.5vw"
/> />
<!-- <van-field <!-- <van-field
@@ -466,21 +466,27 @@
<!-- <van-field v-model="userInfo.homePhone" label="家庭电话" name="家庭电话" placeholder="非必填" maxlength="13" clearable /> --> <!-- <van-field v-model="userInfo.homePhone" label="家庭电话" name="家庭电话" placeholder="非必填" maxlength="13" clearable /> -->
</van-cell-group> </van-cell-group>
<div class="bottom-btn flex"> <div class="bottom-btn flex">
<van-button color="#E9332E" plain v-no-more-click="1000" @click="generateInsureNo" v-if="branchType == '14'">生成投保单号</van-button> <van-button color="#E9332E" plain v-no-more-click="1000" @click="generateInsureNo" v-if="branchType == '14'">
生成投保单号
</van-button>
<!-- <van-button type="danger" @click="nextStep" v-no-more-click="1000" class="flex1">下一步</van-button>--> <!-- <van-button type="danger" @click="nextStep" v-no-more-click="1000" class="flex1">下一步</van-button>-->
</div> </div>
<!-- <van-button type="danger" class="bottom-btn" @click="nextStep" v-no-more-click="1000">下一步</van-button> --> <!-- <van-button type="danger" class="bottom-btn" @click="nextStep" v-no-more-click="1000">下一步</van-button> -->
<!-- 字段选择 --> <!-- 字段选择 -->
<van-popup v-model="popupShow" position="bottom"><van-picker show-toolbar :columns="columns" @confirm="onConfirm" @cancel="popupShow = false"/></van-popup> <van-popup v-model="popupShow" position="bottom">
<van-picker show-toolbar :columns="columns" @confirm="onConfirm" @cancel="popupShow = false" />
</van-popup>
<!-- 地区选择 --> <!-- 地区选择 -->
<!-- <van-popup v-model="areaShow" position="bottom"> <!-- <van-popup v-model="areaShow" position="bottom">
<van-area :area-list="areaList" value="110101" @confirm="sureArea($event, '1')" @cancel="areaShow = false" /> <van-area :area-list="areaList" value="110101" @confirm="sureArea($event, '1')" @cancel="areaShow = false" />
</van-popup> --> </van-popup> -->
<!-- 联系地址选择 --> <!-- 联系地址选择 -->
<van-popup v-model="homeShow" position="bottom" <van-popup v-model="homeShow" position="bottom"
><van-area :area-list="areaLists" :value="areaValue" @confirm="sureArea($event, '2')" @cancel="homeShow = false" >
/></van-popup> <van-area :area-list="areaLists" :value="areaValue" @confirm="sureArea($event, '2')" @cancel="homeShow = false"
/>
</van-popup>
<!-- 户籍选择 --> <!-- 户籍选择 -->
<!-- <van-popup v-model="censusShow" position="bottom"> <!-- <van-popup v-model="censusShow" position="bottom">
<van-area :area-list="areaList" value="110101" :columns-num="2" @confirm="sureArea($event, '3')" @cancel="censusShow = false" /> <van-area :area-list="areaList" value="110101" :columns-num="2" @confirm="sureArea($event, '3')" @cancel="censusShow = false" />
@@ -495,7 +501,9 @@
</div> </div>
</div> </div>
<div style="text-align: center;margin-bottom: 30px;"> <div style="text-align: center;margin-bottom: 30px;">
<van-button round type="danger" size="small" style="padding:0px 35px;font-size: 14px;" @click="isNewPeopleFlagTipshow = false">我知道了</van-button> <van-button round type="danger" size="small" style="padding:0px 35px;font-size: 14px;"
@click="isNewPeopleFlagTipshow = false">我知道了
</van-button>
</div> </div>
</van-dialog> </van-dialog>
<van-dialog v-model="thisdoubledialogshow" :showConfirmButton="false"> <van-dialog v-model="thisdoubledialogshow" :showConfirmButton="false">
@@ -551,13 +559,18 @@
style="padding: 0px 35px; font-size: 14px;margin-right: 30px;" style="padding: 0px 35px; font-size: 14px;margin-right: 30px;"
@click="insureBack()" @click="insureBack()"
v-if="!insureInfo.orderNo" v-if="!insureInfo.orderNo"
>退出</van-button >退出
</van-button
> >
<van-button round type="danger" size="small" style="padding: 0px 35px; font-size: 14px" @click="insureConfirm()" v-if="!insureInfo.orderNo" <van-button round type="danger" size="small" style="padding: 0px 35px; font-size: 14px" @click="insureConfirm()"
>确定</van-button v-if="!insureInfo.orderNo"
>确定
</van-button
> >
<van-button round type="danger" size="small" style="padding: 0px 35px; font-size: 14px" @click="insureNoCompleted()" v-if="insureInfo.orderNo" <van-button round type="danger" size="small" style="padding: 0px 35px; font-size: 14px"
>完成</van-button @click="insureNoCompleted()" v-if="insureInfo.orderNo"
>完成
</van-button
> >
</div> </div>
</van-dialog> </van-dialog>
@@ -1006,7 +1019,6 @@ export default {
//监听名字变化 //监听名字变化
nameChange(name) { nameChange(name) {
this.userInfo.name = name this.userInfo.name = name
this.save()
}, },
selectClick(index) { selectClick(index) {
selectComp(this, index, '1') selectComp(this, index, '1')
@@ -1065,7 +1077,6 @@ export default {
} }
}) })
this.occupationShowPicker = false this.occupationShowPicker = false
this.save()
}, },
//弹框选择 //弹框选择
toSelect(pickerType, valueKey) { toSelect(pickerType, valueKey) {
@@ -1215,83 +1226,78 @@ export default {
this.insuredDialogInfo.idNo = '' this.insuredDialogInfo.idNo = ''
this.insuredDialogInfo.idType = value.id this.insuredDialogInfo.idType = value.id
} }
this.save()
}, },
//证件起始截止日期 //证件起始截止日期
onDateConfirm(val, type) { onDateConfirm(val, type) {
console.log(val, type) console.log(val, type)
switch (type) { switch (type) {
case '0': case '0': {
{ //证件起始日期
//证件起始日期 //如果录入日期早于出生日期或晚于当前日期
//如果录入日期早于出生日期或晚于当前日期 if (Date.parse(val) > Date.parse(new Date()) || Date.parse(val) < Date.parse(this.userInfo.birthday)) {
if (Date.parse(val) > Date.parse(new Date()) || Date.parse(val) < Date.parse(this.userInfo.birthday)) { this.userInfo.certificateValidate = ''
this.userInfo.certificateValidate = '' this.$refs.certificateValidate.date = ''
this.$refs.certificateValidate.date = '' return this.$toast('证件起始日期填写错误')
return this.$toast('证件起始日期填写错误') }
}
// 计算年龄 // 计算年龄
if (this.userInfo.idType == '1') { if (this.userInfo.idType == '1') {
let age = utilsAge.getAge(this.userInfo.birthday, new Date()) let age = utilsAge.getAge(this.userInfo.birthday, new Date())
// 长期按钮是否禁用 // 长期按钮是否禁用
this.effectiveDateTypeAble = age <= 45 this.effectiveDateTypeAble = age <= 45
if (this.userInfo.birthday && !this.userInfo.certiexpiredate) { if (this.userInfo.birthday && !this.userInfo.certiexpiredate) {
this.userInfo.certiexpiredate = countCredentialValidity.getEndDate(this.userInfo.birthday, val) this.userInfo.certiexpiredate = countCredentialValidity.getEndDate(this.userInfo.birthday, val)
if (this.userInfo.certiexpiredate) { if (this.userInfo.certiexpiredate) {
this.userInfo.certiexpiredate = this.userInfo.certiexpiredate this.userInfo.certiexpiredate = this.userInfo.certiexpiredate
this.effectiveDateTypeAble = true this.effectiveDateTypeAble = true
this.userInfo.effectiveDateType = false this.userInfo.effectiveDateType = false
}
} }
} }
} }
}
break break
case '1': case '1': {
{ this.userInfo.effectiveDateType = false
this.userInfo.effectiveDateType = false //如果录入日期早于当前日期
//如果录入日期早于当前日期 if (Date.parse(val) < Date.parse(new Date())) {
if (Date.parse(val) < Date.parse(new Date())) { this.userInfo.certiexpiredate = ''
this.userInfo.certiexpiredate = '' this.$refs.certiexpiredate.date = ''
this.$refs.certiexpiredate.date = '' return this.$toast('亲,请您核实投保人身份证件有效期~')
return this.$toast('亲,请您核实投保人身份证件有效期~')
}
//身份证证件类型的判断
if (this.userInfo.idType == '1') {
// if(this.userInfo.birthday){
// this.userInfo.certificateValidate = countCredentialValidity.getStartDate(this.userInfo.birthday,val)
// }
}
} }
//身份证证件类型的判断
if (this.userInfo.idType == '1') {
// if(this.userInfo.birthday){
// this.userInfo.certificateValidate = countCredentialValidity.getStartDate(this.userInfo.birthday,val)
// }
}
}
break break
case '2': case '2': {
{ //出生日期
//出生日期 //如果录入日期晚于当前日期
//如果录入日期晚于当前日期 if (Date.parse(val) > Date.parse(new Date())) {
if (Date.parse(val) > Date.parse(new Date())) { this.userInfo.birthday = ''
this.userInfo.birthday = '' this.$refs.birthday.date = ''
this.$refs.birthday.date = '' return this.$toast('出生日期不晚于当日')
return this.$toast('出生日期不晚于当日')
}
//长期判断
let age = utilsAge.getAge(this.userInfo.birthday, new Date())
if (this.userInfo.idType == '1') {
this.effectiveDateTypeAble = !(age > 45)
}
//年龄18周岁工作单位默认值为
if (age < 18 && this.branchType != '14') {
this.userInfo.workcompany = this.userInfo.workcompany || '无'
}
if (this.userInfo.certificateValidate && !this.userInfo.certiexpiredate) {
this.userInfo.certiexpiredate = countCredentialValidity.getEndDate(this.userInfo.birthday, this.userInfo.certificateValidate)
}
if (this.userInfo.certiexpiredate && !this.userInfo.certificateValidate) {
this.userInfo.certificateValidate = countCredentialValidity.getEndDate(this.userInfo.birthday, this.userInfo.certiexpiredate)
}
} }
//长期判断
let age = utilsAge.getAge(this.userInfo.birthday, new Date())
if (this.userInfo.idType == '1') {
this.effectiveDateTypeAble = !(age > 45)
}
//年龄18周岁工作单位默认值为
if (age < 18 && this.branchType != '14') {
this.userInfo.workcompany = this.userInfo.workcompany || '无'
}
if (this.userInfo.certificateValidate && !this.userInfo.certiexpiredate) {
this.userInfo.certiexpiredate = countCredentialValidity.getEndDate(this.userInfo.birthday, this.userInfo.certificateValidate)
}
if (this.userInfo.certiexpiredate && !this.userInfo.certificateValidate) {
this.userInfo.certificateValidate = countCredentialValidity.getEndDate(this.userInfo.birthday, this.userInfo.certiexpiredate)
}
}
break break
} }
this.save()
}, },
//选择客户 //选择客户
chooseCustomer(data) { chooseCustomer(data) {
@@ -1693,8 +1699,8 @@ export default {
orderNo: this.$route.query.orderNo orderNo: this.$route.query.orderNo
? this.$route.query.orderNo ? this.$route.query.orderNo
: this.branchType == '14' && this.insureInfo.orderNo : this.branchType == '14' && this.insureInfo.orderNo
? this.insureInfo.orderNo ? this.insureInfo.orderNo
: null, : null,
isElecCont: this.isElecCont isElecCont: this.isElecCont
}, },
appntDTO: {}, appntDTO: {},
@@ -1808,7 +1814,6 @@ export default {
} else { } else {
this.certiexpiredateRequired = true this.certiexpiredateRequired = true
} }
this.save()
}, },
//获取身份证扫描信息 //获取身份证扫描信息
getIdentityInfo(data) { getIdentityInfo(data) {
@@ -1827,7 +1832,6 @@ export default {
this.userInfo.stature = '' this.userInfo.stature = ''
return this.$toast('身高输入有误') return this.$toast('身高输入有误')
} }
this.save()
}, },
//校验体重 //校验体重
checkAvoirdupois(val) { checkAvoirdupois(val) {
@@ -1842,7 +1846,7 @@ export default {
this.userInfo.avoirdupois = '' this.userInfo.avoirdupois = ''
return this.$toast('体重输入有误') return this.$toast('体重输入有误')
} }
this.save()
}, },
getRelatedData(val, source) { getRelatedData(val, source) {
if (this.userInfo.idType != '1') { if (this.userInfo.idType != '1') {
@@ -1875,7 +1879,7 @@ export default {
} else { } else {
// this.userInfo.effectiveDateType = false // this.userInfo.effectiveDateType = false
} }
this.save()
}, },
reload() { reload() {
location.reload() location.reload()
@@ -1900,20 +1904,27 @@ export default {
} }
} }
}, },
"userInfo.sex"(){ userInfo :{
this.save() deep: true,
} async handler() {
if (await this.$validator.validate()) {
this.nextStep()
}else console.log(`validate error`)
}
},
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.insured-info-container { .insured-info-container {
/deep/.van-checkbox { /deep/ .van-checkbox {
margin-left: auto; margin-left: auto;
} }
/deep/.van-radio {
/deep/ .van-radio {
margin-left: auto; margin-left: auto;
} }
.isNewPeopleFlagTipClass { .isNewPeopleFlagTipClass {
margin-top: 45px; margin-top: 45px;
line-height: 24px; line-height: 24px;
@@ -1922,11 +1933,13 @@ export default {
padding: 2px 10px; padding: 2px 10px;
} }
} }
.no-border { .no-border {
/deep/.van-cell { /deep/ .van-cell {
border-bottom: none; border-bottom: none;
} }
} }
.email-tip { .email-tip {
color: #999; color: #999;
margin: 0 0 10px 20px; margin: 0 0 10px 20px;

View File

@@ -2071,6 +2071,14 @@ export default {
this.codeDisabled = false this.codeDisabled = false
}, },
watch: { watch: {
userInfo :{
deep: true,
async handler() {
if (await this.$validator.validate()) {
this.nextStep()
}else console.log(`validate error`)
}
},
async 'withRootUser.value'(n) { async 'withRootUser.value'(n) {
const orderNo = this.$route.query.orderNo const orderNo = this.$route.query.orderNo
if (n && orderNo) { if (n && orderNo) {