diff --git a/src/components/Print/index.vue b/src/components/Print/index.vue index ffd69004..d126a087 100644 --- a/src/components/Print/index.vue +++ b/src/components/Print/index.vue @@ -216,10 +216,10 @@ const toPrint = (item, type) => { if (res.succeeded) { let fileURL = `http://118.190.144.189:3008/printtempfile/${res.data}` if (type == 1) { - window.open(fileURL) + // window.open(fileURL) + printModalRef.value.init(fileURL,res.data) } else { - printModalRef.value.init('http://118.190.144.189:3008/printtempfile/638645246440232175-D2b.pdf','638645246440232175-D2b.pdf') - // window.open(`//118.190.144.189:3008/printtempfile/${res.data}`, '_blank') + window.open(`//118.190.144.189:3008/printtempfile/${res.data}`, '_blank') } } else { createMessage.error(res.message) @@ -239,7 +239,8 @@ const toPrint = (item, type) => { if (res.succeeded) { let fileURL = `http://118.190.144.189:3008/printtempfile/${res.data}` if (type == 1) { - window.open(fileURL) + printModalRef.value.init(fileURL,res.data) + // window.open(fileURL) } else { window.open(`//118.190.144.189:3008/printtempfile/${res.data}`, '_blank') } diff --git a/src/components/Print/printModal.vue b/src/components/Print/printModal.vue index bbec6c2f..0217595e 100644 --- a/src/components/Print/printModal.vue +++ b/src/components/Print/printModal.vue @@ -83,7 +83,7 @@ function copy() { } function downLoad() { const url = fileURL.value - const filename = '638645017458595773-1bk.pdf' + const filename = fileName.value const x = new XMLHttpRequest() x.open('GET', url, true) x.responseType = 'blob'