diff --git a/src/views/ebiz/cardList/information.vue b/src/views/ebiz/cardList/information.vue index 821d4797c..c9c32a8b5 100644 --- a/src/views/ebiz/cardList/information.vue +++ b/src/views/ebiz/cardList/information.vue @@ -40,6 +40,21 @@ > 证件扫描 + +
+ 长期 +
+ 证件扫描 + +
+ 长期 +
+ + +
+ 长期 +
- + + { + underWrite(data).then(res => { if (res.result == '0') { this.$toast.clear() window.localStorage.setItem('underWriteData', JSON.stringify(res)) @@ -665,11 +773,11 @@ export default { flag: 'h5', extra: { url: location.origin + `/#/cardList/pay`, - forbidSwipeBack: 1, + forbidSwipeBack: 1 }, routerInfo: { - path: `/cardList/pay`, - }, + path: `/cardList/pay` + } }) } else { window.localStorage.setItem('uwResult', res.uwResult) @@ -678,11 +786,11 @@ export default { flag: 'h5', extra: { url: location.origin + '/#/cardList/result', - backToFirst: '1', + backToFirst: '1' }, routerInfo: { - path: '/cardList/result', - }, + path: '/cardList/result' + } }) } return true @@ -701,11 +809,11 @@ export default { extra: { title: name, // url: 'http://47.96.143.111/pdfjs/web/viewer.html?file=' + url //测试代码 - url: location.origin + '/#/cardList/ShowPDF', + url: location.origin + '/#/cardList/ShowPDF' }, routerInfo: { - path: '/cardList/ShowPDF', - }, + path: '/cardList/ShowPDF' + } }) }, //监听名字变化 @@ -754,8 +862,8 @@ export default { flag: 'navigation', extra: { title: '投被保人信息', - hiddenRight: '1', - }, + hiddenRight: '1' + } }) if (this.currentPopupIndex == 1) { if (this.selectUser == '1') { @@ -786,7 +894,7 @@ export default { } else if (pickerType == '4') { this.columns = [ { id: 0, text: '有' }, - { id: 1, text: '无' }, + { id: 1, text: '无' } ] } else if (pickerType == '5') { this.columns = DataDictionary.taxIdentity @@ -807,16 +915,16 @@ export default { this.pickerIndex = this.insuredInfo.nativeplace - 1 > 0 ? this.insuredInfo.nativeplace - 1 : 0 } else if (pickerType == '10') { this.columns = [] - this.trialList.forEach((item) => { + this.trialList.forEach(item => { if (item.productCode === 'GFRS_M0022') { this.columns.push({ id: this.proSchemeCode, - text: this.proScheme, + text: this.proScheme }) } else { this.columns.push({ id: item.proSchemeCode, - text: item.proScheme, + text: item.proScheme }) } }) @@ -826,17 +934,21 @@ export default { }, //确认选择字段 onConfirm(value) { + console.log(value, 'value') this.popupShow = false if (this.pickerType == '1') { this.userInfo.nativeplace = value.id } else if (this.pickerType == '2') { - // //身份证以外的证件类型可以使用长期 - // if (value.id != '1') { - // this.effectiveDateTypeAble = false - // } else { - // let age = utilsAge.getAge(this.userInfo.birthday, new Date()) - // this.effectiveDateTypeAble = !(age >= 45) - // } + //身份证以外的证件类型可以使用长期 + //value.id 1 居民身份证 todo + if (value.id != '1') { + this.effectiveDateTypeAble = false + } else { + if (this.userInfo.birthday) { + let age = utilsAge.getAge(this.userInfo.birthday, new Date()) + this.effectiveDateTypeAble = !(age >= 45) + } + } this.userInfo.idType = value.id } else if (this.pickerType == '3') { this.userInfo.degree = value.id @@ -868,6 +980,16 @@ export default { } } } else if (this.pickerType == '22') { + //身份证以外的证件类型可以使用长期 + //value.id 1 居民身份证 todo + if (value.id != '1') { + this.effectiveDateTypeAbleInsured = false + } else { + if (this.userInfo.birthday) { + let age = utilsAge.getAge(this.userInfo.birthday, new Date()) + this.effectiveDateTypeAbleInsured = !(age >= 45) + } + } this.insuredInfo.idType = value.id } }, @@ -904,6 +1026,7 @@ export default { this.$refs.certiexpiredate.date = '' return } + this.userInfo.effectiveDateType = false //如果录入日期早于当前日期 if (Date.parse(val) < Date.parse(new Date())) { this.userInfo.certiexpiredate = '' @@ -992,6 +1115,26 @@ export default { this.productDate = currentData + '0时至' + productDateTime + '24时止' } break + case '7': + { + console.log('证件截止日期') + //被保人--证件截止日期 + //如果已经勾选了长期 + if (this.insuredInfo.effectiveDateType) { + //清空数据并返回 + this.insuredInfo.certiexpiredate = '' + this.$refs.certiexpiredate.date = '' + return + } + this.insuredInfo.effectiveDateType = false + //如果录入日期早于当前日期 + if (Date.parse(val) < Date.parse(new Date())) { + this.insuredInfo.certiexpiredate = '' + this.$refs.certiexpiredate.date = '' + return this.$toast('您的证件已过期') + } + } + break } }, //选择客户 @@ -1010,8 +1153,8 @@ export default { flag: 'navigation', extra: { title: '投被保人信息', - hiddenRight: '1', - }, + hiddenRight: '1' + } }) if (this.selectUser == '0') { let { customerName, customerSex } = data @@ -1023,6 +1166,11 @@ export default { this.userInfo.idType = data.customerIdType //证件类型 this.userInfo.idNo = data.customerIdNumber //证件类别 } + if (data.idEffectEndDate == '9999-01-01') { + this.userInfo.effectiveDateType = true //是否长期 + } else { + this.userInfo.certiexpiredate = data.idEffectEndDate //证件截止日期 + } this.userInfo.email = data.email //邮箱 this.userInfo.mobile = data.customerPhone //移动电话 @@ -1039,10 +1187,10 @@ export default { this.userInfo.healthGrade = data.healthGrade this.userInfo.nativeplace = data.country this.userInfo.marriage = data.marryStatus - // 计算年龄 - // let age = utilsAge.getAge(this.userInfo.birthday, new Date()) - + let age = utilsAge.getAge(this.userInfo.birthday, new Date()) + // 长期按钮是否禁用 + this.effectiveDateTypeAble = age <= 45 this.getRelatedData(this.userInfo.idNo, '1') } else if (this.selectUser == '1') { let { customerName, customerSex } = data @@ -1054,7 +1202,11 @@ export default { this.insuredInfo.idType = data.customerIdType //证件类型 this.insuredInfo.idNo = data.customerIdNumber //证件类别 } - + if (data.idEffectEndDate == '9999-01-01') { + this.insuredInfo.effectiveDateType = true //是否长期 + } else { + this.insuredInfo.certiexpiredate = data.idEffectEndDate //证件截止日期 + } this.insuredInfo.email = data.email //邮箱 this.insuredInfo.mobile = data.customerPhone //移动电话 this.insuredInfo.homeProvince = data.homeProvince //家庭省 @@ -1071,11 +1223,9 @@ export default { this.insuredInfo.nativeplace = data.country this.insuredInfo.marriage = data.marryStatus // 计算年龄 - // let age = utilsAge.getAge(this.userInfo.birthday, new Date()) - - // 计算年龄 - // let age = utilsAge.getAge(this.userInfo.birthday, new Date()) - + let age = utilsAge.getAge(this.insuredInfo.birthday, new Date()) + // 长期按钮是否禁用 + this.effectiveDateTypeAbleInsured = age <= 45 this.getRelatedData(this.insuredInfo.idNo, '2') } // console.log(data, val) @@ -1088,7 +1238,7 @@ export default { if (this.userInfo.relationToInsured == 1) { Object.assign(this.insuredInfo, this.userInfo) } - this.$validator.validate().then((valid) => { + this.$validator.validate().then(valid => { if (true === valid) { // localStorage.chooseProductCodesNew = localStorage.chooseProductCodes //投保人校验 @@ -1181,9 +1331,19 @@ export default { console.log('证件号码校验有误') return this.$toast('您填写的证件号码有误') } - + if (age < 46 && this.userInfo.effectiveDateType == true) { + return this.$toast('证件有效期错误,年龄小于46周岁的公民身份证有效期不能为长期') + } // 年龄在 16-25 周岁之间 - if (age >= 16 && age <= 25) { + if (age <= 15) { + if (Date.parse(this.userInfo.certiexpiredate) - Date.parse(new Date()) > Date.parse('1975-01-01')) { + this.userInfo.certiexpiredate = '' + this.$refs.certiexpiredate.date = '' + // this.effectiveDateTypeAble = true + return this.$toast('证件有效期错误,未满16周岁的公民身份证有效期应小于等于5年') + } + //年龄在 16-25 周岁之间 + } else if (age >= 16 && age <= 25) { console.log('年龄在16-25周岁之间') if (Date.parse(this.userInfo.certiexpiredate) - Date.parse(new Date()) > Date.parse('1980-01-01')) { this.userInfo.certiexpiredate = '' @@ -1247,14 +1407,25 @@ export default { console.log('证件号码校验有误') return this.$toast('您填写的证件号码有误') } + if (age < 46 && this.insuredInfo.effectiveDateType == true) { + return this.$toast('证件有效期错误,年龄小于46周岁的公民身份证有效期不能为长期') + } // 年龄在 16-25 周岁之间 - if (insuredAge >= 16 && insuredAge <= 25) { + if (insuredAge <= 15) { + if (Date.parse(this.insuredInfo.certiexpiredate) - Date.parse(new Date()) > Date.parse('1975-01-01')) { + this.insuredInfo.certiexpiredate = '' + this.$refs.certiexpiredate.date = '' + // this.effectiveDateTypeAble = true + return this.$toast('证件有效期错误,未满16周岁的公民身份证有效期应小于等于5年') + } + //年龄在 16-25 周岁之间 + } else if (insuredAge >= 16 && insuredAge <= 25) { console.log('年龄在16-25周岁之间') if (Date.parse(this.insuredInfo.certiexpiredate) - Date.parse(new Date()) > Date.parse('1980-01-01')) { this.insuredInfo.certiexpiredate = '' this.$refs.certiexpiredate.date = '' - this.effectiveDateTypeAble = true + this.certiexpiredateRequiredInsured = true return this.$toast('证件有效期不正常,16周岁至25周岁公民身份证有效期应小于等于10年') } //年龄在 26-45 周岁之间 @@ -1262,7 +1433,7 @@ export default { if (Date.parse(this.insuredInfo.certiexpiredate) - Date.parse(new Date()) > Date.parse('1990-01-01')) { this.insuredInfo.certiexpiredate = '' this.$refs.certiexpiredate.date = '' - this.effectiveDateTypeAble = true + this.certiexpiredateRequiredInsured = true return this.$toast('证件有效期不正常,26周岁至45周岁公民身份证有效期应小于等于20年') } } @@ -1349,11 +1520,11 @@ export default { orderDTO: { orderInfoDTO: { bnfFlag: '0', - supportBank: '0', + supportBank: '0' }, appntDTO: this.userInfo, - insuredDTOs: [this.insuredInfo], - }, + insuredDTOs: [this.insuredInfo] + } } //组装险种提交数据 @@ -1380,7 +1551,7 @@ export default { proScheme: this.proScheme, proSchemeCode: this.proSchemeCode, insuYear: insuYearDate.insuYear, - insuYearFlag: insuYearDate.insuYearFlag, + insuYearFlag: insuYearDate.insuYearFlag } if (item.hasPredictTransferPrem && item.hasPredictTransferPrem === '0') { //增加万能险 预计转入保费校验 @@ -1497,7 +1668,7 @@ export default { } //如果证件校验不通过,恢复默认值 if (idToData(val).text) { - ;[this.userInfo.idNo, this.userInfo.sex, this.userInfo.birthday] = ['', '0', ''] + ;[this.userInfo.idNo, this.userInfo.sex, this.userInfo.birthday, this.effectiveDateTypeAble] = ['', '0', '', false] return this.$toast(idToData(val).text) } this.userInfo.birthday = idToData(val).birthday @@ -1509,13 +1680,13 @@ export default { } //如果证件校验不通过,恢复默认值 if (idToData(val).text) { - ;[this.insuredInfo.idNo, this.insuredInfo.sex, this.insuredInfo.birthday] = ['', '0', ''] + ;[this.insuredInfo.idNo, this.insuredInfo.sex, this.insuredInfo.birthday, this.effectiveDateTypeAbleInsured] = ['', '0', '', false] return this.$toast(idToData(val).text) } this.insuredInfo.birthday = idToData(val).birthday this.insuredInfo.sex = idToData(val).sex } - }, + } }, // beforeDestroy() { // //清理计时器 @@ -1550,7 +1721,7 @@ export default { homeName: '', //联系地址 homeAddress: '', //详细地址 mobile: '', //移动电话 - email: '', //电子邮箱 + email: '' //电子邮箱 } if (newV === 2) { this.userInfo.sex === '0' ? (this.insuredInfo.sex = '1') : (this.insuredInfo.sex = '0') @@ -1558,7 +1729,7 @@ export default { } }, immediate: true, - deep: true, + deep: true }, 'userInfo.sex': { handler(newV) { @@ -1567,9 +1738,9 @@ export default { } }, immediate: true, - deep: true, - }, - }, + deep: true + } + } } diff --git a/src/views/ebiz/cardList/informationOld.vue b/src/views/ebiz/cardList/informationOld.vue new file mode 100644 index 000000000..7b93c14a8 --- /dev/null +++ b/src/views/ebiz/cardList/informationOld.vue @@ -0,0 +1,1598 @@ + + +