diff --git a/src/views/ebiz/sale/InsuredInfo.vue b/src/views/ebiz/sale/InsuredInfo.vue index 4ef134e67..11fd8d5eb 100644 --- a/src/views/ebiz/sale/InsuredInfo.vue +++ b/src/views/ebiz/sale/InsuredInfo.vue @@ -773,8 +773,6 @@ this.isNewPeopleFlagTipshow = true }, workcompanys(list) { - // 单位数据 - console.log(list) this.userWorkcompanys = list }, setCustomerMarriage(marriageCode) { @@ -1606,35 +1604,42 @@ } }, getRelatedData(val, source) { - if (this.userInfo.idType != '1') { + if (this.userInfo.idType != '1' && this.userInfo.idType != '8') { return } - //如果证件校验不通过,恢复默认值 - if (idToData(val).text) { - ;[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 - this.userInfo.birthday = idToData(val).birthday - this.userInfo.sex = idToData(val).sex - //年龄小于18周岁,工作单位默认值为‘无’ - if (idToData(val).age < 18) { - this.userInfo.workcompany = this.userInfo.workcompany || '无' - } - if (idToData(val).age > 45) { - if (source) { - this.userInfo.effectiveDateType = true + if(this.userInfo.idType == '1'){ + //如果证件校验不通过,恢复默认值 + if (idToData(val).text) { + ;[this.userInfo.idNo, this.userInfo.sex, this.userInfo.birthday, this.effectiveDateTypeAble] = ['', '0', '', false] + return this.$toast(idToData(val).text) } - this.effectiveDateTypeAble = false - } else { - // this.userInfo.effectiveDateType = false + // // 判断投保人年龄是否大于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 + this.userInfo.birthday = idToData(val).birthday + this.userInfo.sex = idToData(val).sex + //年龄小于18周岁,工作单位默认值为‘无’ + if (idToData(val).age < 18) { + this.userInfo.workcompany = this.userInfo.workcompany || '无' + } + if (idToData(val).age > 45) { + if (source) { + this.userInfo.effectiveDateType = true + } + this.effectiveDateTypeAble = false + } else { + // this.userInfo.effectiveDateType = false + } + } + if(this.userInfo.idType == '8'){ + this.userInfo.birthday = idToData(val).birthday + this.userInfo.sex = idToData(val).sex + console.log(this.userInfo.birthday) } }, }, diff --git a/src/views/ebiz/sale/js/verification.js b/src/views/ebiz/sale/js/verification.js index 42748b8b1..affcb0609 100644 --- a/src/views/ebiz/sale/js/verification.js +++ b/src/views/ebiz/sale/js/verification.js @@ -24,6 +24,30 @@ export function idToData(idNo) { text: '您填写的证件号码有误' } } + console.log('12321321321') + let birthday = getBirthById(idNo) + let age = utilsAge.getAge(birthday, new Date()) + let sex = getSexById(idNo) + return { + birthday, + age, + sex + } +} + +//外国人永久居留身份证带出出生日期,性别,年龄 +export function idToData8(idNo) { + //非空 + if (!idNo.trim()) { + return { + text: '证件号码不能为空' + } + } + if (idNo.length != 15 && idNo.length != 18) { + return { + text: '外国人永久居留身份证位数有误' + } + } let birthday = getBirthById(idNo) let age = utilsAge.getAge(birthday, new Date()) let sex = getSexById(idNo)