fix: [quality] 검사 미진행 시 "불일치" → "미검사" 표시 (#5)

- isInspected() 함수 추가 (실측값 0이면 미검사)
- calculateOrderSummary에 notInspected 카운트 추가
- UI: 미검사 건수 별도 표시, 불일치는 실측 후만 표시
This commit is contained in:
2026-03-18 23:29:49 +09:00
parent 48dfc8640b
commit 523f549069
2 changed files with 11 additions and 4 deletions

View File

@@ -701,7 +701,8 @@ export function InspectionCreate() {
<div className="flex items-center gap-3 text-sm">
<span>: <strong>{orderSummary.total}</strong></span>
<span className="text-green-600">: <strong>{orderSummary.same}</strong></span>
<span className="text-red-600">: <strong>{orderSummary.changed}</strong></span>
{orderSummary.changed > 0 && <span className="text-red-600">: <strong>{orderSummary.changed}</strong></span>}
{orderSummary.notInspected > 0 && <span className="text-muted-foreground">: <strong>{orderSummary.notInspected}</strong></span>}
</div>
</CardHeader>
<CardContent className="p-4">

View File

@@ -365,11 +365,17 @@ export const isOrderSpecSame = (item: OrderSettingItem): boolean => {
return item.orderWidth === item.constructionWidth && item.orderHeight === item.constructionHeight;
};
export const isInspected = (item: OrderSettingItem): boolean => {
return (item.constructionWidth ?? 0) > 0 || (item.constructionHeight ?? 0) > 0;
};
export const calculateOrderSummary = (items: OrderSettingItem[]) => {
const total = items.length;
const same = items.filter(isOrderSpecSame).length;
const changed = total - same;
return { total, same, changed };
const inspected = items.filter(isInspected);
const same = inspected.filter(isOrderSpecSame).length;
const changed = inspected.length - same;
const notInspected = total - inspected.length;
return { total, same, changed, notInspected };
};
// ===== 빈 폼 기본값 =====