打印样式修改

This commit is contained in:
zc
2026-06-10 17:34:09 +08:00
parent a173cf7044
commit e7ac5f3bbf
3 changed files with 41 additions and 36 deletions

View File

@@ -494,18 +494,19 @@ const printLabel = async () => {
<head> <head>
<title>标签打印</title> <title>标签打印</title>
<style> <style>
body { margin: 0; padding: 10mm; font-family: Arial, sans-serif; } @page { size: 80mm 50mm; margin: 0; }
.label-container { display: flex; flex-wrap: wrap; gap: 10mm; justify-content: center; } body { margin: 0; padding: 1mm; font-family: Arial, sans-serif; }
.label { width: 90mm; height: 38.5mm; border: 1px solid #000; padding: 0; box-sizing: border-box; page-break-inside: avoid; } .label-container { display: flex; flex-wrap: wrap; gap: 1mm; justify-content: center; transform-origin: center; }
.label-table { width: 100%; height: 100%; border-collapse: collapse; } .label { width: 76mm; height: 46mm; border: 1px solid #000; padding: 0; box-sizing: border-box; page-break-inside: avoid; overflow: hidden; }
.label-cell { border: 1px solid #000; padding: 1mm; vertical-align: top; } .label-table { width: 100%; height: 100%; border-collapse: collapse; table-layout: fixed; }
.qr-cell { width: 24mm; text-align: center; vertical-align: middle; border: 1px solid #000; } .label-cell { border: 1px solid #000; padding: 0.8mm; vertical-align: top; }
.qr-cell { width: 22mm; text-align: center; vertical-align: middle; border: 1px solid #000; }
.label-row { display: flex; align-items: center; } .label-row { display: flex; align-items: center; }
.label-field { font-size: 8pt; font-weight: bold; margin-right: 2mm; min-width: 25pt; } .label-field { font-size: 7.5pt; font-weight: bold; margin-right: 1mm; min-width: 22pt; white-space: nowrap; }
.label-value { font-size: 8pt; font-weight: bold; flex: 1; } .label-value { font-size: 7.5pt; font-weight: bold; flex: 1; overflow-wrap: break-word; word-break: break-word; }
.qr-code img { width: 23mm; height: 23mm; margin: 1mm 0; } .qr-code img { width: 20mm; height: 20mm; margin: 0.5mm 0; }
.mark-number { font-size: 8pt; font-weight: bold; margin-top: 1mm; text-align: center; } .mark-number { font-size: 7pt; font-weight: bold; margin-top: 0.5mm; text-align: center; }
.serial-number { font-size: 8pt; font-weight: bold; margin-top: 1mm; } .serial-number { font-size: 7.5pt; font-weight: bold; margin-top: 0.5mm; }
</style> </style>
</head> </head>
<body> <body>
@@ -640,6 +641,7 @@ defineOptions({ name: 'print' })
font-size: 12px; font-size: 12px;
font-weight: bold; font-weight: bold;
flex: 1; flex: 1;
word-break: break-word;
} }
.qr-code img { .qr-code img {

View File

@@ -218,20 +218,21 @@ const onPrint = async (record: FullWorkOrderResp) => {
<html> <html>
<head> <head>
<title>标签打印</title> <title>标签打印</title>
<style> <style>
body { margin: 0; padding: 10mm; font-family: Arial, sans-serif; } @page { size: 80mm 50mm; margin: 0; }
.label-container { display: flex; flex-wrap: wrap; gap: 10mm; justify-content: center; } body { margin: 0; padding: 1mm; font-family: Arial, sans-serif; }
.label { width: 90mm; height: 38.5mm; border: 1px solid #000; padding: 0; box-sizing: border-box; page-break-inside: avoid; } .label-container { display: flex; flex-wrap: wrap; gap: 1mm; justify-content: center; transform-origin: center; }
.label-table { width: 100%; height: 100%; border-collapse: collapse; } .label { width: 76mm; height: 46mm; border: 1px solid #000; padding: 0; box-sizing: border-box; page-break-inside: avoid; overflow: hidden; }
.label-cell { border: 1px solid #000; padding: 1mm; vertical-align: top; } .label-table { width: 100%; height: 100%; border-collapse: collapse; table-layout: fixed; }
.qr-cell { width: 24mm; text-align: center; vertical-align: middle; border: 1px solid #000; } .label-cell { border: 1px solid #000; padding: 0.8mm; vertical-align: top; }
.label-row { display: flex; align-items: center; } .qr-cell { width: 22mm; text-align: center; vertical-align: middle; border: 1px solid #000; }
.label-field { font-size: 8pt; font-weight: bold; margin-right: 2mm; min-width: 25pt; } .label-row { display: flex; align-items: center; }
.label-value { font-size: 8pt; font-weight: bold; flex: 1; } .label-field { font-size: 7.5pt; font-weight: bold; margin-right: 1mm; min-width: 22pt; white-space: nowrap; }
.qr-code img { width: 23mm; height: 23mm; margin: 1mm 0; } .label-value { font-size: 7.5pt; font-weight: bold; flex: 1; overflow-wrap: break-word; word-break: break-word; }
.mark-number { font-size: 8pt; font-weight: bold; margin-top: 1mm; text-align: center; } .qr-code img { width: 20mm; height: 20mm; margin: 0.5mm 0; }
.serial-number { font-size: 8pt; font-weight: bold; margin-top: 1mm; } .mark-number { font-size: 7pt; font-weight: bold; margin-top: 0.5mm; text-align: center; }
</style> .serial-number { font-size: 7.5pt; font-weight: bold; margin-top: 0.5mm; }
</style>
</head> </head>
<body> <body>
<div class="label-container"> <div class="label-container">

View File

@@ -479,18 +479,19 @@ const printLabel = async () => {
<head> <head>
<title>标签打印</title> <title>标签打印</title>
<style> <style>
body { margin: 0; padding: 10mm; font-family: Arial, sans-serif; } @page { size: 80mm 50mm; margin: 0; }
.label-container { display: flex; flex-wrap: wrap; gap: 10mm; justify-content: center; } body { margin: 0; padding: 1mm; font-family: Arial, sans-serif; }
.label { width: 90mm; height: 38.5mm; border: 1px solid #000; padding: 0; box-sizing: border-box; page-break-inside: avoid; } .label-container { display: flex; flex-wrap: wrap; gap: 1mm; justify-content: center; transform-origin: center; }
.label-table { width: 100%; height: 100%; border-collapse: collapse; } .label { width: 76mm; height: 46mm; border: 1px solid #000; padding: 0; box-sizing: border-box; page-break-inside: avoid; overflow: hidden; }
.label-cell { border: 1px solid #000; padding: 1mm; vertical-align: top; } .label-table { width: 100%; height: 100%; border-collapse: collapse; table-layout: fixed; }
.qr-cell { width: 24mm; text-align: center; vertical-align: middle; border: 1px solid #000; } .label-cell { border: 1px solid #000; padding: 0.8mm; vertical-align: top; }
.qr-cell { width: 22mm; text-align: center; vertical-align: middle; border: 1px solid #000; }
.label-row { display: flex; align-items: center; } .label-row { display: flex; align-items: center; }
.label-field { font-size: 8pt; font-weight: bold; margin-right: 2mm; min-width: 25pt; } .label-field { font-size: 7.5pt; font-weight: bold; margin-right: 1mm; min-width: 22pt; white-space: nowrap; }
.label-value { font-size: 8pt; font-weight: bold; flex: 1; } .label-value { font-size: 7.5pt; font-weight: bold; flex: 1; overflow-wrap: break-word; word-break: break-word; }
.qr-code img { width: 23mm; height: 23mm; margin: 1mm 0; } .qr-code img { width: 20mm; height: 20mm; margin: 0.5mm 0; }
.mark-number { font-size: 8pt; font-weight: bold; margin-top: 1mm; text-align: center; } .mark-number { font-size: 7pt; font-weight: bold; margin-top: 0.5mm; text-align: center; }
.serial-number { font-size: 8pt; font-weight: bold; margin-top: 1mm; } .serial-number { font-size: 7.5pt; font-weight: bold; margin-top: 0.5mm; }
</style> </style>
</head> </head>
<body> <body>
@@ -646,6 +647,7 @@ defineOptions({ name: 'LabelPrint' })
font-size: 10pt; font-size: 10pt;
flex: 1; flex: 1;
font-weight: bold; font-weight: bold;
word-break: break-word;
} }
.qr-code img { .qr-code img {