feat(WEB): 수주 삭제 기능 추가 및 출하목록 데이터 수정
- 수주 상세 페이지에 삭제 기능 추가 - 수주등록/취소 상태에서 삭제 버튼 표시 - 삭제 확인 다이얼로그 구현 - 삭제 후 목록 페이지로 이동 - 출하목록 데이터 누락 수정 - 발주처/현장명 order_info 참조하도록 수정 - 배송방식 라벨 API 응답값 사용 - 공통코드 API 함수 추가 - getDeliveryMethodCodes, getDeliveryMethodOptions - getCodeLabel 유틸 함수
This commit is contained in:
@@ -41,7 +41,6 @@ import { getShipments, getShipmentStats, getShipmentStatsByStatus } from './acti
|
||||
import {
|
||||
SHIPMENT_STATUS_LABELS,
|
||||
SHIPMENT_STATUS_STYLES,
|
||||
DELIVERY_METHOD_LABELS,
|
||||
} from './types';
|
||||
import type { ShipmentItem, ShipmentStatus, ShipmentStats, ShipmentStatusStats } from './types';
|
||||
import { isNextRedirectError } from '@/lib/utils/redirect-error';
|
||||
@@ -287,7 +286,7 @@ export function ShipmentList() {
|
||||
<X className="w-4 h-4 mx-auto text-red-600" />
|
||||
)}
|
||||
</TableCell>
|
||||
<TableCell className="text-center">{DELIVERY_METHOD_LABELS[item.deliveryMethod]}</TableCell>
|
||||
<TableCell className="text-center">{item.deliveryMethodLabel}</TableCell>
|
||||
<TableCell>{item.customerName}</TableCell>
|
||||
<TableCell className="max-w-[120px] truncate">{item.siteName}</TableCell>
|
||||
<TableCell className="text-center">{item.manager || '-'}</TableCell>
|
||||
@@ -331,7 +330,7 @@ export function ShipmentList() {
|
||||
<InfoField label="로트번호" value={item.lotNo} />
|
||||
<InfoField label="발주처" value={item.customerName} />
|
||||
<InfoField label="출고예정일" value={item.scheduledDate} />
|
||||
<InfoField label="배송방식" value={DELIVERY_METHOD_LABELS[item.deliveryMethod]} />
|
||||
<InfoField label="배송방식" value={item.deliveryMethodLabel} />
|
||||
<InfoField label="출하가능" value={item.canShip ? '가능' : '불가'} />
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -144,8 +144,10 @@ function transformApiToListItem(data: ShipmentApiData): ShipmentItem {
|
||||
status: data.status,
|
||||
priority: data.priority,
|
||||
deliveryMethod: data.delivery_method,
|
||||
customerName: data.customer_name || '',
|
||||
siteName: data.site_name || '',
|
||||
deliveryMethodLabel: data.delivery_method_label || data.delivery_method,
|
||||
// 발주처/배송 정보: order_info 우선 참조 (Order가 Single Source of Truth)
|
||||
customerName: data.order_info?.customer_name || data.customer_name || '',
|
||||
siteName: data.order_info?.site_name || data.site_name || '',
|
||||
manager: data.loading_manager,
|
||||
canShip: data.can_ship,
|
||||
depositConfirmed: data.deposit_confirmed,
|
||||
|
||||
@@ -58,6 +58,7 @@ export interface ShipmentItem {
|
||||
status: ShipmentStatus; // 상태
|
||||
priority: ShipmentPriority; // 우선순위
|
||||
deliveryMethod: DeliveryMethod; // 배송방식
|
||||
deliveryMethodLabel: string; // 배송방식 라벨 (API에서 조회)
|
||||
customerName: string; // 발주처
|
||||
siteName: string; // 현장명
|
||||
manager?: string; // 담당
|
||||
|
||||
Reference in New Issue
Block a user