diff --git a/app/modules/malaysia/templates/malaysia/rack_view.html b/app/modules/malaysia/templates/malaysia/rack_view.html index b474879..3a90838 100644 --- a/app/modules/malaysia/templates/malaysia/rack_view.html +++ b/app/modules/malaysia/templates/malaysia/rack_view.html @@ -78,8 +78,8 @@ } .erp-content { margin:0 !important; } .erp-page { padding:0 !important; } - .mys > *:not(.rvp-overlay) { display:none !important; } - .rvp-overlay { + body.printing-cells .mys > *:not(.rvp-overlay) { display:none !important; } + body.printing-cells .rvp-overlay { display:block !important; position:static !important; padding:0 !important; background:#fff !important; overflow:visible !important; } @@ -113,6 +113,66 @@ .rvp-sheet.rvp-many .rvp-line .rvp-calc { font-size:0.75cm; } .rvp-sheet.rvp-many .rvp-line .rvp-calc .rvp-box { font-size:1.2cm; } } + + /* ── 창고 POG (전체 도면 A4 가로 1장) ── */ + .pog-overlay { + display:none; position:fixed; inset:0; z-index:2000; + background:rgba(15,23,42,.55); overflow:auto; padding:24px; + } + .pog-overlay.is-open { display:block; } + .pog-toolbar { + position:sticky; top:0; display:flex; gap:8px; justify-content:flex-end; + align-items:center; margin-bottom:16px; + } + .pog-toolbar .pog-title { margin-right:auto; color:#fff; font-weight:700; font-size:16px; } + .pog-pages { display:flex; justify-content:center; } + /* A4 가로(297:210) 시트. container-type:size → 자식이 cqh/cqw 로 시트에 맞춰 축소 */ + .pog-sheet { + background:#fff; width:min(100%, 1180px); aspect-ratio:297/210; + box-shadow:0 8px 24px rgba(0,0,0,.3); border-radius:4px; + padding:1.6cqh 1.4cqw; box-sizing:border-box; + display:flex; flex-direction:column; overflow:hidden; + container-type:size; + } + .pog-sheet .pog-sheet-head { + display:flex; justify-content:space-between; align-items:baseline; + font-weight:800; color:#0f172a; margin-bottom:1cqh; flex:0 0 auto; + } + .pog-sheet .pog-sheet-head .pog-t { font-size:2.4cqh; } + .pog-sheet .pog-sheet-head .pog-meta { font-size:1.6cqh; color:#475569; font-weight:600; } + .pog-sheet .rv-board { gap:1cqh; flex:1 1 auto; min-height:0; } + .pog-sheet .rv-side { display:flex; flex-direction:column; min-height:0; } + .pog-sheet .rv-side h3 { font-size:1.7cqh; margin:0 0 0.4cqh; } + .pog-sheet .rv-row { gap:0.6cqw; margin-bottom:0.6cqh; } + .pog-sheet .rv-cell { + min-height:0; height:9.2cqh; padding:0.5cqh 0.6cqw; border-radius:3px; + cursor:default; overflow:hidden; background:#f8fafc; + } + .pog-sheet .rv-cell.is-empty { background:#fff; } + .pog-sheet .rv-cell-head { + font-size:1.25cqh; font-weight:700; margin-bottom:0.3cqh; padding-bottom:0.2cqh; + } + .pog-sheet .rv-pick { display:none !important; } + .pog-sheet .rv-items { gap:0.3cqh; } + .pog-sheet .rv-item { font-size:1.25cqh; line-height:1.2; } + .pog-sheet .rv-empty-note { font-size:1.25cqh; } + + @media print { + body.printing-pog .erp-sidebar, body.printing-pog .erp-topbar { display:none !important; } + body.printing-pog .mys > *:not(.pog-overlay) { display:none !important; } + body.printing-pog .pog-overlay { + display:block !important; position:static !important; padding:0 !important; + background:#fff !important; overflow:visible !important; + } + body.printing-pog .pog-toolbar { display:none !important; } + body.printing-pog .pog-pages { display:block !important; } + /* 한 장에 전체 도면. height:100vh → 컨테이너 높이=페이지 높이라 cqh 가 그대로 맞음 */ + body.printing-pog .pog-sheet { + width:100% !important; height:100vh !important; aspect-ratio:auto !important; + box-shadow:none !important; border-radius:0 !important; + page-break-after:avoid; page-break-inside:avoid; + } + } {% endblock %} @@ -142,6 +202,7 @@ 칸을 드래그해 다른 칸으로 옮기면 구성이 이동(채워진 칸끼리는 맞교환)됩니다. 칸 번호는 그대로입니다. 인쇄할 칸은 체크 후 인쇄하세요. 다운로드 + {% endif %} @@ -151,7 +212,9 @@
-
+
{% for side in rack_layout %}

{{ side.label }}

@@ -187,6 +250,16 @@
+ + +
+
+ 창고 POG 미리보기 + + +
+
+
- + {% endblock %} diff --git a/app/static/malaysia_rack_view.js b/app/static/malaysia_rack_view.js index 603f57f..3cc3610 100644 --- a/app/static/malaysia_rack_view.js +++ b/app/static/malaysia_rack_view.js @@ -204,10 +204,59 @@ sheet.appendChild(list); pages.appendChild(sheet); }); + document.body.classList.add("printing-cells"); document.getElementById("rvp-overlay").classList.add("is-open"); } function closePreview() { document.getElementById("rvp-overlay").classList.remove("is-open"); + document.body.classList.remove("printing-cells"); + } + + // ── 창고 POG (전체 도면 A4 가로 1장) 미리보기 ── + function openPOG() { + var board = document.getElementById("rv-board"); + var pages = document.getElementById("pog-pages"); + if (!board || !pages) return; + + var sheet = document.createElement("div"); + sheet.className = "pog-sheet"; + + // 머리말: 제목 + 창고/기준 재고조사 + var head = document.createElement("div"); + head.className = "pog-sheet-head"; + var ttl = document.createElement("span"); + ttl.className = "pog-t"; + ttl.textContent = t("창고 POG", "Warehouse POG"); + var meta = document.createElement("span"); + meta.className = "pog-meta"; + var wh = board.getAttribute("data-wh") || ""; + var st = board.getAttribute("data-stocktake") || ""; + meta.textContent = [wh, st].filter(Boolean).join(" | "); + head.appendChild(ttl); + head.appendChild(meta); + sheet.appendChild(head); + + // 보드 통째로 복제 → 인터랙티브 요소 제거(체크박스/드래그) + var clone = board.cloneNode(true); + clone.removeAttribute("id"); + clone.removeAttribute("style"); + [].slice.call(clone.querySelectorAll(".rv-cell")).forEach(function (c) { + c.removeAttribute("draggable"); + c.classList.remove("is-selected", "is-dragover", "dragging"); + }); + [].slice.call(clone.querySelectorAll(".rv-pick")).forEach(function (cb) { + cb.parentNode && cb.parentNode.removeChild(cb); + }); + sheet.appendChild(clone); + + pages.innerHTML = ""; + pages.appendChild(sheet); + document.body.classList.add("printing-pog"); + document.getElementById("pog-overlay").classList.add("is-open"); + } + function closePOG() { + document.getElementById("pog-overlay").classList.remove("is-open"); + document.body.classList.remove("printing-pog"); } document.addEventListener("DOMContentLoaded", function () { @@ -229,6 +278,12 @@ if (pc) pc.addEventListener("click", closePreview); var pp = document.getElementById("rvp-print"); if (pp) pp.addEventListener("click", function () { window.print(); }); + var gb = document.getElementById("rv-pog-btn"); + if (gb) gb.addEventListener("click", openPOG); + var gc = document.getElementById("pog-close"); + if (gc) gc.addEventListener("click", closePOG); + var gp = document.getElementById("pog-print"); + if (gp) gp.addEventListener("click", function () { window.print(); }); var lt = document.getElementById("mys-lang-toggle"); if (lt) lt.addEventListener("click", function () { setTimeout(renderAll, 0); }); window.addEventListener("beforeunload", function (ev) {