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:
@@ -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;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
@@ -142,6 +202,7 @@
|
||||
<span class="erp-muted i18n" style="flex:1 1 auto;min-width:0;">칸을 드래그해 다른 칸으로 옮기면 구성이 이동(채워진 칸끼리는 맞교환)됩니다. 칸 번호는 그대로입니다. 인쇄할 칸은 체크 후 인쇄하세요.</span>
|
||||
<a href="/malaysia/rack/export?wh={{ selected_wh }}" class="erp-btn erp-btn-outline">다운로드</a>
|
||||
<button type="button" id="rv-print-btn" class="erp-btn erp-btn-outline">인쇄 미리보기</button>
|
||||
<button type="button" id="rv-pog-btn" class="erp-btn erp-btn-outline">창고POG 출력</button>
|
||||
<button type="button" id="rv-save-btn" class="erp-btn erp-btn-primary">저장</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -151,7 +212,9 @@
|
||||
<div id="rv-save-fields"></div>
|
||||
</form>
|
||||
|
||||
<div class="rv-board" id="rv-board" style="margin-top:10px;">
|
||||
<div class="rv-board" id="rv-board" style="margin-top:10px;"
|
||||
data-wh="{{ selected_wh }}"
|
||||
data-stocktake="{% if stocktake %}#{{ stocktake.id }} · {{ stocktake.stocktake_date }}{% endif %}">
|
||||
{% for side in rack_layout %}
|
||||
<div class="rv-side">
|
||||
<h3>{{ side.label }}</h3>
|
||||
@@ -187,6 +250,16 @@
|
||||
</div>
|
||||
<div class="rvp-pages" id="rvp-pages"></div>
|
||||
</div>
|
||||
|
||||
<!-- 창고 POG 미리보기 모달 (전체 도면 1장) -->
|
||||
<div class="pog-overlay" id="pog-overlay">
|
||||
<div class="pog-toolbar">
|
||||
<span class="pog-title i18n">창고 POG 미리보기</span>
|
||||
<button type="button" id="pog-print" class="erp-btn erp-btn-primary">인쇄</button>
|
||||
<button type="button" id="pog-close" class="erp-btn erp-btn-outline">닫기</button>
|
||||
</div>
|
||||
<div class="pog-pages" id="pog-pages"></div>
|
||||
</div>
|
||||
</section>
|
||||
<script src="/static/malaysia_rack_view.js?v=20260617a"></script>
|
||||
<script src="/static/malaysia_rack_view.js?v=20260619a"></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -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