信息录入页面优化代码

This commit is contained in:
liu.xiaofeng@ebiz-digits.com
2024-02-27 15:37:34 +08:00
parent 5cd64f6556
commit 46d605effd

View File

@@ -1085,19 +1085,6 @@
async nextStep() {
//表单校验, 成功跳转
let valid = await this.$validator.validate()
if(this.manageComCode == '45'){
if(this.userInfo.isNewPeopleFlag == '' || this.userInfo.isNewPeopleFlag == null || this.userInfo.isNewPeopleFlag == undefined ){
console.log(this.userInfo.isNewPeopleFlag)
debugger
this.$toast('新市民身份不能为空')
return false
}
}
// if(this.isElecCont == '' || this.isElecCont == null || this.isElecCont == undefined){
// this.$toast('请选择保单形式')
// return false
// }
// .then(valid => {
if (true === valid) {
localStorage.chooseProductCodesNew = localStorage.chooseProductCodes
// 计算年龄
@@ -1211,22 +1198,6 @@
return this.$toast('“证件类型”为“港澳台居民居住证”,“国籍”请选择“中国香港”、“中国澳门”或“中国台湾”~')
}
}
// else if (this.userInfo.idType == '4' && this.userInfo.idNo.length < 3) {
// console.log('证件类型是护照')
// return this.$toast('护照须大于等于3个字符')
// //证件是港澳居民通行证
// } else if (this.userInfo.idType == '5') {
// console.log('证件类型是港澳居民通行证')
// if (this.userInfo.idNo.length != 9) {
// return this.$toast('证件类型为港澳居民通行证的证件号码须为9位')
// } else if (!/^(H|M)[0-9]{8}$/.test(this.userInfo.idNo)) {
// return this.$toast('证件类型为港澳居民通行证的,证件号码首位字母为"H"/"M",证件号码第2位至第9位为阿拉伯数字')
// }
// //证件是台湾居民通行证
// } else if (this.userInfo.idType == '6' && this.userInfo.idNo.length != 8) {
// console.log('证件类型是台湾居民通行证')
// return this.$toast('证件类型为台湾居民通行证的证件号码须为8位数字')
// }
// 投保人年龄必须大于等于16周岁哦
if (age < 16) {
return this.$toast('亲投保人年龄必须大于等于16周岁哦~')
@@ -1237,16 +1208,6 @@
this.userInfo.occupationName = ''
return this.$toast('学生不可以作为投保人,请更换投保人投保')
}
// 职业 学龄前儿童 2099908 离休人员 8000003家庭主妇 4071203无业人员 8000001
// 亲,您填写的工作单位过于简短哦~
// if (
// this.userInfo.occupationCode == '2099908' ||
// this.userInfo.occupationCode == '8000003' ||
// this.userInfo.occupationCode == '4071203' ||
// this.userInfo.occupationCode == '8000001'
// ) {
// }
if (!this.userInfo.workcompany) {
this.userInfo.workcompany = '无'
}
@@ -1264,22 +1225,6 @@
}
}
/*
//如果是已婚
if ((this.userInfo.sex == '0' && age < 22) || (this.userInfo.sex == '1' && age < 20)) {
if (this.userInfo.marriage != '2') {
return this.$toast('投保人不符合国家婚姻法定年龄')
}
}
*/
// if (this.userInfo.marriage == '1') {
// if (this.userInfo.sex == '0' && age < 22) {
// return this.$toast('年龄与婚姻状况不符')
// } else if (this.userInfo.sex == '1' && age < 20) {
// return this.$toast('年龄与婚姻状况不符')
// }
// }
// 通过国籍判断 证件是否符合要求
// 如果是国籍选择中国大陆
@@ -1346,11 +1291,9 @@
}
}
this.infoUpdate()
// console.log('success')
} else {
return this.$toast(this.$validator.errors.all()[0])
}
// })
},
//信息变更
infoUpdate() {
@@ -1364,23 +1307,22 @@
let saleInsuredInfo = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo'))
//如果 姓名, 性别, 出生日期, 有无社保, 职业 ,婚姻情况,发生变化
if (this.userInfo.sex != saleInsuredInfo.sex || this.userInfo.birthday != saleInsuredInfo.birthday) {
console.log('hehe')
//提示用户
if (chooseProductCodes && chooseProductCodes.length)
return this.$dialog
.confirm({
className: 'dialog-delete',
title: '提示',
message: '当前信息已经发生改变,有可能影响险种费率,是否确认修改并清除险种信息?',
cancelButtonColor: '#E9332E',
confirmButtonColor: '#FFFFFF',
})
.then(() => {
this.save()
})
.catch(() => {
return
})
.confirm({
className: 'dialog-delete',
title: '提示',
message: '当前信息已经发生改变,有可能影响险种费率,是否确认修改并清除险种信息?',
cancelButtonColor: '#E9332E',
confirmButtonColor: '#FFFFFF',
})
.then(() => {
this.save()
})
.catch(() => {
return
})
}
}
this.save()
@@ -1463,35 +1405,13 @@
sureArea(area, type) {
console.log('area :>> ', area)
switch (type) {
// case '1': //单位地址
// this.areaName = getAreaName(area)
// ;[this.userInfo.companyProvince, this.userInfo.companyCity, this.userInfo.companyArea] = [area[0].code, area[1].code, area[2].code]
// this.areaShow = false
// break
case '2': //联系地址
this.homeName = `${area[0].name}-${area[1].name}-${area[2].name}`
;[this.userInfo.homeProvince, this.userInfo.homeCity, this.userInfo.homeArea] = [area[0].code, area[1].code, area[2].code]
this.homeShow = false
break
// case '3': //户籍
// this.census = getAreaName(area)
// ;[this.userInfo.householdProvince, this.userInfo.householdCity] = [area[0].code, area[1].code]
// this.censusShow = false
// break
}
},
//设为联系地址
// setAddress(val) {
// console.log(val)
// console.log(this.homeDefault)
// //上面是0下面是1
// if (this.homeDefault) {
// this.userInfo.addressStatus = 1
// }
// if (this.companyDefault) {
// this.userInfo.addressStatus = 0
// }
// },
//长期状态改变时
effectiveDataTypeChange(val) {
@@ -1540,11 +1460,6 @@
;[this.userInfo.idNo, this.userInfo.sex, this.userInfo.birthday, this.effectiveDateTypeAble] = ['', '0', '', false]
return this.$toast(idToData(val).text)
}
// // 判断投保人年龄是否大于16周岁
// if (idToData(val).age <= 16) {
// ;[this.userInfo.idNo, this.userInfo.sex, this.userInfo.birthday, this.effectiveDateTypeAble] = ['', '0', '', false]
// return this.$toast('亲投保人年龄必须大于等于16周岁哦~')
// }
this.userInfo.effectiveDateType = false
this.effectiveDateTypeAble = idToData(val).age <= 45