From 8583b811e1004971fdaa185cb2128e0ef9b7d05a Mon Sep 17 00:00:00 2001 From: DXC Date: Tue, 21 Apr 2026 14:01:20 +0800 Subject: [PATCH] =?UTF-8?q?fix(outbound):=20=E5=B0=86@media=20print?= =?UTF-8?q?=E7=A7=BB=E8=87=B3=E9=9D=9Escoped=E6=A0=B7=E5=BC=8F=EF=BC=8C?= =?UTF-8?q?=E8=A7=A3=E9=99=A4body/html=E9=AB=98=E5=BA=A6=E9=94=81=E6=AD=BB?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E8=87=AA=E7=94=B1=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/outbound/Selection.vue | 138 +++++++++++------- 1 file changed, 82 insertions(+), 56 deletions(-) diff --git a/inventory-web/src/views/outbound/Selection.vue b/inventory-web/src/views/outbound/Selection.vue index db89bf3..34128a4 100644 --- a/inventory-web/src/views/outbound/Selection.vue +++ b/inventory-web/src/views/outbound/Selection.vue @@ -848,67 +848,93 @@ const confirmExport = () => { ::v-deep(.el-card__body) { flex: 1; display: flex; flex-direction: column; overflow: hidden; } /* ================= ★★★ 打印专用样式 ★★★ ================= */ +/* ================= ★★★ 打印区域排版样式 ★★★ ================= */ #print-area { display: none; } -@media print { - @page { margin: 0; size: auto; } - body * { visibility: hidden; } - .el-dialog__wrapper, .v-modal, .el-message, .no-print-content { display: none !important; } - #print-area, #print-area * { visibility: visible; } - #print-area { - position: absolute !important; - left: 0; top: 0; width: 100%; - height: auto !important; - min-height: 100%; - margin: 0; padding: 20mm; background-color: white; - display: block !important; z-index: 99999; - } - .print-header { text-align: center; margin-bottom: 20px; } - .print-header h1 { font-size: 24px; margin: 0 0 10px 0; font-weight: bold; color: #000; } - .print-meta-row { display: flex; justify-content: flex-start; font-size: 12px; margin-bottom: 5px; } - .header-line { border-bottom: 2px solid #000; margin-top: 5px; } - .print-table { width: 100%; border-collapse: collapse; margin-bottom: 40px; border: 1px solid #000; } - .print-table th, .print-table td { border: 1px solid #000; padding: 12px 8px; text-align: left; font-size: 14px; color: #000; } - .print-table th { text-align: center; font-weight: bold; } - .cell-padding { padding-left: 10px; } +.print-header { text-align: center; margin-bottom: 20px; } +.print-header h1 { font-size: 24px; margin: 0 0 10px 0; font-weight: bold; color: #000; } +.print-meta-row { display: flex; justify-content: flex-start; font-size: 12px; margin-bottom: 5px; } +.header-line { border-bottom: 2px solid #000; margin-top: 5px; } +.print-table { width: 100%; border-collapse: collapse; margin-bottom: 40px; border: 1px solid #000; } +.print-table th, .print-table td { border: 1px solid #000; padding: 12px 8px; text-align: left; font-size: 14px; color: #000; } +.print-table th { text-align: center; font-weight: bold; } +.cell-padding { padding-left: 10px; } +.print-table tr { + page-break-inside: avoid !important; + break-inside: avoid !important; +} +.print-footer { display: flex; justify-content: space-between; margin-top: 60px; padding: 0 20px; } +.signature-item { display: flex; flex-direction: column; align-items: center; width: 30%; } +.sig-label { font-size: 14px; margin-bottom: 40px; text-align: left; width: 100%; } +.sig-line { border-bottom: 1px solid #000; width: 100%; height: 1px; display: block; } - /* ★★★ 防止表格行在跨页时被水平切断 ★★★ */ - .print-table tr { - page-break-inside: avoid !important; - break-inside: avoid !important; - } - - .print-footer { display: flex; justify-content: space-between; margin-top: 60px; padding: 0 20px; } - .signature-item { display: flex; flex-direction: column; align-items: center; width: 30%; } - .sig-label { font-size: 14px; margin-bottom: 40px; text-align: left; width: 100%; } - .sig-line { border-bottom: 1px solid #000; width: 100%; height: 1px; display: block; } - - /* ★★★ 修复预览弹窗中 el-table 打印分页截断问题 ★★★ */ - .print-preview-content { - height: auto !important; - max-height: none !important; - overflow: visible !important; - } - .print-preview-content .el-table, - .print-preview-content .el-table__inner-wrapper, - .print-preview-content .el-table__body-wrapper, - .print-preview-content .el-table__body { - height: auto !important; - max-height: none !important; - overflow: visible !important; - } - .print-preview-content .el-scrollbar__wrap { - overflow: visible !important; - } - .print-preview-content .el-table tr { - page-break-inside: avoid !important; - break-inside: avoid !important; - } - .print-preview-content .el-table__body-wrapper is-scrollable-none { - overflow: visible !important; - } +/* ★★★ 修复预览弹窗中 el-table 打印分页截断问题 ★★★ */ +.print-preview-content { + height: auto !important; + max-height: none !important; + overflow: visible !important; +} +.print-preview-content .el-table, +.print-preview-content .el-table__inner-wrapper, +.print-preview-content .el-table__body-wrapper, +.print-preview-content .el-table__body { + height: auto !important; + max-height: none !important; + overflow: visible !important; +} +.print-preview-content .el-scrollbar__wrap { + overflow: visible !important; +} +.print-preview-content .el-table tr { + page-break-inside: avoid !important; + break-inside: avoid !important; +} +.print-preview-content .el-table__body-wrapper is-scrollable-none { + overflow: visible !important; } :deep(.bulk-clickable-row) { cursor: pointer; } + +