feat: [자재투입] 상단에 배정완료 현황 표시 (N/M 배정완료)
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user