Merge branch 'hotfix/【跟爱易保一起上】bug_GFRS-1053影像信息上传-上传图片接口请求错误时,前端未校验住' into release/0422

This commit is contained in:
yuweiqi
2020-04-22 13:43:27 +08:00
2 changed files with 352 additions and 266 deletions

View File

@@ -275,7 +275,8 @@ export default {
let formdata = new FormData() let formdata = new FormData()
formdata.append('imgPath', that.dataURLtoFile(that.file, that.imgName)) formdata.append('imgPath', that.dataURLtoFile(that.file, that.imgName))
uploadImg(formdata).then(res => { uploadImg(formdata).then(
res => {
if (res.result == '0') { if (res.result == '0') {
this.$toast.clear() this.$toast.clear()
let imageInfoType = '' let imageInfoType = ''
@@ -317,8 +318,47 @@ export default {
rgssUrl: encodeURI(res.path).replace(/\+/g, '%2B') rgssUrl: encodeURI(res.path).replace(/\+/g, '%2B')
} }
that.list.push(obj) that.list.push(obj)
} else {
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
} }
}) }
},
error => {
that.$toast('网络环境不佳,图片上传失败,请切换移动网络或稍后重试')
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
}
}
)
}, },
// 删除图片 // 删除图片
deleteImg(file, nameList) { deleteImg(file, nameList) {

View File

@@ -285,7 +285,16 @@
</van-radio-group> </van-radio-group>
</div> </div>
<div class="bg-white bottom-btn"> <div class="bg-white bottom-btn">
<van-button type="danger" class="attachmentManagement-next" size="large" :disabled="isDisabled" @click="next" @touchstart="beforeNext(isDisabled)" v-no-more-click="1000">下一步</van-button> <van-button
type="danger"
class="attachmentManagement-next"
size="large"
:disabled="isDisabled"
@click="next"
@touchstart="beforeNext(isDisabled)"
v-no-more-click="1000"
>下一步</van-button
>
</div> </div>
</div> </div>
</template> </template>
@@ -722,7 +731,8 @@ export default {
}) })
let formdata = new FormData() let formdata = new FormData()
formdata.append('imgPath', that.dataURLtoFile(that.file, that.imgName)) formdata.append('imgPath', that.dataURLtoFile(that.file, that.imgName))
uploadImg(formdata).then(res => { uploadImg(formdata).then(
res => {
// console.log(res) // console.log(res)
if (res.result == '0') { if (res.result == '0') {
this.$toast.clear() this.$toast.clear()
@@ -957,9 +967,6 @@ export default {
case 'fileListBank': case 'fileListBank':
that.fileListBank = [] that.fileListBank = []
break break
// case 'fileListBankBack':
// that.fileListBankBack = []
// break
case 'fileListOther': case 'fileListOther':
that.fileListOther = [] that.fileListOther = []
break break
@@ -985,7 +992,46 @@ export default {
this.$toast.clear() this.$toast.clear()
this.$toast(res.resultMessage) 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
}
this.$toast('网络环境不佳,图片上传失败,请切换移动网络或稍后重试')
}
)
}, },
beforeNext(isDis) { beforeNext(isDis) {
if (isDis && this.fileListBank.length > 0 && this.fileListIdBack.length > 0 && this.fileListIdFront.length > 0) { if (isDis && this.fileListBank.length > 0 && this.fileListIdBack.length > 0 && this.fileListIdFront.length > 0) {