diff --git a/app/quote/[token]/page.tsx b/app/quote/[token]/page.tsx index 17268d6..a5c114a 100644 --- a/app/quote/[token]/page.tsx +++ b/app/quote/[token]/page.tsx @@ -37,6 +37,7 @@ export default function QuotePage() { const [activeTab, setActiveTab] = useState<'overview' | 'wbs' | 'quote' | 'maintenance'>('overview'); const [submitting, setSubmitting] = useState(false); const [submitted, setSubmitted] = useState(false); + const [isPrinting, setIsPrinting] = useState(false); useEffect(() => { fetch(`/api/quote/${token}`) @@ -53,7 +54,10 @@ export default function QuotePage() { else if (d.quote.maintenance.length > 0) setSelectedMaintenance(d.quote.maintenance[0].id); // ?print=1 파라미터 시 자동 인쇄 다이얼로그 if (searchParams.get('print') === '1') { - setTimeout(() => window.print(), 800); + setTimeout(() => { + setIsPrinting(true); + setTimeout(() => window.print(), 300); + }, 800); } }) .catch(() => setNotFound(true)) @@ -145,14 +149,18 @@ export default function QuotePage() { input[type=checkbox] { accent-color: #6366f1; width: 18px; height: 18px; cursor: pointer; } input[type=radio] { accent-color: #6366f1; width: 18px; height: 18px; cursor: pointer; } @media print { - body { background: white !important; color: #1e293b !important; } + body { background: white !important; color: #1e293b !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; } .no-print { display: none !important; } .print-break { page-break-before: always; } + .print-section-title { display: block !important; } [style*="background: #0a0f1e"], [style*="background: #0f172a"] { background: white !important; color: #1e293b !important; } + table { page-break-inside: auto; } + tr { page-break-inside: avoid; } } + .print-section-title { display: none; } `} {/* 헤더 */} @@ -171,7 +179,13 @@ export default function QuotePage() {