fix: 页面调整
This commit is contained in:
parent
f0ace56fad
commit
a8194e7d8f
Binary file not shown.
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 22 KiB |
@ -140,7 +140,7 @@ const props = defineProps({
|
|||||||
})
|
})
|
||||||
const paperRef = ref(null)
|
const paperRef = ref(null)
|
||||||
const printDialogVisible = ref(false)
|
const printDialogVisible = ref(false)
|
||||||
const printPaperSize = ref('A4')
|
const printPaperSize = ref('A5')
|
||||||
const printing = ref(false)
|
const printing = ref(false)
|
||||||
const doctorCode = ref('')
|
const doctorCode = ref('')
|
||||||
const pharmacistNo = ref('')
|
const pharmacistNo = ref('')
|
||||||
@ -189,7 +189,7 @@ function waitForPrintImages(root) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function openPrintDialog() {
|
function openPrintDialog() {
|
||||||
printPaperSize.value = 'A4';
|
printPaperSize.value = 'A5';
|
||||||
printDialogVisible.value = true;
|
printDialogVisible.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -213,14 +213,14 @@ function createPrintPageStyle(paperSize) {
|
|||||||
return style;
|
return style;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function print(paperSize = 'A4') {
|
async function print(paperSize = 'A5') {
|
||||||
if (!paperRef.value) return;
|
if (!paperRef.value) return;
|
||||||
await nextTick();
|
await nextTick();
|
||||||
|
|
||||||
// Element Plus 抽屉带有定位、变换和裁剪样式,直接打印抽屉内节点会得到空白页。
|
// Element Plus 抽屉带有定位、变换和裁剪样式,直接打印抽屉内节点会得到空白页。
|
||||||
// 克隆到 body 的直接子节点后再打印,使处方脱离抽屉的布局上下文。
|
// 克隆到 body 的直接子节点后再打印,使处方脱离抽屉的布局上下文。
|
||||||
const size = paperSize === 'A5' ? 'A5' : 'A4';
|
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');
|
const printRoot = document.createElement('div');
|
||||||
printRoot.className = [
|
printRoot.className = [
|
||||||
'rx-print-root',
|
'rx-print-root',
|
||||||
@ -422,7 +422,7 @@ defineExpose({ print: openPrintDialog });
|
|||||||
|
|
||||||
@media print {
|
@media print {
|
||||||
@page {
|
@page {
|
||||||
size: A4 portrait;
|
size: A5 portrait;
|
||||||
margin: 8mm;
|
margin: 8mm;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -437,21 +437,28 @@ defineExpose({ print: openPrintDialog });
|
|||||||
|
|
||||||
body.printing-rx>.rx-print-root .rx-print-area {
|
body.printing-rx>.rx-print-root .rx-print-area {
|
||||||
position: static !important;
|
position: static !important;
|
||||||
|
display: flex !important;
|
||||||
|
flex-direction: column !important;
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
|
min-height: 281mm !important;
|
||||||
box-sizing: border-box !important;
|
box-sizing: border-box !important;
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
box-shadow: none !important;
|
box-shadow: none !important;
|
||||||
font-size: 12px !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 {
|
body.printing-rx>.rx-print-root .header {
|
||||||
padding-bottom: 4px !important;
|
padding-bottom: 6px !important;
|
||||||
margin-bottom: 5px !important;
|
margin-bottom: 7px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.printing-rx>.rx-print-root .row {
|
body.printing-rx>.rx-print-root .row {
|
||||||
margin-bottom: 2px !important;
|
margin-bottom: 4px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.printing-rx>.rx-print-root .hospital {
|
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 .patient-info,
|
||||||
body.printing-rx>.rx-print-root .diagnosis-section,
|
body.printing-rx>.rx-print-root .diagnosis-section,
|
||||||
body.printing-rx>.rx-print-root .medicine-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 {
|
body.printing-rx>.rx-print-root .info-row {
|
||||||
padding: 2px !important;
|
padding: 3px 2px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.printing-rx>.rx-print-root .diagnosis-header {
|
body.printing-rx>.rx-print-root .diagnosis-header {
|
||||||
@ -478,11 +485,11 @@ defineExpose({ print: openPrintDialog });
|
|||||||
}
|
}
|
||||||
|
|
||||||
body.printing-rx>.rx-print-root .medicine-item {
|
body.printing-rx>.rx-print-root .medicine-item {
|
||||||
margin-bottom: 6px !important;
|
margin-bottom: 9px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.printing-rx>.rx-print-root .medicine-spec {
|
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 {
|
body.printing-rx>.rx-print-root .medicine-section img {
|
||||||
@ -492,11 +499,12 @@ defineExpose({ print: openPrintDialog });
|
|||||||
}
|
}
|
||||||
|
|
||||||
body.printing-rx>.rx-print-root .footer {
|
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 {
|
body.printing-rx>.rx-print-root .footer .pt-3 {
|
||||||
padding-top: 4px !important;
|
padding-top: 6px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.printing-rx>.rx-print-root .signImage {
|
body.printing-rx>.rx-print-root .signImage {
|
||||||
@ -505,19 +513,17 @@ defineExpose({ print: openPrintDialog });
|
|||||||
}
|
}
|
||||||
|
|
||||||
body.printing-rx>.rx-print-root .notice {
|
body.printing-rx>.rx-print-root .notice {
|
||||||
margin-top: 5px !important;
|
margin-top: 7px !important;
|
||||||
font-size: 10px !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 {
|
body.printing-rx>.rx-print-root--dense .rx-print-area {
|
||||||
font-size: 11px !important;
|
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 {
|
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,
|
body.printing-rx>.rx-print-root--a5 .medicine-section img,
|
||||||
@ -526,11 +532,6 @@ defineExpose({ print: openPrintDialog });
|
|||||||
height: 72px !important;
|
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 .medicine-item,
|
||||||
body.printing-rx>.rx-print-root .footer {
|
body.printing-rx>.rx-print-root .footer {
|
||||||
break-inside: avoid;
|
break-inside: avoid;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user