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() {