ui(cupang): 박스 입수량 폼 제품명 드롭다운 + 라벨 정리

- 제품명*(등록 제품 드롭다운, 코드 오름차순) 선택 시 제품코드/스냅샷 자동
- 라벨: 제품명* / 제품코드 / 박스이름 / 박스당 입수량*
- 캐시 버전 d

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-05-30 05:52:57 +09:00
parent 478cde8caf
commit c11c5733de
8 changed files with 38 additions and 14 deletions
+1
View File
@@ -552,6 +552,7 @@ async def box_rules_page(request: Request) -> HTMLResponse:
"page_title": "쿠팡 밀크런 — 박스 입수량",
"page_subtitle": "제품코드별 쿠팡박스 1박스당 입수량 설정",
"box_rules": store.list_box_rules(include_inactive=True),
"products": store.list_products(),
"search_enabled": bool((_itemcode(request)) and _itemcode(request).enabled),
},
)
@@ -1,6 +1,6 @@
{% extends "erp_base.html" %}
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260530c" />{% endblock %}
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260530d" />{% endblock %}
{% block content %}
<section class="cpg">
@@ -16,12 +16,18 @@
<span class="erp-muted">같은 제품코드는 덮어씁니다. 쿠팡박스 1박스당 들어가는 수량.</span>
</div>
<form method="post" action="/cupang/box-rules">
<input type="hidden" name="product_name_snapshot" id="brule-name-snap" />
<div class="cpg-header-grid">
<label class="erp-field"><span>제품코드 *</span>
<input class="erp-input" type="text" name="product_code" required placeholder="예: MS-1001" /></label>
<label class="erp-field"><span>제품명</span>
<input class="erp-input" type="text" name="product_name_snapshot" placeholder="예: 미라네 1호세트" /></label>
<label class="erp-field"><span>박스명</span>
<label class="erp-field"><span>제품 *</span>
<select class="erp-select" id="brule-name" required>
<option value="">— 제품명 선택 —</option>
{% for p in products %}
<option value="{{ p.product_code }}" data-name="{{ p.product_name }}">{{ p.product_name }}</option>
{% endfor %}
</select></label>
<label class="erp-field"><span>제품코드</span>
<input class="erp-input" type="text" name="product_code" id="brule-code" required placeholder="제품명 선택 시 자동" /></label>
<label class="erp-field"><span>박스이름</span>
<input class="erp-input" type="text" name="box_name" value="쿠팡박스" /></label>
<label class="erp-field"><span>박스당 입수량 *</span>
<input class="erp-input" type="number" name="units_per_box" min="1" required /></label>
@@ -32,8 +38,25 @@
<button type="submit" class="erp-btn erp-btn-primary">저장</button>
</div>
</form>
{% if not products %}
<p class="erp-muted"><a href="/cupang/products">설정에서 제품명을 먼저 등록</a>하면 드롭다운에 표시됩니다.</p>
{% endif %}
</div>
<script>
(function () {
var sel = document.getElementById("brule-name");
var code = document.getElementById("brule-code");
var snap = document.getElementById("brule-name-snap");
if (!sel) return;
sel.addEventListener("change", function () {
var opt = sel.options[sel.selectedIndex];
code.value = sel.value;
snap.value = opt ? (opt.getAttribute("data-name") || "") : "";
});
})();
</script>
<!-- 목록 -->
<div class="erp-card cpg-form-card">
<div class="cpg-card-head"><h2>입수량 규칙 ({{ box_rules|length }})</h2></div>
@@ -1,6 +1,6 @@
{% extends "erp_base.html" %}
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260530c" />{% endblock %}
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260530d" />{% endblock %}
{% block content %}
<section class="cpg">
@@ -1,6 +1,6 @@
{% extends "erp_base.html" %}
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260530c" />{% endblock %}
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260530d" />{% endblock %}
{% block content %}
<section class="cpg">
@@ -1,6 +1,6 @@
{% extends "erp_base.html" %}
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260530c" />{% endblock %}
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260530d" />{% endblock %}
{% block content %}
<section class="cpg">
@@ -118,4 +118,4 @@
</script>
{% endblock %}
{% block scripts %}<script src="/static/cupang.js?v=20260530c" defer></script>{% endblock %}
{% block scripts %}<script src="/static/cupang.js?v=20260530d" defer></script>{% endblock %}
@@ -1,6 +1,6 @@
{% extends "erp_base.html" %}
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260530c" />{% endblock %}
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260530d" />{% endblock %}
{% block content %}
<section class="cpg">
@@ -1,6 +1,6 @@
{% extends "erp_base.html" %}
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260530c" />{% endblock %}
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260530d" />{% endblock %}
{% block content %}
<section class="cpg">
+2 -2
View File
@@ -4,8 +4,8 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{{ page_title or "ERP" }} — DBX Corporation</title>
<link rel="stylesheet" href="/static/erp.css?v=20260530c" />
<link rel="stylesheet" href="/static/erp-shell.css?v=20260530c" />
<link rel="stylesheet" href="/static/erp.css?v=20260530d" />
<link rel="stylesheet" href="/static/erp-shell.css?v=20260530d" />
<link rel="stylesheet" href="/static/erp-attach-viewer.css" />
{% block head_extra %}{% endblock %}
</head>