diff --git a/klp-ui/src/components/KLPService/ProductSelect/index.vue b/klp-ui/src/components/KLPService/ProductSelect/index.vue index e0a88820..0c7fd27a 100644 --- a/klp-ui/src/components/KLPService/ProductSelect/index.vue +++ b/klp-ui/src/components/KLPService/ProductSelect/index.vue @@ -23,7 +23,7 @@ @keyup.enter.native="handleQuery" /> - diff --git a/klp-ui/src/components/KLPService/RawMaterialSelect/index.vue b/klp-ui/src/components/KLPService/RawMaterialSelect/index.vue index 355e1216..e1dea4c8 100644 --- a/klp-ui/src/components/KLPService/RawMaterialSelect/index.vue +++ b/klp-ui/src/components/KLPService/RawMaterialSelect/index.vue @@ -23,8 +23,7 @@ @keyup.enter.native="handleQuery" /> - + diff --git a/klp-ui/src/views/wms/coil/panels/LabelRender/ProductionTagPreview.vue b/klp-ui/src/views/wms/coil/panels/LabelRender/ProductionTagPreview.vue index fbc92440..9a5d0393 100644 --- a/klp-ui/src/views/wms/coil/panels/LabelRender/ProductionTagPreview.vue +++ b/klp-ui/src/views/wms/coil/panels/LabelRender/ProductionTagPreview.vue @@ -5,10 +5,10 @@ 料卷号 - + {{ content.enterCoilNo || '' }} - + diff --git a/klp-ui/src/views/wms/coil/panels/LabelRender/index.vue b/klp-ui/src/views/wms/coil/panels/LabelRender/index.vue index 7d80f490..b3030bcc 100644 --- a/klp-ui/src/views/wms/coil/panels/LabelRender/index.vue +++ b/klp-ui/src/views/wms/coil/panels/LabelRender/index.vue @@ -90,13 +90,13 @@ export default { // 3. 用html2canvas生成高清Canvas(解决文字模糊+二维码丢失) const canvas = await html2canvas(labelContainer, { - scale: 3, // 3倍高清渲染(核心) + scale: 1.5, // 3倍高清渲染(核心) backgroundColor: '#ffffff', // 强制白色背景,避免打印时背景透明 useCORS: true, // 支持跨域图片 allowTaint: true, // 允许渲染canvas(二维码) taintTest: false, // 关闭canvas污染检测 - windowWidth: labelContainer.offsetWidth * 3, // 适配缩放后的宽度 - windowHeight: labelContainer.offsetHeight * 3, // 适配缩放后的高度 + windowWidth: labelContainer.offsetWidth * 1.5, // 适配缩放后的宽度 + windowHeight: labelContainer.offsetHeight * 1.5, // 适配缩放后的高度 logging: false, }); @@ -104,17 +104,6 @@ export default { const printContainerId = 'temp-print-container-' + new Date().getTime(); const tempPrintContainer = document.createElement('div'); tempPrintContainer.id = printContainerId; - // 样式:让打印容器居中、适配纸张 - tempPrintContainer.style.cssText = ` - width: 100%; - height: 100%; - display: flex; - justify-content: center; - align-items: center; - padding: 20px; - box-sizing: border-box; - background: #fff; - `; // 将高清Canvas插入临时容器 tempPrintContainer.appendChild(canvas); // document.body.appendChild(tempPrintContainer); @@ -143,7 +132,6 @@ export default { body * { visibility: hidden; } #${printContainerId}, #${printContainerId} * { visibility: visible; } #${printContainerId} { position: absolute; top: 0; left: 0; } - @page { margin: 10mm; } /* 打印纸张边距 */ } `, printContainer: true,