From 41892791f0bdd62e11b5a3ee91623dcd9cedacf5 Mon Sep 17 00:00:00 2001 From: "liu.xiaofeng@ebiz-digits.com" Date: Wed, 9 Aug 2023 10:01:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E9=99=84=E4=BB=B6=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E9=80=BB=E8=BE=91=E9=87=8D=E6=96=B0=E7=BC=96=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ebiz/sale/AttachmentManagement.vue | 848 +++---------------- 1 file changed, 113 insertions(+), 735 deletions(-) diff --git a/src/views/ebiz/sale/AttachmentManagement.vue b/src/views/ebiz/sale/AttachmentManagement.vue index d6860ad9c..1a6f35e31 100644 --- a/src/views/ebiz/sale/AttachmentManagement.vue +++ b/src/views/ebiz/sale/AttachmentManagement.vue @@ -9,7 +9,7 @@ -
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
{ - // console.log(res) - if (res.result == '0') { - this.$toast.clear() - if(res.path){ - if (that.type == 'fileListIdFront' || that.type == 'fileListIdBack' || that.type == 'fileLIstImg' || that.type == 'fileListBank' || that.type == 'fileListNotify' || that.type == 'saleInsuredInfoOther') { - let imageInfoType = '' - let name = '' - if (that.type == 'fileListIdFront' && that.id == '1') { - //身份证正面 - name = 'fileListIdFront' - imageInfoType = '1' - this.fileListIdFront = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListIdBack' && that.id == '1') { - //身份证反面 - name = 'fileListIdBack' - imageInfoType = '2' - this.fileListIdBack = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListIdFront' && that.id == '2') { - //户口本正面 - name = 'fileListIdFront' - imageInfoType = '5' - this.fileListIdFront = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListIdBack' && that.id == '2') { - //户口本反面 - name = 'fileListIdBack' - imageInfoType = '6' - this.fileListIdBack = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListIdFront' && that.id == '3') { - //出生证正面 - name = 'fileListIdFront' - imageInfoType = '7' - this.fileListIdFront = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListIdBack' && that.id == '3') { - //出生证反面 - name = 'fileListIdBack' - imageInfoType = '12' - this.fileListIdBack = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileLIstImg' && that.id == '4') { - //护照面 - name = 'fileLIstImg' - imageInfoType = '8' - this.fileLIstImg = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListIdFront' && that.id == '5') { - //港澳居民来往内地通行证正面 - name = 'fileListIdFront' - imageInfoType = '9' - this.fileListIdFront = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListIdBack' && that.id == '5') { - //港澳居民来往内地通行证反面 - name = 'fileListIdBack' - imageInfoType = '13' - this.fileListIdBack = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListIdFront' && that.id == '6') { - //台湾居民来往大陆通行证正面 - name = 'fileListIdFront' - imageInfoType = '10' - this.fileListIdFront = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListIdBack' && that.id == '6') { - //台湾居民来往大陆通行证反面 - name = 'fileListIdBack' - imageInfoType = '14' - this.fileListIdBack = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListIdFront' && that.id == '8') { - //外国人永久居留身份证正面 - name = 'fileListIdFront' - imageInfoType = '15' - this.fileListIdFront = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListIdBack' && that.id == '8') { - //外国人永久居留身份证反面 - name = 'fileListIdBack' - imageInfoType = '16' - this.fileListIdBack = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListIdFront' && that.id == '9') { - //港澳台居民居住证正面 - name = 'fileListIdFront' - imageInfoType = '17' - this.fileListIdFront = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListIdBack' && that.id == '9') { - //港澳台居民居住证反面 - name = 'fileListIdBack' - imageInfoType = '18' - this.fileListIdBack = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListBank') { - //银行卡正面 - name = 'fileListBank' - imageInfoType = '3' - this.fileListBank = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListNotify') { - name = 'fileListNotify' - imageInfoType = '24' - this.fileListNotify = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } - let obj = { - name: name, - businessNo: that.orderNo, - businessType: '', - imageInfoType: imageInfoType, - // window.localStorage.setItem('bankCardUrlInsuredPath', encodeURI(JSON.parse(data).path).replace(/\+/g, '%2B')) - rgssUrl: encodeURI(res.path).replace(/\+/g, '%2B'), - subBusinessType: '0', - subBusinessNo: that.saleInsuredInfo.appntId, - fileName: that.imgName, - } - this.imageType = imageInfoType - that.list.push(obj) - } - else if (that.type == 'fileListIdFrontInsured' || that.type == 'fileListIdBackInsured' || that.type == 'fileListBankInsured' || that.type == 'fileLIstImgInsured' || that.type == 'fileListNotifyInsured' || that.type == 'saleInsuredPersonInfoOther') { - // 是被保险人 - // 证件类型 - let imageInfoType = '' - let name = '' - if (that.type == 'fileListIdFrontInsured' && that.id == '1') { - name = 'fileListIdFrontInsured' - imageInfoType = '1' - this.fileListIdFrontInsured = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListIdBackInsured' && that.id == '1') { - name = 'fileListIdBackInsured' - imageInfoType = '2' - this.fileListIdBackInsured = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListIdFrontInsured' && that.id == '2') { - name = 'fileListIdFrontInsured' - imageInfoType = '5' - this.fileListIdFrontInsured = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListIdBackInsured' && that.id == '2') { - name = 'fileListIdBackInsured' - imageInfoType = '6' - this.fileListIdBackInsured = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListIdFrontInsured' && that.id == '3') { - name = 'fileListIdFrontInsured' - imageInfoType = '7' - this.fileListIdFrontInsured = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListIdBackInsured' && that.id == '3') { - name = 'fileListIdBackInsured' - imageInfoType = '12' - this.fileListIdBackInsured = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileLIstImgInsured' && that.id == '4') { - name = 'fileLIstImgInsured' - imageInfoType = '8' - this.fileLIstImgInsured = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListIdFrontInsured' && that.id == '5') { - name = 'fileListIdFrontInsured' - imageInfoType = '9' - this.fileListIdFrontInsured = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListIdBackInsured' && that.id == '5') { - name = 'fileListIdBackInsured' - imageInfoType = '13' - this.fileListIdBackInsured = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListIdFrontInsured' && that.id == '6') { - name = 'fileListIdFrontInsured' - imageInfoType = '10' - this.fileListIdFrontInsured = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListIdBackInsured' && that.id == '6') { - name = 'fileListIdBackInsured' - imageInfoType = '14' - this.fileListIdBackInsured = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListIdFrontInsured' && that.id == '8') { - name = 'fileListIdFrontInsured' - imageInfoType = '15' - this.fileListIdFrontInsured = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListIdBackInsured' && that.id == '8') { - name = 'fileListIdBackInsured' - imageInfoType = '16' - this.fileListIdBackInsured = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListIdFrontInsured' && that.id == '9') { - name = 'fileListIdFrontInsured' - imageInfoType = '17' - this.fileListIdFrontInsured = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListIdBackInsured' && that.id == '9') { - name = 'fileListIdBackInsured' - imageInfoType = '18' - this.fileListIdBackInsured = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } else if (that.type == 'fileListNotifyInsured') { - name = 'fileListNotifyInsured' - imageInfoType = '24' - this.fileListNotifyInsured = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } - let obj = { - name: name, - businessNo: that.orderNo, - businessType: '', - imageInfoType: imageInfoType, - rgssUrl: encodeURI(res.path).replace(/\+/g, '%2B'), - subBusinessType: '1', - subBusinessNo: that.saleInsuredPersonInfo.insuredId, - fileName: that.imgName, - } - this.imageType = imageInfoType - that.list.push(obj) - } - else if (that.type == 'fileListIdFrontBeneficiary' || that.type == 'fileListIdBackBeneficiary' || that.type == 'fileLIstImgBeneficiary') { - // 是收益人 - // 证件类型 - let imageInfoType = '' - let name = '' - if (that.type == 'fileListIdFrontBeneficiary' && that.id == '1') { - name = 'fileListIdFrontBeneficiary' - imageInfoType = '1' - that.saleBtnfPersonInfo.forEach((item,index)=>{ - if(item.bnfId == that.bnfId){ - this.bnfInfo[index].fileListIdFrontBeneficiary = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } - }) - } else if (that.type == 'fileListIdBackBeneficiary' && that.id == '1') { - name = 'fileListIdBackBeneficiary' - imageInfoType = '2' - that.saleBtnfPersonInfo.forEach((item,index)=>{ - if(item.bnfId == that.bnfId){ - this.bnfInfo[index].fileListIdBackBeneficiary = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } - }) - } else if (that.type == 'fileListIdFrontBeneficiary' && that.id == '2') { - name = 'fileListIdFrontBeneficiary' - imageInfoType = '5' - that.saleBtnfPersonInfo.forEach((item,index)=>{ - if(item.bnfId == that.bnfId){ - this.bnfInfo[index].fileListIdFrontBeneficiary = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } - }) - } else if (that.type == 'fileListIdBackBeneficiary' && that.id == '2') { - name = 'fileListIdBackBeneficiary' - imageInfoType = '6' - that.saleBtnfPersonInfo.forEach((item,index)=>{ - if(item.bnfId == that.bnfId){ - this.bnfInfo[index].fileListIdBackBeneficiary = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } - }) - } else if (that.type == 'fileListIdFrontBeneficiary' && that.id == '3') { - name = 'fileListIdFrontBeneficiary' - imageInfoType = '7' - that.saleBtnfPersonInfo.forEach((item,index)=>{ - if(item.bnfId == that.bnfId){ - this.bnfInfo[index].fileListIdFrontBeneficiary = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } - }) - } else if (that.type == 'fileListIdBackBeneficiary' && that.id == '3') { - name = 'fileListIdBackBeneficiary' - imageInfoType = '12' - that.saleBtnfPersonInfo.forEach((item,index)=>{ - if(item.bnfId == that.bnfId){ - this.bnfInfo[index].fileListIdBackBeneficiary = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } - }) - } else if (that.type == 'fileLIstImgBeneficiary' && that.id == '4') { - name = 'fileLIstImgBeneficiary' - imageInfoType = '8' - that.saleBtnfPersonInfo.forEach((item,index)=>{ - if(item.bnfId == that.bnfId){ - this.bnfInfo[index].fileLIstImgBeneficiary = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } - }) - } else if (that.type == 'fileListIdFrontBeneficiary' && that.id == '5') { - name = 'fileListIdFrontBeneficiary' - imageInfoType = '9' - that.saleBtnfPersonInfo.forEach((item,index)=>{ - if(item.bnfId == that.bnfId){ - this.bnfInfo[index].fileListIdFrontBeneficiary = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } - }) - } else if (that.type == 'fileListIdBackBeneficiary' && that.id == '5') { - name = 'fileListIdBackBeneficiary' - imageInfoType = '13' - that.saleBtnfPersonInfo.forEach((item,index)=>{ - if(item.bnfId == that.bnfId){ - this.bnfInfo[index].fileListIdBackBeneficiary = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } - }) - } else if (that.type == 'fileListIdFrontBeneficiary' && that.id == '6') { - name = 'fileListIdFrontBeneficiary' - imageInfoType = '10' - that.saleBtnfPersonInfo.forEach((item,index)=>{ - if(item.bnfId == that.bnfId){ - this.bnfInfo[index].fileListIdFrontBeneficiary = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } - }) - } else if (that.type == 'fileListIdBackBeneficiary' && that.id == '6') { - name = 'fileListIdBackBeneficiary' - imageInfoType = '14' - that.saleBtnfPersonInfo.forEach((item,index)=>{ - if(item.bnfId == that.bnfId){ - this.bnfInfo[index].fileListIdBackBeneficiary = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } - }) - } else if (that.type == 'fileListIdFrontBeneficiary' && that.id == '8') { - name = 'fileListIdFrontBeneficiary' - imageInfoType = '15' - that.saleBtnfPersonInfo.forEach((item,index)=>{ - if(item.bnfId == that.bnfId){ - this.bnfInfo[index].fileListIdFrontBeneficiary = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } - }) - } else if (that.type == 'fileListIdBackBeneficiary' && that.id == '8') { - name = 'fileListIdBackBeneficiary' - imageInfoType = '16' - that.saleBtnfPersonInfo.forEach((item,index)=>{ - if(item.bnfId == that.bnfId){ - this.bnfInfo[index].fileListIdBackBeneficiary = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } - }) - } else if (that.type == 'fileListIdFrontBeneficiary' && that.id == '9') { - name = 'fileListIdFrontBeneficiary' - imageInfoType = '17' - that.saleBtnfPersonInfo.forEach((item,index)=>{ - if(item.bnfId == that.bnfId){ - this.bnfInfo[index].fileListIdFrontBeneficiary = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } - }) - } else if (that.type == 'fileListIdBackBeneficiary' && that.id == '9') { - name = 'fileListIdBackBeneficiary' - imageInfoType = '18' - that.saleBtnfPersonInfo.forEach((item,index)=>{ - if(item.bnfId == that.bnfId){ - this.bnfInfo[index].fileListIdBackBeneficiary = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - } - }) - } - let obj = { - name: name, - businessNo: that.orderNo, - businessType: '', - imageInfoType: imageInfoType, - rgssUrl: encodeURI(res.path).replace(/\+/g, '%2B'), - subBusinessType: '3', - subBusinessNo: that.bnfId, - fileName: that.imgName, - } - this.imageType = imageInfoType - that.list.push(obj) - } - else if (that.type == 'fileListOther') { - // 是其他 - let type = '2' - let name = 'fileListOther' - this.fileListOther = { - url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${res.path}`, - } - let obj = { - name: name, - businessNo: that.orderNo, - businessType: name, - imageInfoType: '11', - rgssUrl: encodeURI(res.path).replace(/\+/g, '%2B'), - subBusinessType: type, - subBusinessNo: '', - fileName: that.imgName, - } - that.list.push(obj) - } else if (that.type == 'fileListNotify') { + uploadImg(formdata).then(res=>{ + if(res.result == 0 && res.path){ + let subBusinessNo = '' + if ( + that.type == 'fileListIdFront' || + that.type == 'fileListIdBack' || + that.type == 'fileLIstImg' || + that.type == 'fileListBank' || + that.type == 'fileListNotify' || + that.type == 'saleInsuredInfoOther' + ){ + subBusinessNo = that.saleInsuredInfo.appntId + } + else if ( + that.type == 'fileListIdFrontInsured' || + that.type == 'fileListIdBackInsured' || + that.type == 'fileListBankInsured' || + that.type == 'fileLIstImgInsured' || + that.type == 'fileListNotifyInsured' || + that.type == 'saleInsuredPersonInfoOther' + ){ + subBusinessNo = that.saleInsuredPersonInfo.insuredId + } else if ( + that.type == 'fileListIdFrontBeneficiary' || + that.type == 'fileListIdBackBeneficiary' || + that.type == 'fileLIstImgBeneficiary' + ){ + subBusinessNo = that.bnfId + } else if (that.type == 'fileListOther'){ + subBusinessNo = '' + } - } + let obj = { + name: name, + businessNo: that.orderNo, + businessType: '', + imageInfoType: that.imageType, + rgssUrl: encodeURI(res.path).replace(/\+/g, '%2B'), + subBusinessType: '0', + subBusinessNo: subBusinessNo, + fileName: that.imgName, + } + that.list.push(obj) - let imgPath = res.path - //只有身份证件才进行ocr校验 - if(that.type == 'fileListIdFront' || that.type == 'fileListIdBack' || that.type == 'fileLIstImg' || that.type == 'fileListIdFrontInsured' || that.type == 'fileListIdBackInsured' || that.type == 'fileLIstImgInsured' || that.type == 'fileListIdFrontBeneficiary'|| that.type == 'fileListIdBackBeneficiary'){ - if(that.id == '1' && this.imageType == '1' && that.type == 'fileListIdFront'){ - //投保人身份证正面 - this.IDCardOCRValite(that.id, this.orderNo, imgPath, 'FRONT', 'appentFront') - }else if(that.id == '1' && this.imageType == '2' && that.type == 'fileListIdBack'){ - //投保人身份证反面 - this.IDCardOCRValite(that.id, this.orderNo, imgPath, 'BACK', 'appentBack') - }else if(that.id == '1' && this.imageType == '1' && that.type == 'fileListIdFrontInsured'){ - //被保人身份证正面 - this.IDCardOCRValite(that.id, this.orderNo, imgPath, 'FRONT', 'insuredFront') - }else if(that.id == '1' && this.imageType == '2' && that.type == 'fileListIdBackInsured'){ - //被保人身份证反面 - this.IDCardOCRValite(that.id, this.orderNo, imgPath, 'BACK', 'insuredBack') - }else if(that.id == '1' && this.imageType == '1' && that.type == 'fileListIdFrontBeneficiary'){ - //受益人身份证正面 - this.IDCardOCRValite(that.id, this.orderNo, imgPath, 'FRONT', 'beneficiaryFront') - }else if(that.id == '1' && this.imageType == '2' && that.type == 'fileListIdBackBeneficiary'){ - //受益人身份证反面 - this.IDCardOCRValite(that.id, this.orderNo, imgPath, 'BACK', 'beneficiaryBack') - }else { - //其他素材(护照,户口本,港澳身份证等) - this.IDCardOCRValite(that.id, this.orderNo, imgPath, "OTHER", '') - } - } - } - else{ - switch (that.type) { - case 'fileListIdFront': - that.fileListIdFront = [] - break - case 'fileListIdBack': - that.fileListIdBack = [] - break - case 'fileLIstImg': - that.fileLIstImg = [] - break - case 'fileListBank': - that.fileListBank = [] - break - case 'fileListOther': - that.fileListOther = [] - break - case 'fileListIdFrontInsured': - that.fileListIdFrontInsured = [] - break - case 'fileListIdBackInsured': - that.fileListIdBackInsured = [] - break - case 'fileListBankInsured': - that.fileListBankInsured = [] - break - case 'fileLIstImgInsured': - that.fileLIstImgInsured = [] - break - case 'saleInsuredInfoOther': - that.saleInsuredInfoOther = [] - break - case 'saleInsuredPersonInfoOther': - that.saleInsuredPersonInfoOther = [] - break - } - if(that.type == 'fileListIdFrontBeneficiary'){ - that.saleBtnfPersonInfo.forEach((item,index)=>{ - if(item.bnfId == that.bnfId){ - that.bnfInfo[index].fileListIdFrontBeneficiary = [] - } - }) - } - if(that.type == 'fileListIdBackBeneficiary'){ - that.saleBtnfPersonInfo.forEach((item,index)=>{ - if(item.bnfId == that.bnfId){ - that.bnfInfo[index].fileListIdBackBeneficiary = [] - } - }) - } - if(that.type == 'fileLIstImgBeneficiary'){ - that.saleBtnfPersonInfo.forEach((item,index)=>{ - if(item.bnfId == that.bnfId){ - that.bnfInfo[index].fileLIstImgBeneficiary = [] - } - }) - } - this.$toast.clear() + //只有身份证件才进行ocr校验 + if(that.type == 'fileListIdFront' || that.type == 'fileListIdBack' || that.type == 'fileLIstImg' || + that.type == 'fileListIdFrontInsured' || that.type == 'fileListIdBackInsured' || that.type == 'fileLIstImgInsured' + || that.type == 'fileListIdFrontBeneficiary'|| that.type == 'fileListIdBackBeneficiary'){ + if(that.id == '1' && this.imageType == '1' && that.type == 'fileListIdFront'){ + //投保人身份证正面 + that.IDCardOCRValite(that.id, that.orderNo, res.path, 'FRONT', 'appentFront') + }else if(that.id == '1' && that.imageType == '2' && that.type == 'fileListIdBack'){ + //投保人身份证反面 + that.IDCardOCRValite(that.id, that.orderNo, res.path, 'BACK', 'appentBack') + }else if(that.id == '1' && that.imageType == '1' && that.type == 'fileListIdFrontInsured'){ + //被保人身份证正面 + that.IDCardOCRValite(that.id, that.orderNo, res.path, 'FRONT', 'insuredFront') + }else if(that.id == '1' && that.imageType == '2' && that.type == 'fileListIdBackInsured'){ + //被保人身份证反面 + that.IDCardOCRValite(that.id, that.orderNo, res.path, 'BACK', 'insuredBack') + }else if(that.id == '1' && that.imageType == '1' && that.type == 'fileListIdFrontBeneficiary'){ + //受益人身份证正面 + that.IDCardOCRValite(that.id, that.orderNo, res.path, 'FRONT', 'beneficiaryFront') + }else if(that.id == '1' && that.imageType == '2' && that.type == 'fileListIdBackBeneficiary'){ + //受益人身份证反面 + that.IDCardOCRValite(that.id, that.orderNo, res.path, 'BACK', 'beneficiaryBack') + }else { + //其他素材(护照,户口本,港澳身份证等) + that.IDCardOCRValite(that.id, that.orderNo, res.path, "OTHER", '') } } - else { - switch (that.type) { - case 'fileListIdFront': - that.fileListIdFront = [] - break - case 'fileListIdBack': - that.fileListIdBack = [] - break - case 'fileLIstImg': - that.fileLIstImg = [] - break - case 'fileListBank': - that.fileListBank = [] - break - case 'fileListOther': - that.fileListOther = [] - break - case 'fileListIdFrontInsured': - that.fileListIdFrontInsured = [] - break - case 'fileListIdBackInsured': - that.fileListIdBackInsured = [] - break - case 'fileListBankInsured': - that.fileListBankInsured = [] - break - case 'fileLIstImgInsured': - that.fileLIstImgInsured = [] - break - case 'saleInsuredInfoOther': - that.saleInsuredInfoOther = [] - break - case 'saleInsuredPersonInfoOther': - that.saleInsuredPersonInfoOther = [] - break - } - if(that.type == 'fileListIdFrontBeneficiary'){ - that.saleBtnfPersonInfo.forEach((item,index)=>{ - if(item.bnfId == that.bnfId){ - that.bnfInfo[index].fileListIdFrontBeneficiary = [] - } - }) - } - if(that.type == 'fileListIdBackBeneficiary'){ - that.saleBtnfPersonInfo.forEach((item,index)=>{ - if(item.bnfId == that.bnfId){ - that.bnfInfo[index].fileListIdBackBeneficiary = [] - } - }) - } - if(that.type == 'fileLIstImgBeneficiary'){ - that.saleBtnfPersonInfo.forEach((item,index)=>{ - if(item.bnfId == that.bnfId){ - that.bnfInfo[index].fileLIstImgBeneficiary = [] - } - }) - } - this.$toast.clear() - this.$toast(res.resultMessage) - } - }, - (error) => { - switch (that.type) { - case 'fileListIdFront': - that.fileListIdFront = [] - break - case 'fileListIdBack': - that.fileListIdBack = [] - break - case 'fileLIstImg': - that.fileLIstImg = [] - break - case 'fileListBank': - that.fileListBank = [] - break - case 'fileListOther': - that.fileListOther = [] - break - case 'fileListIdFrontInsured': - that.fileListIdFrontInsured = [] - break - case 'fileListIdBackInsured': - that.fileListIdBackInsured = [] - break - case 'fileListBankInsured': - that.fileListBankInsured = [] - break - case 'fileLIstImgInsured': - that.fileLIstImgInsured = [] - break - case 'saleInsuredInfoOther': - that.saleInsuredInfoOther = [] - break - case 'saleInsuredPersonInfoOther': - that.saleInsuredPersonInfoOther = [] - break - } - if(that.type == 'fileListIdFrontBeneficiary'){ + + }else{ + if(that.bnfId){ that.saleBtnfPersonInfo.forEach((item,index)=>{ if(item.bnfId == that.bnfId){ - that.bnfInfo[index].fileListIdFrontBeneficiary = [] + that.bnfInfo[index][that.type]= [] } }) + } else { + that[that.type] = [] } - if(that.type == 'fileListIdBackBeneficiary'){ - that.saleBtnfPersonInfo.forEach((item,index)=>{ - if(item.bnfId == that.bnfId){ - that.bnfInfo[index].fileListIdBackBeneficiary = [] - } - }) - } - if(that.type == 'fileLIstImgBeneficiary'){ - that.saleBtnfPersonInfo.forEach((item,index)=>{ - if(item.bnfId == that.bnfId){ - that.bnfInfo[index].fileLIstImgBeneficiary = [] - } - }) - } - if(that.type == 'fileListIdFrontBeneficiary'){ - that.saleBtnfPersonInfo.forEach((item,index)=>{ - if(item.bnfId == that.bnfId){ - that.bnfInfo[index].fileListIdFrontBeneficiary = [] - } - }) - } - if(that.type == 'fileListIdBackBeneficiary'){ - that.saleBtnfPersonInfo.forEach((item,index)=>{ - if(item.bnfId == that.bnfId){ - that.bnfInfo[index].fileListIdBackBeneficiary = [] - } - }) - } - if(that.type == 'fileLIstImgBeneficiary'){ - that.saleBtnfPersonInfo.forEach((item,index)=>{ - if(item.bnfId == that.bnfId){ - that.bnfInfo[index].fileLIstImgBeneficiary = [] - } - }) - } - this.$toast('网络环境不佳,图片上传失败,请切换移动网络或稍后重试') + that.$toast(res.resultMessage) + return false } - ) + },(error)=>{ + if(that.bnfId){ + that.saleBtnfPersonInfo.forEach((item,index)=>{ + if(item.bnfId == that.bnfId){ + that.bnfInfo[index][that.type]= [] + } + }) + } else { + that[that.type] = [] + } + that.$toast('网络环境不佳,图片上传失败,请切换移动网络或稍后重试') + return false + }) }, beforeNext(isDis) { if (isDis && this.fileListBank.length > 0 && this.fileListIdBack.length > 0 && this.fileListIdFront.length > 0) { @@ -1554,6 +925,12 @@ export default { }, IDCardOCRValite(idType, orderNo, imgPath, cardSide, flag){ + this.$toast.loading({ + duration: 0, // 持续展示 toast + forbidClick: true, // 禁用背景点击 + loadingType: 'spinner', + message: '加载中……', + }) let param = { idType : idType, orderNo : orderNo, @@ -1562,6 +939,7 @@ export default { } //调用身份证OCR识别 IDCardOCR(param).then((res) => { + this.$toast.clear() if(res.result == '0'){ //不校验OCR直接返回 if(res.content == '' || res.content == null){