生产卡单新增户口本有效期相关规则

This commit is contained in:
liyuetong
2022-02-14 10:59:43 +08:00
parent 98f2457968
commit 1fb752f159
2 changed files with 81 additions and 26 deletions

View File

@@ -654,7 +654,8 @@ export default {
], ],
maxDate: beforeDate.getBeforeYear(18), //投保人出生日期可选最大值 maxDate: beforeDate.getBeforeYear(18), //投保人出生日期可选最大值
insuredMaxDate: beforeDate.getBeforeDays(28), //被保人出生日期可选最大值 insuredMaxDate: beforeDate.getBeforeDays(28), //被保人出生日期可选最大值
filterMaxDate: beforeDate.getBeforeYear(-2), // filterMaxDate: beforeDate.getBeforeYear(-2),
filterMaxDate: afterDate.getAfterDays(60),
popupShow: false, popupShow: false,
areaShow: false, //省级联动 areaShow: false, //省级联动
homeShow: false, //家庭地址联动 homeShow: false, //家庭地址联动
@@ -1141,6 +1142,9 @@ export default {
} }
} }
} else if (this.pickerType == '22') { } else if (this.pickerType == '22') {
this.idLimitInsured = false
//选择证件类型后,清空证件号,证件截止日期,出生日期
this.insuredInfo.idNo = this.insuredInfo.certiexpiredate = this.insuredInfo.birthday = ''
//身份证以外的证件类型可以使用长期 //身份证以外的证件类型可以使用长期
//value.id 1 居民身份证 todo //value.id 1 居民身份证 todo
if (value.id != '1') { if (value.id != '1') {
@@ -1159,12 +1163,17 @@ export default {
this.insuredInfo.effectiveDateType = false this.insuredInfo.effectiveDateType = false
} }
} }
// 选择户口本时,是否长期默认为是,不可点击,有效止期隐藏 // 去掉--选择户口本时,是否长期默认为是,不可点击,有效止期隐藏证件类型为户口本时被保人年龄小于16周岁时户口本有效止期长期变更为第16周岁日期
if(value.id==2){ if(value.id==2){
this.insuredInfo.effectiveDateType = true this.idLimitInsured = true
this.insuredInfo.certiexpiredate = '9999-01-01' //证件类型户口本时,证件截止日期和是否长期不可选择
this.effectiveDateTypeAbleInsured = true this.effectiveDateTypeAbleInsured = true //长期按钮是否禁用--被保人
this.isInsuredCertiexpiredate = false this.insuredInfo.effectiveDateType = false //是否长期
// this.insuredInfo.effectiveDateType = true
// this.insuredInfo.certiexpiredate = '9999-01-01'
// this.effectiveDateTypeAbleInsured = true
// this.isInsuredCertiexpiredate = false
this.isInsuredCertiexpiredate = true
}else{ }else{
this.insuredInfo.certiexpiredate = '' this.insuredInfo.certiexpiredate = ''
this.insuredInfo.effectiveDateType = false this.insuredInfo.effectiveDateType = false
@@ -1391,11 +1400,21 @@ export default {
let { customerName, customerSex } = data let { customerName, customerSex } = data
this.insuredInfo.name = customerName //用户名 this.insuredInfo.name = customerName //用户名
this.insuredInfo.sex = customerSex ? customerSex.toString() : '0' //性别 this.insuredInfo.sex = customerSex ? customerSex.toString() : '0' //性别
this.insuredInfo.birthday = data.birthday //出生日期 this.insuredInfo.birthday = data.birthday //出生日期
this.insuredInfo.idType = data.customerIdType //证件类型 this.insuredInfo.idType = data.customerIdType //证件类型
this.insuredInfo.idNo = data.customerIdNumber //证件类别 this.insuredInfo.idNo = data.customerIdNumber //证件类别
if(this.insuredInfo.idType == '2' && idToData(this.insuredInfo.idNo).age <16){
// 获取出生日期年份16证件类型为户口本时被保人年龄小于16周岁时卡单户口本有效止期长期变更为第16周岁日期
let year = Number(this.insuredInfo.birthday.substr(0,4)) + 16
if(this.insuredInfo.birthday.substr(5,5) == '02-29'){
// 获取某年某月一共多少天
let date = new Date(year, 2, 1)
let dayEnd = new Date(date.getTime() - 864e5).getDate()
this.insuredInfo.certiexpiredate = year +'-02-'+ dayEnd
}else{
this.insuredInfo.certiexpiredate = year +'-'+ this.insuredInfo.birthday.substr(5,5)
}
}
if (data.customerIdType == 2) { if (data.customerIdType == 2) {
this.insuredInfo.effectiveDateType = true this.insuredInfo.effectiveDateType = true
this.insuredInfo.certiexpiredate = '9999-01-01' this.insuredInfo.certiexpiredate = '9999-01-01'
@@ -1986,6 +2005,7 @@ export default {
// }) // })
// }, // },
getRelatedData(val, ind) { getRelatedData(val, ind) {
//ind 1 投保人 2 被保人
if (ind == '1') { if (ind == '1') {
if (this.userInfo.idType != '1') { if (this.userInfo.idType != '1') {
return return
@@ -1999,16 +2019,38 @@ export default {
this.userInfo.sex = idToData(val).sex this.userInfo.sex = idToData(val).sex
} }
if (ind == '2') { if (ind == '2') {
if (this.insuredInfo.idType != '1') { if (this.insuredInfo.idType != '1' && this.insuredInfo.idType != '2') {
return return
} }
//如果证件校验不通过,恢复默认值 //如果证件校验不通过,恢复默认值(并且非空时)
if (idToData(val).text) { if (idToData(val).text) {
;[this.insuredInfo.idNo, this.insuredInfo.sex, this.insuredInfo.birthday, this.effectiveDateTypeAbleInsured] = ['', '0', '', false] if (this.insuredInfo.idType == '2'){
;[this.insuredInfo.idNo, this.insuredInfo.sex, this.insuredInfo.birthday, this.effectiveDateTypeAbleInsured] = ['', '0', '', true]
}else{
;[this.insuredInfo.idNo, this.insuredInfo.sex, this.insuredInfo.birthday, this.effectiveDateTypeAbleInsured] = ['', '0', '', false]
}
return this.$toast(idToData(val).text) return this.$toast(idToData(val).text)
} }
if (this.insuredInfo.idType == '2' && idToData(this.insuredInfo.idNo).age >= 16) {
this.idLimitInsured = false //截止日期是否可编辑--被保人
return this.$toast('客户年龄在16周岁以上不能使用户口本作为有效证件')
}else{
this.idLimitInsured = true
}
this.insuredInfo.birthday = idToData(val).birthday this.insuredInfo.birthday = idToData(val).birthday
this.insuredInfo.sex = idToData(val).sex // 获取出生日期年份16证件类型为户口本时被保人年龄小于16周岁时卡单户口本有效止期长期变更为第16周岁日期
if(this.insuredInfo.idType == '2' && idToData(this.insuredInfo.idNo).age <16){
let year = Number(this.insuredInfo.birthday.substr(0,4)) + 16
if(this.insuredInfo.birthday.substr(5,5) == '02-29'){
// 获取某年某月一共多少天
let date = new Date(year, 2, 1)
let dayEnd = new Date(date.getTime() - 864e5).getDate()
this.insuredInfo.certiexpiredate = year+'-02-'+ dayEnd
}else{
this.insuredInfo.certiexpiredate = year+'-'+ this.insuredInfo.birthday.substr(5,5)
}
}
this.insuredInfo.sex = idToData(val).sex
//GFRS-2641-- 被保险人年龄小于18周岁不含前端需隐藏手机号码电子邮箱 //GFRS-2641-- 被保险人年龄小于18周岁不含前端需隐藏手机号码电子邮箱
//GFRS-2641--被保险人大于等于18周岁前端需展示手机号码电子邮箱且非必填 //GFRS-2641--被保险人大于等于18周岁前端需展示手机号码电子邮箱且非必填
if (this.insuredInfo.birthday) { if (this.insuredInfo.birthday) {
@@ -2088,21 +2130,23 @@ export default {
this.insuredInfo.mobile = this.userInfo.mobile this.insuredInfo.mobile = this.userInfo.mobile
this.insuredInfo.email = this.userInfo.email this.insuredInfo.email = this.userInfo.email
this.insuredInfo.idType = '2' this.insuredInfo.idType = '2'
this.insuredInfo.effectiveDateType = true // this.insuredInfo.effectiveDateType = true
this.insuredInfo.certiexpiredate = '9999-01-01' // this.insuredInfo.certiexpiredate = '9999-01-01'
// 选择户口本时是否长期默认为是,不可点击,有效止期隐藏 // 去掉--选择户口本时是否长期默认为是不可点击有效止期隐藏证件类型为户口本时被保人年龄小于16周岁时户口本有效止期长期变更为第16周岁日期
this.effectiveDateTypeAbleInsured = true // this.effectiveDateTypeAbleInsured = true
this.isInsuredCertiexpiredate = false // this.isInsuredCertiexpiredate = false
this.isInsuredCertiexpiredate = true
} else if (this.itemProductDTOS.productCode == 'GFRS_M0049') { } else if (this.itemProductDTOS.productCode == 'GFRS_M0049') {
this.insuredInfo.occupationCode = '2099908' this.insuredInfo.occupationCode = '2099908'
this.insuredInfo.occupationName = '学龄前儿童' this.insuredInfo.occupationName = '学龄前儿童'
this.insuredInfo.marriage = '2' this.insuredInfo.marriage = '2'
this.insuredInfo.idType = '2' this.insuredInfo.idType = '2'
this.insuredInfo.effectiveDateType = true // this.insuredInfo.effectiveDateType = true
this.insuredInfo.certiexpiredate = '9999-01-01' // this.insuredInfo.certiexpiredate = '9999-01-01'
// 选择户口本时是否长期默认为是,不可点击,有效止期隐藏 // 去掉--选择户口本时是否长期默认为是不可点击有效止期隐藏证件类型为户口本时被保人年龄小于16周岁时户口本有效止期长期变更为第16周岁日期
this.effectiveDateTypeAbleInsured = true // this.effectiveDateTypeAbleInsured = true
this.isInsuredCertiexpiredate = false // this.isInsuredCertiexpiredate = false
this.isInsuredCertiexpiredate = true
} }
// GFRS-2641--少儿安康,默认户口本且户口本证件截止日期默认长期 // GFRS-2641--少儿安康,默认户口本且户口本证件截止日期默认长期
if (this.itemProductDTOS.productCode == 'GFRS_M0052') { if (this.itemProductDTOS.productCode == 'GFRS_M0052') {
@@ -2112,9 +2156,10 @@ export default {
this.insuredInfo.occupationCode = '2099907' this.insuredInfo.occupationCode = '2099907'
this.insuredInfo.occupationName = '一般学生' this.insuredInfo.occupationName = '一般学生'
this.insuredInfo.marriage = '2' this.insuredInfo.marriage = '2'
// 选择户口本时是否长期默认为是,不可点击,有效止期隐藏 // 去掉--选择户口本时是否长期默认为是不可点击有效止期隐藏证件类型为户口本时被保人年龄小于16周岁时户口本有效止期长期变更为第16周岁日期
this.effectiveDateTypeAbleInsured = true // this.effectiveDateTypeAbleInsured = true
this.isInsuredCertiexpiredate = false // this.isInsuredCertiexpiredate = false
this.isInsuredCertiexpiredate = true
} }
// 2516--除万福卡投保人被保险人年收入默认为0允许修改 // 2516--除万福卡投保人被保险人年收入默认为0允许修改

View File

@@ -1844,9 +1844,19 @@ export default {
// } // }
//如果证件校验不通过,恢复默认值 //如果证件校验不通过,恢复默认值
if (idToData(val).text) { if (idToData(val).text) {
;[this.userInfo.idNo, this.userInfo.sex, this.userInfo.birthday, this.effectiveDateTypeAble] = ['', '0', '', false] if (this.userInfo.idType == '2'){
;[this.userInfo.idNo, this.userInfo.sex, this.userInfo.birthday, this.effectiveDateTypeAble] = ['', '0', '', true]
}else{
;[this.userInfo.idNo, this.userInfo.sex, this.userInfo.birthday, this.effectiveDateTypeAble] = ['', '0', '', false]
}
return this.$toast(idToData(val).text) return this.$toast(idToData(val).text)
} }
if (this.userInfo.idType == '2' && idToData(this.userInfo.idNo).age >= 16) {
this.idLimit = false //截止日期是否可编辑--被保人
return this.$toast('客户年龄在16周岁以上不能使用户口本作为有效证件')
}else{
this.idLimit = true
}
this.userInfo.effectiveDateType = false this.userInfo.effectiveDateType = false
this.effectiveDateTypeAble = idToData(val).age <= 45 this.effectiveDateTypeAble = idToData(val).age <= 45
this.userInfo.birthday = idToData(val).birthday this.userInfo.birthday = idToData(val).birthday