fix(orders): admin 출고처리 — ITEM 라인 삭제 버튼 추가 (REQUESTED/APPROVED)
Deploy momo-erp / deploy (push) Successful in 2m7s
Deploy momo-erp / deploy (push) Successful in 2m7s
This commit is contained in:
@@ -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({
|
||||
? <RemarkInput initial={it.REMARK || ""} onSave={(r) => saveRemark(it.OBJID, r)} />
|
||||
: <span className="text-slate-600 text-[10px]">{it.REMARK || ""}</span>}
|
||||
</td>
|
||||
{editable && <td className="border border-slate-300 px-1 py-1"></td>}
|
||||
{editable && (
|
||||
<td className="border border-slate-300 px-1 py-1 text-center">
|
||||
<button onClick={() => deleteItemLine(it.OBJID, it.ITEM_NAME)} className="text-rose-500 hover:text-rose-700" title="품목 삭제">
|
||||
<X size={12} />
|
||||
</button>
|
||||
</td>
|
||||
)}
|
||||
</tr>
|
||||
);
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user