2025-12-23 21:13:07 +09:00
|
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 전량완료 확인 다이얼로그
|
|
|
|
|
*
|
|
|
|
|
* "자재 투입이 필요합니다" 안내 후 확인 클릭 시 MaterialInputModal로 이동
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
AlertDialog,
|
|
|
|
|
AlertDialogAction,
|
|
|
|
|
AlertDialogCancel,
|
|
|
|
|
AlertDialogContent,
|
|
|
|
|
AlertDialogDescription,
|
|
|
|
|
AlertDialogFooter,
|
|
|
|
|
AlertDialogHeader,
|
|
|
|
|
AlertDialogTitle,
|
|
|
|
|
} from '@/components/ui/alert-dialog';
|
|
|
|
|
import type { WorkOrder } from '../ProductionDashboard/types';
|
|
|
|
|
|
|
|
|
|
interface CompletionConfirmDialogProps {
|
|
|
|
|
open: boolean;
|
|
|
|
|
onOpenChange: (open: boolean) => void;
|
|
|
|
|
order: WorkOrder | null;
|
|
|
|
|
onConfirm: () => void; // 확인 클릭 시 → MaterialInputModal 열기
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function CompletionConfirmDialog({
|
|
|
|
|
open,
|
|
|
|
|
onOpenChange,
|
|
|
|
|
order,
|
|
|
|
|
onConfirm,
|
|
|
|
|
}: CompletionConfirmDialogProps) {
|
|
|
|
|
const handleConfirm = () => {
|
|
|
|
|
onOpenChange(false);
|
|
|
|
|
onConfirm(); // 부모에서 MaterialInputModal 열기
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleCancel = () => {
|
|
|
|
|
onOpenChange(false);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (!order) return null;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<AlertDialog open={open} onOpenChange={onOpenChange}>
|
|
|
|
|
<AlertDialogContent>
|
|
|
|
|
<AlertDialogHeader>
|
|
|
|
|
<AlertDialogTitle className="text-orange-600">
|
|
|
|
|
자재 투입이 필요합니다!
|
|
|
|
|
</AlertDialogTitle>
|
|
|
|
|
<AlertDialogDescription asChild>
|
|
|
|
|
<div className="space-y-3">
|
|
|
|
|
<div className="bg-gray-50 p-3 rounded-lg space-y-1 text-sm">
|
|
|
|
|
<p>
|
|
|
|
|
<span className="text-muted-foreground">작업지시:</span>{' '}
|
|
|
|
|
<span className="font-medium text-foreground">{order.orderNo}</span>
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
<span className="text-muted-foreground">공정:</span>{' '}
|
|
|
|
|
<span className="font-medium text-foreground">
|
2026-01-20 17:03:13 +09:00
|
|
|
{order.processName}
|
2025-12-23 21:13:07 +09:00
|
|
|
</span>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<p className="text-orange-600 font-medium">
|
|
|
|
|
자재 투입 없이 완료 처리하시겠습니까?
|
|
|
|
|
</p>
|
|
|
|
|
<p className="text-sm text-muted-foreground">
|
|
|
|
|
(LOT 추적이 불가능해집니다)
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</AlertDialogDescription>
|
|
|
|
|
</AlertDialogHeader>
|
|
|
|
|
<AlertDialogFooter>
|
|
|
|
|
<AlertDialogCancel onClick={handleCancel}>취소</AlertDialogCancel>
|
|
|
|
|
<AlertDialogAction onClick={handleConfirm}>
|
|
|
|
|
확인
|
|
|
|
|
</AlertDialogAction>
|
|
|
|
|
</AlertDialogFooter>
|
|
|
|
|
</AlertDialogContent>
|
|
|
|
|
</AlertDialog>
|
|
|
|
|
);
|
|
|
|
|
}
|