This commit is contained in:
Euni4U 2025-04-11 16:40:49 +08:00
parent a3426eaaa0
commit f4ed1dd779

View File

@ -390,11 +390,16 @@ const handlePrintBarcode = async (row: PatientVO) => {
settingContainer: "#BarcodePrintElementOptionSetting", settingContainer: "#BarcodePrintElementOptionSetting",
}); });
// // - barcode.js
const options = { const options = {
leftOffset: 0, leftOffset: 0,
topOffset: 0, topOffset: 0,
printMode: 'popup' printMode: 'popup',
paperType: 'A7', // A7
height: 30, // 30mm
width: 50, // 50mm
paperHeader: -6, // -6mm
paperFooter: 85.03937007874016 //
}; };
// //
@ -403,10 +408,30 @@ const handlePrintBarcode = async (row: PatientVO) => {
}, },
styleHandler: () => { styleHandler: () => {
return `<style> return `<style>
.hiprint-printElement-text{color:black !important;} /* 条形码打印特定样式 */
.hiprint-printElement-barcode{display:block !important; visibility:visible !important;} @page {
svg {display:block !important; width:100% !important;} size: ${options.width}mm ${options.height}mm;
.hiprint-printElement{opacity:1 !important; visibility:visible !important;} margin: 0;
@top-center { content: none; }
@bottom-center { content: none; }
}
@media print {
body {
margin: 0;
padding: 0;
}
.hiprint-printPanel {
border: none !important;
padding: 0 !important;
margin: 0 !important;
}
/* 隐藏页眉页脚页码 */
.hiprint-printPanel-header,
.hiprint-printPanel-footer,
.hiprint-printPanel-pageNumber {
display: none !important;
}
}
</style>`; </style>`;
}, },
}; };