From 8d662f5d78fd590f6da9b0fce9bd5204f6dff370 Mon Sep 17 00:00:00 2001 From: 86134 <aa> Date: 星期六, 18 十一月 2023 17:27:58 +0800 Subject: [PATCH] 11 --- src/views/quality/finishedProductInspection/index.vue | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/views/quality/finishedProductInspection/index.vue b/src/views/quality/finishedProductInspection/index.vue index 0f471c8..600db99 100644 --- a/src/views/quality/finishedProductInspection/index.vue +++ b/src/views/quality/finishedProductInspection/index.vue @@ -217,18 +217,20 @@ }, //鎵撳嵃鎸夐挳 printFun() { - // this.printDialogVisible = false; - // const imgWidth = 841.89 - margin * 2 - // const imgHeight = 841.89 / (canvas.width / canvas.height) - margin * 2 + const printSettings = { + paper: { + width: 827, // A4绾哥殑瀹藉害锛堝崟浣嶏細鍍忕礌锛� + height: 595, // A4绾哥殑楂樺害锛堝崟浣嶏細鍍忕礌锛� + orientation: 'portrait', // 绔栧悜鎵撳嵃 + }} + PrintJS({ printable: "printRaw", type: "html", - header:"", - maxWidth: 950, - style: '@page {margin: 2.0mm 2.0mm}', + maxWidth: 880, + printSettings, + style: '@page {margin: 2.0mm 2.0mm;size:A4;}', targetStyles: ["*"], - // importCSS: true, - fontSize: '30px', ignoreElements: ["no-ignore"], orientation: 'portrait' }); @@ -239,10 +241,8 @@ this.printFormData = res.data.data this.printFormData.createTime = row.createTime this.printFormData.updateTime = row.updateTime - // console.log(this.printFormData,"7777777777====="); this.printDialogVisible = true }).catch(error=>{ - // console.log(error); }) }, exportExcel(){ -- Gitblit v1.9.3