diff --git a/src/components/process-management/StepForm.tsx b/src/components/process-management/StepForm.tsx index 27d45d07..9d88d383 100644 --- a/src/components/process-management/StepForm.tsx +++ b/src/components/process-management/StepForm.tsx @@ -30,12 +30,16 @@ import type { StepConnectionType, StepCompletionType, InspectionSetting, + InspectionScope, + InspectionScopeType, } from '@/types/process'; import { STEP_CONNECTION_TYPE_OPTIONS, STEP_COMPLETION_TYPE_OPTIONS, STEP_CONNECTION_TARGET_OPTIONS, DEFAULT_INSPECTION_SETTING, + DEFAULT_INSPECTION_SCOPE, + INSPECTION_SCOPE_TYPE_OPTIONS, } from '@/types/process'; import { createProcessStep, updateProcessStep } from './actions'; import type { DetailConfig } from '@/components/templates/IntegratedDetailTemplate/types'; @@ -108,6 +112,9 @@ export function StepForm({ mode, processId, initialData }: StepFormProps) { const [inspectionSetting, setInspectionSetting] = useState( initialData?.inspectionSetting || DEFAULT_INSPECTION_SETTING ); + const [inspectionScope, setInspectionScope] = useState( + initialData?.inspectionScope || DEFAULT_INSPECTION_SCOPE + ); // 모달 상태 const [isInspectionSettingOpen, setIsInspectionSettingOpen] = useState(false); @@ -137,6 +144,7 @@ export function StepForm({ mode, processId, initialData }: StepFormProps) { connectionTarget: connectionType === '팝업' ? connectionTarget : undefined, completionType, inspectionSetting: isInspectionEnabled ? inspectionSetting : undefined, + inspectionScope: isInspectionEnabled ? inspectionScope : undefined, }; setIsLoading(true); @@ -237,6 +245,52 @@ export function StepForm({ mode, processId, initialData }: StepFormProps) { + {isInspectionEnabled && ( + <> +
+ + +
+ {inspectionScope.type === 'sampling' && ( +
+ + + setInspectionScope((prev) => ({ + ...prev, + sampleSize: Math.max(1, parseInt(e.target.value) || 1), + })) + } + placeholder="검사할 개소 수" + /> +
+ )} + + )}