feat(cupang): 상자 목록을 번호·제품명·제품코드·수량 표로, 엑셀 다운로드 추가

- ② 상자 목록: 카드 대신 표. 한 상자에 여러 제품이면 상자번호 칸 rowspan 병합
- GET /cupang/{id}/boxes.xlsx — 같은 표를 xlsx 로 (export.build_box_list_workbook)
- box_list 항목에 product_code 포함

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-01 19:55:06 +09:00
parent 15947e73ed
commit 3926b6a431
9 changed files with 174 additions and 61 deletions
+29 -19
View File
@@ -1,6 +1,6 @@
{% extends "erp_base.html" %}
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260903a" />{% endblock %}
{% block head_extra %}<link rel="stylesheet" href="/static/cupang.css?v=20260903b" />{% endblock %}
{% block content %}
{# 출고 묶음 보기 — 상자 계산 화면과 같은 3열 구성. 읽기 전용(수정 없음). #}
@@ -49,6 +49,8 @@
<div class="cpg-card-head">
<h2>② 상자 목록</h2>
<span class="erp-muted">상자마다 담긴 제품과 수량</span>
<a class="erp-btn erp-btn-ghost cpg-boxno-dl"
href="/cupang/{{ shipment.id }}/boxes.xlsx">엑셀 다운로드</a>
</div>
<div id="cpg-sum-body">
@@ -71,26 +73,34 @@
</div>
<div class="cpg-sum-scroll">
<ul class="cpg-boxno-list">
{% for b in box_list %}
<li class="cpg-boxno{% if b.kind == 'mix' %} is-mix{% endif %}">
<div class="cpg-boxno-head">
<span class="cpg-boxno-no">{{ b.no }}</span>
<span class="cpg-boxno-name">{{ b.box_name or '상자' }}</span>
{% if b.kind == 'mix' %}<span class="cpg-boxno-tag">혼합</span>{% endif %}
<span class="cpg-boxno-qty">{{ b.quantity }}개</span>
</div>
<ul class="cpg-boxno-items">
<table class="erp-table cpg-boxno-table">
<colgroup>
<col class="cpg-boxno-c-no" />
<col class="cpg-boxno-c-name" />
<col class="cpg-boxno-c-code" />
<col class="cpg-boxno-c-qty" />
</colgroup>
<thead>
<tr><th>상자번호</th><th>제품명</th><th>제품코드</th><th>수량</th></tr>
</thead>
<tbody>
{% for b in box_list %}
{% for it in b['items'] %}
<li><span>{{ it.product_name }}</span><b>{{ it.quantity }}개</b></li>
<tr class="{% if loop.first %}is-boxtop{% endif %}">
{% if loop.first %}
<td class="cpg-boxno-cell" rowspan="{{ b['items']|length }}">{{ b.no }}</td>
{% endif %}
<td title="{{ it.product_name }}">{{ it.product_name }}</td>
<td class="cpg-boxno-code">{{ it.product_code }}</td>
<td class="cpg-calc-num">{{ it.quantity }}</td>
</tr>
{% endfor %}
</ul>
</li>
{% endfor %}
{% if not box_list %}
<li class="erp-muted">상자 정보가 없습니다.</li>
{% endif %}
</ul>
{% endfor %}
{% if not box_list %}
<tr><td colspan="4" class="erp-muted">상자 정보가 없습니다.</td></tr>
{% endif %}
</tbody>
</table>
</div>
</div>
</div>