diff --git a/app/modules/cupang/templates/cupang/box_calc.html b/app/modules/cupang/templates/cupang/box_calc.html
index 771a9ad..e553486 100644
--- a/app/modules/cupang/templates/cupang/box_calc.html
+++ b/app/modules/cupang/templates/cupang/box_calc.html
@@ -1,6 +1,6 @@
{% extends "erp_base.html" %}
-{% block head_extra %}{% endblock %}
+{% block head_extra %}{% endblock %}
{% block content %}
@@ -1066,10 +1066,13 @@
syncConfirm();
}
- // ── 스크롤 영역 높이 (CSS 만으로 안 잡히는 경우 대비) ──
- // 각 영역의 화면상 위치를 재서 "창 아래까지" 높이를 직접 준다.
- // window.CPG_DEBUG = true 로 두면 계산값을 콘솔에 찍는다.
+ // ── 스크롤 영역 높이 ──────────────────────────────
+ // 넓은 화면(3열): 카드 안쪽에서만 스크롤 → 카드 아래끝까지를 높이로 준다.
+ // 좁은 화면(2열/1열): 카드가 세로로 쌓이므로 높이를 풀고 페이지가 스크롤.
+ var FRAME_MIN_WIDTH = 1501;
+
function fitScrollAreas() {
+ var wide = window.innerWidth >= FRAME_MIN_WIDTH;
var panes = [
[".cpg-calc-card .erp-table-wrap", document.querySelector(".cpg-calc-card .erp-table-wrap")],
[".cpg-sum-scroll", document.querySelector(".cpg-calc-sum .cpg-sum-scroll")],
@@ -1078,15 +1081,22 @@
panes.forEach(function (pair) {
var el = pair[1];
if (!el) return;
+ if (!wide) { // 좁은 화면: 제한 해제(페이지가 스크롤)
+ el.style.removeProperty("max-height");
+ el.style.removeProperty("overflow-y");
+ el.removeAttribute("data-fit");
+ return;
+ }
+ var card = el.closest(".erp-card");
var top = el.getBoundingClientRect().top;
- var avail = Math.floor(window.innerHeight - top - 16);
- var h = avail > 200 ? avail : Math.round(window.innerHeight * 0.6);
+ var bottom = card ? card.getBoundingClientRect().bottom - 16 : window.innerHeight - 16;
+ var h = Math.max(160, Math.floor(Math.min(bottom, window.innerHeight - 16) - top));
el.style.setProperty("max-height", h + "px", "important");
el.style.setProperty("overflow-y", "auto", "important");
el.style.setProperty("min-height", "0", "important");
el.setAttribute("data-fit", h);
if (window.CPG_DEBUG) {
- console.log("[cpg fit]", pair[0], "top=", Math.round(top), "avail=", avail,
+ console.log("[cpg fit]", pair[0], "top=", Math.round(top), "cardBottom=", Math.round(bottom),
"set=", h, "client=", el.clientHeight, "scroll=", el.scrollHeight);
}
});
diff --git a/app/modules/cupang/templates/cupang/box_rules.html b/app/modules/cupang/templates/cupang/box_rules.html
index 8deada8..95355c9 100644
--- a/app/modules/cupang/templates/cupang/box_rules.html
+++ b/app/modules/cupang/templates/cupang/box_rules.html
@@ -1,6 +1,6 @@
{% extends "erp_base.html" %}
-{% block head_extra %}{% endblock %}
+{% block head_extra %}{% endblock %}
{% block content %}
diff --git a/app/modules/cupang/templates/cupang/centers.html b/app/modules/cupang/templates/cupang/centers.html
index 232052f..b1f21be 100644
--- a/app/modules/cupang/templates/cupang/centers.html
+++ b/app/modules/cupang/templates/cupang/centers.html
@@ -1,6 +1,6 @@
{% extends "erp_base.html" %}
-{% block head_extra %}{% endblock %}
+{% block head_extra %}{% endblock %}
{% block content %}
diff --git a/app/modules/cupang/templates/cupang/index.html b/app/modules/cupang/templates/cupang/index.html
index 3051a45..dadf404 100644
--- a/app/modules/cupang/templates/cupang/index.html
+++ b/app/modules/cupang/templates/cupang/index.html
@@ -1,6 +1,6 @@
{% extends "erp_base.html" %}
-{% block head_extra %}{% endblock %}
+{% block head_extra %}{% endblock %}
{% block content %}
diff --git a/app/modules/cupang/templates/cupang/products.html b/app/modules/cupang/templates/cupang/products.html
index f605ff4..003c8f2 100644
--- a/app/modules/cupang/templates/cupang/products.html
+++ b/app/modules/cupang/templates/cupang/products.html
@@ -1,6 +1,6 @@
{% extends "erp_base.html" %}
-{% block head_extra %}{% endblock %}
+{% block head_extra %}{% endblock %}
{% block content %}
diff --git a/app/modules/cupang/templates/cupang/view.html b/app/modules/cupang/templates/cupang/view.html
index 7595fac..eda4c65 100644
--- a/app/modules/cupang/templates/cupang/view.html
+++ b/app/modules/cupang/templates/cupang/view.html
@@ -1,6 +1,6 @@
{% extends "erp_base.html" %}
-{% block head_extra %}{% endblock %}
+{% block head_extra %}{% endblock %}
{% block content %}
{# 출고 묶음 보기 — 상자 계산 화면과 같은 3열 구성. 읽기 전용(수정 없음). #}
diff --git a/app/static/cupang.css b/app/static/cupang.css
index ced0f42..693d1a3 100644
--- a/app/static/cupang.css
+++ b/app/static/cupang.css
@@ -1496,9 +1496,19 @@ body.cpg-dragging { cursor: grabbing; user-select: none; }
}
.cpg-dist-card .cpg-dist-list::-webkit-scrollbar-thumb:hover { background: var(--color-midtone-gray); }
-/* 3열이 2열/1열로 접히면 행이 여러 개라 1fr 고정이 통하지 않는다.
- 그때는 카드마다 최대 높이를 준다. */
+/* 3열이 2열/1열로 접히면 카드가 세로로 쌓여 화면 높이를 나눠 갖게 된다.
+ 그때는 높이 제한을 풀고 내용만큼 늘어나게 두어 페이지가 스크롤되게 한다. */
@media (max-width: 1500px) {
- .cpg-calc3 { grid-template-rows: none; }
- .cpg-calc3 > .erp-card { max-height: min(76vh, 820px); }
+ .erp-page > .cpg { flex: 0 0 auto; min-height: auto; }
+ .cpg-calc3 {
+ grid-template-rows: none;
+ flex: 0 0 auto;
+ }
+ .cpg-calc3 > .erp-card { max-height: none; overflow: visible; }
+ .cpg-calc-card .erp-table-wrap,
+ .cpg-calc-sum .cpg-sum-scroll,
+ .cpg-dist-card .cpg-dist-list {
+ max-height: none;
+ overflow: visible;
+ }
}