mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-09 12:16:43 +08:00
【国富惠桂保团体医疗保险产品上线金掌桂投保开发需求】被保人非本人关系时,被保人页面insuredId值对应的数据
This commit is contained in:
@@ -128,11 +128,35 @@ export function revokeOrder(data) {
|
||||
}
|
||||
|
||||
// 团险--多个被保人--开始
|
||||
// 投保人保存接口
|
||||
// 投保人、被保人保存接口
|
||||
export function saveOrUpdateGroupCard(data) {
|
||||
return request({
|
||||
url: getUrl('/sale/card/saveOrUpdateGroupCard', 1),
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
//详情
|
||||
// {
|
||||
// "orderNo": "8186270000017833",
|
||||
// }
|
||||
export function cardOrderDetail(data) {
|
||||
return request({
|
||||
url: getUrl('/sale/card/orderDetail', 1),
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
//删除
|
||||
// {
|
||||
// "id": "23271" //被保险人insuredId
|
||||
// }
|
||||
|
||||
export function deleteGroupCardByInsured(data) {
|
||||
return request({
|
||||
url: getUrl('/sale/card/deleteGroupCardByInsured', 1),
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class='insured-info-container pb50'>
|
||||
<!-- 被保险人信息 (投保人与被保险人非同一人的情况)-->
|
||||
<van-cell-group class='mt10' v-if='userInfo.relationToInsured != 1'>
|
||||
<van-cell-group class='mt10' v-if='userInfo.relationToAppnt != 1'>
|
||||
<p style='border-bottom: 1px solid #ebedf0' class='fs15 fwb pl10 pv12'>被保人信息</p>
|
||||
<customer-picker
|
||||
@on-choose='chooseCustomer(arguments)'
|
||||
@@ -388,7 +388,7 @@ import OccupationPicker from '@/components/ebiz/occipation/OccupationPicker'
|
||||
import CustomerPicker from '@/components/ebiz/customer/CustomerPicker'
|
||||
import DataDictionary from '@/assets/js/utils/data-dictionary'
|
||||
import areaList from '@/assets/js/utils/areaForSale'
|
||||
import { saveOrUpdateGroupCard, insureTrial } from '@/api/ebiz/cardList/cardList.js'
|
||||
import { saveOrUpdateGroupCard, insureTrial,cardOrderDetail } from '@/api/ebiz/cardList/cardList.js'
|
||||
import utilsAge from '@/assets/js/utils/age'
|
||||
import getAreaName from '@/assets/js/utils/getAreaNameForSale'
|
||||
import IdentityCardScan from '@/components/ebiz/sale/IdentityCardScan'
|
||||
@@ -428,7 +428,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
cardOrderNo: this.$route.query.cardOrderNo,
|
||||
cardOrderNo: '',
|
||||
isLessEighteen: true, //是否小于18周岁(不含)
|
||||
averageAnnualIncomeFlag: false, // 20210730 年收入不展示且默认为0 核心对年收入有非空校验
|
||||
idLimit: false, //截止日期是否可编辑
|
||||
@@ -490,7 +490,7 @@ export default {
|
||||
bnfType: '0', // 受益人类型
|
||||
bnfSelec: '请选择',
|
||||
birthday: '', //投保人出生日期
|
||||
relationToInsured: '1',
|
||||
relationToAppnt: '1',
|
||||
idType: '1', //证件类型
|
||||
idNo: '', //证件号码
|
||||
certiexpiredate: '', //证件到期时间
|
||||
@@ -540,7 +540,8 @@ export default {
|
||||
email: '',//电子邮箱
|
||||
medical:'0',//有无社保
|
||||
schoolName: '',
|
||||
className: ''
|
||||
className: '',
|
||||
relationToAppnt:''
|
||||
},
|
||||
selectUser: '',
|
||||
areaList: areaList,
|
||||
@@ -571,7 +572,6 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.userInfo.relationToInsured = this.$route.query.relationToInsured
|
||||
// document.body.style.backgroundColor = '#F5F5F5'
|
||||
//如果是编辑进来
|
||||
// if (this.$route.query.edit) {
|
||||
@@ -597,7 +597,7 @@ export default {
|
||||
// if (this.itemProductDTOS.productCode === 'GFRS_M0048' || this.itemProductDTOS.productCode === 'GFRS_M0049' || this.itemProductDTOS.productCode === 'GFRS_M0050') {
|
||||
// //金掌桂学平险产品指定生效日规则调整的申请,学平险+60
|
||||
// this.filterMaxDate = afterDate.getAfterDays(60)
|
||||
// this.userInfo.relationToInsured = ''
|
||||
// this.userInfo.relationToAppnt = ''
|
||||
// this.showField = true
|
||||
// let currentTime = dateUtils.formatDate(new Date(), 'yyyy-MM-dd')
|
||||
// let currentDataArr = currentTime.split('-')
|
||||
@@ -639,7 +639,7 @@ export default {
|
||||
// }
|
||||
// //GFRS-2641 少儿安康
|
||||
// if (this.itemProductDTOS.productCode === 'GFRS_M0052') {
|
||||
// this.userInfo.relationToInsured = '3'
|
||||
// this.userInfo.relationToAppnt = '3'
|
||||
// //GFRS-2641 保留首次投保、保险期间届满重新投保,默认首次投保
|
||||
// this.showFirstOr = true
|
||||
// //GFRS-2641 被保险人去掉电子邮箱、手机号码字段
|
||||
@@ -677,10 +677,36 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
let that = this
|
||||
// 2516--除万福卡,投保人、被保险人年收入,默认为0,允许修改
|
||||
// if (this.itemProductDTOS.productCode != 'GFRS_M0032') {
|
||||
// this.userInfo.averageAnnualIncome = '0'
|
||||
// }
|
||||
this.userInfo.relationToAppnt = this.$route.query.relationToAppnt
|
||||
this.insuredInfo.relationToAppnt = this.$route.query.relationToAppnt
|
||||
|
||||
if (this.$route.query.cardOrderNo) {
|
||||
this.cardOrderNo = this.$route.query.cardOrderNo
|
||||
}
|
||||
//根据后台数据来展示
|
||||
let cardInfoDTO = {
|
||||
orderNo: this.cardOrderNo
|
||||
}
|
||||
cardOrderDetail(cardInfoDTO).then(res => {
|
||||
if (res.result == '0') {
|
||||
if(that.$route.query.insuredId){ //编辑
|
||||
res.orderDTO.insuredDTOs.forEach(item => {
|
||||
if(that.$route.query.insuredId == item.insuredId){
|
||||
that.insuredInfo = item
|
||||
}
|
||||
})
|
||||
} else {
|
||||
if(that.$route.query.relationToAppnt == '1'){ //新增关系为本人
|
||||
Object.assign(this.userInfo,res.orderDTO.appntDTO)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
//长期状态改变时
|
||||
@@ -912,7 +938,7 @@ export default {
|
||||
} else if (this.pickerType == '8') {
|
||||
this.userInfo.salarySource = value.id
|
||||
} else if (this.pickerType == '9') {
|
||||
this.userInfo.relationToInsured = value.id
|
||||
this.userInfo.relationToAppnt = value.id
|
||||
} else if (this.pickerType == '66') {
|
||||
this.insuredInfo.marriage = value.id
|
||||
this.insuredInfo.marriageStatus = value.text
|
||||
@@ -1216,6 +1242,7 @@ export default {
|
||||
this.insuredInfo.homeName = getAreaName([{ code: data.homeProvince }, { code: data.homeCity }, { code: data.homeArea }]) //家庭地址
|
||||
}
|
||||
this.insuredInfo.homeAddress = data.homeAddress //家庭详细地址
|
||||
this.insuredInfo.medical = data.socialSecurity //有无社保
|
||||
//2516--三个学平险--被保险人职业类别默认学生,允许修改。
|
||||
if (this.itemProductDTOS.productCode == 'GFRS_M0048' || this.itemProductDTOS.productCode == 'GFRS_M0049' || this.itemProductDTOS.productCode == 'GFRS_M0050') {
|
||||
this.insuredInfo.occupationCode = '2099907'
|
||||
@@ -1248,6 +1275,7 @@ export default {
|
||||
}
|
||||
// 长期按钮是否禁用
|
||||
this.effectiveDateTypeAbleInsured = age <= 45
|
||||
console.log(this.insuredInfo,'this.insuredInfo')
|
||||
this.getRelatedData(this.insuredInfo.idNo, '2')
|
||||
}
|
||||
// console.log(data, val)
|
||||
@@ -1257,7 +1285,7 @@ export default {
|
||||
// console.log(this.userInfo.salarySource)
|
||||
// console.log(this.userInfo.otherSalarySource)
|
||||
//表单校验, 成功跳转
|
||||
if (this.userInfo.relationToInsured == 1) {
|
||||
if (this.userInfo.relationToAppnt == 1) {
|
||||
Object.assign(this.insuredInfo, this.userInfo)
|
||||
}
|
||||
this.$validator.validate().then(valid => {
|
||||
@@ -1297,7 +1325,7 @@ export default {
|
||||
if (!this.insuredInfo.homeAddress) {
|
||||
return this.$toast('被保人详细地址不能为空')
|
||||
}
|
||||
if (this.userInfo.relationToInsured == 2 && this.userInfo.sex == this.insuredInfo.sex) {
|
||||
if (this.userInfo.relationToAppnt == 2 && this.userInfo.sex == this.insuredInfo.sex) {
|
||||
return this.$toast('哦~配偶性别不能相同的哟~')
|
||||
}
|
||||
|
||||
@@ -1382,7 +1410,7 @@ export default {
|
||||
if (this.itemProductDTOS.productCode === 'GFRS_M0022') {
|
||||
// return
|
||||
// 如果是未成年人
|
||||
if (insuredAge < 7 && this.userInfo.relationToInsured != '3') {
|
||||
if (insuredAge < 7 && this.userInfo.relationToAppnt != '3') {
|
||||
return this.$toast('0-7岁未成年人须由其父母投保,请确定')
|
||||
}
|
||||
|
||||
@@ -1435,20 +1463,20 @@ export default {
|
||||
}
|
||||
}
|
||||
// 投被保人年龄与投被保人年龄之间校验逻辑
|
||||
// if (this.userInfo.relationToInsured == '4') {
|
||||
// if (this.userInfo.relationToAppnt == '4') {
|
||||
// //投被保人关系是子女
|
||||
// // 被保险人的出生日期大于投保人的出生日期(即被保险人年龄小于投保人年龄)点击【下一步】提示“当前被保险人是投保人的子女,被保险人年龄需小于投保人年龄。
|
||||
// if (age > insuredAge) {
|
||||
// return this.$toast('当前投保人是被保险人的子女,投保人年龄需小于被保险人年龄')
|
||||
// }
|
||||
// } else if (this.userInfo.relationToInsured == '3') {
|
||||
// } else if (this.userInfo.relationToAppnt == '3') {
|
||||
// //投被保人关系是父母
|
||||
// // 被保险人的出生日期小于投保人的出生日期(即被保险人年龄大于投保人年龄)点击【下一步】提示“当前被保险人是投保人的父母,被保险人年龄需大于投保人年龄。
|
||||
// if (age < insuredAge) {
|
||||
// return this.$toast('当前投保人是被保险人的父母,投保人年龄需大于被保险人年龄')
|
||||
// }
|
||||
// }
|
||||
if (this.userInfo.relationToInsured != '1') {
|
||||
if (this.userInfo.relationToAppnt != '1') {
|
||||
//投被保人关系不是本人
|
||||
//投保人和被保险人的证件信息(证件号码、证件类型)相同时,关系只能是本人,当“是投保人的”枚举为非本人(配偶、父母、子女、其他),但证件号码和本人相同,点击【下一步】提示“投保人和被保人关系不是本人,证件号码不可一致,请修改。”
|
||||
if (this.userInfo.idNo == this.insuredInfo.idNo && this.userInfo.idType == this.insuredInfo.idType) {
|
||||
@@ -1746,7 +1774,7 @@ export default {
|
||||
// this.codeDisabled = false
|
||||
// },
|
||||
watch: {
|
||||
'userInfo.relationToInsured': {
|
||||
'userInfo.relationToAppnt': {
|
||||
handler(newV) {
|
||||
// 如果关系为本人,将投保人信息带入到被保人信息上
|
||||
if (newV === 1) {
|
||||
@@ -1771,7 +1799,9 @@ export default {
|
||||
homeAddress: '', //详细地址
|
||||
mobile: '', //移动电话
|
||||
email: '', //电子邮箱
|
||||
effectiveDateType: false //是否长期
|
||||
effectiveDateType: false, //是否长期
|
||||
medical:'0',//有无社保
|
||||
relationToAppnt: this.$route.query.relationToAppnt
|
||||
}
|
||||
// 设置选中‘同投保人’的勾选项
|
||||
this.withRootUser.value = true
|
||||
@@ -1843,7 +1873,7 @@ export default {
|
||||
},
|
||||
'userInfo.sex': {
|
||||
handler(newV) {
|
||||
if (this.userInfo.relationToInsured === 2) {
|
||||
if (this.userInfo.relationToAppnt === 2) {
|
||||
this.insuredInfo.sex = this.userInfo.sex === '0' ? '1' : '0'
|
||||
}
|
||||
},
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<span class="ml10 mr20 fs15">{{ choose.relationName }}</span>
|
||||
<div v-if="choose.hasRisk" class="fs15 c-gray-dark">
|
||||
<div>姓名: {{ choose.name }}</div>
|
||||
<div v-if="choose.totalPrem != '0.00'">保费(元): {{ choose.totalPrem | moneyFormat }}</div>
|
||||
<div v-if="choose.riskDTOLst[0].prem != '0.00'">保费(元): {{ choose.riskDTOLst[0].prem | moneyFormat }}</div>
|
||||
</div>
|
||||
<div class="mr10 fs15 c-gray-dark" @click="insure(choose)" v-else>点击为他/她投保</div>
|
||||
<div style="flex-grow:1" :class="[choose.totalAmt == '0.00' || choose.hasRisk == false ? '' : 'mt10', 'flex', 'justify-content-fe']">
|
||||
@@ -46,7 +46,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { Icon, Dialog, Toast } from 'vant'
|
||||
import { getDetail, deleteProposal } from '@/api/ebiz/proposal/proposal.js'
|
||||
import { cardOrderDetail, deleteGroupCardByInsured } from '@/api/ebiz/cardList/cardList.js'
|
||||
// import BreadcrumbNavigator from '@/components/ebiz/proposal/BreadcrumbNavigator'
|
||||
import { GoodsAction, GoodsActionIcon, GoodsActionButton } from 'vant'
|
||||
import { underWrite } from '@/api/ebiz/sale/sale'
|
||||
@@ -65,7 +65,7 @@ export default {
|
||||
{
|
||||
relationName: '本人',
|
||||
code: 0,
|
||||
check: true,
|
||||
check: false,
|
||||
relation: relation[0].id
|
||||
},
|
||||
{
|
||||
@@ -88,16 +88,7 @@ export default {
|
||||
}
|
||||
],
|
||||
//与被保险人关系默认为本人。
|
||||
chooseList: [
|
||||
{
|
||||
check: true,
|
||||
code: 0,
|
||||
hasRisk: false,
|
||||
relation: 1,
|
||||
relationName: "本人"
|
||||
}
|
||||
], //添加上的被保险人
|
||||
proposalInfo: '', //查询中的建议书信息
|
||||
chooseList: [], //添加上的被保险人
|
||||
cardOrderNo: '',
|
||||
allPrice:0
|
||||
}
|
||||
@@ -119,28 +110,26 @@ export default {
|
||||
// this.cardOrderNo = this.$CacheUtils.getLocItem('orderNo')
|
||||
// }
|
||||
//根据后台数据来展示
|
||||
let proposalInfoDTO = {
|
||||
let cardInfoDTO = {
|
||||
orderNo: this.cardOrderNo
|
||||
}
|
||||
getDetail(proposalInfoDTO).then(res => {
|
||||
cardOrderDetail(cardInfoDTO).then(res => {
|
||||
if (res.result == '0') {
|
||||
this.chooseList = res.content[0].insuredDTOs
|
||||
this.$CacheUtils.setLocItem('proposalAppnt', JSON.stringify(res.content[0].appntDTO))
|
||||
this.proposalInfo = res.content[0]
|
||||
if (this.chooseList != null) {
|
||||
if (res.orderDTO.insuredDTOs.length > 0) {
|
||||
this.chooseList = res.orderDTO.insuredDTOs
|
||||
this.chooseList.forEach(v => {
|
||||
// relation.forEach(r => {
|
||||
// if (r.id == v.relationToAppnt) {
|
||||
// //根据关系id 获取关系name
|
||||
// v.relationName = r.text
|
||||
// if (v.relationToAppnt == '3' && v.sex == '0') {
|
||||
// //判断父亲和母亲
|
||||
// v.relationName = '父亲'
|
||||
// } else if (v.relationToAppnt == '3' && v.sex == '1') {
|
||||
// v.relationName = '母亲'
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
relation.forEach(r => {
|
||||
if (r.id == v.relationToAppnt) {
|
||||
//根据关系id 获取关系name
|
||||
v.relationName = r.text
|
||||
// if (v.relationToAppnt == '3' && v.sex == '0') {
|
||||
// //判断父亲和母亲
|
||||
// v.relationName = '父亲'
|
||||
// } else if (v.relationToAppnt == '3' && v.sex == '1') {
|
||||
// v.relationName = '母亲'
|
||||
// }
|
||||
}
|
||||
})
|
||||
if (v.insuredId) {
|
||||
//判断是否已经添加被保险人及险种
|
||||
v.hasRisk = true
|
||||
@@ -166,9 +155,20 @@ export default {
|
||||
}
|
||||
})
|
||||
})
|
||||
// 做排序
|
||||
this.sortarr(this.chooseList, 'code')
|
||||
} else {
|
||||
this.chooseList = []
|
||||
//初始化数据
|
||||
this.chooseList = [
|
||||
{
|
||||
check: true,
|
||||
code: 0,
|
||||
hasRisk: false,
|
||||
relation: 1,
|
||||
relationName: "本人"
|
||||
}
|
||||
]
|
||||
this.persons[0].check = true
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -215,7 +215,7 @@ export default {
|
||||
type: '1',
|
||||
orderDTO: {
|
||||
orderInfoDTO: {
|
||||
orderNo: this.proposalInfo.orderInfoDTO.orderNo
|
||||
orderNo: this.cardOrderNo
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -317,7 +317,7 @@ export default {
|
||||
// },
|
||||
// type: '2'
|
||||
// }
|
||||
// deleteProposal(parans).then(res => {
|
||||
// deleteGroupCardByInsured(parans).then(res => {
|
||||
// //删除从接口中获取的
|
||||
// if (res.result == '0') {
|
||||
// item.check = !item.check
|
||||
@@ -342,26 +342,44 @@ export default {
|
||||
return this.formatChoose(choose, index)
|
||||
}
|
||||
let params = {
|
||||
orderDTO: {
|
||||
orderInfoDTO: {
|
||||
orderNo: this.$CacheUtils.getLocItem('orderNo')
|
||||
},
|
||||
insuredDTOs: [
|
||||
{
|
||||
insuredNo: choose.insuredId
|
||||
}
|
||||
]
|
||||
},
|
||||
type: '2'
|
||||
// orderDTO: {
|
||||
// orderInfoDTO: {
|
||||
// orderNo: this.$CacheUtils.getLocItem('orderNo')
|
||||
// },
|
||||
// insuredDTOs: [
|
||||
// {
|
||||
// insuredNo: choose.insuredId
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// type: '2'
|
||||
id: choose.insuredId
|
||||
}
|
||||
deleteProposal(params).then(res => {
|
||||
deleteGroupCardByInsured(params).then(res => {
|
||||
if (res.result == '0') {
|
||||
this.formatChoose(choose, index)
|
||||
this.chooseList.splice(index, 1)
|
||||
// this.formatChoose(choose, index)
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
formatChoose(choose, index) {
|
||||
let has = false //判断当前是否有相同的已经选中的
|
||||
this.chooseList.splice(index, 1)
|
||||
this.chooseList.forEach(value => {
|
||||
if (value.code == choose.code) {
|
||||
has = true
|
||||
}
|
||||
})
|
||||
this.persons.forEach(v => {
|
||||
if (v.code == choose.code) {
|
||||
if (!has) {
|
||||
v.check = false
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
//将数组排序
|
||||
sortarr(arr, factor) {
|
||||
for (let i = 0; i < arr.length - 1; i++) {
|
||||
@@ -385,7 +403,7 @@ export default {
|
||||
this.$CacheUtils.setLocItem('cardInsuredPersonInfo', JSON.stringify(cardInsuredPersonInfo)) //存储被保险人信息
|
||||
localStorage.chooseProductCodes = '' //置空所选险种
|
||||
|
||||
let url = `/cardList/GroupInsuredInfo?relationToInsured=${person.relation}&cardOrderNo=${this.cardOrderNo}`
|
||||
let url = `/cardList/GroupInsuredInfo?relationToAppnt=${person.relation}&cardOrderNo=${this.cardOrderNo}`
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
@@ -397,12 +415,8 @@ export default {
|
||||
})
|
||||
},
|
||||
//编辑被保险人
|
||||
edit(item) {
|
||||
item.birthday = item.birthdayLabel
|
||||
item.age = item.insuredAge
|
||||
this.$CacheUtils.setLocItem('cardInsuredPersonInfo', JSON.stringify(item)) //存储被保险人信息
|
||||
// localStorage.isFrom = 'proposal'
|
||||
let url = `/cardList/GroupInsuredInfo?relationToInsured=1&cardOrderNo=${item.orderNo}`
|
||||
edit(choose) {
|
||||
let url = `/cardList/GroupInsuredInfo?relationToAppnt=${choose.relationToAppnt}&cardOrderNo=${choose.orderNo}&insuredId=${choose.insuredId}`
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
@@ -425,22 +439,6 @@ export default {
|
||||
// })
|
||||
// this.sortarr(this.chooseList, 'code')
|
||||
// },
|
||||
formatChoose(choose, index) {
|
||||
let has = false //判断当前是否有相同的已经选中的
|
||||
this.chooseList.splice(index, 1)
|
||||
this.chooseList.forEach(value => {
|
||||
if (value.code == choose.code) {
|
||||
has = true
|
||||
}
|
||||
})
|
||||
this.persons.forEach(v => {
|
||||
if (v.code == choose.code) {
|
||||
if (!has) {
|
||||
v.check = false
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user