Compare commits

...

10 Commits

Author SHA1 Message Date
liu.xiaofeng@ebiz-digits.com
9947200762 受益人页面同投保人按钮 关联出婚姻状态代码逻辑修改 2023-07-10 18:13:34 +08:00
liu.xiaofeng@ebiz-digits.com
4d2601a7e8 受益人页面同投保人按钮功能代码逻辑修改 2023-07-10 16:59:50 +08:00
liu.xiaofeng@ebiz-digits.com
d0bb2d95c5 电子投保试算页面点击核保试算的弹窗调整说明样式2 2023-07-05 16:52:38 +08:00
liu.xiaofeng@ebiz-digits.com
7ee43dd29b 电子投保试算页面点击核保试算的弹窗调整说明样式 2023-07-05 16:41:35 +08:00
liu.xiaofeng@ebiz-digits.com
d521b57fb7 在金掌桂核保试算功能页面中,去掉原来“达标”、“未达标”字段和展示,保留“绿色✔”、“红色×”(重新调整位置靠近左边一点);在展示框左下角添加说明:“绿色✔表示 未触发规则、红色×表示 触发规则”。 2023-07-05 15:12:08 +08:00
liu.xiaofeng@ebiz-digits.com
6980da5934 电子投保流程被保人以及受益人证件有效期校验规则修改 2023-07-05 14:47:01 +08:00
liu.xiaofeng@ebiz-digits.com
43b9db0107 电子投保流程投保人证件有效期校验规则修改 2023-07-05 13:43:28 +08:00
liu.xiaofeng@ebiz-digits.com
3fd4237d25 自动计算证件有效期组件添加 根据证件截止日期计算证件起始日期的方法 2023-07-05 11:39:54 +08:00
liu.xiaofeng@ebiz-digits.com
be0791d8e0 证件类型是居民身份证的,客户填写或修改证件起始日期或证件止期时,另一项自动计算带出(增加组件) 2023-07-04 16:13:56 +08:00
liu.xiaofeng@ebiz-digits.com
afabe86131 新增【同投保人地址】按钮, 查询投保人地址信息, 对应相应的地址省市区编码及名称和详细地址文字 2023-07-04 13:26:55 +08:00
6 changed files with 330 additions and 326 deletions

View File

