From 1fb752f159f1f1f3be715dc98a2cc652fb68cc6c Mon Sep 17 00:00:00 2001
From: liyuetong
Date: Mon, 14 Feb 2022 10:59:43 +0800
Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E5=8D=A1=E5=8D=95=E6=96=B0?=
=?UTF-8?q?=E5=A2=9E=E6=88=B7=E5=8F=A3=E6=9C=AC=E6=9C=89=E6=95=88=E6=9C=9F?=
=?UTF-8?q?=E7=9B=B8=E5=85=B3=E8=A7=84=E5=88=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/ebiz/cardList/information.vue | 95 ++++++++++++++++++-------
src/views/ebiz/sale/InsuredPerson.vue | 12 +++-
2 files changed, 81 insertions(+), 26 deletions(-)
diff --git a/src/views/ebiz/cardList/information.vue b/src/views/ebiz/cardList/information.vue
index 18120b642..ca16a819d 100644
--- a/src/views/ebiz/cardList/information.vue
+++ b/src/views/ebiz/cardList/information.vue
@@ -654,7 +654,8 @@ export default {
],
maxDate: beforeDate.getBeforeYear(18), //投保人出生日期可选最大值
insuredMaxDate: beforeDate.getBeforeDays(28), //被保人出生日期可选最大值
- filterMaxDate: beforeDate.getBeforeYear(-2),
+ // filterMaxDate: beforeDate.getBeforeYear(-2),
+ filterMaxDate: afterDate.getAfterDays(60),
popupShow: false,
areaShow: false, //省级联动
homeShow: false, //家庭地址联动
@@ -1141,6 +1142,9 @@ export default {
}
}
} else if (this.pickerType == '22') {
+ this.idLimitInsured = false
+ //选择证件类型后,清空证件号,证件截止日期,出生日期
+ this.insuredInfo.idNo = this.insuredInfo.certiexpiredate = this.insuredInfo.birthday = ''
//身份证以外的证件类型可以使用长期
//value.id 1 居民身份证 todo
if (value.id != '1') {
@@ -1159,12 +1163,17 @@ export default {
this.insuredInfo.effectiveDateType = false
}
}
- // 选择户口本时,是否长期默认为是,不可点击,有效止期隐藏
+ // 去掉--选择户口本时,是否长期默认为是,不可点击,有效止期隐藏(证件类型为户口本时,被保人年龄小于16周岁时,户口本有效止期长期变更为第16周岁日期)
if(value.id==2){
- this.insuredInfo.effectiveDateType = true
- this.insuredInfo.certiexpiredate = '9999-01-01'
- this.effectiveDateTypeAbleInsured = true
- this.isInsuredCertiexpiredate = false
+ this.idLimitInsured = true
+ //证件类型户口本时,证件截止日期和是否长期不可选择
+ this.effectiveDateTypeAbleInsured = true //长期按钮是否禁用--被保人
+ this.insuredInfo.effectiveDateType = false //是否长期
+ // this.insuredInfo.effectiveDateType = true
+ // this.insuredInfo.certiexpiredate = '9999-01-01'
+ // this.effectiveDateTypeAbleInsured = true
+ // this.isInsuredCertiexpiredate = false
+ this.isInsuredCertiexpiredate = true
}else{
this.insuredInfo.certiexpiredate = ''
this.insuredInfo.effectiveDateType = false
@@ -1391,11 +1400,21 @@ export default {
let { customerName, customerSex } = data
this.insuredInfo.name = customerName //用户名
this.insuredInfo.sex = customerSex ? customerSex.toString() : '0' //性别
-
this.insuredInfo.birthday = data.birthday //出生日期
-
this.insuredInfo.idType = data.customerIdType //证件类型
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) {
this.insuredInfo.effectiveDateType = true
this.insuredInfo.certiexpiredate = '9999-01-01'
@@ -1986,6 +2005,7 @@ export default {
// })
// },
getRelatedData(val, ind) {
+ //ind 1 投保人 2 被保人
if (ind == '1') {
if (this.userInfo.idType != '1') {
return
@@ -1999,16 +2019,38 @@ export default {
this.userInfo.sex = idToData(val).sex
}
if (ind == '2') {
- if (this.insuredInfo.idType != '1') {
+ if (this.insuredInfo.idType != '1' && this.insuredInfo.idType != '2') {
return
}
- //如果证件校验不通过,恢复默认值
+ //如果证件校验不通过,恢复默认值(并且非空时)
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)
}
+ 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.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周岁(含),前端需展示手机号码、电子邮箱,且非必填
if (this.insuredInfo.birthday) {
@@ -2088,21 +2130,23 @@ export default {
this.insuredInfo.mobile = this.userInfo.mobile
this.insuredInfo.email = this.userInfo.email
this.insuredInfo.idType = '2'
- this.insuredInfo.effectiveDateType = true
- this.insuredInfo.certiexpiredate = '9999-01-01'
- // 选择户口本时,是否长期默认为是,不可点击,有效止期隐藏
- this.effectiveDateTypeAbleInsured = true
- this.isInsuredCertiexpiredate = false
+ // this.insuredInfo.effectiveDateType = true
+ // this.insuredInfo.certiexpiredate = '9999-01-01'
+ // 去掉--选择户口本时,是否长期默认为是,不可点击,有效止期隐藏(证件类型为户口本时,被保人年龄小于16周岁时,户口本有效止期长期变更为第16周岁日期)
+ // this.effectiveDateTypeAbleInsured = true
+ // this.isInsuredCertiexpiredate = false
+ this.isInsuredCertiexpiredate = true
} else if (this.itemProductDTOS.productCode == 'GFRS_M0049') {
this.insuredInfo.occupationCode = '2099908'
this.insuredInfo.occupationName = '学龄前儿童'
this.insuredInfo.marriage = '2'
this.insuredInfo.idType = '2'
- this.insuredInfo.effectiveDateType = true
- this.insuredInfo.certiexpiredate = '9999-01-01'
- // 选择户口本时,是否长期默认为是,不可点击,有效止期隐藏
- this.effectiveDateTypeAbleInsured = true
- this.isInsuredCertiexpiredate = false
+ // this.insuredInfo.effectiveDateType = true
+ // this.insuredInfo.certiexpiredate = '9999-01-01'
+ // 去掉--选择户口本时,是否长期默认为是,不可点击,有效止期隐藏(证件类型为户口本时,被保人年龄小于16周岁时,户口本有效止期长期变更为第16周岁日期)
+ // this.effectiveDateTypeAbleInsured = true
+ // this.isInsuredCertiexpiredate = false
+ this.isInsuredCertiexpiredate = true
}
// GFRS-2641--少儿安康,默认户口本,且户口本证件截止日期默认长期
if (this.itemProductDTOS.productCode == 'GFRS_M0052') {
@@ -2112,9 +2156,10 @@ export default {
this.insuredInfo.occupationCode = '2099907'
this.insuredInfo.occupationName = '一般学生'
this.insuredInfo.marriage = '2'
- // 选择户口本时,是否长期默认为是,不可点击,有效止期隐藏
- this.effectiveDateTypeAbleInsured = true
- this.isInsuredCertiexpiredate = false
+ // 去掉--选择户口本时,是否长期默认为是,不可点击,有效止期隐藏(证件类型为户口本时,被保人年龄小于16周岁时,户口本有效止期长期变更为第16周岁日期)
+ // this.effectiveDateTypeAbleInsured = true
+ // this.isInsuredCertiexpiredate = false
+ this.isInsuredCertiexpiredate = true
}
// 2516--除万福卡,投保人、被保险人年收入,默认为0,允许修改
diff --git a/src/views/ebiz/sale/InsuredPerson.vue b/src/views/ebiz/sale/InsuredPerson.vue
index ac8116a91..9b948efd0 100644
--- a/src/views/ebiz/sale/InsuredPerson.vue
+++ b/src/views/ebiz/sale/InsuredPerson.vue
@@ -1844,9 +1844,19 @@ export default {
// }
//如果证件校验不通过,恢复默认值
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)
}
+ 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.effectiveDateTypeAble = idToData(val).age <= 45
this.userInfo.birthday = idToData(val).birthday