From a02015641c5f7f860388a7784da8894c6f0c4eed Mon Sep 17 00:00:00 2001 From: chpark Date: Fri, 15 May 2026 01:19:10 +0900 Subject: [PATCH] =?UTF-8?q?fix(orders):=20admin=20=EC=B6=9C=EA=B3=A0?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=20=E2=80=94=20ITEM=20=EB=9D=BC=EC=9D=B8=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C=20=EB=B2=84=ED=8A=BC=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?(REQUESTED/APPROVED)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/(main)/m/admin/orders/page.tsx | 27 +++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/app/(main)/m/admin/orders/page.tsx b/src/app/(main)/m/admin/orders/page.tsx index bfd65cd..1d575a8 100644 --- a/src/app/(main)/m/admin/orders/page.tsx +++ b/src/app/(main)/m/admin/orders/page.tsx @@ -531,6 +531,25 @@ function StatementPreview({ else Swal.fire({ icon: "error", title: "수량 저장 실패", text: j.message }); }; + // ITEM 라인 삭제 — items/update API delete 옵션 + const deleteItemLine = async (lineObjid: string, itemName: string) => { + const ok = await Swal.fire({ + icon: "question", + title: `${itemName} 품목을 삭제하시겠습니까?`, + showCancelButton: true, + confirmButtonColor: "#dc2626", + confirmButtonText: "삭제", + }); + if (!ok.isConfirmed) return; + const res = await fetch("/api/m/orders/items/update", { + method: "POST", headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ orderObjid: order.OBJID, lines: [{ objid: lineObjid, delete: true }] }), + }); + const j = await res.json(); + if (j.success) { onReload(); onReloadList(); } + else Swal.fire({ icon: "error", title: "삭제 실패", text: j.message }); + }; + const upsertExtra = async (line: { objid?: string; kind: "DELIVERY" | "CHARTER"; label: string; unitPrice: number; qty: number }) => { const res = await fetch("/api/m/orders/lines/save", { method: "POST", headers: { "Content-Type": "application/json" }, @@ -776,7 +795,13 @@ function StatementPreview({ ? saveRemark(it.OBJID, r)} /> : {it.REMARK || ""}} - {editable && } + {editable && ( + + + + )} ); })}