@@ -0,0 +1,167 @@
export default {
//计算身份证起始日期
getStartDate: function(age, endDate) {
let startDate = '' //证件起始日期
let thisDate = new Date() //当年日期
let thisyear = thisDate.getFullYear() //当前年份
if (age < 16) {
/**
* @Author: LiuXiaoFeng
* @Description: 16周岁以下的证件有效期为5年
* @Date: 2023/7/4
**/
startDate = String(Number(endDate.slice(0,4)) - 5) + endDate.slice(4,11)
} else if (age >= 16 && age <= 21) {
/**
* @Author: LiuXiaoFeng
* @Description: 16周岁~21周岁的证件有效期为10年或5年
* @Date: 2023/7/4
**/
if (age - (10 - (endDate.slice(0,4) - thisyear)) < 16 ) {
/**
* @Author: LiuXiaoFeng
* @Description: 如果证件有效期为10年 根据证件截止日期 判断10年前的年龄 如果小于16周岁 那么证件有效期就是5年
* @Date: 2023/7/5
**/
startDate = String(Number(endDate.slice(0,4)) - 5) + endDate.slice(4,11)
} else {
startDate = String(Number(endDate.slice(0,4)) - 10) + endDate.slice(4,11)
}
} else if(age >= 22 && age <= 25) {
/**
* @Author: LiuXiaoFeng
* @Description: 22周岁~25周岁的证件有效期为10年
* @Date: 2023/7/4
**/
startDate = String(Number(endDate.slice(0,4)) - 10) + endDate.slice(4,11)
} else if (age >= 26 && age <= 35) {
/**
* @Author: LiuXiaoFeng
* @Description: 26周岁~35周岁的证件有效期为20年或10年
* @Date: 2023/7/4
**/
if (age - (20 - (endDate.slice(0,4) - thisyear)) < 26 ) {
/**
* @Author: LiuXiaoFeng
* @Description: 如果证件有效期为20年 根据证件截止日期 判断20年前的年龄 如果小于26周岁 那么证件有效期就是10年
* @Date: 2023/7/5
**/
startDate = String(Number(endDate.slice(0,4)) - 10) + endDate.slice(4,11)
} else {
startDate = String(Number(endDate.slice(0,4)) - 20) + endDate.slice(4,11)
}
} else if (age >= 36 && age <= 45) {
/**
* @Author: LiuXiaoFeng
* @Description: 36周岁~45周岁的证件有效期为20年
* @Date: 2023/7/4
**/
startDate = String(Number(endDate.slice(0,4)) + 20) + endDate.slice(4,11)
} else if (age >= 46 && age <= 65) {
/**
* @Author: LiuXiaoFeng
* @Description: 46周岁~65周岁的证件有效期为20年或长期
* @Date: 2023/7/4
**/
if (age - (20 - (endDate.slice(0,4) - thisyear)) < 46 ) {
/**
* @Author: LiuXiaoFeng
* @Description: 如果证件有效期为20年 根据证件截止日期 判断20年前的年龄 如果小于46周岁 那么证件有效期就是20年
* @Date: 2023/7/5
**/
startDate = String(Number(endDate.slice(0,4)) - 20) + endDate.slice(4,11)
}
} else if (age > 65) {
/**
* @Author: LiuXiaoFeng
* @Description: 65周岁以上的证件有效期为长期
* @Date: 2023/7/4
**/
}
return startDate
},
//计算身份证截止日期
getEndDate: function(age, startDate) {
let endDate = '' //证件截止日期
let thisDate = new Date() //当年日期
let thisyear = thisDate.getFullYear() //当前年份
if (age < 16) {
/**
* @Author: LiuXiaoFeng
* @Description: 16周岁以下的证件有效期为5年
* @Date: 2023/7/4
**/
endDate = String(Number(startDate.slice(0,4)) + 5) + startDate.slice(4,11)
} else if (age >= 16 && age <= 21) {
/**
* @Author: LiuXiaoFeng
* @Description: 16周岁~21周岁的证件有效期为10年或5年
* @Date: 2023/7/4
**/
if (age - (thisyear - startDate.slice(0,4)) < 16 ) {
/**
* @Author: LiuXiaoFeng
* @Description: 根据证件起始日期计算办证时年龄 如果办证时年龄小于16周岁 那么证件有效期就是5年
* @Date: 2023/7/5
**/
endDate = String(Number(startDate.slice(0,4)) + 5) + startDate.slice(4,11)
} else {
endDate = String(Number(startDate.slice(0,4)) + 10) + startDate.slice(4,11)
}
} else if(age >= 22 && age <= 25) {
/**
* @Author: LiuXiaoFeng
* @Description: 22周岁~25周岁的证件有效期为10年
* @Date: 2023/7/4
**/
endDate = String(Number(startDate.slice(0,4)) + 10) + startDate.slice(4,11)
} else if (age >= 26 && age <= 35) {
/**
* @Author: LiuXiaoFeng
* @Description: 26周岁~35周岁的证件有效期为20年或10年
* @Date: 2023/7/4
**/
if (age - (thisyear - startDate.slice(0,4)) < 26 ) {
/**
* @Author: LiuXiaoFeng
* @Description: 根据证件起始日期计算办证时年龄 如果办证时年龄小于26周岁 那么证件有效期就是10年
* @Date: 2023/7/5
**/
endDate = String(Number(startDate.slice(0,4)) + 10) + startDate.slice(4,11)
} else {
endDate = String(Number(startDate.slice(0,4)) + 20) + startDate.slice(4,11)
}
} else if (age >= 36 && age <= 45) {
/**
* @Author: LiuXiaoFeng
* @Description: 36周岁~45周岁的证件有效期为20年
* @Date: 2023/7/4
**/
endDate = String(Number(startDate.slice(0,4)) + 20) + startDate.slice(4,11)
} else if (age >= 46 && age <= 65) {
/**
* @Author: LiuXiaoFeng
* @Description: 46周岁~65周岁的证件有效期为20年或长期
* @Date: 2023/7/4
**/
if (age - (thisyear - startDate.slice(0,4)) < 46 ) {
/**
* @Author: LiuXiaoFeng
* @Description: 根据证件起始日期计算办证时年龄 如果办证时年龄小于46周岁 那么证件有效期就是20年
* @Date: 2023/7/5
**/
endDate = String(Number(startDate.slice(0,4)) + 20) + startDate.slice(4,11)
}
} else if (age > 65) {
/**
* @Author: LiuXiaoFeng
* @Description: 65周岁以上的证件有效期为长期
* @Date: 2023/7/4
**/
}
return endDate
}
}

