feat: [자재투입] 상단에 배정완료 현황 표시 (N/M 배정완료)

This commit is contained in:
김보곤
2026-03-22 10:40:11 +09:00
parent f0fffcb16b
commit 7b0adead79

View File

@@ -506,9 +506,29 @@ export function MaterialInputModal({
{workOrderItemName ? ` - ${workOrderItemName}` : ''}
</DialogTitle>
<div className="flex items-center justify-between mt-1">
<p className="text-sm text-gray-500">
.
</p>
<div className="flex items-center gap-2">
<p className="text-sm text-gray-500">
.
</p>
{!isLoading && materialGroups.length > 0 && (() => {
const fulfilled = materialGroups.filter((g) => {
const target = getGroupTargetQty(g);
if (target <= 0 && g.alreadyInputted <= 0) return true;
const allocated = g.lots.reduce((sum, lot) => sum + (allocations.get(getLotKey(lot, g.groupKey)) || 0), 0);
return allocated >= target;
}).length;
const total = materialGroups.length;
return (
<span className={cn(
"text-xs font-semibold px-2.5 py-1 rounded-full",
fulfilled === total ? "bg-emerald-100 text-emerald-700" : "bg-amber-100 text-amber-700"
)}>
{fulfilled === total ? <Check className="h-3 w-3 inline mr-0.5" /> : null}
{fulfilled} / {total}
</span>
);
})()}
</div>
{!isLoading && materials.length > 0 && (
<button
onClick={handleAutoFill}