fix(cupang): 박스 계산 표 표기 정리·상자 라벨 고정

- 제품 드롭다운은 제품명만 표시(박스·입수량 병기 제거)
- 표 머리글 가운데 정렬 + 굵게
- 셀 옆에 나타나던 "…"" 제거: input/button 이 든 셀까지 text-overflow:
  ellipsis 가 걸려 빈 말줄임표가 그려졌다. 말줄임은 글자 셀에만 적용
- 혼합 박스 그림의 호수 추출 로직 삭제 → 항상 "쿠팡박스" 표기(글자 수에
  맞춰 라벨 크기 11px)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-29 02:27:01 +09:00
parent 354eebeaac
commit fe344f9fda
8 changed files with 19 additions and 21 deletions
@@ -1,6 +1,6 @@
{% extends "erp_base.html" %} {% extends "erp_base.html" %}
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260828z" />{% endblock %} {% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260829a" />{% endblock %}
{% block content %} {% block content %}
<section class="cpg"> <section class="cpg">
@@ -100,10 +100,7 @@
var optionsHtml = '<option value="">— 제품명 선택 —</option>'; var optionsHtml = '<option value="">— 제품명 선택 —</option>';
rules.forEach(function (r) { rules.forEach(function (r) {
// 드롭다운 폭을 줄이려고 "쿠팡 " 접두어를 떼고 짧게 표기한다. 예: 미라네 1호 세트 (2호·8) var label = r.product_name_snapshot || r.product_code;
var shortBox = (r.box_name || "-").replace(/^쿠팡\s*/, "");
var label = (r.product_name_snapshot || r.product_code) +
" (" + shortBox + "·" + r.units_per_box + ")";
optionsHtml += '<option value="' + esc(r.product_code) + '">' + esc(label) + "</option>"; optionsHtml += '<option value="' + esc(r.product_code) + '">' + esc(label) + "</option>";
}); });
@@ -204,10 +201,7 @@
"</svg>"; "</svg>";
} }
// "쿠팡 2호" → "2호" (상자 그림 안에 넣을 짧은 이름)
function shortBoxName(name) {
return String(name || "").replace(/^쿠팡\s*/, "").trim() || "박스";
}
function renderSummary(results, mixes, grandTotal) { function renderSummary(results, mixes, grandTotal) {
var ok = results.filter(function (r) { return r.configured; }); var ok = results.filter(function (r) { return r.configured; });
@@ -254,7 +248,7 @@
return '<li><span>' + esc(it.product_name) + "</span><b>" + it.quantity + "개</b></li>"; return '<li><span>' + esc(it.product_name) + "</span><b>" + it.quantity + "개</b></li>";
}).join(""); }).join("");
bh += '<div class="cpg-box-card" style="animation-delay:' + (n * 70) + 'ms">' + bh += '<div class="cpg-box-card" style="animation-delay:' + (n * 70) + 'ms">' +
'<div class="cpg-box-art">' + boxSvg(b.fill_percent, shortBoxName(m.box_name)) + "</div>" + '<div class="cpg-box-art">' + boxSvg(b.fill_percent, "쿠팡박스") + "</div>" +
'<div class="cpg-box-info">' + '<div class="cpg-box-info">' +
'<div class="cpg-box-title">' + esc(m.box_name) + " 혼합 #" + (i + 1) + "</div>" + '<div class="cpg-box-title">' + esc(m.box_name) + " 혼합 #" + (i + 1) + "</div>" +
'<ul class="cpg-box-items">' + items + "</ul>" + '<ul class="cpg-box-items">' + items + "</ul>" +
@@ -1,6 +1,6 @@
{% extends "erp_base.html" %} {% extends "erp_base.html" %}
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260828z" />{% endblock %} {% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260829a" />{% endblock %}
{% block content %} {% block content %}
<section class="cpg"> <section class="cpg">
@@ -1,6 +1,6 @@
{% extends "erp_base.html" %} {% extends "erp_base.html" %}
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260828z" />{% endblock %} {% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260829a" />{% endblock %}
{% block content %} {% block content %}
<section class="cpg"> <section class="cpg">
@@ -1,6 +1,6 @@
{% extends "erp_base.html" %} {% extends "erp_base.html" %}
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260828z" />{% endblock %} {% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260829a" />{% endblock %}
{% block content %} {% block content %}
<section class="cpg"> <section class="cpg">
@@ -1,6 +1,6 @@
{% extends "erp_base.html" %} {% extends "erp_base.html" %}
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260828z" />{% endblock %} {% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260829a" />{% endblock %}
{% block content %} {% block content %}
<section class="cpg"> <section class="cpg">
@@ -1,6 +1,6 @@
{% extends "erp_base.html" %} {% extends "erp_base.html" %}
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260828z" />{% endblock %} {% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260829a" />{% endblock %}
{% block content %} {% block content %}
<section class="cpg"> <section class="cpg">
@@ -1,6 +1,6 @@
{% extends "erp_base.html" %} {% extends "erp_base.html" %}
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260828z" />{% endblock %} {% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260829a" />{% endblock %}
{% block content %} {% block content %}
<section class="cpg"> <section class="cpg">
+9 -5
View File
@@ -331,7 +331,7 @@
.cpg-calc-table { table-layout: fixed; width: 100%; } .cpg-calc-table { table-layout: fixed; width: 100%; }
.cpg-calc-table th, .cpg-calc-table td { padding: 8px 6px; } .cpg-calc-table th, .cpg-calc-table td { padding: 8px 6px; }
.cpg-calc-table .cpg-calc-num { text-align: right; white-space: nowrap; } .cpg-calc-table .cpg-calc-num { text-align: right; white-space: nowrap; }
.cpg-calc-table th.cpg-calc-num { text-align: right; }
.cpg-calc-table .cpg-calc-name { width: 100%; min-width: 0; } .cpg-calc-table .cpg-calc-name { width: 100%; min-width: 0; }
.cpg-calc-table .cpg-calc-qty { width: 100%; min-width: 0; text-align: right; padding-left: 6px; padding-right: 6px; } .cpg-calc-table .cpg-calc-qty { width: 100%; min-width: 0; text-align: right; padding-left: 6px; padding-right: 6px; }
.cpg-calc-table .cpg-calc-box { white-space: nowrap; font-size: 13px; } .cpg-calc-table .cpg-calc-box { white-space: nowrap; font-size: 13px; }
@@ -344,9 +344,13 @@
.cpg-calc-table col.cpg-col-box { width: 116px; } .cpg-calc-table col.cpg-col-box { width: 116px; }
.cpg-calc-table col.cpg-col-n { width: 64px; } .cpg-calc-table col.cpg-col-n { width: 64px; }
.cpg-calc-table col.cpg-col-act { width: 40px; } .cpg-calc-table col.cpg-col-act { width: 40px; }
/* fixed 레이아웃에서 내용이 셀 밖으로 삐져나와 가로 스크롤이 생기는 것을 막는다. */ /* fixed 레이아웃에서 내용이 셀 밖으로 삐져나와 가로 스크롤이 생기는 것을 막는다.
.cpg-calc-table th, .cpg-calc-table td { overflow: hidden; text-overflow: ellipsis; } 말줄임(…)은 글자 셀에만 준다 — input/button 이 든 셀에 주면 빈 "…" 이 그려진다. */
.cpg-calc-table thead th { white-space: nowrap; } .cpg-calc-table th, .cpg-calc-table td { overflow: hidden; }
.cpg-calc-table thead th { white-space: nowrap; text-align: center; font-weight: 700; color: var(--color-rich-black); }
.cpg-calc-table .cpg-calc-box { text-overflow: ellipsis; }
/* 숫자열 헤더도 가운데 정렬(본문 셀은 우측 정렬 유지) */
.cpg-calc-table thead th.cpg-calc-num { text-align: center; }
.cpg-calc-row.cpg-calc-warn { background: color-mix(in srgb, var(--color-callout-red) 8%, transparent); } .cpg-calc-row.cpg-calc-warn { background: color-mix(in srgb, var(--color-callout-red) 8%, transparent); }
.cpg-calc-actions { margin-top: 12px; gap: 8px; align-items: center; } .cpg-calc-actions { margin-top: 12px; gap: 8px; align-items: center; }
/* 상단선 정렬: 2열 그리드에서는 위 여백을 주지 않는다. */ /* 상단선 정렬: 2열 그리드에서는 위 여백을 주지 않는다. */
@@ -565,7 +569,7 @@
/* 상자 그림 안 박스 호수 라벨 (예: 2호) */ /* 상자 그림 안 박스 호수 라벨 (예: 2호) */
.cpg-box-label { .cpg-box-label {
font-family: inherit; font-family: inherit;
font-size: 15px; font-size: 11px;
font-weight: 700; font-weight: 700;
fill: #8a5a1e; fill: #8a5a1e;
paint-order: stroke; paint-order: stroke;