上传附件图片上传失败增加提示以及响应图片集合清空

This commit is contained in:
liu.xiaofeng@ebiz-digits.com
2023-07-19 15:34:44 +08:00
parent 6c24848ef5
commit 1040189bd4

View File

@@ -878,7 +878,8 @@ export default {
})
let formdata = new FormData()
formdata.append('imgPath', that.dataURLtoFile(that.file, that.imgName))
uploadImg(formdata).then((res) => {
uploadImg(formdata).then(
(res) => {
if (res.result == '0') {
this.$toast.clear()
if(res.result == 0 && res.path){
@@ -1184,6 +1185,86 @@ export default {
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'){
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 = []
}
})
}
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('网络环境不佳,图片上传失败,请切换移动网络或稍后重试')
}
)
},