mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-10 03:26:45 +08:00
投保人请求{{URL}}/sale/card/saveOrUpdateGroupCard
This commit is contained in:
@@ -126,3 +126,13 @@ export function revokeOrder(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 团险--多个被保人--开始
|
||||
// 投保人保存接口
|
||||
export function saveOrUpdateGroupCard(data) {
|
||||
return request({
|
||||
url: getUrl('/sale/card/saveOrUpdateGroupCard', 1),
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
@@ -198,7 +198,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 { saveOrUpdateCard } from '@/api/ebiz/cardList/cardList.js'
|
||||
import { saveOrUpdateGroupCard } 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'
|
||||
@@ -797,12 +797,22 @@ export default {
|
||||
supportBank: '0'
|
||||
},
|
||||
appntDTO: this.userInfo,
|
||||
// insuredDTOs: [this.insuredInfo]
|
||||
}
|
||||
},
|
||||
orderType: "CARDGROUP_APPNT_ORDER"
|
||||
}
|
||||
|
||||
let resultData = await saveOrUpdateCard(params)
|
||||
let resultData = await saveOrUpdateGroupCard(params)
|
||||
if (resultData.result == 0) {
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + `/#/cardList/GroupInsuredInfo`,
|
||||
forbidSwipeBack: 1
|
||||
},
|
||||
routerInfo: {
|
||||
path: `/cardList/GroupInsuredInfo`
|
||||
}
|
||||
})
|
||||
console.log('resultData.orderNo', resultData.content.object)
|
||||
} else {
|
||||
console.error(resultData.resultMessage)
|
||||
|
||||
@@ -25,15 +25,19 @@
|
||||
<van-field :value='riskDTO.insuYear + riskDTO.dateCN' label='保险期间' name='保险期间' readonly />
|
||||
</van-cell-group>
|
||||
<!-- <div class='tips'>注:{{ productDate }}</div> -->
|
||||
<van-cell-group class='mt10' v-for="(item, index) in insuredInfo" :key="index">
|
||||
<van-cell-group class='mt10'>
|
||||
<p style='border-bottom: 1px solid #ebedf0' class='fs15 fwb pl10 pv12'>被保人信息</p>
|
||||
<van-field :value='item.name' label='姓名' name='姓名' readonly />
|
||||
<van-field :value="item.idType | idToText('insuredIdType')" label='证件类型' name='证件类型' readonly />
|
||||
<van-field :value='item.idNo' label='证件号码' name='证件号码' readonly />
|
||||
<!-- <van-field v-if='item.isLessEighteen' :value='item.mobile' label='手机号码' name='手机号码' readonly /> -->
|
||||
<!-- <van-field v-if='item.isLessEighteen' :value='item.email' label='电子邮箱' name='电子邮箱' readonly /> -->
|
||||
<van-field :value='item.homeName' label='联系地址' name='联系地址' readonly />
|
||||
<van-field :value='item.homeAddress' label='详细地址' name='详细地址' readonly />
|
||||
<van-collapse v-model="activeNames" :border="false">
|
||||
<van-collapse-item :name="index" v-for="(item, index) in insuredInfo" :key="index" :border="false">
|
||||
<van-field :value='item.name' label='姓名' name='姓名' readonly />
|
||||
<van-field :value="item.idType | idToText('insuredIdType')" label='证件类型' name='证件类型' readonly />
|
||||
<van-field :value='item.idNo' label='证件号码' name='证件号码' readonly />
|
||||
<!-- <van-field v-if='item.isLessEighteen' :value='item.mobile' label='手机号码' name='手机号码' readonly /> -->
|
||||
<!-- <van-field v-if='item.isLessEighteen' :value='item.email' label='电子邮箱' name='电子邮箱' readonly /> -->
|
||||
<van-field :value='item.homeName' label='联系地址' name='联系地址' readonly />
|
||||
<van-field :value='item.homeAddress' label='详细地址' name='详细地址' readonly />
|
||||
</van-collapse-item>
|
||||
</van-collapse>
|
||||
</van-cell-group>
|
||||
<van-cell-group class='mt10'>
|
||||
<p style='border-bottom: 1px solid #ebedf0' class='fs15 fwb pl10 pv12'>受益人信息</p>
|
||||
@@ -52,7 +56,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Field, GoodsAction, GoodsActionIcon, GoodsActionButton, Icon } from 'vant'
|
||||
import { Field, GoodsAction, GoodsActionIcon, GoodsActionButton, Icon ,Collapse, CollapseItem} from 'vant'
|
||||
import { getOrderDetail, information, underWrite } from '@/api/ebiz/sale/sale'
|
||||
import getAreaName from '@/assets/js/utils/getAreaNameForSale'
|
||||
import afterDate from '@/assets/js/utils/getAfterDate.js'
|
||||
@@ -65,6 +69,8 @@ export default {
|
||||
[GoodsAction.name]: GoodsAction,
|
||||
[GoodsActionIcon.name]: GoodsActionIcon,
|
||||
[GoodsActionButton.name]: GoodsActionButton,
|
||||
[Collapse.name]: Collapse,
|
||||
[CollapseItem.name]: CollapseItem,
|
||||
[Icon.name]: Icon
|
||||
},
|
||||
computed: {
|
||||
@@ -76,7 +82,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: ['1'],
|
||||
activeNames: [], //折叠面板
|
||||
appntInfo: {},
|
||||
insuredInfo: {},
|
||||
bnfTypeVal: '法定受益人', //受益人类型文字展示
|
||||
|
||||
@@ -403,7 +403,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 { saveOrUpdateCard } from '@/api/ebiz/cardList/cardList.js'
|
||||
import { saveOrUpdateGroupCard } 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'
|
||||
@@ -1154,8 +1154,6 @@ export default {
|
||||
|
||||
if (this.selectUser == '1') {
|
||||
this.customerShowPicker2 = false
|
||||
} else {
|
||||
this.customerShowPicker = false
|
||||
}
|
||||
|
||||
this.$jump({
|
||||
@@ -1165,47 +1163,7 @@ export default {
|
||||
hiddenRight: '1'
|
||||
}
|
||||
})
|
||||
if (this.selectUser == '0') {
|
||||
let { customerName, customerSex } = data
|
||||
this.userInfo.name = customerName //用户名
|
||||
this.userInfo.sex = customerSex ? customerSex.toString() : '0' //性别
|
||||
this.userInfo.birthday = data.birthday //出生日期
|
||||
this.userInfo.idType = data.customerIdType //证件类型
|
||||
this.userInfo.idNo = data.customerIdNumber //证件类别
|
||||
if (data.idEffectEndDate == '9999-01-01') {
|
||||
this.userInfo.effectiveDateType = true //是否长期
|
||||
} else {
|
||||
this.userInfo.certiexpiredate = data.idEffectEndDate //证件截止日期
|
||||
}
|
||||
this.userInfo.email = data.email //电子邮箱
|
||||
|
||||
this.userInfo.mobile = data.customerPhone //移动电话
|
||||
this.userInfo.homeProvince = data.homeProvince //家庭省
|
||||
this.userInfo.homeCity = data.homeCity //家庭市
|
||||
this.userInfo.homeArea = data.homeArea //家庭区
|
||||
if (data.homeProvince && data.homeCity && data.homeArea) {
|
||||
this.userInfo.homeName = getAreaName([{ code: data.homeProvince }, { code: data.homeCity }, { code: data.homeArea }]) //家庭地址
|
||||
}
|
||||
this.userInfo.homeAddress = data.homeAddress //家庭详细地址
|
||||
this.userInfo.occupationCode = data.occupationCode
|
||||
this.userInfo.occupationName = data.occupationName
|
||||
|
||||
this.userInfo.lifeGrade = data.lifeGrade
|
||||
this.userInfo.healthGrade = data.healthGrade
|
||||
this.userInfo.averageAnnualIncome = this.itemProductDTOS.productCode == 'GFRS_M0032' ? data.averageYearlyIncome : '0' //平均年收入
|
||||
//2516--三个学平险--被保险人国籍默认中国,允许修改
|
||||
if (this.itemProductDTOS.productCode == 'GFRS_M0048' || this.itemProductDTOS.productCode == 'GFRS_M0049' || this.itemProductDTOS.productCode == 'GFRS_M0050') {
|
||||
this.userInfo.nativeplace = '1'
|
||||
} else {
|
||||
this.userInfo.nativeplace = data.country
|
||||
}
|
||||
this.userInfo.marriage = data.marryStatus
|
||||
// 计算年龄
|
||||
let age = utilsAge.getAge(this.userInfo.birthday, new Date())
|
||||
// 长期按钮是否禁用
|
||||
this.effectiveDateTypeAble = age <= 45
|
||||
this.getRelatedData(this.userInfo.idNo, '1')
|
||||
} else if (this.selectUser == '1') {
|
||||
if (this.selectUser == '1') {
|
||||
let { customerName, customerSex } = data
|
||||
this.insuredInfo.name = customerName //用户名
|
||||
this.insuredInfo.sex = customerSex ? customerSex.toString() : '0' //性别
|
||||
@@ -1344,89 +1302,6 @@ export default {
|
||||
return this.$toast('哦~配偶性别不能相同的哟~')
|
||||
}
|
||||
|
||||
let age = utilsAge.getAge(this.userInfo.birthday, new Date())
|
||||
console.log('计算年龄', age)
|
||||
// return
|
||||
// 如果是未成年人
|
||||
if (age < 18) {
|
||||
return this.$toast('亲,投保人年龄必须大于等于18周岁哦~')
|
||||
}
|
||||
//如果证件类型是身份证
|
||||
if (this.userInfo.idType == '1') {
|
||||
console.log('证件类型是身份证')
|
||||
//校验性别是否与身份证号码位相符
|
||||
if (this.userInfo.idNo.length == '15') {
|
||||
//15位身份证第15位是性别位, 奇男偶女
|
||||
let sexSign = this.userInfo.idNo.substr(14, 1)
|
||||
console.log('性别位' + sexSign)
|
||||
if ((parseInt(sexSign) % 2 == 0 && this.userInfo.sex != 1) || (parseInt(sexSign) % 2 != 0 && this.userInfo.sex != 0)) {
|
||||
return this.$toast('性别录入与身份证不符')
|
||||
}
|
||||
|
||||
//15位身份证第7-12位是生日位, 年月日
|
||||
let birthSign = this.userInfo.idNo.substr(6, 6)
|
||||
console.log('生日位' + birthSign)
|
||||
if (
|
||||
this.userInfo.birthday.substr(2, 2) != birthSign.substr(0, 2) ||
|
||||
this.userInfo.birthday.substr(5, 2) != birthSign.substr(2, 2) ||
|
||||
this.userInfo.birthday.substr(8, 2) != birthSign.substr(4, 2)
|
||||
) {
|
||||
return this.$toast('生日录入与身份证不符')
|
||||
}
|
||||
} else if (this.userInfo.idNo.length == '18') {
|
||||
//18位身份证第17位是性别位, 奇男偶女
|
||||
let sexSign = this.userInfo.idNo.substr(16, 1)
|
||||
if ((parseInt(sexSign) % 2 == 0 && this.userInfo.sex != 1) || (parseInt(sexSign) % 2 != 0 && this.userInfo.sex != 0)) {
|
||||
return this.$toast('性别录入与身份证不符')
|
||||
}
|
||||
|
||||
//18位身份证第7-14位是生日位, 年月日
|
||||
let birthSign = this.userInfo.idNo.substr(6, 8)
|
||||
if (
|
||||
this.userInfo.birthday.substr(0, 4) != birthSign.substr(0, 4) ||
|
||||
this.userInfo.birthday.substr(5, 2) != birthSign.substr(4, 2) ||
|
||||
this.userInfo.birthday.substr(8, 2) != birthSign.substr(6, 2)
|
||||
) {
|
||||
return this.$toast('生日录入与身份证不符')
|
||||
}
|
||||
}
|
||||
|
||||
// 证件号码规则校验
|
||||
if (!idNoCheck.isIdno(this.userInfo.idNo)) {
|
||||
console.log('证件号码校验有误')
|
||||
return this.$toast('您填写的证件号码有误')
|
||||
}
|
||||
if (age < 46 && this.userInfo.effectiveDateType == true) {
|
||||
return this.$toast('证件有效期错误,年龄小于46周岁的公民身份证有效期不能为长期')
|
||||
}
|
||||
// 年龄在 16-25 周岁之间
|
||||
if (age <= 15) {
|
||||
if (Date.parse(this.userInfo.certiexpiredate) - Date.parse(new Date()) > Date.parse('1975-01-01')) {
|
||||
this.userInfo.certiexpiredate = ''
|
||||
this.$refs.certiexpiredate.date = ''
|
||||
// this.effectiveDateTypeAble = true
|
||||
return this.$toast('证件有效期错误,未满16周岁的公民身份证有效期应小于等于5年')
|
||||
}
|
||||
//年龄在 16-25 周岁之间
|
||||
} else if (age >= 16 && age <= 25) {
|
||||
console.log('年龄在16-25周岁之间')
|
||||
if (Date.parse(this.userInfo.certiexpiredate) - Date.parse(new Date()) > Date.parse('1980-01-01')) {
|
||||
this.userInfo.certiexpiredate = ''
|
||||
this.$refs.certiexpiredate.date = ''
|
||||
this.effectiveDateTypeAble = true
|
||||
return this.$toast('证件有效期不正常,16周岁至25周岁公民身份证有效期应小于等于10年')
|
||||
}
|
||||
//年龄在 26-45 周岁之间
|
||||
} else if (age >= 26 && age <= 45) {
|
||||
console.log('年龄在26-45周岁之间')
|
||||
if (Date.parse(this.userInfo.certiexpiredate) - Date.parse(new Date()) > Date.parse('1990-01-01')) {
|
||||
this.userInfo.certiexpiredate = ''
|
||||
this.$refs.certiexpiredate.date = ''
|
||||
this.effectiveDateTypeAble = true
|
||||
return this.$toast('证件有效期不正常,26周岁至45周岁公民身份证有效期应小于等于20年')
|
||||
}
|
||||
}
|
||||
}
|
||||
let insuredAge = utilsAge.getAge(this.insuredInfo.birthday, new Date())
|
||||
console.log('计算年龄', insuredAge)
|
||||
//如果证件类型是身份证
|
||||
@@ -1560,19 +1435,20 @@ export default {
|
||||
return this.$toast('被保险人年龄应为0岁-17岁,请重新选择。')
|
||||
}
|
||||
}
|
||||
if (this.userInfo.relationToInsured == '4') {
|
||||
//投被保人关系是子女
|
||||
// 被保险人的出生日期大于投保人的出生日期(即被保险人年龄小于投保人年龄)点击【下一步】提示“当前被保险人是投保人的子女,被保险人年龄需小于投保人年龄。
|
||||
if (age > insuredAge) {
|
||||
return this.$toast('当前投保人是被保险人的子女,投保人年龄需小于被保险人年龄')
|
||||
}
|
||||
} else if (this.userInfo.relationToInsured == '3') {
|
||||
//投被保人关系是父母
|
||||
// 被保险人的出生日期小于投保人的出生日期(即被保险人年龄大于投保人年龄)点击【下一步】提示“当前被保险人是投保人的父母,被保险人年龄需大于投保人年龄。
|
||||
if (age < insuredAge) {
|
||||
return this.$toast('当前投保人是被保险人的父母,投保人年龄需大于被保险人年龄')
|
||||
}
|
||||
}
|
||||
// 投被保人年龄与投被保人年龄之间校验逻辑
|
||||
// if (this.userInfo.relationToInsured == '4') {
|
||||
// //投被保人关系是子女
|
||||
// // 被保险人的出生日期大于投保人的出生日期(即被保险人年龄小于投保人年龄)点击【下一步】提示“当前被保险人是投保人的子女,被保险人年龄需小于投保人年龄。
|
||||
// if (age > insuredAge) {
|
||||
// return this.$toast('当前投保人是被保险人的子女,投保人年龄需小于被保险人年龄')
|
||||
// }
|
||||
// } else if (this.userInfo.relationToInsured == '3') {
|
||||
// //投被保人关系是父母
|
||||
// // 被保险人的出生日期小于投保人的出生日期(即被保险人年龄大于投保人年龄)点击【下一步】提示“当前被保险人是投保人的父母,被保险人年龄需大于投保人年龄。
|
||||
// if (age < insuredAge) {
|
||||
// return this.$toast('当前投保人是被保险人的父母,投保人年龄需大于被保险人年龄')
|
||||
// }
|
||||
// }
|
||||
if (this.userInfo.relationToInsured != '1') {
|
||||
//投被保人关系不是本人
|
||||
//投保人和被保险人的证件信息(证件号码、证件类型)相同时,关系只能是本人,当“是投保人的”枚举为非本人(配偶、父母、子女、其他),但证件号码和本人相同,点击【下一步】提示“投保人和被保人关系不是本人,证件号码不可一致,请修改。”
|
||||
@@ -1671,12 +1547,13 @@ export default {
|
||||
bnfFlag: '0',
|
||||
supportBank: '0'
|
||||
},
|
||||
appntDTO: this.userInfo,
|
||||
// insuredDTOs: [this.insuredInfo]
|
||||
appntDTO: {},
|
||||
insuredDTOs: [this.insuredInfo],
|
||||
orderType: "CARDGROUP_INSURED_ORDER",
|
||||
}
|
||||
}
|
||||
|
||||
let resultData = await saveOrUpdateCard(params)
|
||||
let resultData = await saveOrUpdateGroupCard(params)
|
||||
if (resultData.result == 0) {
|
||||
let url = `/cardList/GroupInsuredList?cardEdit=1&cardOrderNo=${this.cardOrderNo}`
|
||||
this.$jump({
|
||||
|
||||
@@ -50,7 +50,9 @@ export default {
|
||||
console.log(code)
|
||||
await this.getData(code)
|
||||
await this.getProductDetail()
|
||||
await this.insureTrial()
|
||||
if(this.productCode != 'GFRS_M0058'){
|
||||
await this.insureTrial()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
goDocu(url, name) {
|
||||
@@ -94,14 +96,21 @@ export default {
|
||||
message: `1、您即将进入投保流程,为维护您的合法权益,投保时请您务必仔细阅读和确认保险条款、投保须知、免除保险人责任条款、犹豫期条款等页面所有内容。<br/>2.您的投保过程和操作将被记录。`,
|
||||
})
|
||||
.then(() => {
|
||||
let url
|
||||
if(this.productCode != 'GFRS_M0058'){
|
||||
url = '/cardList/information'
|
||||
}else{
|
||||
// 团险(多个被保人)流程页面
|
||||
url = '/cardList/GroupAppntInfo'
|
||||
}
|
||||
// on confirm
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + '/#/cardList/information',
|
||||
url: location.origin + '/#'+ url,
|
||||
},
|
||||
routerInfo: {
|
||||
path: '/cardList/information',
|
||||
path: url,
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user