View File

@@ -353,8 +353,17 @@
<van-dialog v-model="trialResultsShow" title="核保试算结果" :show-cancel-button="false">
<div class="pl40 pr40 mt10">
<div class="flex justify-content-s fs12" v-for="(item, index) in verifyResultList" :key="index">
<div><img class="w20 h20 p10 v-middle" :src="require('@/assets/images/sale/ruleType0'+ item.ruleType +'.png')" alt=""><span class="v-middle">{{item.ruleType | ruleTypeFilter}}</span></div>
<div><span class="v-middle">{{item.status | approvedFilter}}</span><img class="w20 h20 p10 v-middle" :src="require('@/assets/images/sale/approved'+ item.status +'.png')" alt=""></div>
<div>
<img class="w20 h20 p10 v-middle" :src="require('@/assets/images/sale/ruleType0'+ item.ruleType +'.png')" alt="">
<span class="v-middle">{{item.ruleType | ruleTypeFilter}}</span>
</div>
<div>
<!-- <span class="v-middle">{{item.status | approvedFilter}}</span>-->
<img class="w20 h20 p10 v-middle" :src="require('@/assets/images/sale/approved'+ item.status +'.png')" alt="">
</div>
</div>
<div style="padding:25px 0px 10px 10px;font-size: 10px;color: #999;">
<p style="line-height: 20px;"><span style="width: 40px;display: inline-block;">说明:</span>绿色✔表示 未触发规则、红色×表示 触发规则</p>
</div>
</div>
</van-dialog>

View File

