feat(WEB): 공정 단계 설정(검사여부/연결정보/완료정보) → WorkerScreen 연동
- WorkStepData 타입에 stepProgressId, needsInspection, connectionType, connectionTarget, completionType 추가 - getWorkOrderDetail step 변환에서 needs_inspection, connection_type, completion_type 추출 - PROCESS_STEPS 폴백 시 processListCache 단계 설정 매칭하여 enrichStep 헬퍼로 주입 - handleStepClick에 connectionType='팝업' + connectionTarget='중간검사' 분기 추가 - handleInspectionComplete에서 completionType='검사완료 시 완료' 단계 toggleStepProgress API 호출 - TemplateInspectionContent: reference_attribute → workItem 치수 연동 - InspectionInputModal: workItemDimensions prop으로 실제 치수 기반 설계값 표시
This commit is contained in:
@@ -70,6 +70,9 @@ export function ProcessForm({ mode, initialData }: ProcessFormProps) {
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
||||
// 중간검사/작업일지 설정 (Process 레벨)
|
||||
const [needsInspection, setNeedsInspection] = useState(
|
||||
initialData?.needsInspection ?? false
|
||||
);
|
||||
const [documentTemplateId, setDocumentTemplateId] = useState<number | undefined>(
|
||||
initialData?.documentTemplateId
|
||||
);
|
||||
@@ -320,7 +323,8 @@ export function ProcessForm({ mode, initialData }: ProcessFormProps) {
|
||||
processType,
|
||||
processCategory: processCategory || undefined,
|
||||
department,
|
||||
documentTemplateId: documentTemplateId || undefined,
|
||||
documentTemplateId: needsInspection ? (documentTemplateId || undefined) : undefined,
|
||||
needsInspection,
|
||||
needsWorkLog,
|
||||
workLogTemplateId: needsWorkLog ? workLogTemplateId : undefined,
|
||||
classificationRules: classificationRules.map((rule) => ({
|
||||
@@ -486,27 +490,44 @@ export function ProcessForm({ mode, initialData }: ProcessFormProps) {
|
||||
</Select>
|
||||
</div>
|
||||
</div>
|
||||
{/* Row 3: 중간검사양식 | 작업일지여부 | 작업일지양식 */}
|
||||
{/* Row 3: 중간검사여부 | 중간검사양식 | 작업일지여부 | 작업일지양식 */}
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 mt-6">
|
||||
<div className="space-y-2">
|
||||
<Label>중간검사 양식</Label>
|
||||
<Label>중간검사 여부</Label>
|
||||
<Select
|
||||
key={`doc-template-${documentTemplateId ?? 'none'}`}
|
||||
value={documentTemplateId ? String(documentTemplateId) : ''}
|
||||
onValueChange={(v) => setDocumentTemplateId(v ? Number(v) : undefined)}
|
||||
value={needsInspection ? '사용' : '미사용'}
|
||||
onValueChange={(v) => setNeedsInspection(v === '사용')}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="선택하세요" />
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{documentTemplates.map((tmpl) => (
|
||||
<SelectItem key={tmpl.id} value={String(tmpl.id)}>
|
||||
{tmpl.name} ({tmpl.category})
|
||||
</SelectItem>
|
||||
))}
|
||||
<SelectItem value="사용">사용</SelectItem>
|
||||
<SelectItem value="미사용">미사용</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
{needsInspection && (
|
||||
<div className="space-y-2">
|
||||
<Label>중간검사 양식</Label>
|
||||
<Select
|
||||
key={`doc-template-${documentTemplateId ?? 'none'}`}
|
||||
value={documentTemplateId ? String(documentTemplateId) : ''}
|
||||
onValueChange={(v) => setDocumentTemplateId(v ? Number(v) : undefined)}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="선택하세요" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{documentTemplates.map((tmpl) => (
|
||||
<SelectItem key={tmpl.id} value={String(tmpl.id)}>
|
||||
{tmpl.name} ({tmpl.category})
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
)}
|
||||
<div className="space-y-2">
|
||||
<Label>작업일지 여부</Label>
|
||||
<Select
|
||||
@@ -760,6 +781,7 @@ export function ProcessForm({ mode, initialData }: ProcessFormProps) {
|
||||
manager,
|
||||
useProductionDate,
|
||||
isActive,
|
||||
needsInspection,
|
||||
documentTemplateId,
|
||||
needsWorkLog,
|
||||
workLogTemplateId,
|
||||
|
||||
Reference in New Issue
Block a user