From f1d6c3a61c8284b1eabca99bca251b9a844b48fb Mon Sep 17 00:00:00 2001 From: pangxingyue <120277894@qq.com> Date: Tue, 9 Mar 2021 18:10:45 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E5=86=99=E5=8F=97=E7=9B=8A=E4=BA=BA?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8F=AF=E7=BC=96=E8=BE=91=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=EF=BC=8C=E9=85=8D=E6=8A=95=E4=BF=9D=E4=BA=BA=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ebiz/SelectRadio.vue | 2 +- .../ebiz/insureAgain/InsureInformation.vue | 476 +++++++++++++----- src/views/ebiz/insureAgain/js/methods.js | 94 ++++ src/views/ebiz/insureAgain/js/verification.js | 54 ++ 4 files changed, 491 insertions(+), 135 deletions(-) create mode 100644 src/views/ebiz/insureAgain/js/methods.js create mode 100644 src/views/ebiz/insureAgain/js/verification.js diff --git a/src/components/ebiz/SelectRadio.vue b/src/components/ebiz/SelectRadio.vue index 5ae80d7b2..bc586ee7e 100644 --- a/src/components/ebiz/SelectRadio.vue +++ b/src/components/ebiz/SelectRadio.vue @@ -49,7 +49,7 @@ export default { handleChoose(value) { if (this.disabled) { return - } + } this.$emit('update:value', value) this.$emit('radioChange', value) } diff --git a/src/views/ebiz/insureAgain/InsureInformation.vue b/src/views/ebiz/insureAgain/InsureInformation.vue index 2bc99bae2..d3a6aef20 100644 --- a/src/views/ebiz/insureAgain/InsureInformation.vue +++ b/src/views/ebiz/insureAgain/InsureInformation.vue @@ -12,7 +12,7 @@ {{userInfo.nativeplace | idToText('nativeplace')}} + right-icon="arrow" placeholder="请选择" @click="toSelect('10','','appntDTO')" /> {{userInfo.occupationCode}} {{userInfo.mobile}} {{userInfo.email}} @@ -29,77 +29,80 @@ 被保险人信息 - - - - - - 男 - 女 - - - - - - - - 有 - 无 - - - + {{insuredPersonInfo.name}} + {{userInfo.idType | idToText('idType')}} + {{insuredPersonInfo.idNo}} + {{insuredPersonInfo.birthday}} + + {{insuredPersonInfo.nativeplace | idToText('nativeplace')}} + + {{insuredPersonInfo.occupationCode}} + + {{insuredPersonInfo.name}} + {{insuredHomeName}} {{userInfo.homeAddress}} 受益人信息 - - - - - - - 男 - 女 - - - - - - - - - - - - - - + + 法定受益人 + + + + 指定受益人 + {{ item.relationToInsured | idToText('relationToAppnt') }} + {{ item.name }} + {{item.idType | idToText('insuredIdType')}} + {{item.certiexpiredate}} + + + + + + + + + + {{ item.bnfLot }}% + + 账户信息 - - 男 - 女 - - - - + {{accountPersonInfo.accountName}} + {{accountPersonInfo.bankName}} + {{accountPersonInfo.cardBookCode}} - 下一步 + + + + - diff --git a/src/views/ebiz/insureAgain/js/methods.js b/src/views/ebiz/insureAgain/js/methods.js new file mode 100644 index 000000000..4bd82d6ba --- /dev/null +++ b/src/views/ebiz/insureAgain/js/methods.js @@ -0,0 +1,94 @@ +//点击弹出组件 +export function selectComp(that, index, type = '') { + that.currentPopupIndex = index + let title = '' + if (index == 1) { + ;[that.customerShowPicker, title] = [true, '客户列表'] + } else if (index == 2) { + ;[that.occupationShowPicker, title] = [true, '职业类别'] + } else if (index == 3) { + if (type == '1') { + //投保人 + localStorage.scanFromInsured = 'true' + } else if (type == '2') { + //被保险人 + localStorage.scanFromInsured = 'false' + } + ;[that.isScan, title] = [true, '身份证扫描'] + } + + setTimeout(() => { + that.$jump({ + flag: 'navigation', + extra: { + title, + hiddenLeft: '1' + } + }) + closeBtn(that) + }, 400) +} + +// 关闭按钮的显示 +function closeBtn(that) { + that.$jump({ + flag: 'webview_right_button', + extra: { + btns: [ + { + img: that.$assetsUrl + 'images/del-close.png', + route: { flag: '', extra: {} } + } + ] + } + }) +} + +// 获取身份证扫描信息 +/** + * + * @param {*} that 上下文 + * @param {*} data 扫描数据 + * @param {*} type 1 投保人 2 被保险人 + */ +export function getIdentityInfo(that, data, type) { + // 正面 + if (data.name && data.name != '待识别') { + that.userInfo.name = data.name + that.userInfo.idNo = data.idNo + that.userInfo.birthday = `${data.birthYear}-${data.birthMonth}-${data.birthDay}` + that.userInfo.sex = data.gender == '男' ? '0' : '1' + } + // 反面 + if (data.startDate && data.startDate != '待识别') { + that.userInfo.certificateValidate = `${data.startDate.substr(0, 4)}-${data.startDate.substr(5, 2)}-${data.startDate.substr(8, 2)}` + //that.userInfo.certificateValidate = `${data.startDate.substr(0, 4)}-${data.startDate.substr(4, 2)}-${data.startDate.substr(6, 2)}` + // 是否为长期身份证 + if (data.endDate != '长期') { + that.userInfo.certiexpiredate = `${data.endDate.substr(0, 4)}-${data.endDate.substr(5, 2)}-${data.endDate.substr(8, 2)}` + // that.userInfo.certiexpiredate = `${data.endDate.substr(0, 4)}-${data.endDate.substr(4, 2)}-${data.endDate.substr(6, 2)}` + that.effectiveDateTypeAble = true + that.idLimit = false + that.isRequired = true + } else { + // 勾选长期 + that.userInfo.effectiveDateType = true + // 长期按钮不禁用 + that.effectiveDateTypeAble = false + // 证件截止日期不需要校验 + that.certiexpiredateRequired = false + //截止日期不可编辑 + that.idLimit = true + that.isRequired = false + } + } + that.isScan = false + let title = type == '1' ? '投保人信息' : '被保险人信息' + that.$jump({ + flag: 'navigation', + extra: { + title, + hiddenRight: '1' + } + }) +} diff --git a/src/views/ebiz/insureAgain/js/verification.js b/src/views/ebiz/insureAgain/js/verification.js new file mode 100644 index 000000000..42748b8b1 --- /dev/null +++ b/src/views/ebiz/insureAgain/js/verification.js @@ -0,0 +1,54 @@ +import changeFifteenToEighteen from '@/assets/js/utils/changeFifteenToEighteen' +import idNoCheck from '@/assets/js/utils/idNoCheck' +import utilsAge from '@/assets/js/utils/age' +//身份证带出出生日期,性别,年龄 +export function idToData(idNo) { + //非空 + if (!idNo.trim()) { + return { + text: '证件号码不能为空' + } + } + //如果是15位身份证号先转为18位 + if (idNo.length == 15) { + idNo = changeFifteenToEighteen(idNo) + } + if (idNo.length != 18) { + return { + text: '亲,居民身份证须为18位哦~' + } + } + // 证件号码规则校验 + if (!idNoCheck.isIdno(idNo)) { + return { + text: '您填写的证件号码有误' + } + } + let birthday = getBirthById(idNo) + let age = utilsAge.getAge(birthday, new Date()) + let sex = getSexById(idNo) + return { + birthday, + age, + sex + } +} + +function getBirthById(idNo) { + // 获取生日 + var year = idNo.substr(6, 4) + var month = idNo.substr(10, 2) + var day = idNo.substr(12, 2) + return year + '-' + month + '-' + day +} + +function getSexById(idNo) { + // 获取性别 + if (idNo.charAt(16) >= '0' && idNo.charAt(16) <= '9') { + if (parseInt(idNo.charAt(16)) % 2 == 0) { + return '1' + } else { + return '0' + } + } +}