fix: [입고] 검사완료 상태 처리, 단위 누락 수정, 컬럼 순서 변경
This commit is contained in:
@@ -722,7 +722,9 @@ export function ReceivingDetail({ id, mode = 'view' }: Props) {
|
||||
// ===== 커스텀 헤더 액션 (view/edit 모드) =====
|
||||
// 수정 버튼은 IntegratedDetailTemplate의 DetailActions에서 아이콘으로 제공하므로 중복 제거
|
||||
// 수입검사하기 버튼은 수입검사 성적서 템플릿이 있는 품목만 표시
|
||||
const customHeaderActions = (isViewMode || isEditMode) && detail && hasInspectionTemplate ? (
|
||||
// 수입검사 버튼 표시 조건: 템플릿이 있거나 이미 검사 완료된 경우
|
||||
const showInspectionActions = hasInspectionTemplate || !!detail?.inspectionResult || !!detail?.inspectionDate;
|
||||
const customHeaderActions = (isViewMode || isEditMode) && detail && showInspectionActions ? (
|
||||
<div className="flex gap-2">
|
||||
<Button variant="outline" size="sm" onClick={handleInspection}>
|
||||
<ClipboardCheck className="w-4 h-4 md:mr-2" />
|
||||
|
||||
@@ -243,24 +243,24 @@ export function ReceivingList() {
|
||||
},
|
||||
},
|
||||
|
||||
// 테이블 컬럼 (기획서 2026-02-03 순서)
|
||||
// 테이블 컬럼
|
||||
columns: [
|
||||
{ key: 'no', label: 'No.', className: 'w-[50px] text-center' },
|
||||
{ key: 'materialNo', label: '입고번호', className: 'w-[130px]', copyable: true },
|
||||
{ key: 'lotNo', label: '원자재로트', className: 'w-[120px]', copyable: true },
|
||||
{ key: 'inspectionStatus', label: '수입검사', className: 'w-[70px] text-center' },
|
||||
{ key: 'status', label: '상태', className: 'w-[80px] text-center' },
|
||||
{ key: 'inspectionDate', label: '검사일', className: 'w-[90px] text-center', copyable: true },
|
||||
{ key: 'supplier', label: '발주처', className: 'min-w-[100px]', copyable: true },
|
||||
{ key: 'manufacturer', label: '제조사', className: 'min-w-[100px]', copyable: true },
|
||||
{ key: 'itemCode', label: '품목코드', className: 'min-w-[100px]', copyable: true },
|
||||
{ key: 'itemType', label: '품목유형', className: 'w-[80px] text-center' },
|
||||
{ key: 'itemName', label: '품목명', className: 'min-w-[130px]', copyable: true },
|
||||
{ key: 'specification', label: '규격', className: 'w-[90px]', copyable: true },
|
||||
{ key: 'unit', label: '단위', className: 'w-[50px] text-center', copyable: true },
|
||||
{ key: 'receivingQty', label: '수량', className: 'w-[60px] text-center', copyable: true },
|
||||
{ key: 'receivingDate', label: '입고변경일', className: 'w-[100px] text-center', copyable: true },
|
||||
{ key: 'createdBy', label: '작성자', className: 'w-[70px] text-center', copyable: true },
|
||||
{ key: 'status', label: '상태', className: 'w-[80px] text-center' },
|
||||
{ key: 'itemType', label: '품목유형', className: 'w-[80px] text-center' },
|
||||
],
|
||||
|
||||
// 서버 사이드 페이지네이션
|
||||
@@ -347,11 +347,15 @@ export function ReceivingList() {
|
||||
);
|
||||
})()}
|
||||
</TableCell>
|
||||
<TableCell className="text-center">
|
||||
<Badge className={`text-xs ${RECEIVING_STATUS_STYLES[item.status]}`}>
|
||||
{RECEIVING_STATUS_LABELS[item.status]}
|
||||
</Badge>
|
||||
</TableCell>
|
||||
<TableCell className="text-center">{item.inspectionDate || '-'}</TableCell>
|
||||
<TableCell>{item.supplier}</TableCell>
|
||||
<TableCell>{item.manufacturer || '-'}</TableCell>
|
||||
<TableCell>{item.itemCode}</TableCell>
|
||||
<TableCell className="text-center">{item.itemType || '-'}</TableCell>
|
||||
<TableCell className="max-w-[130px] truncate">{item.itemName}</TableCell>
|
||||
<TableCell>{item.specification || '-'}</TableCell>
|
||||
<TableCell className="text-center">{item.unit}</TableCell>
|
||||
@@ -360,11 +364,7 @@ export function ReceivingList() {
|
||||
</TableCell>
|
||||
<TableCell className="text-center">{item.receivingDate || '-'}</TableCell>
|
||||
<TableCell className="text-center">{item.createdBy || '-'}</TableCell>
|
||||
<TableCell className="text-center">
|
||||
<Badge className={`text-xs ${RECEIVING_STATUS_STYLES[item.status]}`}>
|
||||
{RECEIVING_STATUS_LABELS[item.status]}
|
||||
</Badge>
|
||||
</TableCell>
|
||||
<TableCell className="text-center">{item.itemType || '-'}</TableCell>
|
||||
</TableRow>
|
||||
);
|
||||
},
|
||||
|
||||
@@ -368,6 +368,7 @@ interface ReceivingApiStatsResponse {
|
||||
receiving_pending_count: number;
|
||||
shipping_count: number;
|
||||
inspection_pending_count: number;
|
||||
inspection_completed_count: number;
|
||||
today_receiving_count: number;
|
||||
}
|
||||
|
||||
@@ -470,7 +471,7 @@ function transformApiToStats(data: ReceivingApiStatsResponse): ReceivingStats {
|
||||
receivingPendingCount: data.receiving_pending_count,
|
||||
receivingCompletedCount: data.shipping_count,
|
||||
inspectionPendingCount: data.inspection_pending_count,
|
||||
inspectionCompletedCount: data.today_receiving_count,
|
||||
inspectionCompletedCount: data.inspection_completed_count,
|
||||
shippingCount: data.shipping_count,
|
||||
todayReceivingCount: data.today_receiving_count,
|
||||
};
|
||||
@@ -491,7 +492,8 @@ function transformFrontendToApi(
|
||||
// 발주수량: orderQty가 없으면 receivingQty를 사용
|
||||
const orderQty = data.orderQty ?? data.receivingQty;
|
||||
if (orderQty !== undefined) result.order_qty = orderQty;
|
||||
if (data.orderUnit !== undefined) result.order_unit = data.orderUnit;
|
||||
const unit = data.orderUnit ?? data.unit;
|
||||
if (unit !== undefined) result.order_unit = unit;
|
||||
if (data.dueDate !== undefined) result.due_date = data.dueDate;
|
||||
if (data.status !== undefined) result.status = data.status;
|
||||
if (data.remark !== undefined) result.remark = data.remark;
|
||||
@@ -1845,7 +1847,7 @@ export async function saveInspectionData(params: {
|
||||
if (docResult.__authError) return { success: false, __authError: true };
|
||||
if (!docResult.success) return { success: false, error: docResult.error };
|
||||
|
||||
// Step 2: PUT /v1/receivings/{id} - 검사 완료 후 입고대기로 상태 변경 (비필수)
|
||||
// Step 2: PUT /v1/receivings/{id} - 검사 완료 후 상태 변경
|
||||
const today = getTodayString();
|
||||
const inspectionStatus = params.inspectionResult === 'pass' ? '적' : params.inspectionResult === 'fail' ? '부적' : '-';
|
||||
const inspectionResultLabel = params.inspectionResult === 'pass' ? '합격' : params.inspectionResult === 'fail' ? '불합격' : null;
|
||||
@@ -1854,7 +1856,7 @@ export async function saveInspectionData(params: {
|
||||
url: buildApiUrl(`/api/v1/receivings/${params.receivingId}`),
|
||||
method: 'PUT',
|
||||
body: {
|
||||
status: 'receiving_pending',
|
||||
status: 'inspection_completed',
|
||||
inspection_status: inspectionStatus,
|
||||
inspection_date: today,
|
||||
inspection_result: inspectionResultLabel,
|
||||
|
||||
Reference in New Issue
Block a user