From eacde5b322bf22639f7367289664cea1e757eef2 Mon Sep 17 00:00:00 2001 From: king Date: Sun, 14 Jun 2026 17:10:49 +0900 Subject: [PATCH] =?UTF-8?q?style(malaysia):=20=EC=9E=85=EC=88=98=EB=9F=89?= =?UTF-8?q?=C2=B7=EB=B0=95=EC=8A=A4=20=ED=95=9C=20=EC=A4=84=20+=20?= =?UTF-8?q?=EC=B9=B8=20=ED=95=A9=EA=B3=84=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 입수량/박스 입력을 한 줄로(.rk-line) - 칸 ∑ 합계 제거 — 서로 다른 상품을 합산해 의미 없음(입력·랙보기 양쪽) - 상품별 행 소계(합계)는 유지(개별 SKU 기준 유효) - malaysia_rack.js: 칸 합계 로직 삭제, 행 소계만 갱신 Co-Authored-By: Claude Opus 4.8 --- .../templates/malaysia/rack_view.html | 4 ---- .../templates/malaysia/stocktake_detail.html | 23 ++++++++++--------- app/static/malaysia_rack.js | 17 ++------------ 3 files changed, 14 insertions(+), 30 deletions(-) diff --git a/app/modules/malaysia/templates/malaysia/rack_view.html b/app/modules/malaysia/templates/malaysia/rack_view.html index 7c493f5..4bf757e 100644 --- a/app/modules/malaysia/templates/malaysia/rack_view.html +++ b/app/modules/malaysia/templates/malaysia/rack_view.html @@ -16,7 +16,6 @@ font-size:11px; font-weight:600; color:#475569; margin-bottom:4px; border-bottom:1px solid #e2e8f0; padding-bottom:3px; } - .rv-cell-head .rv-total { color:#0f172a; white-space:nowrap; } .rv-items { display:flex; flex-direction:column; gap:3px; } .rv-item { font-size:11px; line-height:1.25; } .rv-item .rv-name { font-weight:600; color:#0f172a; } @@ -56,12 +55,9 @@ {% for col in row.cols %} {% for cell in col %} {% set entries = rack_by_cell.get(cell, []) %} - {% set ns = namespace(total=0) %} - {% for e in entries %}{% set ns.total = ns.total + e.total %}{% endfor %}
{{ cell }} - ∑ {{ "{:,}".format(ns.total) }}
{% for e in entries %} diff --git a/app/modules/malaysia/templates/malaysia/stocktake_detail.html b/app/modules/malaysia/templates/malaysia/stocktake_detail.html index 99794c0..fb7b3e4 100644 --- a/app/modules/malaysia/templates/malaysia/stocktake_detail.html +++ b/app/modules/malaysia/templates/malaysia/stocktake_detail.html @@ -9,12 +9,14 @@ {% endfor %} - - +
+ + +
합계 {{ "{:,}".format(entry.units_per_box * entry.box_count) if entry else 0 }} {% if not disabled %}{% endif %} @@ -52,7 +54,6 @@ display:flex; align-items:center; gap:4px; justify-content:space-between; font-size:11px; font-weight:600; color:#475569; margin-bottom:4px; } - .rack-cell-head .rk-cell-total { color:#0f172a; white-space:nowrap; } .rack-cell-head .rk-add { border:1px solid #94a3b8; background:#fff; border-radius:4px; width:20px; height:20px; line-height:1; padding:0; cursor:pointer; font-weight:700; flex:0 0 auto; @@ -64,8 +65,9 @@ border:1px solid #e2e8f0; border-radius:5px; background:#fff; padding:4px; } .rk-row .rk-sku { font-size:12px; padding:2px 4px; width:100%; min-width:0; } - .rk-row .rk-f { display:flex; align-items:center; gap:4px; font-size:11px; margin:0; } - .rk-row .rk-f > span { flex:0 0 38px; color:#64748b; } + .rk-row .rk-line { display:flex; gap:6px; } + .rk-row .rk-f { display:flex; align-items:center; gap:3px; font-size:11px; margin:0; flex:1 1 0; min-width:0; } + .rk-row .rk-f > span { flex:0 0 auto; color:#64748b; } .rk-row .rk-upb, .rk-row .rk-box { flex:1 1 auto; min-width:0; font-size:12px; padding:2px 4px; text-align:right; } @@ -119,7 +121,6 @@
{{ cell }} - 0 {% if is_draft %}{% endif %}
@@ -193,5 +194,5 @@
- + {% endblock %} diff --git a/app/static/malaysia_rack.js b/app/static/malaysia_rack.js index 4a61c5b..bff1b24 100644 --- a/app/static/malaysia_rack.js +++ b/app/static/malaysia_rack.js @@ -3,7 +3,8 @@ * - 칸(.rack-cell) 헤더의 + 버튼: 빈 입력행을 칸에 추가(템플릿 #rk-row-tpl 클론). * 클론 시 숨김필드 rk_cell 에 해당 칸 코드를 채워 서버 병렬배열과 정렬. * - 행의 × 버튼: 그 행 제거(칸에 행이 0개여도 무방 — 서버가 빈 칸 스킵). - * - 입수량/박스수 입력 시 행 소계(rk-sub)와 칸 합계(rk-cell-total-v) 실시간 갱신. + * - 입수량/박스수 입력 시 행 소계(rk-sub)만 실시간 갱신. + * (칸 합계는 서로 다른 상품을 더하게 되어 의미 없으므로 표시하지 않음.) * 저장은 폼 제출(서버에서 SKU별 집계 → 재고조사 라인 재생성). */ (function () { @@ -25,29 +26,16 @@ if (sub) sub.textContent = comma(upb * box); } - function recalcCell(cell) { - var total = 0; - cell.querySelectorAll(".rk-row").forEach(function (row) { - total += num(row.querySelector(".rk-upb")) * num(row.querySelector(".rk-box")); - }); - var out = cell.querySelector(".rk-cell-total-v"); - if (out) out.textContent = comma(total); - } - function wireRow(row) { row.querySelectorAll(".rk-upb, .rk-box").forEach(function (inp) { inp.addEventListener("input", function () { recalcRow(row); - var cell = row.closest(".rack-cell"); - if (cell) recalcCell(cell); }); }); var del = row.querySelector(".rk-del"); if (del) { del.addEventListener("click", function () { - var cell = row.closest(".rack-cell"); row.remove(); - if (cell) recalcCell(cell); }); } } @@ -71,7 +59,6 @@ wireRow(row); recalcRow(row); }); - document.querySelectorAll(".rack-cell").forEach(recalcCell); document.querySelectorAll(".rack-cell .rk-add").forEach(function (btn) { btn.addEventListener("click", function () { var cell = btn.closest(".rack-cell");