diff --git a/src/components/production/WorkerScreen/MaterialInputModal.tsx b/src/components/production/WorkerScreen/MaterialInputModal.tsx index da05aa5e..64d3ce49 100644 --- a/src/components/production/WorkerScreen/MaterialInputModal.tsx +++ b/src/components/production/WorkerScreen/MaterialInputModal.tsx @@ -87,6 +87,7 @@ export function MaterialInputModal({ const [manualAllocations, setManualAllocations] = useState>(new Map()); const [isLoading, setIsLoading] = useState(false); const [isSubmitting, setIsSubmitting] = useState(false); + const [showUnfulfilledOnly, setShowUnfulfilledOnly] = useState(false); const materialsLoadedRef = useRef(false); // 재공품 여부 판별 — 재공품이면 검색 시 원자재(RM)만 조회 @@ -538,13 +539,18 @@ export function MaterialInputModal({ }).length; const total = materialGroups.length; return ( - + ); })()} @@ -642,7 +648,13 @@ export function MaterialInputModal({ ) : (
- {materialGroups.map((group, groupIdx) => { + {materialGroups.filter((group) => { + if (!showUnfulfilledOnly) return true; + const target = getGroupTargetQty(group); + if (target <= 0 && group.alreadyInputted <= 0) return false; + const allocated = group.lots.reduce((sum, lot) => sum + (allocations.get(getLotKey(lot, group.groupKey)) || 0), 0); + return allocated < target; + }).map((group, groupIdx) => { // 같은 카테고리 내 순번 계산 (①②③...) const categoryIndex = group.category ? materialGroups.slice(0, groupIdx).filter(g => g.category === group.category).length