feat(WEB): 공정관리/작업지시/작업자화면 기능 강화 및 템플릿 개선

- 공정관리: ProcessDetail/ProcessForm/ProcessList 개선, StepDetail/StepForm 신규 추가
- 작업지시: WorkOrderDetail/Edit/List UI 개선, 작업지시서 문서 추가
- 작업자화면: WorkerScreen 대폭 개선, MaterialInputModal/WorkLogModal 수정, WorkItemCard 신규
- 영업주문: 주문 상세 페이지 개선
- 입고관리: 상세/actions 수정
- 템플릿: IntegratedDetailTemplate/IntegratedListTemplateV2/UniversalListPage 기능 확장
- UI: confirm-dialog 개선

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
유병철
2026-01-29 22:56:01 +09:00
parent 106ce09482
commit 3fc63d0b3e
50 changed files with 5801 additions and 1377 deletions

View File

@@ -3,7 +3,7 @@
import { isNextRedirectError } from '@/lib/utils/redirect-error';
import { serverFetch } from '@/lib/api/fetch-wrapper';
import type { Process, ProcessFormData, ClassificationRule, IndividualItem } from '@/types/process';
import type { Process, ProcessFormData, ClassificationRule, IndividualItem, ProcessStep } from '@/types/process';
// ============================================================================
// API 타입 정의
@@ -661,3 +661,152 @@ export async function getItemList(params?: GetItemListParams): Promise<ItemOptio
return [];
}
}
// ============================================================================
// 공정 단계 (Process Step) - 목데이터 및 스텁 함수
// 백엔드 API 미준비 → 프론트엔드 목데이터로 운영
// ============================================================================
const MOCK_STEPS: Record<string, ProcessStep[]> = {
// processId별로 목데이터 보유
default: [
{
id: 'step-1',
stepCode: 'STP-001',
stepName: '자재투입',
isRequired: true,
needsApproval: false,
needsInspection: false,
isActive: true,
order: 1,
connectionType: '팝업',
connectionTarget: '입고완료 자재 목록',
completionType: '선택 완료 시 완료',
},
{
id: 'step-2',
stepCode: 'STP-002',
stepName: '미싱',
isRequired: true,
needsApproval: false,
needsInspection: false,
isActive: true,
order: 2,
connectionType: '없음',
completionType: '클릭 시 완료',
},
{
id: 'step-3',
stepCode: 'STP-003',
stepName: '중간검사',
isRequired: false,
needsApproval: true,
needsInspection: true,
isActive: true,
order: 3,
connectionType: '없음',
completionType: '클릭 시 완료',
},
{
id: 'step-4',
stepCode: 'STP-004',
stepName: '포장',
isRequired: true,
needsApproval: false,
needsInspection: false,
isActive: true,
order: 4,
connectionType: '없음',
completionType: '클릭 시 완료',
},
],
};
/**
* 공정 단계 목록 조회 (목데이터)
*/
export async function getProcessSteps(processId: string): Promise<{
success: boolean;
data?: ProcessStep[];
error?: string;
}> {
// 목데이터 반환
const steps = MOCK_STEPS[processId] || MOCK_STEPS['default'];
return { success: true, data: steps };
}
/**
* 공정 단계 상세 조회 (목데이터)
*/
export async function getProcessStepById(processId: string, stepId: string): Promise<{
success: boolean;
data?: ProcessStep;
error?: string;
}> {
const steps = MOCK_STEPS[processId] || MOCK_STEPS['default'];
const step = steps.find((s) => s.id === stepId);
if (!step) {
return { success: false, error: '단계를 찾을 수 없습니다.' };
}
return { success: true, data: step };
}
/**
* 공정 단계 생성 (스텁)
*/
export async function createProcessStep(
_processId: string,
data: Omit<ProcessStep, 'id'>
): Promise<{ success: boolean; data?: ProcessStep; error?: string }> {
const newStep: ProcessStep = {
...data,
id: `step-${Date.now()}`,
};
return { success: true, data: newStep };
}
/**
* 공정 단계 수정 (스텁)
*/
export async function updateProcessStep(
_processId: string,
stepId: string,
data: Partial<ProcessStep>
): Promise<{ success: boolean; data?: ProcessStep; error?: string }> {
return {
success: true,
data: {
id: stepId,
stepCode: data.stepCode || '',
stepName: data.stepName || '',
isRequired: data.isRequired ?? false,
needsApproval: data.needsApproval ?? false,
needsInspection: data.needsInspection ?? false,
isActive: data.isActive ?? true,
order: data.order ?? 0,
connectionType: data.connectionType || '없음',
connectionTarget: data.connectionTarget,
completionType: data.completionType || '클릭 시 완료',
},
};
}
/**
* 공정 단계 삭제 (스텁)
*/
export async function deleteProcessStep(
_processId: string,
_stepId: string
): Promise<{ success: boolean; error?: string }> {
return { success: true };
}
/**
* 공정 단계 순서 변경 (스텁)
*/
export async function reorderProcessSteps(
_processId: string,
_stepIds: string[]
): Promise<{ success: boolean; error?: string }> {
return { success: true };
}