Merge remote-tracking branch 'origin/main'

main
cyl 1 year ago
commit 3e4ad2d3cc

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

@ -164,12 +164,17 @@ export default {
let FormDatas = new FormData(); let FormDatas = new FormData();
FormDatas.append("multipartFile", file.raw); FormDatas.append("multipartFile", file.raw);
this.$modal.loading("正在上传,请稍候..."); this.$modal.loading("正在上传,请稍候...");
uploadInvoiceApi(FormDatas).then((res) => { uploadInvoiceApi(FormDatas)
this.invoiceForm = res.data; .then((res) => {
this.fileList.push({ name: file.name, url: res.data.fileUrl }); // this.invoiceForm = res.data;
this.$emit("onConfirm", this.fileList); this.fileList.push({ name: file.name, url: res.data.fileUrl }); //
this.$modal.closeLoading(); this.$emit("onConfirm", this.fileList);
}); this.$modal.closeLoading();
})
.catch(() => {
this.fileList = [];
this.$modal.closeLoading();
});
}, },
closeImgViewer() { closeImgViewer() {
this.dialogVisible = false; this.dialogVisible = false;

Loading…
Cancel
Save