BOM零件打印背景颜色修改

This commit is contained in:
Ledo 2025-08-04 14:30:14 +08:00
parent f5195b96c6
commit 762641d122
2 changed files with 33 additions and 32 deletions

View File

@ -106,13 +106,13 @@ const open = async (bomCode, vals) => {
const qrCodeElement = document.getElementById('qrCodeContainer') const qrCodeElement = document.getElementById('qrCodeContainer')
if (qrCodeElement) { if (qrCodeElement) {
(qrCodeElement.innerHTML += (qrCodeElement.innerHTML +=
`<div style="width: 90mm; height: 60mm; padding: 2mm; box-sizing: border-box; font-family: monospace; position: relative; background-color: black; color: white;"> `<div style="width: 90mm; height: 60mm; padding: 2mm; box-sizing: border-box; font-family: monospace; position: relative; background-color: white; color: black;">
<div style="font-size: 11px; margin-bottom: 1mm;"> <div style="font-size: 11px; margin-bottom: 1mm;">
<span style="display: inline-block; width: 100%; border-bottom: 1px solid white; padding-bottom: 0.2mm;">${item.code}</span> <span style="display: inline-block; width: 100%; border-bottom: 1px solid black; padding-bottom: 0.2mm;">${item.code}</span>
</div> </div>
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
<span style="white-space: nowrap; margin-right: 1mm;">名称:</span> <span style="white-space: nowrap; margin-right: 1mm;">名称:</span>
<span style="flex-grow: 1; border-bottom: 1px solid white; height: 2em; margin-left: 1mm;">${item.name}</span> <span style="flex-grow: 1; border-bottom: 1px solid black; height: 2em; margin-left: 1mm;">${item.name}</span>
</div> </div>
<div style="display: flex; position: absolute; bottom: 2mm; left: 2mm; right: 2mm; height: 34mm;"> <div style="display: flex; position: absolute; bottom: 2mm; left: 2mm; right: 2mm; height: 34mm;">
<div style="display: flex; flex-direction: column; justify-content: center; align-items: flex-start; width: 13mm; margin-right: 1mm;"> <div style="display: flex; flex-direction: column; justify-content: center; align-items: flex-start; width: 13mm; margin-right: 1mm;">
@ -145,7 +145,7 @@ defineExpose({ open })
min-height: 60mm; min-height: 60mm;
margin: auto; margin: auto;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
background-color: black; background-color: white;
color: white; color: white;
padding: 2mm; padding: 2mm;
box-sizing: border-box; box-sizing: border-box;
@ -159,7 +159,7 @@ defineExpose({ open })
/* 确保打印样式优先 */ /* 确保打印样式优先 */
@media print { @media print {
.page { .page {
background-color: black !important; background-color: white !important;
color: white !important; color: white !important;
.code-line span, .name-underline { .code-line span, .name-underline {

View File

@ -53,8 +53,8 @@ const onPrint = () => {
body { body {
margin: 0; margin: 0;
padding: 0; padding: 0;
background-color: black !important; background-color: white !important;
color: white !important; color: black !important;
-webkit-print-color-adjust: exact; -webkit-print-color-adjust: exact;
print-color-adjust: exact; print-color-adjust: exact;
} }
@ -65,17 +65,18 @@ const onPrint = () => {
box-sizing: border-box; box-sizing: border-box;
font-family: monospace; font-family: monospace;
position: relative; position: relative;
background-color: black !important; background-color: white !important;
color: white !important; color: black !important;
} }
.code-line, .name-line { .code-line, .name-line {
font-size: 11px; font-size: 11px;
margin-bottom: 1mm; margin-bottom: 1mm;
} }
.code-line span { .code-line span {
display: inline-block; display: inline-block;
width: 100%; width: 100%;
border-bottom: 1px solid white; border-bottom: 1px solid black;
padding-bottom: 0.2mm; padding-bottom: 0.2mm;
} }
.name-line { .name-line {
@ -88,7 +89,7 @@ const onPrint = () => {
} }
.name-underline { .name-underline {
flex-grow: 1; flex-grow: 1;
border-bottom: 1px solid white; border-bottom: 1px solid black;
height: 1em; height: 1em;
margin-left: 1mm; margin-left: 1mm;
} }
@ -229,8 +230,8 @@ defineExpose({ open })
min-height: 30mm; min-height: 30mm;
margin: auto; margin: auto;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
background-color: black; background-color: white;
color: white; color: black;
padding: 2mm; padding: 2mm;
box-sizing: border-box; box-sizing: border-box;
@ -243,8 +244,8 @@ defineExpose({ open })
/* 确保打印样式优先 */ /* 确保打印样式优先 */
@media print { @media print {
.page { .page {
background-color: black !important; background-color: white !important;
color: white !important; color: black !important;
.code-line span, .name-underline { .code-line span, .name-underline {
display: inline-block; display: inline-block;