From 6bbc5867feb7d9441ae5b5aa6c5b82da78cb3c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=ED=98=81=EC=84=B1?= Date: Fri, 13 Mar 2026 22:26:19 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[order]=20=EC=88=98=EC=A3=BC=20?= =?UTF-8?q?=ED=99=95=EC=A0=95=20=EB=AA=A8=EB=8B=AC=EC=97=90=20=ED=92=88?= =?UTF-8?q?=EB=AA=A9=20=EC=A0=95=EB=B3=B4=20=ED=85=8C=EC=9D=B4=EB=B8=94=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 총금액 표시 제거 - 수주 품목 테이블 추가 (품목명, 층, 부호, 사이즈, 수량) - nodes 기반 렌더링 우선, products fallback - 모달 너비 max-w-md → max-w-lg 확장 --- .../order-management-sales/[id]/page.tsx | 84 ++++++++++++++++--- 1 file changed, 73 insertions(+), 11 deletions(-) diff --git a/src/app/[locale]/(protected)/sales/order-management-sales/[id]/page.tsx b/src/app/[locale]/(protected)/sales/order-management-sales/[id]/page.tsx index 9e16e013..64d96482 100644 --- a/src/app/[locale]/(protected)/sales/order-management-sales/[id]/page.tsx +++ b/src/app/[locale]/(protected)/sales/order-management-sales/[id]/page.tsx @@ -363,11 +363,21 @@ export default function OrderDetailPage() { }); if (result.success && result.data) { setOrder(result.data.order); - const { deletedCounts } = result.data; - toast.success( - `생산지시가 되돌려졌습니다. (작업지시 ${deletedCounts.workOrders}건, 품목 ${deletedCounts.workOrderItems}건, 결과 ${deletedCounts.workResults}건 삭제)` - ); + if (result.data.deletedCounts) { + // force 모드 (개발): 물리 삭제 건수 + const { deletedCounts } = result.data; + toast.success( + `생산지시가 되돌려졌습니다. (작업지시 ${deletedCounts.workOrders}건, 품목 ${deletedCounts.workOrderItems}건, 결과 ${deletedCounts.workResults}건 삭제)` + ); + } else { + // cancel 모드 (운영): 취소 처리 건수 + const msg = result.data.cancelledCount + ? `생산지시가 취소되었습니다. (${result.data.cancelledCount}건 취소)` + : '생산지시가 되돌려졌습니다.'; + toast.success(msg); + } setIsRevertDialogOpen(false); + setRevertReason(""); } else { toast.error(result.error || "생산지시 되돌리기에 실패했습니다."); } @@ -1133,7 +1143,7 @@ export default function OrderDetailPage() { {/* 수주 확정 다이얼로그 */} - + @@ -1156,18 +1166,70 @@ export default function OrderDetailPage() { 현장명 {order.siteName} -
- 총금액 - - {formatAmount(order.totalAmount || 0)}원 - -
현재 상태 {getOrderStatusBadge(order.status)}
+ {/* 수주 품목 정보 */} + {((order.nodes && order.nodes.length > 0) || (order.products && order.products.length > 0)) && ( +
+
+ 수주 품목 ({order.nodes?.length || order.products?.length || 0}건) +
+ + + + No + 품목 + + 부호 + 사이즈 + 수량 + + + + {order.nodes && order.nodes.length > 0 ? ( + order.nodes.map((node, idx) => { + const product = order.products?.[idx]; + const width = (node.options?.width as number) || product?.openWidth; + const height = (node.options?.height as number) || product?.openHeight; + const productName = product?.productName || node.name || '-'; + const floor = product?.floor || '-'; + const code = product?.code || '-'; + return ( + + {idx + 1} + {productName} + {floor} + {code} + + {width && height ? `${width} × ${height}` : '-'} + + {node.quantity} + + ); + }) + ) : order.products?.map((product, idx) => ( + + {idx + 1} + {product.productName || '-'} + {product.floor || '-'} + {product.code || '-'} + + {product.openWidth && product.openHeight + ? `${product.openWidth} × ${product.openHeight}` + : '-'} + + {product.quantity} + + ))} + +
+
+ )} + {/* 확정 안내 */}

확정 후 변경사항