|
|
|
@ -8,6 +8,7 @@
|
|
|
|
|
:file-list="fileList"
|
|
|
|
|
:on-change="onUploadChange"
|
|
|
|
|
:before-upload="beforeFileUpload"
|
|
|
|
|
:on-error="handleUploadError"
|
|
|
|
|
action="#"
|
|
|
|
|
:accept="imgType"
|
|
|
|
|
list-type="picture-card"
|
|
|
|
@ -161,12 +162,18 @@ export default {
|
|
|
|
|
let FormDatas = new FormData();
|
|
|
|
|
FormDatas.append("multipartFile", file.raw);
|
|
|
|
|
this.$modal.loading("正在上传,请稍候...");
|
|
|
|
|
uploadBankSlipApi(FormDatas).then((res) => {
|
|
|
|
|
this.invoiceForm = res.data;
|
|
|
|
|
this.fileList.push({ name: file.name, url: res.data.fileUrl }); //成功过后手动将文件添加到展示列表里
|
|
|
|
|
this.$emit("onConfirm", this.fileList);
|
|
|
|
|
this.$modal.closeLoading();
|
|
|
|
|
});
|
|
|
|
|
uploadBankSlipApi(FormDatas)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
this.invoiceForm = res.data;
|
|
|
|
|
this.fileList.push({ name: file.name, url: res.data.fileUrl }); //成功过后手动将文件添加到展示列表里
|
|
|
|
|
this.$emit("onConfirm", this.fileList);
|
|
|
|
|
this.$modal.closeLoading();
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.fileList = [];
|
|
|
|
|
this.$modal.closeLoading();
|
|
|
|
|
this.$message.error("上传失败");
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
closeImgViewer() {
|
|
|
|
|
this.dialogVisible = false;
|
|
|
|
@ -181,6 +188,10 @@ export default {
|
|
|
|
|
this.dialogVisible = true;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleUploadError() {
|
|
|
|
|
this.$modal.closeLoading();
|
|
|
|
|
this.$message.error("上传失败");
|
|
|
|
|
},
|
|
|
|
|
// 发票识别
|
|
|
|
|
handleScan() {
|
|
|
|
|
if (this.fileList.length) {
|
|
|
|
|