From 867bc510dad3d7a2ff8da82b81321086455c39b8 Mon Sep 17 00:00:00 2001 From: king Date: Sat, 30 May 2026 04:16:24 +0900 Subject: [PATCH] =?UTF-8?q?ui(cupang):=20=EB=B0=95=EC=8A=A4=EC=9E=85?= =?UTF-8?q?=EC=88=98=EB=9F=89=20=EB=9D=BC=EB=B2=A8/=EA=B2=B9=EC=B9=A8,=20?= =?UTF-8?q?=EC=9E=85=EA=B3=A0=EC=84=BC=ED=84=B0=20=EC=BB=B4=ED=8C=A9?= =?UTF-8?q?=ED=8A=B8=20=EC=9E=AC=EB=94=94=EC=9E=90=EC=9D=B8,=20=EC=B6=9C?= =?UTF-8?q?=EA=B3=A0=20=EC=99=84=EC=A0=84=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 박스 입수량 폼: 제품명(스냅샷)→제품명, 헤더그리드로 교체해 입력란 겹침 해소 - 입고센터: 추가 폼 슬림화 + 센터 목록 2열 그리드(한 줄/센터)로 압축 - 출고 상세: 완전삭제 버튼 추가(/{id}/hard-delete, 라인 CASCADE). 취소 처리는 outline 로 Co-Authored-By: Claude Opus 4.8 --- app/modules/cupang/router.py | 17 ++++ .../cupang/templates/cupang/box_rules.html | 28 +++--- .../cupang/templates/cupang/centers.html | 95 +++++++++---------- .../cupang/templates/cupang/detail.html | 9 +- app/static/cupang.css | 25 +++++ 5 files changed, 108 insertions(+), 66 deletions(-) diff --git a/app/modules/cupang/router.py b/app/modules/cupang/router.py index 82e909b..4d3e1bf 100644 --- a/app/modules/cupang/router.py +++ b/app/modules/cupang/router.py @@ -425,6 +425,23 @@ async def delete( return RedirectResponse(url=f"/cupang/{shipment_id}", status_code=303) +@router.post("/{shipment_id:int}/hard-delete") +async def hard_delete( + request: Request, + shipment_id: int, + user: dict[str, Any] = Depends(_require_user), +) -> RedirectResponse: + """완전 삭제(헤더+라인 CASCADE). 달력으로 복귀.""" + store = _store(request) + if store is None: + raise HTTPException(status_code=503, detail="cupang_db 미설정") + try: + store.hard_delete(shipment_id=shipment_id) + except KeyError: + raise HTTPException(status_code=404, detail="출고 묶음을 찾을 수 없습니다.") + return RedirectResponse(url="/cupang/", status_code=303) + + # ════════════════════════════════════════════════════════════ # 입고센터 관리 # ════════════════════════════════════════════════════════════ diff --git a/app/modules/cupang/templates/cupang/box_rules.html b/app/modules/cupang/templates/cupang/box_rules.html index 9469075..5061cc8 100644 --- a/app/modules/cupang/templates/cupang/box_rules.html +++ b/app/modules/cupang/templates/cupang/box_rules.html @@ -15,18 +15,22 @@

박스 입수량 추가 / 수정

같은 제품코드는 덮어씁니다. 쿠팡박스 1박스당 들어가는 수량. -
- - - - - -
+ +
+ + + + + +
+
+ +
diff --git a/app/modules/cupang/templates/cupang/centers.html b/app/modules/cupang/templates/cupang/centers.html index c2b6330..6fce5f9 100644 --- a/app/modules/cupang/templates/cupang/centers.html +++ b/app/modules/cupang/templates/cupang/centers.html @@ -9,65 +9,56 @@ ← 달력 - -
-

입고센터 추가

+ +
+

입고센터 추가

- - + +
- +
-

센터 목록 ({{ centers|length }})

-
- - - - - - {% for c in centers %} - - - - - - - - {% endfor %} - -
센터명정렬상태사용중동작
-
- - - -
-
{{ c.sort_order }} - {% if c.active %}활성 - {% else %}비활성{% endif %} - {% if c.in_use %}사용중{% else %}—{% endif %} -
- {% if c.active %} -
- - -
- {% else %} -
- - -
- {% endif %} -
- -
-
-
+
+

센터 목록 ({{ centers|length }})

+ 사용 중 센터는 삭제 시 비활성화됩니다. +
+ +
+ {% for c in centers %} +
+
+ + + +
+ + {% if c.in_use %}사용중{% endif %} + {% if c.active %}활성 + {% else %}비활성{% endif %} + + + {% if c.active %} +
+ + +
+ {% else %} +
+ + +
+ {% endif %} +
+ +
+
+
+ {% endfor %}
-

※ 출고 데이터에서 사용 중인 센터는 삭제 시 hard delete 되지 않고 비활성화됩니다.

diff --git a/app/modules/cupang/templates/cupang/detail.html b/app/modules/cupang/templates/cupang/detail.html index c1b6832..4ac6e36 100644 --- a/app/modules/cupang/templates/cupang/detail.html +++ b/app/modules/cupang/templates/cupang/detail.html @@ -20,8 +20,13 @@
- + onsubmit="return confirm('이 출고 묶음을 취소 처리합니다(상태=취소). 계속할까요?');"> + +
+ +
+
diff --git a/app/static/cupang.css b/app/static/cupang.css index 63c2089..9885a8f 100644 --- a/app/static/cupang.css +++ b/app/static/cupang.css @@ -98,6 +98,31 @@ .cpg-inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; } .cpg-row-actions { display: flex; gap: 6px; flex-wrap: wrap; } +/* ── 입고센터 관리 (컴팩트) ── */ +.cpg-center-add { padding: 12px 16px; } +.cpg-center-add-title { font-size: 15px; font-weight: 600; margin: 0 0 8px; } +.cpg-btn-sm { padding: 3px 8px; font-size: 12px; } + +.cpg-center-grid { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 6px 16px; +} +@media (max-width: 820px) { .cpg-center-grid { grid-template-columns: 1fr; } } + +.cpg-center-row { + display: flex; align-items: center; gap: 8px; + padding: 5px 8px; + border: 1px solid var(--color-subtle-ash); border-radius: 10px; + min-width: 0; +} +.cpg-center-row.is-inactive { opacity: .55; } +.cpg-center-edit { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; } +.cpg-center-name { flex: 1 1 auto; min-width: 0; } +.cpg-center-sort { width: 56px; flex: 0 0 auto; } +.cpg-center-state { display: inline-flex; gap: 4px; flex: 0 0 auto; } +.cpg-center-act { display: inline-flex; gap: 4px; flex: 0 0 auto; } + /* ── 라인 테이블 ── */ .cpg-lines td { vertical-align: middle; } .cpg-lines .cpg-name-sel { width: 100%; min-width: 160px; }