From 3e48987f2ab702ec7f53817c3b8bb631bbb08721 Mon Sep 17 00:00:00 2001 From: anthonywj Date: Thu, 21 Mar 2024 11:06:52 +0800 Subject: [PATCH] =?UTF-8?q?pdf=E6=89=93=E5=BC=80=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/inout/InvoiceRegistrationDetermine.vue | 4 ++++ src/views/inventory/DeviceInspectTake.vue | 4 ++++ src/views/inventory/DeviceInspectTakeAdd.vue | 4 ++++ src/views/inventory/DeviceInspectTakeAuditModify.vue | 4 ++++ src/views/purchase/company/supCompanyAduditDialog.vue | 6 ++++++ 5 files changed, 22 insertions(+) diff --git a/src/views/inout/InvoiceRegistrationDetermine.vue b/src/views/inout/InvoiceRegistrationDetermine.vue index 8f55c43..ab3164f 100644 --- a/src/views/inout/InvoiceRegistrationDetermine.vue +++ b/src/views/inout/InvoiceRegistrationDetermine.vue @@ -489,6 +489,10 @@ export default { showImgViewer(row) { this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name="; this.imgList = []; + if (row.filePath.toLowerCase().slice(-5).includes(".pdf")) { + window.open(this.certFileUrl + row.filePath.replace(",", "")); + return + } previewImage({imageUrl: row.licenseUrl, certFileUrl: this.certFileUrl}).then(response => { if (response.code === 20000) { this.imgList = response.data; diff --git a/src/views/inventory/DeviceInspectTake.vue b/src/views/inventory/DeviceInspectTake.vue index dd899ee..4cbf054 100644 --- a/src/views/inventory/DeviceInspectTake.vue +++ b/src/views/inventory/DeviceInspectTake.vue @@ -584,6 +584,10 @@ export default { } this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name="; this.imgList = []; + if (row.filePath.toLowerCase().slice(-5).includes(".pdf")) { + window.open(this.certFileUrl + row.filePath.replace(",", "")); + return + } previewImage({imageUrl: row.inspectImage, certFileUrl: this.certFileUrl}).then(response => { if (response.code === 20000) { this.imgList = response.data; diff --git a/src/views/inventory/DeviceInspectTakeAdd.vue b/src/views/inventory/DeviceInspectTakeAdd.vue index cbf325e..d969e0f 100644 --- a/src/views/inventory/DeviceInspectTakeAdd.vue +++ b/src/views/inventory/DeviceInspectTakeAdd.vue @@ -691,6 +691,10 @@ export default { } this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name="; this.imgList = []; + if (row.filePath.toLowerCase().slice(-5).includes(".pdf")) { + window.open(this.certFileUrl + row.filePath.replace(",", "")); + return + } previewImage({imageUrl: row.inspectImage, certFileUrl: this.certFileUrl}).then(response => { if (response.code === 20000) { this.imgList = response.data; diff --git a/src/views/inventory/DeviceInspectTakeAuditModify.vue b/src/views/inventory/DeviceInspectTakeAuditModify.vue index c4c04a4..1f34da0 100644 --- a/src/views/inventory/DeviceInspectTakeAuditModify.vue +++ b/src/views/inventory/DeviceInspectTakeAuditModify.vue @@ -461,6 +461,10 @@ export default { } this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name="; this.imgList = []; + if (row.filePath.toLowerCase().slice(-5).includes(".pdf")) { + window.open(this.certFileUrl + row.filePath.replace(",", "")); + return + } previewImage({imageUrl: row.inspectImage, certFileUrl: this.certFileUrl}).then(response => { if (response.code === 20000) { this.imgList = response.data; diff --git a/src/views/purchase/company/supCompanyAduditDialog.vue b/src/views/purchase/company/supCompanyAduditDialog.vue index 30fc2ae..6ad8a5d 100644 --- a/src/views/purchase/company/supCompanyAduditDialog.vue +++ b/src/views/purchase/company/supCompanyAduditDialog.vue @@ -547,6 +547,12 @@ export default { // let newWindow = window.open(); // newWindow.document.write(row.filePath) this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name="; + + if (row.filePath.toLowerCase().slice(-5).includes(".pdf")) { + window.open(this.certFileUrl + row.filePath.replace(",", "")); + return + } + this.imgList = []; previewImage({imageUrl: row.filePath, certFileUrl: this.certFileUrl}).then(response => { if (response.code === 20000) {