From 0474f4323bfe19530462d6038633ff6c21eb4cc8 Mon Sep 17 00:00:00 2001 From: 1178634255 <1178634255@qq.com> Date: Thu, 6 Jul 2023 17:01:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E5=8F=91=E7=A5=A8?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E4=B8=AD=E7=9A=84=E9=A2=84=E8=A7=88=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=97=A0=E6=B3=95=E6=89=8B=E5=8A=A8=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/inout/InvoiceRegistration.vue | 38 +++++++++++-------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/src/views/inout/InvoiceRegistration.vue b/src/views/inout/InvoiceRegistration.vue index d7066054..6dfd59ba 100644 --- a/src/views/inout/InvoiceRegistration.vue +++ b/src/views/inout/InvoiceRegistration.vue @@ -798,41 +798,37 @@ export default { showImgViewer(row) { this.certFileUrl = this.BASE_URL + - "/udiwms/image/register/file/getImage?type=image2&name="+row.licenseUrl; + "/udiwms/image/register/file/getImage?type=image2&name=" + row.licenseUrl; this.imgList = []; - this.imgList.push(this.certFileUrl) + this.imgList.push(this.certFileUrl); let index = row.licenseUrl.lastIndexOf('.'); - if(index===-1){ - this.$message.error("文件名异常!") - return false + if (index === -1) { + this.$message.error("文件名异常!"); + return false; } - if(row.licenseUrl.substr(index+1)==='pdf'){ - let pdf = "application/pdf" + if (row.licenseUrl.substr(index + 1) === 'pdf') { + let pdf = "application/pdf"; let binaryData = []; - previewFile(this.certFileUrl).then(res=>{ + previewFile(this.certFileUrl).then(res => { binaryData.push(res); - let URL = window.URL.createObjectURL(new Blob(binaryData, {type: pdf})); + let URL = window.URL.createObjectURL(new Blob(binaryData, { type: pdf })); window.open(URL); - }) - // window.open(this.imgList[0]) - return false + }); + return false; } this.imgViewerVisible = true; - // previewImage({ - // imageUrl: this.inputQuery.licenseUrl, - // certFileUrl: this.certFileUrl, - // }).then((response) => { - // if (response.code === 20000) { - // } - // console.log(this.imgList); - // }); const m = (e) => { e.preventDefault(); }; document.body.style.overflow = "hidden"; document.addEventListener("touchmove", m, false); // 禁止页面滑动 - }, + closeImgViewer() { + this.imgViewerVisible = false; + document.body.style.overflow = "auto"; // 恢复页面滑动 + document.removeEventListener("touchmove", m, false); // 移除禁止页面滑动的事件 + }, + invChange() {