@@ -136,6 +136,9 @@
data-vv-name="联系地址"
/>
<van-field v-model="userInfo.village" label="" name="详细地址" placeholder="请输入详细地址" v-validate="'required'" clearable maxlength="30" />
<div class="pl10 pt10 pb10 pr10 address fs14">
<van-checkbox v-model="withRootUser.value">同投保人地址</van-checkbox>
</div>
<van-field
v-model="userInfo.yearSalary"
label="平均年收入(万元)"
@@ -238,6 +241,7 @@ import FieldDatePicter from '@/components/ebiz/FieldDatePicter'
import OccupationPicker from '@/components/ebiz/occipation/OccupationPicker'
import DataDictionary from '@/assets/js/utils/data-dictionary'
import areaList from '@/assets/js/utils/areaForSale'
import countCredentialValidity from '@/assets/js/utils/countCredentialValidity'
import filter from '@/filters/index'
import utilsAge from '@/assets/js/utils/age'
import IdentityCardScan from '@/components/ebiz/sale/IdentityCardScan'
@@ -271,6 +275,10 @@ export default {
},
data() {
return {
withRootUser: {
load: false, //防止重复请求
value: false,
},
nameLimit: false,
idNoLimit: false,
birthdayLimit: false,
@@ -633,6 +641,9 @@ export default {
if (this.userInfo.idType == '1') {
let age = utilsAge.getAge(this.userInfo.birthday, new Date())
this.effectiveDateTypeAble = age <= 45
if(this.userInfo.birthday){
this.userInfo.certiexpiredate = countCredentialValidity.getEndDate(age,val)
}
}
}
break
@@ -657,63 +668,9 @@ export default {
if (this.userInfo.idType == '1') {
//获取年龄
let age = utilsAge.getAge(this.userInfo.birthday, new Date())
console.log(age)
//年龄在16周岁以下
if (age < 16) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 5) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('16周岁以下的证件有效期为5年')
}
//年龄在16-21周岁之间
}else if (age >= 16 && age <= 21) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 10 && new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 5) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('16周岁~21周岁的证件有效期为10年或5年')
}
//年龄在22-25周岁之间
}else if (age >= 22 && age <= 25) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 10) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('22周岁~25周岁的证件有效期为10年')
}
//年龄在26-35周岁之间
}else if (age >= 26 && age <= 35) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 20 && new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 10) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('26周岁~35周岁的证件有效期为20年或10年')
}
//年龄在36-45周岁之间
} else if (age >= 36 && age <= 45) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 20) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('36周岁~45周岁的证件有效期为20年')
}
//年龄在46-65周岁之间
} else if (age >= 46 && age <= 65) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 20 || this.effectiveDateType == false) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('46周岁~65周岁的证件有效期为20年或长期')
}
//年龄在65周岁以上
} else if (age > 65) {
if (this.userInfo.effectiveDateType == false) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('65周岁以上的证件有效期为长期')
}
}
//此外的年龄段不支持
// else {
// this.userInfo.certiexpiredate = ''
// this.$refs.certiexpiredate.date = ''
// return this.$toast('身份证不支持此年龄段')
// }
if(this.userInfo.birthday){
this.userInfo.certificateValidate = countCredentialValidity.getStartDate(age,val)
}
}
}
break
@@ -739,6 +696,13 @@ export default {
return this.$toast('出生证有效期或出生日期有误')
}
}
let age = utilsAge.getAge(this.userInfo.birthday, new Date())
if (this.userInfo.certificateValidate && !this.userInfo.certiexpiredate) {
this.userInfo.certiexpiredate = countCredentialValidity.getEndDate(age,this.userInfo.certificateValidate)
}
if (this.userInfo.certiexpiredate && !this.userInfo.certificateValidate) {
this.userInfo.certificateValidate = countCredentialValidity.getEndDate(age,this.userInfo.certiexpiredate)
}
}
break
}
@@ -954,50 +918,36 @@ export default {
//年龄在16周岁以下
if (age < 16) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 5) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('16周岁以下的证件有效期为5年')
}
//年龄在16-21周岁之间
}else if (age >= 16 && age <= 21) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 10 && new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 5) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('16周岁~21周岁的证件有效期为10年或5年')
}
//年龄在22-25周岁之间
}else if (age >= 22 && age <= 25) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 10) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('22周岁~25周岁的证件有效期为10年')
}
//年龄在26-35周岁之间
}else if (age >= 26 && age <= 35) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 20 && new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 10) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('26周岁~35周岁的证件有效期为20年或10年')
}
//年龄在36-45周岁之间
} else if (age >= 36 && age <= 45) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 20) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('36周岁~45周岁的证件有效期为20年')
}
//年龄在46-65周岁之间
} else if (age >= 46 && age <= 65) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 20 && this.userInfo.effectiveDateType == false) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('46周岁~65周岁的证件有效期为20年或长期')
}
//年龄在65周岁以上
} else if (age > 65) {
if (this.userInfo.effectiveDateType == false) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('65周岁以上的证件有效期为长期')
}
}
@@ -1196,31 +1146,64 @@ export default {
}
this.isInsured = true
let insuredDetail = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo'))
console.log(insuredDetail,'insuredDetailqqqqqqqqq')
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)
let age = utilsAge.getAge(insuredDetail.birthday, new Date())
this.effectiveDateTypeAble = age <= 45
if (age > 45) {
this.userInfo.effectiveDateType = true
let params = {
orderNo: this.$route.query.orderNo
}
this.idLimit = true
this.userInfo.occupationCode = insuredDetail.occupationCode //职业类别编码
this.userInfo.occupationName = insuredDetail.occupationName //职业类别名称
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.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 {
this.isInsured = false
this.userInfo.relationToInsured = ''
@@ -1302,11 +1285,38 @@ export default {
}
this.effectiveDateTypeAble = false
}
//如果选择户口本
if (this.userInfo.idType == '2') {
let exipreDate = Date.parse(this.userInfo.birthday) + Date.parse('1985-12-31')
this.userInfo.certificateValidate = this.userInfo.birthday
this.userInfo.certiexpiredate = this.timeStampFormat(exipreDate)
this.idLimit = true
//如果选择出生证明
}
}
},
filters: {
idToText: filter.idToText
},
watch: {
async 'withRootUser.value'(n) {
const orderNo = this.$route.query.orderNo
if (n && orderNo) {
const rs = await getOrderDetail({ orderNo: orderNo});
this.areaStr = getAreaName([
{ code: rs.orderDTO.appntDTO.homeProvince },
{ code: rs.orderDTO.appntDTO.homeCity },
{ code: rs.orderDTO.appntDTO.homeArea },
])
this.userInfo.province = rs.orderDTO.appntDTO.homeProvince
this.userInfo.city = rs.orderDTO.appntDTO.homeCity
this.userInfo.area = rs.orderDTO.appntDTO.homeArea
this.userInfo.village = rs.orderDTO.appntDTO.homeAddress
} else {
this.homeName = this.userInfo.homeAddress = ''
}
}
},
beforeRouteLeave(to, from, next) {
document.body.style.backgroundColor = ''
next()
@@ -1322,5 +1332,9 @@ export default {
/deep/.van-checkbox {
margin-left: auto;
}
.address {
display: flex;
flex-direction: row-reverse;
}
}
</style>

View File

@@ -388,6 +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 countCredentialValidity from '@/assets/js/utils/countCredentialValidity'
import areaLists from '@/assets/js/utils/areaNewForSale'
import { saveOrUpdateOrderInfo, getAuthCode, getOrderDetail, getCompany } from '@/api/ebiz/sale/sale'
import utilsAge from '@/assets/js/utils/age'
@@ -858,20 +859,14 @@ export default {
let age = utilsAge.getAge(this.userInfo.birthday, new Date())
// 长期按钮是否禁用
this.effectiveDateTypeAble = age <= 45
if(this.userInfo.birthday){
this.userInfo.certiexpiredate = countCredentialValidity.getEndDate(age,val)
}
}
}
break
case '1':
{
console.log('证件截止日期')
//证件截止日期
//如果已经勾选了长期
// if (this.userInfo.effectiveDateType) {
// //清空数据并返回
// this.userInfo.certiexpiredate = ''
// this.$refs.certiexpiredate.date = ''
// return
// }
this.userInfo.effectiveDateType = false
//如果录入日期早于当前日期
if (Date.parse(val) < Date.parse(new Date())) {
@@ -881,65 +876,10 @@ export default {
}
//身份证证件类型的判断
if (this.userInfo.idType == '1') {
//获取年龄
let age = utilsAge.getAge(this.userInfo.birthday, new Date())
console.log(age)
//年龄在16周岁以下
if (age < 16) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 5) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('16周岁以下的证件有效期为5年')
}
//年龄在16-21周岁之间
}else if (age >= 16 && age <= 21) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 10 && new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 5) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('16周岁~21周岁的证件有效期为10年或5年')
}
//年龄在22-25周岁之间
}else if (age >= 22 && age <= 25) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 10) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('22周岁~25周岁的证件有效期为10年')
}
//年龄在26-35周岁之间
}else if (age >= 26 && age <= 35) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 20 && new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 10) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('26周岁~35周岁的证件有效期为20年或10年')
}
//年龄在36-45周岁之间
} else if (age >= 36 && age <= 45) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 20) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('36周岁~45周岁的证件有效期为20年')
}
//年龄在46-65周岁之间
} else if (age >= 46 && age <= 65) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 20 && this.userInfo.effectiveDateType == false) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('46周岁~65周岁的证件有效期为20年或长期')
}
//年龄在65周岁以上
} else if (age > 65) {
if (this.userInfo.effectiveDateType == false) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('65周岁以上的证件有效期为长期')
}
}
//此外的年龄段不支持
// else {
// this.userInfo.certiexpiredate = ''
// this.$refs.certiexpiredate.date = ''
// return this.$toast('身份证不支持此年龄段')
// }
if(this.userInfo.birthday){
this.userInfo.certificateValidate = countCredentialValidity.getStartDate(age,val)
}
}
}
break
@@ -961,6 +901,12 @@ export default {
if (age < 18) {
this.userInfo.workcompany = this.userInfo.workcompany || '无'
}
if (this.userInfo.certificateValidate && !this.userInfo.certiexpiredate) {
this.userInfo.certiexpiredate = countCredentialValidity.getEndDate(age,this.userInfo.certificateValidate)
}
if (this.userInfo.certiexpiredate && !this.userInfo.certificateValidate) {
this.userInfo.certificateValidate = countCredentialValidity.getEndDate(age,this.userInfo.certiexpiredate)
}
}
break
}
@@ -1054,32 +1000,9 @@ export default {
//如果证件类型是身份证
if (this.userInfo.idType == '1') {
console.log('证件类型是身份证')
if (this.userInfo.nativeplace != '1') {
return this.$toast('证件类型”为“身份证,国籍必须为中国哦')
}
//校验性别是否与身份证号码位相符
// 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)
@@ -1114,71 +1037,39 @@ export default {
//年龄在16周岁以下
if (age < 16) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 5) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('16周岁以下的证件有效期为5年')
}
//年龄在16-21周岁之间
}else if (age >= 16 && age <= 21) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 10 && new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 5) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('16周岁~21周岁的证件有效期为10年或5年')
}
//年龄在22-25周岁之间
}else if (age >= 22 && age <= 25) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 10) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('22周岁~25周岁的证件有效期为10年')
}
//年龄在26-35周岁之间
}else if (age >= 26 && age <= 35) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 20 && new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 10) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('26周岁~35周岁的证件有效期为20年或10年')
}
//年龄在36-45周岁之间
} else if (age >= 36 && age <= 45) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 20) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('36周岁~45周岁的证件有效期为20年')
}
//年龄在46-65周岁之间
} else if (age >= 46 && age <= 65) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 20 && this.userInfo.effectiveDateType == false) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('46周岁~65周岁的证件有效期为20年或长期')
}
//年龄在65周岁以上
} else if (age > 65) {
if (this.userInfo.effectiveDateType == false) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
if (this.userInfo.effectiveDateType == false) {
return this.$toast('65周岁以上的证件有效期为长期')
}
}
// 年龄在 16-25 周岁之间
// if (age >= 16 && age <= 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) {
// 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年')
// }
// }
}
//证件类型是户口本
} else if (this.userInfo.idType == '2') {
if (age > 16) {

View File

@@ -452,6 +452,7 @@ import CustomerPicker from '@/components/ebiz/customer/CustomerPicker'
import DataDictionary from '@/assets/js/utils/data-dictionary'
import areaList from '@/assets/js/utils/areaForSale'
import areaLists from '@/assets/js/utils/areaNewForSale'
import countCredentialValidity from '@/assets/js/utils/countCredentialValidity'
import { saveOrUpdateOrderInfo, getAuthCode, getOrderDetail } from '@/api/ebiz/sale/sale'
import utilsAge from '@/assets/js/utils/age'
import getAreaName from '@/assets/js/utils/getAreaNameForSale'
@@ -1062,6 +1063,9 @@ export default {
let age = utilsAge.getAge(this.userInfo.birthday, new Date())
// 长期按钮是否禁用
this.effectiveDateTypeAble = age <= 45
if(this.userInfo.birthday){
this.userInfo.certiexpiredate = countCredentialValidity.getEndDate(age,val)
}
}
}
break
@@ -1088,62 +1092,9 @@ export default {
//获取年龄
let age = utilsAge.getAge(this.userInfo.birthday, new Date())
console.log(age)
//年龄在16周岁以下
if (age < 16) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 5) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('16周岁以下的证件有效期为5年')
}
//年龄在16-21周岁之间
}else if (age >= 16 && age <= 21) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 10 && new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 5) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('16周岁~21周岁的证件有效期为10年或5年')
}
//年龄在22-25周岁之间
}else if (age >= 22 && age <= 25) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 10) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('22周岁~25周岁的证件有效期为10年')
}
//年龄在26-35周岁之间
}else if (age >= 26 && age <= 35) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 20 && new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 10) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('26周岁~35周岁的证件有效期为20年或10年')
}
//年龄在36-45周岁之间
} else if (age >= 36 && age <= 45) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 20) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('36周岁~45周岁的证件有效期为20年')
}
//年龄在46-65周岁之间
} else if (age >= 46 && age <= 65) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 20 && this.userInfo.effectiveDateType == false) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('46周岁~65周岁的证件有效期为20年或长期')
}
//年龄在65周岁以上
} else if (age > 65) {
if (this.userInfo.effectiveDateType == false) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('65周岁以上的证件有效期为长期')
}
}
//此外的年龄段不支持
// else {
// this.userInfo.certiexpiredate = ''
// this.$refs.certiexpiredate.date = ''
// return this.$toast('身份证不支持此年龄段')
// }
if(this.userInfo.birthday){
this.userInfo.certificateValidate = countCredentialValidity.getStartDate(age,val)
}
}
}
break
@@ -1170,24 +1121,14 @@ export default {
this.userInfo.otherSalarySource = '无'
this.userInfo.averageAnnualIncome = '0'
this.userInfo.liabilitiesMoney = '0'
// this.userInfo.jobStatus = '3'
// this.userInfo.marriage = '2'
} else {
// this.userInfo.salarySource = ''
// this.userInfo.averageAnnualIncome = ''
// this.userInfo.liabilitiesMoney = ''
// this.userInfo.jobStatus = ''
// this.userInfo.marriage = ''
}
}
//出生证有效期
// if (this.userInfo.idType == '3') {
// if (Date.parse(this.userInfo.certiexpiredate) - Date.parse(val) > Date.parse('1973-01-01')) {
// this.userInfo.birthday = ''
// this.$refs.birthday.date = ''
// return this.$toast('出生证有效期或出生日期有误')
// }
// }
if (this.userInfo.certificateValidate && !this.userInfo.certiexpiredate) {
this.userInfo.certiexpiredate = countCredentialValidity.getEndDate(age,this.userInfo.certificateValidate)
}
if (this.userInfo.certiexpiredate && !this.userInfo.certificateValidate) {
this.userInfo.certificateValidate = countCredentialValidity.getEndDate(age,this.userInfo.certiexpiredate)
}
}
break
}
@@ -1472,53 +1413,39 @@ export default {
//年龄在16周岁以下
if (age < 16) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 5) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('16周岁以下的证件有效期为5年')
}
//年龄在16-21周岁之间
}else if (age >= 16 && age <= 21) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 10 && new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 5) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('16周岁~21周岁的证件有效期为10年或5年')
}
//年龄在22-25周岁之间
}else if (age >= 22 && age <= 25) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 10) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('22周岁~25周岁的证件有效期为10年')
}
//年龄在26-35周岁之间
}else if (age >= 26 && age <= 35) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 20 && new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 10) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('26周岁~35周岁的证件有效期为20年或10年')
}
//年龄在36-45周岁之间
} else if (age >= 36 && age <= 45) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 20) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('36周岁~45周岁的证件有效期为20年')
}
//年龄在46-65周岁之间
} else if (age >= 46 && age <= 65) {
if (new Date(val).getFullYear() - new Date(this.userInfo.certificateValidate).getFullYear() != 20 && this.userInfo.effectiveDateType == false) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
return this.$toast('46周岁~65周岁的证件有效期为20年或长期')
}
//年龄在65周岁以上
} else if (age > 65) {
if (this.userInfo.effectiveDateType == false) {
this.userInfo.certiexpiredate = ''
this.$refs.certiexpiredate.date = ''
if (this.userInfo.effectiveDateType == false) {
return this.$toast('65周岁以上的证件有效期为长期')
}
}
}
//年龄在0-15周岁之间
// if (age <= 15) {
// if (Date.parse(this.userInfo.certiexpiredate) - Date.parse(new Date()) > Date.parse('1975-01-01')) {
@@ -2003,36 +1930,27 @@ export default {
this.userInfo.otherSalarySource = ''
this.userInfo.averageAnnualIncome = '0'
this.userInfo.liabilitiesMoney = '0'
// this.userInfo.jobStatus = '3'
// this.userInfo.marriage = '2'
} else {
this.userInfo.salarySource = ''
this.userInfo.averageAnnualIncome = ''
this.userInfo.liabilitiesMoney = ''
// this.userInfo.jobStatus = ''
// this.userInfo.marriage = ''
}
}
if (idToData(val).age > 45) {
// this.idLimit = true
// this.isRequired = false
if (from) {
this.userInfo.effectiveDateType = true
}
this.effectiveDateTypeAble = false
} else {
// this.idLimit = false
// this.isRequired = true
// this.userInfo.effectiveDateType = false
}
//如果选择户口本
// if (this.userInfo.idType == '2') {
// let exipreDate = Date.parse(this.userInfo.birthday) + Date.parse('1985-12-31')
// this.userInfo.certificateValidate = this.userInfo.birthday
// this.userInfo.certiexpiredate = this.timeStampFormat(exipreDate)
// this.idLimit = true
// //如果选择出生证明
// } else if (this.userInfo.idType == '3') {
if (this.userInfo.idType == '2') {
let exipreDate = Date.parse(this.userInfo.birthday) + Date.parse('1985-12-31')
this.userInfo.certificateValidate = this.userInfo.birthday
this.userInfo.certiexpiredate = this.timeStampFormat(exipreDate)
this.idLimit = true
//如果选择出生证明
}
// else if (this.userInfo.idType == '3') {
// let exipreDate = Date.parse(this.userInfo.birthday) + Date.parse('1972-12-31')
// this.userInfo.certificateValidate = this.userInfo.birthday
// this.userInfo.certiexpiredate = this.timeStampFormat(exipreDate)

View File

@@ -148,6 +148,11 @@ export default {
if (res.result == '0') {
res.orderDTO.insuredDTOs[0].riskDTOLst.forEach(item => {
if(item.isMainRisk == '0'){
/**
* @Author: LiuXiaoFeng
* @Description: 保险期间大于1年或者是保终身的才展示产品说明书
* @Date: 2023/7/4
**/
if(item.insuYearFlag == 'Y' && item.insuYear > 1){
this.hasProductTip = true
}