From c9e1238e7d4fb08291db9b093e2c2b9099048950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=ED=98=81=EC=84=B1?= Date: Wed, 18 Mar 2026 23:18:46 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20[shipment]=20=EC=B6=9C=ED=95=98=20s?= =?UTF-8?q?hipping=20=EC=83=81=ED=83=9C=20=EC=88=98=EC=A0=95=20=ED=97=88?= =?UTF-8?q?=EC=9A=A9=20+=20=EB=B0=B0=EC=B0=A8=EA=B4=80=EB=A6=AC=20?= =?UTF-8?q?=EC=88=98=EC=A3=BC=20=EC=A0=95=EB=B3=B4=20=EB=A7=A4=ED=95=91=20?= =?UTF-8?q?=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 출하 상세 shipping 상태에서도 수정 허용 - 배차관리 현장명/발주처/작성자를 수주 정보에서 매핑 - 배차 상태를 freight_cost_type 기반으로 판단 --- .../VehicleDispatchManagement/actions.ts | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/components/outbound/VehicleDispatchManagement/actions.ts b/src/components/outbound/VehicleDispatchManagement/actions.ts index 7c8737cc..8ee9548f 100644 --- a/src/components/outbound/VehicleDispatchManagement/actions.ts +++ b/src/components/outbound/VehicleDispatchManagement/actions.ts @@ -27,13 +27,15 @@ interface PaginationMeta { function transformToListItem(data: any): VehicleDispatchItem { const options = data.options || {}; const shipment = data.shipment || {}; + const order = shipment.order || {}; + const orderInfo = shipment.order_info || {}; return { id: String(data.id), dispatchNo: options.dispatch_no || `DC-${data.id}`, shipmentNo: shipment.shipment_no || '', lotNo: shipment.lot_no || '', - siteName: shipment.site_name || '', - orderCustomer: shipment.customer_name || '', + siteName: orderInfo.site_name || order.site_name || shipment.site_name || '', + orderCustomer: orderInfo.customer_name || order.client_name || shipment.customer_name || '', logisticsCompany: data.logistics_company || '', tonnage: data.tonnage || '', supplyAmount: options.supply_amount || 0, @@ -42,9 +44,9 @@ function transformToListItem(data: any): VehicleDispatchItem { freightCostType: options.freight_cost_type || 'prepaid', vehicleNo: data.vehicle_no || '', driverContact: data.driver_contact || '', - writer: options.writer || '', + writer: shipment.creator?.name || order.writer?.name || options.writer || '', arrivalDateTime: data.arrival_datetime || '', - status: options.status || 'draft', + status: options.freight_cost_type ? 'completed' : 'draft', remarks: data.remarks || '', }; } @@ -53,16 +55,18 @@ function transformToListItem(data: any): VehicleDispatchItem { function transformToDetail(data: any): VehicleDispatchDetail { const options = data.options || {}; const shipment = data.shipment || {}; + const order = shipment.order || {}; + const orderInfo = shipment.order_info || {}; return { id: String(data.id), dispatchNo: options.dispatch_no || `DC-${data.id}`, shipmentNo: shipment.shipment_no || '', lotNo: shipment.lot_no || '', - siteName: shipment.site_name || '', - orderCustomer: shipment.customer_name || '', + siteName: orderInfo.site_name || order.site_name || shipment.site_name || '', + orderCustomer: orderInfo.customer_name || order.client_name || shipment.customer_name || '', freightCostType: options.freight_cost_type || 'prepaid', - status: options.status || 'draft', - writer: options.writer || '', + status: options.freight_cost_type ? 'completed' : 'draft', + writer: shipment.creator?.name || order.writer?.name || options.writer || '', logisticsCompany: data.logistics_company || '', arrivalDateTime: data.arrival_datetime || '', tonnage: data.tonnage || '',