上传附件页面关于图片删除逻辑代码修改

This commit is contained in:
liu.xiaofeng@ebiz-digits.com
2023-07-20 10:36:04 +08:00
parent 1040189bd4
commit 55f430d9d2

View File

@@ -9,15 +9,7 @@
<van-field required label="银行卡账户" disabled />
</van-cell-group>
<div @click="test('fileListBank', saleInsuredInfo.idType)">
<van-uploader
name="fileListBank"
v-model="fileListBank"
:after-read="afterRead"
@delete="deleteImg"
:before-delete="beforeDelete"
class="mt10 ml20"
:max-count="1"
/>
<van-uploader name="fileListBank" v-model="fileListBank" :after-read="afterRead" @delete="deleteImg" :before-delete="beforeDelete" class="mt10 ml20" :max-count="1"/>
</div>
</div>
<div v-else>
@@ -35,29 +27,13 @@
<van-field required :label="item.id == '2' ? `${item.text}户主页` : `${item.text}正面`" disabled />
</van-cell-group>
<div @click="test('fileListIdFront', saleInsuredInfo.idType)" class="flex align-items-e">
<van-uploader
name="fileListIdFront"
v-model="fileListIdFront"
:after-read="afterRead"
:before-delete="beforeDelete"
class="mt10 ml20"
:max-count="1"
@delete="deleteImg"
/>
<van-uploader name="fileListIdFront" v-model="fileListIdFront" :after-read="afterRead" :before-delete="beforeDelete" class="mt10 ml20" :max-count="1" @delete="deleteImg"/>
</div>
<van-cell-group>
<van-field required :label="item.id == '2' ? `${item.text}本人页` : `${item.text}反面`" disabled />
</van-cell-group>
<div @click="test('fileListIdBack', saleInsuredInfo.idType)">
<van-uploader
name="fileListIdBack"
v-model="fileListIdBack"
:after-read="afterRead"
@delete="deleteImg"
:before-delete="beforeDelete"
class="mt10 ml20"
:max-count="1"
/>
<van-uploader name="fileListIdBack" v-model="fileListIdBack" :after-read="afterRead" @delete="deleteImg" :before-delete="beforeDelete" class="mt10 ml20" :max-count="1"/>
</div>
</div>
<div v-if="item.id == '4'">
@@ -65,15 +41,7 @@
<van-field required :label="`${item.text}头像面`" disabled />
</van-cell-group>
<div @click="test('fileLIstImg', saleInsuredInfo.idType)">
<van-uploader
name="fileLIstImg"
v-model="fileLIstImg"
:after-read="afterRead"
@delete="deleteImg"
:before-delete="beforeDelete"
class="mt10 ml20"
:max-count="1"
/>
<van-uploader name="fileLIstImg" v-model="fileLIstImg" :after-read="afterRead" @delete="deleteImg" :before-delete="beforeDelete" class="mt10 ml20" :max-count="1"/>
</div>
</div>
</div>
@@ -82,29 +50,13 @@
<van-field required label="银行卡正面" disabled />
</van-cell-group>
<div @click="test('fileListBank', saleInsuredInfo.idType)">
<van-uploader
name="fileListBank"
v-model="fileListBank"
:after-read="afterRead"
@delete="deleteImg"
:before-delete="beforeDelete"
class="mt10 ml20"
:max-count="1"
/>
<van-uploader name="fileListBank" v-model="fileListBank" :after-read="afterRead" @delete="deleteImg" :before-delete="beforeDelete" class="mt10 ml20" :max-count="1"/>
</div>
<van-cell-group v-if="isNotify">
<van-field label="健康告知异常类资料" disabled />
</van-cell-group>
<div v-if="isNotify" @click="test('fileListNotify', saleInsuredInfo.idType)">
<van-uploader
name="fileListNotify"
v-model="fileListNotify"
:after-read="afterRead"
@delete="deleteImg"
:before-delete="beforeDelete"
class="mt10 ml20"
:max-count="20"
/>
<van-uploader name="fileListNotify" v-model="fileListNotify" :after-read="afterRead" @delete="deleteImg" :before-delete="beforeDelete" class="mt10 ml20" :max-count="20"/>
</div>
</div>
</div>
@@ -123,29 +75,13 @@
<van-field required :label="item.id == '2' ? `${item.text}户主页` : `${item.text}正面`" disabled />
</van-cell-group>
<div @click="test('fileListIdFrontInsured', saleInsuredPersonInfo.idType)">
<van-uploader
name="fileListIdFrontInsured"
v-model="fileListIdFrontInsured"
:after-read="afterRead"
:before-delete="beforeDelete"
@delete="deleteImg"
class="mt10 ml20"
:max-count="1"
/>
<van-uploader name="fileListIdFrontInsured" v-model="fileListIdFrontInsured" :after-read="afterRead" :before-delete="beforeDelete" @delete="deleteImg" class="mt10 ml20" :max-count="1"/>
</div>
<van-cell-group>
<van-field required :label="item.id == '2' ? `${item.text}本人页` : `${item.text}反面`" disabled />
</van-cell-group>
<div @click="test('fileListIdBackInsured', saleInsuredPersonInfo.idType)">
<van-uploader
name="fileListIdBackInsured"
v-model="fileListIdBackInsured"
:after-read="afterRead"
:before-delete="beforeDelete"
@delete="deleteImg"
class="mt10 ml20"
:max-count="1"
/>
<van-uploader name="fileListIdBackInsured" v-model="fileListIdBackInsured" :after-read="afterRead" :before-delete="beforeDelete" @delete="deleteImg" class="mt10 ml20" :max-count="1"/>
</div>
</div>
<div v-if="item.id == '4'">
@@ -153,15 +89,7 @@
<van-field required :label="`${item.text}头像页`" disabled />
</van-cell-group>
<div @click="test('fileLIstImgInsured', saleInsuredPersonInfo.idType)">
<van-uploader
name="fileLIstImgInsured"
v-model="fileLIstImgInsured"
:after-read="afterRead"
:before-delete="beforeDelete"
@delete="deleteImg"
class="mt10 ml20"
:max-count="1"
/>
<van-uploader name="fileLIstImgInsured" v-model="fileLIstImgInsured" :after-read="afterRead" :before-delete="beforeDelete" @delete="deleteImg" class="mt10 ml20" :max-count="1"/>
</div>
</div>
</div>
@@ -170,15 +98,7 @@
<van-field label="健康告知异常类资料" disabled />
</van-cell-group>
<div v-if="isNotifyInsured" @click="test('fileListNotifyInsured', saleInsuredInfo.idType)">
<van-uploader
name="fileListNotifyInsured"
v-model="fileListNotifyInsured"
:after-read="afterRead"
@delete="deleteImg"
:before-delete="beforeDelete"
class="mt10 ml20"
:max-count="20"
/>
<van-uploader name="fileListNotifyInsured" v-model="fileListNotifyInsured" :after-read="afterRead" @delete="deleteImg" :before-delete="beforeDelete" class="mt10 ml20" :max-count="20"/>
</div>
</div>
</div>
@@ -198,29 +118,13 @@
<van-field required :label="item.id == '2' ? `${item01.name}+${item.text}户主页` : `${item01.name}+${item.text}正面`" disabled />
</van-cell-group>
<div @click="test('fileListIdFrontBeneficiary', item01.idType, item01.bnfId)">
<van-uploader
:name="'fileListIdFrontBeneficiary'+index01"
v-model="bnfInfo[index01].fileListIdFrontBeneficiary"
:after-read="afterRead"
:before-delete="beforeDelete"
@delete="deleteImg"
class="mt10 ml20"
:max-count="1"
/>
<van-uploader :name="'fileListIdFrontBeneficiary'+index01" v-model="bnfInfo[index01].fileListIdFrontBeneficiary" :after-read="afterRead" :before-delete="beforeDelete" @delete="deleteImg" class="mt10 ml20" :max-count="1"/>
</div>
<van-cell-group>
<van-field required :label="item.id == '2' ? `${item01.name}+${item.text}本人页` : `${item01.name}+${item.text}反面`" disabled />
</van-cell-group>
<div @click="test('fileListIdBackBeneficiary', item01.idType, item01.bnfId)">
<van-uploader
:name="'fileListIdBackBeneficiary'+index01"
v-model="bnfInfo[index01].fileListIdBackBeneficiary"
:after-read="afterRead"
:before-delete="beforeDelete"
@delete="deleteImg"
class="mt10 ml20"
:max-count="1"
/>
<van-uploader :name="'fileListIdBackBeneficiary'+index01" v-model="bnfInfo[index01].fileListIdBackBeneficiary" :after-read="afterRead" :before-delete="beforeDelete" @delete="deleteImg" class="mt10 ml20" :max-count="1"/>
</div>
</div>
<div v-if="item.id == '4'">
@@ -228,15 +132,7 @@
<van-field required :label="`${item01.name}+${item.text}头像页`" disabled />
</van-cell-group>
<div @click="test('fileLIstImgBeneficiary', item01.idType, item01.bnfId)">
<van-uploader
:name="'fileLIstImgBeneficiary'+index01"
v-model="bnfInfo[index01].fileLIstImgBeneficiary"
:after-read="afterRead"
:before-delete="beforeDelete"
@delete="deleteImg"
class="mt10 ml20"
:max-count="1"
/>
<van-uploader :name="'fileLIstImgBeneficiary'+index01" v-model="bnfInfo[index01].fileLIstImgBeneficiary" :after-read="afterRead" :before-delete="beforeDelete" @delete="deleteImg" class="mt10 ml20" :max-count="1"/>
</div>
</div>
</div>
@@ -251,30 +147,23 @@
</van-radio-group>
</div>
<div class="bg-white bottom-btn">
<van-button
type="danger"
class="attachmentManagement-next"
size="large"
:disabled="!(isDisabled == false && isDisabledBnf == false)"
@click="next"
@touchstart="beforeNext(isDisabled)"
v-no-more-click="1000"
>下一步</van-button
>
<van-button type="danger" class="attachmentManagement-next" size="large" :disabled="!(isDisabled == false && isDisabledBnf == false)" @click="next" @touchstart="beforeNext(isDisabled)" v-no-more-click="1000">
下一步
</van-button>
</div>
</div>
</template>
<script>
import DataDictionary from '@/assets/js/utils/data-dictionary'
import { Cell, CellGroup, Field, Uploader, RadioGroup, Radio, Dialog, Picker, Popup } from 'vant'
import { uploadImg, saveInformation, getOrderDetail, IDCardOCR } from '@/api/ebiz/sale/sale'
import config from '@/config'
import IndexBar from '@/components/ebiz/sale/IndexBar'
import utils from '../../../assets/js/business-common'
import DataDictionary from '@/assets/js/utils/data-dictionary'
import { Cell, CellGroup, Field, Uploader, RadioGroup, Radio, Dialog, Picker, Popup } from 'vant'
import { uploadImg, saveInformation, getOrderDetail, IDCardOCR } from '@/api/ebiz/sale/sale'
import config from '@/config'
import IndexBar from '@/components/ebiz/sale/IndexBar'
import utils from '../../../assets/js/business-common'
export default {
export default {
data() {
return {
isNotify: false, //是否有异常的健康告知
@@ -662,7 +551,6 @@ export default {
},
// 删除图片前
beforeDelete(file, detail) {
let that = this
Dialog.confirm({
title: '提示',
message: '您确定要删除吗',
@@ -679,8 +567,6 @@ export default {
} else if (detail.name == 'fileListBank') {
this.fileListBank = []
this.deleteImg(file, 'fileListBank')
// } else if (detail.name == 'fileListBankBack') {
// this.fileListBankBack = []
} else if (detail.name == 'fileListIdFrontInsured') {
this.fileListIdFrontInsured = []
this.deleteImg(file, 'fileListIdFrontInsured')
@@ -693,26 +579,12 @@ export default {
} else if (detail.name == 'fileLIstImgInsured') {
this.fileLIstImgInsured = []
this.deleteImg(file, 'fileLIstImgInsured')
// } else if (detail.name == 'fileListOtherOne') {
// this.fileListOtherOne = []
// } else if (detail.name == 'fileListOtherTwo') {
// this.fileListOtherTwo = []
// } else if (detail.name == 'fileListOtherThree') {
// this.fileListOtherThree = []
} else if (detail.name == 'saleInsuredInfoOther') {
this.saleInsuredInfoOther = []
this.deleteImg(file, 'saleInsuredInfoOther')
} else if (detail.name == 'saleInsuredPersonInfoOther') {
this.saleInsuredPersonInfoOther = []
this.deleteImg(file, 'saleInsuredPersonInfoOther')
// } else if (detail.name == 'fileListtypebeneficiary') {
// that.fileListtypebeneficiary.map((item, index, array) => {
// if (item.content == file.content) {
// array.splice(index, 1)
// } else {
// return
// }
// })
} else if (detail.name.indexOf('fileListIdFrontBeneficiary') != -1) {
//单独处理受益人影像删除通过name值查询到当前收益指的索引值下标操作data数据中定义的数据
let detailIndex = detail.name.substring(26,detail.name.length)
@@ -819,22 +691,19 @@ export default {
// 删除图片
deleteImg(file, nameList) {
let that = this
that.list.map((item, index, array) => {
// if (item.fileName.indexOf(file.file.name) == -1) {
// return
// } else {
// array.splice(index, 1)
// }
debugger
that.list.forEach((item, index) => {
if (item.fileName == file.name && nameList == item.name) {
array.splice(index, 1)
that.list.splice(index, 1)
}
//单独处理受益人影像删除通过bnfId查询到删除某条数据
if(nameList == 'fileListIdFrontBeneficiary' || nameList == 'fileListIdBackBeneficiary' || nameList == 'fileLIstImgBeneficiary'){
if (item.fileName == file.name && item.subBusinessNo == that.bnfId) {
array.splice(index, 1)
that.list.splice(index, 1)
}
}
})
debugger
},
afterRead(file) {
let that = this
@@ -883,40 +752,18 @@ export default {
if (res.result == '0') {
this.$toast.clear()
if(res.result == 0 && res.path){
let imgPath = res.path
//只有身份证件才进行ocr校验
if(that.type == 'fileListIdFront' ||
that.type == 'fileListIdBack' ||
that.type == 'fileListIdFrontInsured' ||
that.type == 'fileListIdBackInsured' ||
that.type == 'fileListIdFrontBeneficiary'||
that.type == 'fileListIdBackBeneficiary'){
if(that.id == '1' && that.type == 'fileListIdFront'){
//投保人身份证正面
this.IDCardOCRValite(that.id, this.orderNo, imgPath, 'FRONT', 'fileListIdFront')
}else if(that.id == '1' && that.type == 'fileListIdBack'){
//投保人身份证反面
this.IDCardOCRValite(that.id, this.orderNo, imgPath, 'BACK', 'fileListIdBack')
}else if(that.id == '1' && that.type == 'fileListIdFrontInsured'){
//被保人身份证正面
this.IDCardOCRValite(that.id, this.orderNo, imgPath, 'FRONT', 'fileListIdFrontInsured')
}else if(that.id == '1' && that.type == 'fileListIdBackInsured'){
//被保人身份证反面
this.IDCardOCRValite(that.id, this.orderNo, imgPath, 'BACK', 'fileListIdBackInsured')
}else if(that.id == '1' && that.type == 'fileListIdFrontBeneficiary'){
//受益人身份证正面
this.IDCardOCRValite(that.id, this.orderNo, imgPath, 'FRONT', 'fileListIdFrontBeneficiary')
}else if(that.id == '1' && that.type == 'fileListIdBackBeneficiary'){
//受益人身份证反面
this.IDCardOCRValite(that.id, this.orderNo, imgPath, 'BACK', 'fileListIdBackBeneficiary')
}
}
if (that.type == 'fileLIstImg' || that.type == 'fileListBank' || that.type == 'fileListNotify' || that.type == 'saleInsuredInfoOther') {
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 == '2') {
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'
@@ -976,6 +823,7 @@ export default {
name = 'fileListNotify'
imageInfoType = '24'
}
this.imageType = imageInfoType
let obj = {
name: name,
businessNo: that.orderNo,
@@ -986,27 +834,20 @@ export default {
subBusinessNo: that.saleInsuredInfo.appntId,
fileName: that.imgName,
}
if(that.list && that.list.length != 0){
let thisIndex = ''
let thisFlag = false
that.list.forEach((item,index)=>{
if(item.imageInfoType == imageInfoType){
thisFlag = true
thisIndex = index
}
})
if(thisFlag){
that.list.slice(thisIndex,1)
}
}
that.list.push(obj)
}
else if (that.type == 'fileListBankInsured' || that.type == 'fileLIstImgInsured' || that.type == 'fileListNotifyInsured' || that.type == 'saleInsuredPersonInfoOther') {
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 == '2') {
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') {
@@ -1049,7 +890,7 @@ export default {
name = 'fileListNotifyInsured'
imageInfoType = '24'
}
this.imageType = imageInfoType
let obj = {
name: name,
businessNo: that.orderNo,
@@ -1060,29 +901,21 @@ export default {
subBusinessNo: that.saleInsuredPersonInfo.insuredId,
fileName: that.imgName,
}
this.imageType = imageInfoType
if(that.list && that.list.length != 0){
let thisIndex = ''
let thisFlag = false
that.list.forEach((item,index)=>{
if(item.imageInfoType == imageInfoType){
thisFlag = true
thisIndex = index
}
})
if(thisFlag){
that.list.slice(thisIndex,1)
}
}
that.list.push(obj)
}
else if (that.type == 'fileLIstImgBeneficiary') {
else if (that.type == 'fileListIdFrontBeneficiary' || that.type == 'fileListIdBackBeneficiary' || that.type == 'fileLIstImgBeneficiary') {
// 是收益人
// 证件类型
let imageInfoType = ''
let name = ''
if (that.type == 'fileListIdFrontBeneficiary' && that.id == '2') {
if (that.type == 'fileListIdFrontBeneficiary' && that.id == '1') {
name = 'fileListIdFrontBeneficiary'
imageInfoType = '1'
} else if (that.type == 'fileListIdBackBeneficiary' && that.id == '1') {
name = 'fileListIdBackBeneficiary'
imageInfoType = '2'
} else if (that.type == 'fileListIdFrontBeneficiary' && that.id == '2') {
name = 'fileListIdFrontBeneficiary'
imageInfoType = '5'
} else if (that.type == 'fileListIdBackBeneficiary' && that.id == '2') {
@@ -1122,7 +955,7 @@ export default {
name = 'fileListIdBackBeneficiary'
imageInfoType = '18'
}
this.imageType = imageInfoType
let obj = {
name: name,
businessNo: that.orderNo,
@@ -1133,20 +966,6 @@ export default {
subBusinessNo: that.bnfId,
fileName: that.imgName,
}
this.imageType = imageInfoType
if(that.list && that.list.length != 0){
let thisIndex = ''
let thisFlag = false
that.list.forEach((item,index)=>{
if(item.imageInfoType == imageInfoType){
thisFlag = true
thisIndex = index
}
})
if(thisFlag){
that.list.slice(thisIndex,1)
}
}
that.list.push(obj)
}
else if (that.type == 'fileListOther') {
@@ -1163,25 +982,155 @@ export default {
subBusinessNo: '',
fileName: that.imgName,
}
if(that.list && that.list.length != 0){
let thisIndex = ''
let thisFlag = false
that.list.forEach((item,index)=>{
if(item.imageInfoType == imageInfoType){
thisFlag = true
thisIndex = index
}
})
if(thisFlag){
that.list.slice(thisIndex,1)
}
}
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()
}
}
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)
}
@@ -1283,78 +1232,21 @@ export default {
//调用身份证OCR识别
IDCardOCR(param).then((res) => {
if(res.result == '0'){
//如果识别的身份证信息与填写的不一致,进行提示
let isFlag = true;
let imageInfoType = ''
let subBusinessNo = ''
//不校验OCR直接返回
if(res.content == '' || res.content == null){
if(flag == 'fileListIdFront'){
imageInfoType = '1'
subBusinessNo = this.saleInsuredInfo.appntId
}
else if(flag == 'fileListIdBack'){
imageInfoType = '2'
subBusinessNo = this.saleInsuredInfo.appntId
}
else if(flag == 'fileListIdFrontInsured'){
imageInfoType = '1'
subBusinessNo = this.saleInsuredPersonInfo.insuredId
}
else if(flag == 'fileListIdBackInsured'){
imageInfoType = '2'
subBusinessNo = this.saleInsuredPersonInfo.insuredId
}
else if(flag == 'fileListIdFrontBeneficiary'){
imageInfoType = '1'
subBusinessNo = this.bnfId
}
else if(flag == 'fileListIdBackBeneficiary'){
imageInfoType = '2'
subBusinessNo = this.bnfId
}
let obj = {
name: flag,
businessNo: this.orderNo,
businessType: '',
imageInfoType: imageInfoType,
rgssUrl: encodeURI(imgPath).replace(/\+/g, '%2B'),
subBusinessType: '0',
subBusinessNo: subBusinessNo,
fileName: this.imgName,
}
this.imageType = imageInfoType
if(this.list && this.list.length != 0){
let thisIndex = ''
let thisFlag = false
this.list.forEach((item,index)=>{
if(item.imageInfoType == imageInfoType){
thisFlag = true
thisIndex = index
}
})
if(thisFlag){
this.list.slice(thisIndex,1)
}
}
this.list.push(obj)
return
}
//如果识别的身份证信息与填写的不一致,进行提示
let isFlag = true;
//投保人身份证正面
if(flag == 'fileListIdFront'){
imageInfoType = '1'
subBusinessNo = this.saleInsuredInfo.appntId
if('appentFront' == flag){
this.saleInsuredInfo.sex = this.saleInsuredInfo.sex == '0'? '男' :'女'
res.content.birth = utils.formatDate(Date.parse(res.content.birth), 'yyyy-MM-dd')
if(this.saleInsuredInfo.name != res.content.name || this.saleInsuredInfo.sex != res.content.sex || this.saleInsuredInfo.birthday != res.content.birth || this.saleInsuredInfo.idNo != res.content.idNum){
isFlag = false;
this.fileListIdFront = []
}
}
else if(flag == 'fileListIdBack'){
imageInfoType = '2'
subBusinessNo = this.saleInsuredInfo.appntId
else if('appentBack' == flag){
//投保人身份证反面
//"ValidDate": "2010.07.21-2020.07.21"
//"ValidDate": "2010.07.21-长期"
@@ -1363,31 +1255,22 @@ export default {
res.content.validDate = '9999-12-31'
if(this.saleInsuredInfo.certiexpiredate != res.content.validDate){
isFlag = false;
this.fileListIdBack = []
}
}else{
res.content.validDate = res.content.validDate.split('-')[1].replace(/\./g,'-')
if(this.saleInsuredInfo.certiexpiredate != res.content.validDate){
isFlag = false;
this.fileListIdBack = []
}
}
}
else if(flag == 'fileListIdFrontInsured'){
imageInfoType = '1'
subBusinessNo = this.saleInsuredPersonInfo.insuredId
}else if('insuredFront' == flag){
this.saleInsuredPersonInfo.sex = this.saleInsuredPersonInfo.sex == '0'? '男' :'女'
res.content.birth = utils.formatDate(Date.parse(res.content.birth), 'yyyy-MM-dd')
//被保人身份证正面
if(this.saleInsuredPersonInfo.name != res.content.name || this.saleInsuredPersonInfo.sex != res.content.sex || this.saleInsuredPersonInfo.birthday != res.content.birth || this.saleInsuredPersonInfo.idNo != res.content.idNum){
isFlag = false;
this.fileListIdFrontInsured = []
}
}
else if(flag == 'fileListIdBackInsured'){
imageInfoType = '2'
subBusinessNo = this.saleInsuredPersonInfo.insuredId
}else if('insuredBack' == flag){
//被保人身份证反面
//"ValidDate": "2010.07.21-2020.07.21"
//"ValidDate": "2010.07.21-长期"
@@ -1397,30 +1280,21 @@ export default {
res.content.validDate = '9999-12-31'
if(this.saleInsuredPersonInfo.certiexpiredate != res.content.validDate){
isFlag = false;
this.fileListIdBackInsured = []
}
}else{
res.content.validDate = res.content.validDate.split('-')[1].replace(/\./g,'-')
if(this.saleInsuredPersonInfo.certiexpiredate != res.content.validDate){
isFlag = false;
this.fileListIdBackInsured = []
}
}
}
else if(flag == 'fileListIdFrontBeneficiary'){
imageInfoType = '1'
subBusinessNo = this.bnfId
}else if('beneficiaryFront' == flag){
this.saleBtnfPersonInfo.sex = this.saleBtnfPersonInfo.sex == '0'? '男' :'女'
res.content.birth = utils.formatDate(Date.parse(res.content.birth), 'yyyy-MM-dd')
//受益人身份证正面
if(this.saleBtnfPersonInfo.name != res.content.name || this.saleBtnfPersonInfo.sex != res.content.sex || this.saleBtnfPersonInfo.birthday != res.content.birth || this.saleBtnfPersonInfo.idNo != res.content.idNum){
isFlag = false;
this.fileListIdFrontBeneficiary = []
}
}
else if(flag == 'fileListIdBackBeneficiary'){
imageInfoType = '2'
subBusinessNo = this.bnfId
}else if('beneficiaryBack' == flag){
//受益人身份证反面
//"ValidDate": "2010.07.21-2020.07.21"
//"ValidDate": "2010.07.21-长期"
@@ -1430,45 +1304,17 @@ export default {
res.content.validDate = '9999-12-31'
if(this.saleBtnfPersonInfo.certiexpiredate != res.content.validDate){
isFlag = false;
this.fileListIdBackBeneficiary = []
}
}else{
res.content.validDate = res.content.validDate.split('-')[1].replace(/\./g,'-')
if(this.saleBtnfPersonInfo.certiexpiredate != res.content.validDate){
isFlag = false;
this.fileListIdBackBeneficiary = []
}
}
}
if(!isFlag){
this.$toast.clear()
this.$toast("上传的证件信息与录入的证件信息不一致,请核对修改并重新上传。")
}else{
let obj = {
name: flag,
businessNo: this.orderNo,
businessType: '',
imageInfoType: imageInfoType,
rgssUrl: encodeURI(imgPath).replace(/\+/g, '%2B'),
subBusinessType: '0',
subBusinessNo: subBusinessNo,
fileName: this.imgName,
}
this.imageType = imageInfoType
if(this.list && this.list.length != 0){
let thisIndex = ''
let thisFlag = false
this.list.forEach((item,index)=>{
if(item.imageInfoType == imageInfoType){
thisFlag = true
thisIndex = index
}
})
if(thisFlag){
this.list.slice(thisIndex,1)
}
}
this.list.push(obj)
}
}else{
this.$toast.clear()
@@ -1495,6 +1341,8 @@ export default {
},
orderType: that.changeCard ? 'MEDIANEW_ORDER' : 'MEDIA_ORDER',
}
console.log(data)
return
saveInformation(data).then((res) => {
if (res.result == '0') {
this.$toast.clear()
@@ -1753,26 +1601,26 @@ export default {
[Popup.name]: Popup,
[IndexBar.name]: IndexBar,
},
}
}
</script>
<style lang="scss" scoped>
@import '@/assets/sass/variables.scss';
@import '@/assets/sass/variables.scss';
.attachmentManagement-block {
.attachmentManagement-block {
width: 4px;
height: 15px;
background: #d6211a;
margin-right: 5px;
}
}
.attachmentManagement-next {
.attachmentManagement-next {
width: 100%;
}
/deep/ .van-hairline-unset--top-bottom::after {
}
/deep/ .van-hairline-unset--top-bottom::after {
border: none;
}
.redRadioCheckbox {
}
.redRadioCheckbox {
overflow: hidden;
}
}
</style>