diff --git a/src/views/ebiz/saleFlowProImprove/components/IdentityCardScan.vue b/src/views/ebiz/saleFlowProImprove/components/IdentityCardScan.vue index eac00d70b..9818d1457 100644 --- a/src/views/ebiz/saleFlowProImprove/components/IdentityCardScan.vue +++ b/src/views/ebiz/saleFlowProImprove/components/IdentityCardScan.vue @@ -141,22 +141,40 @@ export default { }, inject: ['nextStepProcesserContainer'], methods: { + validateRoleImage(orderDetail) { + if (orderDetail.result !== '0') return false + const { orderDTO } = orderDetail + const { mediaDTOS } = orderDTO + return Array.isArray(mediaDTOS) && mediaDTOS.filter(item => item.subBusinessType === this.role).length === 2 + }, registerSubTask() { if (!this.subTask) return this.nextStepProcesserContainer.registerPreTask(this.subTask, async () => { - if (this.list.length <= 2) { - setTimeout(() => this.$toast('请补充完整影像信息'), 600) - return false + const result = getOrderDetail({ orderNo: this.$route.query.orderNo }) + + // 如果触发上传图片行为, 就开始进行列表检测 + if (this.updateImage) { + if (this.list.length <= 2) { + setTimeout(() => this.$toast('请补充完整影像信息'), 600) + return false + } + } else { + // 如果没有上传图片,对云端图片进行检测 + if (!this.validateRoleImage(result)) { + setTimeout(() => this.$toast('请补充完整影像信息'), 600) + return false + } } + // 针对 受益人进行特殊的处理, 下一步前的前置处理 if (this.role === this.user.beneficiary) { - const result = getOrderDetail({ orderNo: this.$route.query.orderNo }) - if (result.result !== '0') return + if (result.result !== '0') return false const idNo = this.userInfo['idNo'] const beneficiaries = result.orderDTO.insuredDTOs[0].bnfDTOs - if (!Array.isArray(beneficiaries)) return + if (!Array.isArray(beneficiaries)) return false const beneficiary = beneficiaries.find(beneficiary => beneficiary.idNo === idNo) + // 通过 idNo 获取对应的 idNo 受益人, 然后获取 bnfId , 对照片参数补充完整 this.list.forEach(item => { item.subBusinessNo = beneficiary.bnfId }) @@ -179,7 +197,8 @@ export default { }) const result = JSON.parse(data) - + // 检测图片上传的 single, 跟下一步处理有相关内容 + this.updateImage = true if (result.code === '1') { if (isFront) { this.handleFrontScanResult(result.content)