feat(malaysia): 창고 랙 전체 도면 A4 1장 'POG 출력' 추가
창고POG 출력 버튼 → Side A/B/Ground 전체 도면을 A4 가로 1장에 미리보기 후 인쇄. container-type:size + cqh/cqw 로 시트 높이에 맞춰 자동 축소. 기존 칸별 인쇄와 body 클래스(printing-cells/ printing-pog)로 분리해 인쇄 대상 충돌 방지. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user