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; }