From a10e6d29a46c2e78aafe9e3e70af341b75953d37 Mon Sep 17 00:00:00 2001 From: "liu.xiaofeng@ebiz-digits.com" Date: Thu, 18 Jan 2024 15:08:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=96=E5=9B=BD=E4=BA=BA=E6=B0=B8=E4=B9=85?= =?UTF-8?q?=E5=B1=85=E7=95=99=E8=BA=AB=E4=BB=BD=E8=AF=81=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E9=95=BF=E5=BA=A6=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ebiz/sale/InsuredInfo.vue | 61 ++++++++++++++------------ src/views/ebiz/sale/js/verification.js | 24 ++++++++++ 2 files changed, 57 insertions(+), 28 deletions(-) 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)