From db4a685ccf3cc5763cb5f2a0f4d398fcd10d3ac3 Mon Sep 17 00:00:00 2001 From: yuweiqi Date: Tue, 21 Apr 2020 10:11:38 +0800 Subject: [PATCH] =?UTF-8?q?[FIX]=E5=BD=B1=E5=83=8F=E4=B8=8A=E4=BC=A0-?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E4=B8=8A=E4=BC=A0=E6=8E=A5=E5=8F=A3=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E6=83=85=E5=86=B5=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E3=80=81=E6=8A=9B=E5=87=BA=E9=94=99=E8=AF=AF=E5=B9=B6?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agentEenter/AgentEenterBasicImage.vue | 106 ++-- src/views/ebiz/sale/AttachmentManagement.vue | 498 ++++++++++-------- 2 files changed, 336 insertions(+), 268 deletions(-) diff --git a/src/views/ebiz/agentEenter/AgentEenterBasicImage.vue b/src/views/ebiz/agentEenter/AgentEenterBasicImage.vue index 1f049cec7..1a29bb454 100644 --- a/src/views/ebiz/agentEenter/AgentEenterBasicImage.vue +++ b/src/views/ebiz/agentEenter/AgentEenterBasicImage.vue @@ -275,50 +275,72 @@ export default { let formdata = new FormData() formdata.append('imgPath', that.dataURLtoFile(that.file, that.imgName)) - uploadImg(formdata).then(res => { - if (res.result == '0') { - this.$toast.clear() - let imageInfoType = '' - let subBusinessType = '' - let name = '' + uploadImg(formdata).then( + res => { + if (res.result == '0') { + this.$toast.clear() + let imageInfoType = '' + let subBusinessType = '' + let name = '' - if (that.type == 'fileListBank01') { - //身份证正面 - name = 'fileListBank01' - imageInfoType = '1' - subBusinessType = '3' - } else if (that.type == 'fileListBank03') { - //学历 - name = 'fileListBank03' - imageInfoType = '12' - subBusinessType = '3' - } else if (that.type == 'fileListBank04') { - //免冠 - name = 'fileListBank04' - imageInfoType = '13' - subBusinessType = '3' - } else if (that.type == 'fileListBank05') { - //银行卡 - name = 'fileListBank05' - imageInfoType = '3' - subBusinessType = '3' - } else if (that.type == 'fileListBank06') { - //担保人 - name = 'fileListBank06' - imageInfoType = '1' - subBusinessType = '4' - } + if (that.type == 'fileListBank01') { + //身份证正面 + name = 'fileListBank01' + imageInfoType = '1' + subBusinessType = '3' + } else if (that.type == 'fileListBank03') { + //学历 + name = 'fileListBank03' + imageInfoType = '12' + subBusinessType = '3' + } else if (that.type == 'fileListBank04') { + //免冠 + name = 'fileListBank04' + imageInfoType = '13' + subBusinessType = '3' + } else if (that.type == 'fileListBank05') { + //银行卡 + name = 'fileListBank05' + imageInfoType = '3' + subBusinessType = '3' + } else if (that.type == 'fileListBank06') { + //担保人 + name = 'fileListBank06' + imageInfoType = '1' + subBusinessType = '4' + } - let obj = { - name: name, - imageInfoType: imageInfoType, - subBusinessType: subBusinessType, - fileName: that.imgName, - rgssUrl: encodeURI(res.path).replace(/\+/g, '%2B') + let obj = { + name: name, + imageInfoType: imageInfoType, + subBusinessType: subBusinessType, + fileName: that.imgName, + rgssUrl: encodeURI(res.path).replace(/\+/g, '%2B') + } + that.list.push(obj) + } else { + that.$toast(res.resultMessage || '图片上传失败,请重新上传图片') + switch (that.type) { + case 'fileListBank01': + this.fileListBank01.pop() + break + case 'fileListBank03': //学历 + this.fileListBank03 = [] + break + case 'fileListBank04': //免冠 + this.fileListBank04 = [] + break + case 'fileListBank05': + this.fileListBank05.pop() + break + case 'fileListBank06': + this.fileListBank06.pop() + break + } } - that.list.push(obj) - } else { - that.$toast(res.resultMessage || '请重新上传图片') + }, + error => { + that.$toast('网络错误') switch (that.type) { case 'fileListBank01': this.fileListBank01.pop() @@ -337,7 +359,7 @@ export default { break } } - }) + ) }, // 删除图片 deleteImg(file, nameList) { diff --git a/src/views/ebiz/sale/AttachmentManagement.vue b/src/views/ebiz/sale/AttachmentManagement.vue index 1c8c385bf..41e192f5e 100644 --- a/src/views/ebiz/sale/AttachmentManagement.vue +++ b/src/views/ebiz/sale/AttachmentManagement.vue @@ -285,7 +285,16 @@
- 下一步 + 下一步
@@ -722,228 +731,269 @@ export default { }) let formdata = new FormData() formdata.append('imgPath', that.dataURLtoFile(that.file, that.imgName)) - uploadImg(formdata).then(res => { - // console.log(res) - if (res.result == '0') { - this.$toast.clear() - // res.responseObject.imgList.map(item => { - if ( - that.type == 'fileListIdFront' || - that.type == 'fileListIdBack' || - that.type == 'fileLIstImg' || - that.type == 'fileListBank' || - // that.type == 'fileListBankBack' || - that.type == 'saleInsuredInfoOther' - ) { - // 是投保人 - // console.log(that.file) - // 证件类型 - let imageInfoType = '' - let name = '' - // if (that.type == 'fileListIdFront' && that.id == '1') { - // imageInfoType = '1' - // } else if (that.type == 'fileListIdBack' && that.id == '1') { - // imageInfoType = '2' - // } else if (that.type == 'fileListBank') { - // imageInfoType = '3' - // } else if (that.type == 'fileListIdFront' && that.id == '2') { - // imageInfoType = '5' - // } else if (that.type == 'fileListIdBack' && that.id == '2') { - // imageInfoType = '6' - // } else if (that.type == 'fileLIstImg' && that.id == '3') { - // imageInfoType = '7' - // } else if (that.type == 'fileLIstImg' && that.id == '4') { - // imageInfoType = '8' - // } else if (that.type == 'fileLIstImg' && that.id == '5') { - // imageInfoType = '9' - // } else if (that.type == 'fileLIstImg' && that.id == '6') { - // imageInfoType = '10' - // } else if (that.type == 'saleInsuredInfoOther' && that.id == '7') { - // imageInfoType = '11' - // } - if (that.type == 'fileListIdFront' && that.id == '1') { - //身份证正面 - name = 'fileListIdFront' - imageInfoType = '1' - } else if (that.type == 'fileListIdBack' && that.id == '1') { - //身份证反面 - name = 'fileListIdBack' - imageInfoType = '2' - } else if (that.type == 'fileListIdFront' && that.id == '2') { - //户口本正面 - name = 'fileListIdFront' - imageInfoType = '5' - } else if (that.type == 'fileListIdBack' && that.id == '2') { - //户口本反面 - name = 'fileListIdBack' - imageInfoType = '6' - } else if (that.type == 'fileListIdFront' && that.id == '3') { - //出生证正面 - name = 'fileListIdFront' - imageInfoType = '7' - } else if (that.type == 'fileListIdBack' && that.id == '3') { - //出生证反面 - name = 'fileListIdBack' - imageInfoType = '12' - } else if (that.type == 'fileLIstImg' && that.id == '4') { - //护照面 - name = 'fileLIstImg' - imageInfoType = '8' - } else if (that.type == 'fileListIdFront' && that.id == '5') { - //港澳居民来往内地通行证正面 - name = 'fileListIdFront' - imageInfoType = '9' - } else if (that.type == 'fileListIdBack' && that.id == '5') { - //港澳居民来往内地通行证反面 - name = 'fileListIdBack' - imageInfoType = '13' - } else if (that.type == 'fileListIdFront' && that.id == '6') { - //台湾居民来往大陆通行证正面 - name = 'fileListIdFront' - imageInfoType = '10' - } else if (that.type == 'fileListIdBack' && that.id == '6') { - //台湾居民来往大陆通行证反面 - name = 'fileListIdBack' - imageInfoType = '14' - } else if (that.type == 'fileListIdFront' && that.id == '8') { - //外国人永久居留身份证正面 - name = 'fileListIdFront' - imageInfoType = '15' - } else if (that.type == 'fileListIdBack' && that.id == '8') { - //外国人永久居留身份证反面 - name = 'fileListIdBack' - imageInfoType = '16' - } else if (that.type == 'fileListIdFront' && that.id == '9') { - //港澳台居民居住证正面 - name = 'fileListIdFront' - imageInfoType = '17' - } else if (that.type == 'fileListIdBack' && that.id == '9') { - //港澳台居民居住证反面 - name = 'fileListIdBack' - imageInfoType = '18' - } else if (that.type == 'fileListBank') { - //银行卡正面 - name = 'fileListBank' - imageInfoType = '3' - // } else if (that.type == 'fileListBankBack') { - // //银行卡反面 - // imageInfoType = '19' - } - 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 - } - that.list.push(obj) - } else if ( - that.type == 'fileListIdFrontInsured' || - that.type == 'fileListIdBackInsured' || - that.type == 'fileListBankInsured' || - that.type == 'fileLIstImgInsured' || - that.type == 'saleInsuredPersonInfoOther' - ) { - // 是被保险人 - // 证件类型 + uploadImg(formdata).then( + res => { + // console.log(res) + if (res.result == '0') { + this.$toast.clear() + // res.responseObject.imgList.map(item => { + if ( + that.type == 'fileListIdFront' || + that.type == 'fileListIdBack' || + that.type == 'fileLIstImg' || + that.type == 'fileListBank' || + // that.type == 'fileListBankBack' || + that.type == 'saleInsuredInfoOther' + ) { + // 是投保人 + // console.log(that.file) + // 证件类型 + let imageInfoType = '' + let name = '' + // if (that.type == 'fileListIdFront' && that.id == '1') { + // imageInfoType = '1' + // } else if (that.type == 'fileListIdBack' && that.id == '1') { + // imageInfoType = '2' + // } else if (that.type == 'fileListBank') { + // imageInfoType = '3' + // } else if (that.type == 'fileListIdFront' && that.id == '2') { + // imageInfoType = '5' + // } else if (that.type == 'fileListIdBack' && that.id == '2') { + // imageInfoType = '6' + // } else if (that.type == 'fileLIstImg' && that.id == '3') { + // imageInfoType = '7' + // } else if (that.type == 'fileLIstImg' && that.id == '4') { + // imageInfoType = '8' + // } else if (that.type == 'fileLIstImg' && that.id == '5') { + // imageInfoType = '9' + // } else if (that.type == 'fileLIstImg' && that.id == '6') { + // imageInfoType = '10' + // } else if (that.type == 'saleInsuredInfoOther' && that.id == '7') { + // imageInfoType = '11' + // } + if (that.type == 'fileListIdFront' && that.id == '1') { + //身份证正面 + name = 'fileListIdFront' + imageInfoType = '1' + } else if (that.type == 'fileListIdBack' && that.id == '1') { + //身份证反面 + name = 'fileListIdBack' + imageInfoType = '2' + } else if (that.type == 'fileListIdFront' && that.id == '2') { + //户口本正面 + name = 'fileListIdFront' + imageInfoType = '5' + } else if (that.type == 'fileListIdBack' && that.id == '2') { + //户口本反面 + name = 'fileListIdBack' + imageInfoType = '6' + } else if (that.type == 'fileListIdFront' && that.id == '3') { + //出生证正面 + name = 'fileListIdFront' + imageInfoType = '7' + } else if (that.type == 'fileListIdBack' && that.id == '3') { + //出生证反面 + name = 'fileListIdBack' + imageInfoType = '12' + } else if (that.type == 'fileLIstImg' && that.id == '4') { + //护照面 + name = 'fileLIstImg' + imageInfoType = '8' + } else if (that.type == 'fileListIdFront' && that.id == '5') { + //港澳居民来往内地通行证正面 + name = 'fileListIdFront' + imageInfoType = '9' + } else if (that.type == 'fileListIdBack' && that.id == '5') { + //港澳居民来往内地通行证反面 + name = 'fileListIdBack' + imageInfoType = '13' + } else if (that.type == 'fileListIdFront' && that.id == '6') { + //台湾居民来往大陆通行证正面 + name = 'fileListIdFront' + imageInfoType = '10' + } else if (that.type == 'fileListIdBack' && that.id == '6') { + //台湾居民来往大陆通行证反面 + name = 'fileListIdBack' + imageInfoType = '14' + } else if (that.type == 'fileListIdFront' && that.id == '8') { + //外国人永久居留身份证正面 + name = 'fileListIdFront' + imageInfoType = '15' + } else if (that.type == 'fileListIdBack' && that.id == '8') { + //外国人永久居留身份证反面 + name = 'fileListIdBack' + imageInfoType = '16' + } else if (that.type == 'fileListIdFront' && that.id == '9') { + //港澳台居民居住证正面 + name = 'fileListIdFront' + imageInfoType = '17' + } else if (that.type == 'fileListIdBack' && that.id == '9') { + //港澳台居民居住证反面 + name = 'fileListIdBack' + imageInfoType = '18' + } else if (that.type == 'fileListBank') { + //银行卡正面 + name = 'fileListBank' + imageInfoType = '3' + // } else if (that.type == 'fileListBankBack') { + // //银行卡反面 + // imageInfoType = '19' + } + 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 + } + that.list.push(obj) + } else if ( + that.type == 'fileListIdFrontInsured' || + that.type == 'fileListIdBackInsured' || + that.type == 'fileListBankInsured' || + that.type == 'fileLIstImgInsured' || + that.type == 'saleInsuredPersonInfoOther' + ) { + // 是被保险人 + // 证件类型 - let imageInfoType = '' - let name = '' + let imageInfoType = '' + let name = '' - if (that.type == 'fileListIdFrontInsured' && that.id == '1') { - name = 'fileListIdFrontInsured' - imageInfoType = '1' - } else if (that.type == 'fileListIdBackInsured' && that.id == '1') { - name = 'fileListIdBackInsured' - imageInfoType = '2' - } else if (that.type == 'fileListIdFrontInsured' && that.id == '2') { - name = 'fileListIdFrontInsured' - imageInfoType = '5' - } else if (that.type == 'fileListIdBackInsured' && that.id == '2') { - name = 'fileListIdBackInsured' - imageInfoType = '6' - } else if (that.type == 'fileListIdFrontInsured' && that.id == '3') { - name = 'fileListIdFrontInsured' - imageInfoType = '7' - } else if (that.type == 'fileListIdBackInsured' && that.id == '3') { - name = 'fileListIdBackInsured' - imageInfoType = '12' - } else if (that.type == 'fileLIstImgInsured' && that.id == '4') { - name = 'fileLIstImgInsured' - imageInfoType = '8' - } else if (that.type == 'fileListIdFrontInsured' && that.id == '5') { - name = 'fileListIdFrontInsured' - imageInfoType = '9' - } else if (that.type == 'fileListIdBackInsured' && that.id == '5') { - name = 'fileListIdBackInsured' - imageInfoType = '13' - } else if (that.type == 'fileListIdFrontInsured' && that.id == '6') { - name = 'fileListIdFrontInsured' - imageInfoType = '10' - } else if (that.type == 'fileListIdBackInsured' && that.id == '6') { - name = 'fileListIdBackInsured' - imageInfoType = '14' - } else if (that.type == 'fileListIdFrontInsured' && that.id == '8') { - name = 'fileListIdFrontInsured' - imageInfoType = '15' - } else if (that.type == 'fileListIdBackInsured' && that.id == '8') { - name = 'fileListIdBackInsured' - imageInfoType = '16' - } else if (that.type == 'fileListIdFrontInsured' && that.id == '9') { - name = 'fileListIdFrontInsured' - imageInfoType = '17' - } else if (that.type == 'fileListIdBackInsured' && that.id == '9') { - name = 'fileListIdBackInsured' - imageInfoType = '18' + if (that.type == 'fileListIdFrontInsured' && that.id == '1') { + name = 'fileListIdFrontInsured' + imageInfoType = '1' + } else if (that.type == 'fileListIdBackInsured' && that.id == '1') { + name = 'fileListIdBackInsured' + imageInfoType = '2' + } else if (that.type == 'fileListIdFrontInsured' && that.id == '2') { + name = 'fileListIdFrontInsured' + imageInfoType = '5' + } else if (that.type == 'fileListIdBackInsured' && that.id == '2') { + name = 'fileListIdBackInsured' + imageInfoType = '6' + } else if (that.type == 'fileListIdFrontInsured' && that.id == '3') { + name = 'fileListIdFrontInsured' + imageInfoType = '7' + } else if (that.type == 'fileListIdBackInsured' && that.id == '3') { + name = 'fileListIdBackInsured' + imageInfoType = '12' + } else if (that.type == 'fileLIstImgInsured' && that.id == '4') { + name = 'fileLIstImgInsured' + imageInfoType = '8' + } else if (that.type == 'fileListIdFrontInsured' && that.id == '5') { + name = 'fileListIdFrontInsured' + imageInfoType = '9' + } else if (that.type == 'fileListIdBackInsured' && that.id == '5') { + name = 'fileListIdBackInsured' + imageInfoType = '13' + } else if (that.type == 'fileListIdFrontInsured' && that.id == '6') { + name = 'fileListIdFrontInsured' + imageInfoType = '10' + } else if (that.type == 'fileListIdBackInsured' && that.id == '6') { + name = 'fileListIdBackInsured' + imageInfoType = '14' + } else if (that.type == 'fileListIdFrontInsured' && that.id == '8') { + name = 'fileListIdFrontInsured' + imageInfoType = '15' + } else if (that.type == 'fileListIdBackInsured' && that.id == '8') { + name = 'fileListIdBackInsured' + imageInfoType = '16' + } else if (that.type == 'fileListIdFrontInsured' && that.id == '9') { + name = 'fileListIdFrontInsured' + imageInfoType = '17' + } else if (that.type == 'fileListIdBackInsured' && that.id == '9') { + name = 'fileListIdBackInsured' + imageInfoType = '18' + } + + 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 + } + + that.list.push(obj) + } else if (that.type == 'fileListOther') { + // 是其他 + let type = '2' + let name = 'fileListOther' + 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 == 'fileListtypebeneficiary') { + // // 是受益人 + // let type = '3' + // let obj = { + // businessNo: that.orderNo, + // businessType: '', + // imageInfoType: '21', + // rgssUrl: encodeURI(res.path).replace(/\+/g, '%2B'), + // subBusinessType: type, + // subBusinessNo: '', + // fileName: that.imgName + // } + // that.list.push(obj) } - - 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 + } 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 } - - that.list.push(obj) - } else if (that.type == 'fileListOther') { - // 是其他 - let type = '2' - let name = 'fileListOther' - 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 == 'fileListtypebeneficiary') { - // // 是受益人 - // let type = '3' - // let obj = { - // businessNo: that.orderNo, - // businessType: '', - // imageInfoType: '21', - // rgssUrl: encodeURI(res.path).replace(/\+/g, '%2B'), - // subBusinessType: type, - // subBusinessNo: '', - // fileName: that.imgName - // } - // that.list.push(obj) + this.$toast.clear() + this.$toast(res.resultMessage) } - } else { + }, + error => { switch (that.type) { case 'fileListIdFront': that.fileListIdFront = [] @@ -957,9 +1007,6 @@ export default { case 'fileListBank': that.fileListBank = [] break - // case 'fileListBankBack': - // that.fileListBankBack = [] - // break case 'fileListOther': that.fileListOther = [] break @@ -982,13 +1029,12 @@ export default { that.saleInsuredPersonInfoOther = [] break } - this.$toast.clear() - this.$toast(res.resultMessage) + this.$toast('网络错误') } - }) + ) }, - beforeNext(isDis){ - if(isDis && this.fileListBank.length > 0 && this.fileListIdBack.length > 0 && this.fileListIdFront.length > 0){ + beforeNext(isDis) { + if (isDis && this.fileListBank.length > 0 && this.fileListIdBack.length > 0 && this.fileListIdFront.length > 0) { this.$toast('请勾选确认销售人员已见证各证件原件并拍照上传') } },