From 4a2a54ff70e30e6c9dc85faf63ff9a0c707e18b0 Mon Sep 17 00:00:00 2001 From: zhangqi1 Date: Fri, 24 Sep 2021 18:34:57 +0800 Subject: [PATCH] =?UTF-8?q?GFRS-2618=E3=80=90=E5=89=8D=E7=AB=AF=E3=80=91?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=89=8D=E7=AB=AF=E9=83=A8=E5=88=86bug--?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BA=BA=EF=BC=9A=E5=BC=A0=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/js/utils/data-dictionary.js | 4 +-- .../application/AttachmentManagement.vue | 29 ++++++++++--------- .../ebiz/allowance/application/BaseInfo.vue | 22 ++++++++++---- src/views/ebiz/allowance/js/methods.js | 15 +++++++--- src/views/ebiz/allowance/js/verification.js | 16 +++++++++- .../allowance/myInfo/AttachmentManagement.vue | 4 ++- src/views/ebiz/allowance/myInfo/BaseInfo.vue | 12 ++++---- 7 files changed, 68 insertions(+), 34 deletions(-) diff --git a/src/assets/js/utils/data-dictionary.js b/src/assets/js/utils/data-dictionary.js index 5990f49b7..3d0d01b01 100644 --- a/src/assets/js/utils/data-dictionary.js +++ b/src/assets/js/utils/data-dictionary.js @@ -3632,8 +3632,8 @@ export default { // 津贴申请-享受人角色的枚举(父母津贴申请功能专用) allowanceEnjoyUserRole: [ - { id: '0', text: '父亲' }, - { id: '1', text: '母亲' } + { id: 'F', text: '父亲' }, + { id: 'M', text: '母亲' } ], // imageInfoType:[ diff --git a/src/views/ebiz/allowance/application/AttachmentManagement.vue b/src/views/ebiz/allowance/application/AttachmentManagement.vue index 7c24302e2..a791adcb3 100644 --- a/src/views/ebiz/allowance/application/AttachmentManagement.vue +++ b/src/views/ebiz/allowance/application/AttachmentManagement.vue @@ -573,8 +573,6 @@ export default { fileName: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${window.localStorage.getItem('imgfrontPath')}` } this.list.push(obj) - } else { - this.fileListIdFrontApplicant = [] } // 申请人身份证反面 @@ -594,8 +592,6 @@ export default { fileName: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${window.localStorage.getItem('imgBackPath')}` } this.list.push(obj) - } else { - this.fileListIdBackApplicant = [] } // 享受人身份证正面 @@ -615,8 +611,6 @@ export default { fileName: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${window.localStorage.getItem('imgfrontInsuredPath')}` } this.list.push(obj) - } else { - this.fileListIdFrontEnjoyUser = [] } // 享受人身份证反面 @@ -636,8 +630,6 @@ export default { fileName: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${window.localStorage.getItem('imgBackInsuredPath')}` } this.list.push(obj) - } else { - this.fileListIdBackEnjoyUser = [] } // 银行卡 @@ -658,8 +650,6 @@ export default { fileName: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${window.localStorage.getItem('bankCardUrlPath')}` } this.list.push(obj) - } else { - this.fileListBank = [] } }, @@ -751,11 +741,22 @@ export default { // 删除关系证明图片 } else if (detail.name == 'fileListProve') { this.fileListProve.map((item, index, array) => { - if (item.url == file.url) { - array.splice(index, 1) - this.deleteImg(file, 'fileListProve') + // 图片新增上传时,删除其中一张关系证明图片的执行的方法 + if (file.file) { + if (item.name == file.name) { + array.splice(index, 1) + this.deleteImg(file, 'fileListProve') + } else { + return + } } else { - return + // 图片返显时,删除其中一张关系证明图片的执行的方法 + if (item.url == file.url) { + array.splice(index, 1) + this.deleteImg(file, 'fileListProve') + } else { + return + } } }) diff --git a/src/views/ebiz/allowance/application/BaseInfo.vue b/src/views/ebiz/allowance/application/BaseInfo.vue index 2bba292bc..5fea97dd5 100644 --- a/src/views/ebiz/allowance/application/BaseInfo.vue +++ b/src/views/ebiz/allowance/application/BaseInfo.vue @@ -185,8 +185,8 @@ export default { relationship: '', // 享受人角色(与申请人的关系) // 享受人角色(与申请人的关系)的选择项 relationshipRadio: [ - { value: '0', label: '父亲' }, - { value: '1', label: '母亲' } + { value: 'F', label: '父亲' }, + { value: 'M', label: '母亲' } ], sex: '', // 享受人的性别 // 享受人性别的选择项 @@ -235,6 +235,16 @@ export default { * @Date:2021-09-14 */ init() { + // 清除存储ORC扫描的图片的缓存, + // 防止重新开始进行津贴流程申请时,会携带之前的ORC图片缓存,在影像资料页面进行图片回显,这样回显的图片是不正确的 + // 清除存储ORC扫描申请人和享受人证件功能后存储的申请人和享受人证件图片缓存。 + localStorage.removeItem('imgfrontPath') // 申请人证件正面 + localStorage.removeItem('imgBackPath') // 申请人证件反面 + localStorage.removeItem('imgfrontInsuredPath') // 享受人证件正面 + localStorage.removeItem('imgBackInsuredPath') // 享受人证件反面 + // 清除存储ORC扫描银行卡功能后存储的银行卡图片缓存 + localStorage.removeItem('bankCardUrlPath') // 银行卡 + // 判断是新增操作还是编辑操作的类型,根据不同操作类型调用不同接口查询数据 if (this.$route.query.edit) { // 从路由参数中获取'allowanceNo'津贴流水号,定义参数格式 @@ -404,7 +414,7 @@ export default { }) // 将选择的享受人的数据,赋值给对应的变量 this.enjoyUserInfo.name = data.name // 享受人姓名 - this.enjoyUserInfo.relationship = String(data.relationship) // 享受人角色(与申请人的关系) + this.enjoyUserInfo.relationship = data.relationship // 享受人角色(与申请人的关系) this.enjoyUserInfo.idType = data.idType // 享受人证件类型 this.enjoyUserInfo.idNo = data.idNo // 享受人证件号码 this.enjoyUserInfo.sex = String(data.sex) // 享受人性别 @@ -430,7 +440,7 @@ export default { return this.$toast(idToData(val).text) } else { // 如果合规会自动填充享受人角色,性别,出生日期等信息 - this.enjoyUserInfo.relationship = idToData(val).sex // 性别男,表示的角色为父亲 + this.enjoyUserInfo.relationship = idToData(val).relationship this.enjoyUserInfo.sex = idToData(val).sex this.enjoyUserInfo.birthday = idToData(val).birthday } @@ -530,11 +540,11 @@ export default { } } // 判断当享受人角色为父亲,性别为女时,要进行提示 - if (this.enjoyUserInfo.relationship == 0 && this.enjoyUserInfo.sex == 1) { + if (this.enjoyUserInfo.relationship == 'F' && this.enjoyUserInfo.sex == 1) { return this.$toast('享受人为父亲,性别不可为女,请修改。') } // 判断当享受人角色为母亲,性别为男时,要进行提示 - if (this.enjoyUserInfo.relationship == 1 && this.enjoyUserInfo.sex == 0) { + if (this.enjoyUserInfo.relationship == 'M' && this.enjoyUserInfo.sex == 0) { return this.$toast('享受人为母亲,性别不可为男,请修改。') } // 计算享受人年龄 diff --git a/src/views/ebiz/allowance/js/methods.js b/src/views/ebiz/allowance/js/methods.js index af8efda45..f60b119b6 100644 --- a/src/views/ebiz/allowance/js/methods.js +++ b/src/views/ebiz/allowance/js/methods.js @@ -53,10 +53,17 @@ function closeBtn(that) { export function getApplicantIdentityInfo(that, data) { // 正面 if (data.name && data.name != '待识别') { - that.applicantInfo.name = data.name - that.applicantInfo.idNo = data.idNo - // that.applicantInfo.birthday = `${data.birthYear}-${data.birthMonth}-${data.birthDay}` - // that.applicantInfo.sex = data.gender == '男' ? '0' : '1' + if (that.applicantInfo.name === data.name) { + that.applicantInfo.name = data.name + that.applicantInfo.idNo = data.idNo + // that.applicantInfo.birthday = `${data.birthYear}-${data.birthMonth}-${data.birthDay}` + // that.applicantInfo.sex = data.gender == '男' ? '0' : '1' + } else { + that.$toast('身份证姓名和申请人姓名不一致,请重新上传。') + // 如果身份证姓名和申请人姓名不一致,要清除OCR扫描后存储的申请人证件正面的图片的缓存,不能将其带入到影像资料页面中进行回显 + localStorage.removeItem('imgfrontPath') // 申请人证件正面 + localStorage.removeItem('imgBackPath') // 申请人证件反面 + } } // 反面 // if (data.startDate && data.startDate != '待识别') {} diff --git a/src/views/ebiz/allowance/js/verification.js b/src/views/ebiz/allowance/js/verification.js index 42748b8b1..7883c0cd5 100644 --- a/src/views/ebiz/allowance/js/verification.js +++ b/src/views/ebiz/allowance/js/verification.js @@ -1,6 +1,7 @@ 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) { //非空 @@ -27,10 +28,12 @@ export function idToData(idNo) { let birthday = getBirthById(idNo) let age = utilsAge.getAge(birthday, new Date()) let sex = getSexById(idNo) + let relationship = getRelationshipById(idNo) return { birthday, age, - sex + sex, + relationship } } @@ -52,3 +55,14 @@ function getSexById(idNo) { } } } + +function getRelationshipById(idNo) { + // 获取性别 + if (idNo.charAt(16) >= '0' && idNo.charAt(16) <= '9') { + if (parseInt(idNo.charAt(16)) % 2 == 0) { + return 'M' + } else { + return 'F' + } + } +} diff --git a/src/views/ebiz/allowance/myInfo/AttachmentManagement.vue b/src/views/ebiz/allowance/myInfo/AttachmentManagement.vue index a9b59f674..c97a2f1f9 100644 --- a/src/views/ebiz/allowance/myInfo/AttachmentManagement.vue +++ b/src/views/ebiz/allowance/myInfo/AttachmentManagement.vue @@ -570,7 +570,9 @@ export default { // 删除关系证明图片 } else if (detail.name == 'fileListProve') { this.fileListProve.map((item, index, array) => { - if (item.url == file.url) { + // 我的资料与津贴申请不同,因为我的资料-影像资料页面不会涉及到图片回显的功能, + // 所以用'name'属性判断,然后进行删除图片即可实现 + if (item.name == file.name) { array.splice(index, 1) this.deleteImg(file, 'fileListProve') } else { diff --git a/src/views/ebiz/allowance/myInfo/BaseInfo.vue b/src/views/ebiz/allowance/myInfo/BaseInfo.vue index 548cea61f..04ef4fdb7 100644 --- a/src/views/ebiz/allowance/myInfo/BaseInfo.vue +++ b/src/views/ebiz/allowance/myInfo/BaseInfo.vue @@ -184,8 +184,8 @@ export default { relationship: '', // 享受人角色(与申请人的关系) // 享受人角色(与申请人的关系)的选择项 relationshipRadio: [ - { value: '0', label: '父亲' }, - { value: '1', label: '母亲' } + { value: 'F', label: '父亲' }, + { value: 'M', label: '母亲' } ], sex: '', // 享受人的性别 // 享受人性别的选择项 @@ -404,7 +404,7 @@ export default { // 将选择的享受人的数据,赋值给对应的变量 this.enjoyUserInfo.id = data.id // 新增或修改我的资料的唯一标识,用于当做参数传给顶部导航组件,也用于在点击下一步时,传给后台,后台去判断是新增操作还是编辑操作 this.enjoyUserInfo.name = data.name // 享受人姓名 - this.enjoyUserInfo.relationship = String(data.relationship) // 享受人角色(与申请人的关系) + this.enjoyUserInfo.relationship = data.relationship // 享受人角色(与申请人的关系) this.enjoyUserInfo.idType = data.idType // 享受人证件类型 this.enjoyUserInfo.idNo = data.idNo // 享受人证件号码 this.enjoyUserInfo.sex = String(data.sex) // 享受人性别 @@ -430,7 +430,7 @@ export default { return this.$toast(idToData(val).text) } else { // 如果合规会自动填充享受人角色,性别,出生日期等信息 - this.enjoyUserInfo.relationship = idToData(val).sex // 性别男,表示的角色为父亲 + this.enjoyUserInfo.relationship = idToData(val).relationship this.enjoyUserInfo.sex = idToData(val).sex this.enjoyUserInfo.birthday = idToData(val).birthday } @@ -530,11 +530,11 @@ export default { } } // 判断当享受人角色为父亲,性别为女时,要进行提示 - if (this.enjoyUserInfo.relationship == 0 && this.enjoyUserInfo.sex == 1) { + if (this.enjoyUserInfo.relationship == 'F' && this.enjoyUserInfo.sex == 1) { return this.$toast('享受人为父亲,性别不可为女,请修改。') } // 判断当享受人角色为母亲,性别为男时,要进行提示 - if (this.enjoyUserInfo.relationship == 1 && this.enjoyUserInfo.sex == 0) { + if (this.enjoyUserInfo.relationship == 'M' && this.enjoyUserInfo.sex == 0) { return this.$toast('享受人为母亲,性别不可为男,请修改。') } // 计算享受人年龄