diff --git a/src/components/outbound/ShipmentManagement/actions.ts b/src/components/outbound/ShipmentManagement/actions.ts index 75db8eec..9536b316 100644 --- a/src/components/outbound/ShipmentManagement/actions.ts +++ b/src/components/outbound/ShipmentManagement/actions.ts @@ -49,8 +49,12 @@ interface OrderInfoApiData { customer_name?: string; site_name?: string; delivery_address?: string; + delivery_address_detail?: string; contact?: string; + receiver?: string; + receiver_contact?: string; delivery_date?: string; + delivery_method?: string; writer_id?: number; writer_name?: string; } @@ -160,8 +164,8 @@ function transformApiToListItem(data: ShipmentApiData): ShipmentItem { depositConfirmed: data.deposit_confirmed, invoiceIssued: data.invoice_issued, deliveryTime: data.vehicle_dispatches?.[0]?.arrival_datetime || data.expected_arrival, - // 수신/작성자/출고일 매핑 - receiver: data.receiver || '', + // 수신/작성자/출고일 매핑 (order_info 우선 → 출하 직접 필드 fallback) + receiver: data.order_info?.receiver || data.receiver || '', receiverAddress: data.order_info?.delivery_address || data.delivery_address || '', receiverCompany: data.order_info?.customer_name || data.customer_name || '', writer: data.order_info?.writer_name || data.creator?.name || '', @@ -207,8 +211,8 @@ function transformApiToDetail(data: ShipmentApiData): ShipmentDetail { customerName: data.order_info?.customer_name || data.customer_name || '', siteName: data.order_info?.site_name || data.site_name || '', deliveryAddress: data.order_info?.delivery_address || data.delivery_address || '', - receiver: data.receiver, - receiverContact: data.order_info?.contact || data.receiver_contact, + receiver: data.order_info?.receiver || data.receiver, + receiverContact: data.order_info?.receiver_contact || data.order_info?.contact || data.receiver_contact, zipCode: (data as unknown as Record).zip_code as string | undefined, address: (data as unknown as Record).address as string | undefined, addressDetail: (data as unknown as Record).address_detail as string | undefined, diff --git a/src/components/production/WorkerScreen/index.tsx b/src/components/production/WorkerScreen/index.tsx index 90a9084c..66dfbde7 100644 --- a/src/components/production/WorkerScreen/index.tsx +++ b/src/components/production/WorkerScreen/index.tsx @@ -864,8 +864,8 @@ export default function WorkerScreen() { } else if (step.needsInspection || step.isInspection) { // 검사 단계 (processListCache 설정 또는 하드코딩 폴백) → 중간검사 모달 열기 handleInspectionClick(itemId, step.name); - } else if (step.completionType === 'click_complete' && step.stepProgressId) { - // 클릭 시 완료 → 서버 토글 API 호출 + } else if (step.stepProgressId) { + // stepProgressId가 있으면 서버 토글 API 호출 (모든 일반 step 포함) const workItem = workItems.find((item) => item.id === itemId); const orderId = workItem?.workOrderId; if (orderId) { @@ -887,7 +887,7 @@ export default function WorkerScreen() { } } } else { - // 기타 → 완료/미완료 토글 (로컬) - enrichStep stepKey 형식 일치 + // stepProgressId 없는 경우 → 로컬 토글 (폴백) const stepKey = `${itemId.replace('-node-', '-')}-${step.name}`; setStepCompletionMap((prev) => ({ ...prev,