diff --git a/src/assets/seal_custom.png b/src/assets/seal_custom.png index cb20bb2..f5251b6 100644 Binary files a/src/assets/seal_custom.png and b/src/assets/seal_custom.png differ diff --git a/src/components/rx-paper-drawer/rx-paper-drawer.vue b/src/components/rx-paper-drawer/rx-paper-drawer.vue index 57d4d57..7f2f23b 100644 --- a/src/components/rx-paper-drawer/rx-paper-drawer.vue +++ b/src/components/rx-paper-drawer/rx-paper-drawer.vue @@ -140,7 +140,7 @@ const props = defineProps({ }) const paperRef = ref(null) const printDialogVisible = ref(false) -const printPaperSize = ref('A4') +const printPaperSize = ref('A5') const printing = ref(false) const doctorCode = ref('') const pharmacistNo = ref('') @@ -189,7 +189,7 @@ function waitForPrintImages(root) { } function openPrintDialog() { - printPaperSize.value = 'A4'; + printPaperSize.value = 'A5'; printDialogVisible.value = true; } @@ -213,14 +213,14 @@ function createPrintPageStyle(paperSize) { return style; } -async function print(paperSize = 'A4') { +async function print(paperSize = 'A5') { if (!paperRef.value) return; await nextTick(); // Element Plus 抽屉带有定位、变换和裁剪样式,直接打印抽屉内节点会得到空白页。 // 克隆到 body 的直接子节点后再打印,使处方脱离抽屉的布局上下文。 const size = paperSize === 'A5' ? 'A5' : 'A4'; - const useDenseLayout = drugList.value.length >= (size === 'A5' ? 4 : 5); + const useDenseLayout = drugList.value.length >= (size === 'A5' ? 7 : 10); const printRoot = document.createElement('div'); printRoot.className = [ 'rx-print-root', @@ -422,7 +422,7 @@ defineExpose({ print: openPrintDialog }); @media print { @page { - size: A4 portrait; + size: A5 portrait; margin: 8mm; } @@ -437,21 +437,28 @@ defineExpose({ print: openPrintDialog }); body.printing-rx>.rx-print-root .rx-print-area { position: static !important; + display: flex !important; + flex-direction: column !important; width: 100% !important; + min-height: 281mm !important; box-sizing: border-box !important; padding: 0 !important; box-shadow: none !important; font-size: 12px !important; - line-height: 1.25 !important; + line-height: 1.4 !important; + } + + body.printing-rx>.rx-print-root--a5 .rx-print-area { + min-height: 194mm !important; } body.printing-rx>.rx-print-root .header { - padding-bottom: 4px !important; - margin-bottom: 5px !important; + padding-bottom: 6px !important; + margin-bottom: 7px !important; } body.printing-rx>.rx-print-root .row { - margin-bottom: 2px !important; + margin-bottom: 4px !important; } body.printing-rx>.rx-print-root .hospital { @@ -462,11 +469,11 @@ defineExpose({ print: openPrintDialog }); body.printing-rx>.rx-print-root .patient-info, body.printing-rx>.rx-print-root .diagnosis-section, body.printing-rx>.rx-print-root .medicine-section { - margin-top: 5px !important; + margin-top: 8px !important; } body.printing-rx>.rx-print-root .info-row { - padding: 2px !important; + padding: 3px 2px !important; } body.printing-rx>.rx-print-root .diagnosis-header { @@ -478,11 +485,11 @@ defineExpose({ print: openPrintDialog }); } body.printing-rx>.rx-print-root .medicine-item { - margin-bottom: 6px !important; + margin-bottom: 9px !important; } body.printing-rx>.rx-print-root .medicine-spec { - margin: 1px 0 !important; + margin: 2px 0 !important; } body.printing-rx>.rx-print-root .medicine-section img { @@ -492,11 +499,12 @@ defineExpose({ print: openPrintDialog }); } body.printing-rx>.rx-print-root .footer { - margin-top: 6px !important; + margin-top: auto !important; + padding-top: 7px !important; } body.printing-rx>.rx-print-root .footer .pt-3 { - padding-top: 4px !important; + padding-top: 6px !important; } body.printing-rx>.rx-print-root .signImage { @@ -505,19 +513,17 @@ defineExpose({ print: openPrintDialog }); } body.printing-rx>.rx-print-root .notice { - margin-top: 5px !important; + margin-top: 7px !important; font-size: 10px !important; } - body.printing-rx>.rx-print-root--a5 .rx-print-area, body.printing-rx>.rx-print-root--dense .rx-print-area { font-size: 11px !important; - line-height: 1.2 !important; + line-height: 1.3 !important; } - body.printing-rx>.rx-print-root--a5 .medicine-item, body.printing-rx>.rx-print-root--dense .medicine-item { - margin-bottom: 4px !important; + margin-bottom: 6px !important; } body.printing-rx>.rx-print-root--a5 .medicine-section img, @@ -526,11 +532,6 @@ defineExpose({ print: openPrintDialog }); height: 72px !important; } - body.printing-rx>.rx-print-root--a5.rx-print-root--dense .rx-print-area { - font-size: 10px !important; - line-height: 1.15 !important; - } - body.printing-rx>.rx-print-root .medicine-item, body.printing-rx>.rx-print-root .footer { break-inside: avoid;