From 9272ddb3455a8c9f4de098a46030645c6debaf6d Mon Sep 17 00:00:00 2001 From: kjs Date: Mon, 13 Apr 2026 11:58:26 +0900 Subject: [PATCH] refactor: Improve table header and cell styling for production plan management and item inspection pages - Updated the table header and cell styles to enhance visibility and usability, including adjustments to z-index and sticky positioning. - Implemented dynamic label mapping for inspection types in the item inspection page to improve clarity. - Enhanced the sales order page by including management item filters in server queries, allowing for better data handling and user experience. - These changes aim to provide a more intuitive interface and improve data representation across multiple company implementations. --- .../production/plan-management/page.tsx | 30 ++++++------ .../quality/item-inspection/page.tsx | 9 ++-- .../(main)/COMPANY_10/sales/order/page.tsx | 46 ++++++++----------- .../production/plan-management/page.tsx | 30 ++++++------ .../quality/item-inspection/page.tsx | 9 ++-- .../(main)/COMPANY_16/sales/order/page.tsx | 46 ++++++++----------- .../production/plan-management/page.tsx | 30 ++++++------ .../quality/item-inspection/page.tsx | 9 ++-- .../(main)/COMPANY_29/sales/order/page.tsx | 46 ++++++++----------- .../production/plan-management/page.tsx | 30 ++++++------ .../quality/item-inspection/page.tsx | 9 ++-- .../production/plan-management/page.tsx | 30 ++++++------ .../quality/item-inspection/page.tsx | 9 ++-- .../app/(main)/COMPANY_7/sales/order/page.tsx | 46 ++++++++----------- .../production/plan-management/page.tsx | 30 ++++++------ .../quality/item-inspection/page.tsx | 9 ++-- .../app/(main)/COMPANY_8/sales/order/page.tsx | 46 ++++++++----------- .../production/plan-management/page.tsx | 30 ++++++------ .../quality/item-inspection/page.tsx | 9 ++-- 19 files changed, 235 insertions(+), 268 deletions(-) diff --git a/frontend/app/(main)/COMPANY_10/production/plan-management/page.tsx b/frontend/app/(main)/COMPANY_10/production/plan-management/page.tsx index 38b01658..534582f9 100644 --- a/frontend/app/(main)/COMPANY_10/production/plan-management/page.tsx +++ b/frontend/app/(main)/COMPANY_10/production/plan-management/page.tsx @@ -1053,14 +1053,14 @@ export default function ProductionPlanManagementPage() { return ( - + - + 0} onCheckedChange={(c) => toggleAllItemGroups(!!c)} className="h-4 w-4" /> - - 품목코드 - 품목명 + + 품목코드 + 품목명 {ts.visibleColumns.map((col) => ( {col.label} @@ -1073,9 +1073,9 @@ export default function ProductionPlanManagementPage() { if (item._isGroupSummary) { return ( - - - + + + {ts.visibleColumns.map((col) => { const v = (item as any)[col.key]; return ( @@ -1090,14 +1090,14 @@ export default function ProductionPlanManagementPage() { return ( - e.stopPropagation()}> + e.stopPropagation()}> toggleItemGroupSelect(item.item_code)} className="h-4 w-4" /> - toggleItemExpand(item.item_code)}> + toggleItemExpand(item.item_code)}> - toggleItemExpand(item.item_code)}>{item.item_code} - toggleItemExpand(item.item_code)}>{item.item_name} + toggleItemExpand(item.item_code)}>{item.item_code} + toggleItemExpand(item.item_code)}>{item.item_name} {ts.visibleColumns.map((col) => renderGroupCell(col, item))} {expandedItems.has(item.item_code) && item.orders?.map((detail: any) => { @@ -1107,9 +1107,9 @@ export default function ProductionPlanManagementPage() { } return ( - - - + + +
수주번호: {detail.order_no} diff --git a/frontend/app/(main)/COMPANY_10/quality/item-inspection/page.tsx b/frontend/app/(main)/COMPANY_10/quality/item-inspection/page.tsx index 05facbbc..863c0aef 100644 --- a/frontend/app/(main)/COMPANY_10/quality/item-inspection/page.tsx +++ b/frontend/app/(main)/COMPANY_10/quality/item-inspection/page.tsx @@ -424,9 +424,10 @@ export default function ItemInspectionInfoPage() { case "inspection_type": return (
- {group.types.map((t: string) => ( - {t} - ))} + {group.types.map((t: string) => { + const label = inspTypeCatOptions.find((o) => o.code === t)?.label || t; + return {label}; + })}
); @@ -494,7 +495,7 @@ export default function ItemInspectionInfoPage() { : "bg-muted/50 text-muted-foreground border-border hover:bg-muted" )} > - {type} + {inspTypeCatOptions.find((o) => o.code === type)?.label || type} o.code === itemSearchDivision)?.label || ""; + // 코드 또는 라벨이 저장된 경우 모두 조회하기 위해 in 연산자 사용 + const divValues = [itemSearchDivision]; + if (divLabel) divValues.push(divLabel); + filters.push({ columnName: "division", operator: "in", value: divValues }); + } + // 거래처우선 단가방식일 때 거래처에 연결된 품목만 필터링 const isCustomerPrice = masterForm.price_mode === "CAT_MM0BV3OS_41DX" || masterForm.price_mode === "CAT_MLKG7D8K_N8SI"; const partnerId = masterForm.partner_id; @@ -632,7 +641,7 @@ export default function SalesOrderPage() { if (isCustomerPrice && partnerId) { try { const mappingRes = await apiClient.post(`/table-management/tables/customer_item_mapping/data`, { - page: 1, size: 500, + page: 1, size: 5000, dataFilter: { enabled: true, filters: [{ columnName: "customer_id", operator: "equals", value: partnerId }] }, autoFilter: true, }); @@ -642,31 +651,22 @@ export default function SalesOrderPage() { } const res = await apiClient.post(`/table-management/tables/item_info/data`, { - page: 1, size: 500, + page: p, size: s, dataFilter: filters.length > 0 ? { enabled: true, filters } : undefined, autoFilter: true, }); const resData = res.data?.data; - let allRows = resData?.data || resData?.rows || []; + let rows = resData?.data || resData?.rows || []; + const serverTotal = resData?.total || resData?.totalCount || rows.length; - // 거래처우선일 때 연결된 품목만 표시 + // 거래처우선일 때 연결된 품목만 표시 (클라이언트 필터) if (customerItemIds) { - allRows = allRows.filter((item: any) => customerItemIds!.has(item.item_number) || customerItemIds!.has(item.id)); + rows = rows.filter((item: any) => customerItemIds!.has(item.item_number) || customerItemIds!.has(item.id)); } - // 관리품목 필터 (코드/라벨 혼재 대응) - if (itemSearchDivision !== "all") { - const divLabel = categoryOptions["item_division"]?.find((o) => o.code === itemSearchDivision)?.label || ""; - allRows = allRows.filter((item: any) => { - const div = item.division || ""; - return div.includes(itemSearchDivision) || (divLabel && div.includes(divLabel)); - }); - } - const total = allRows.length; - const start = (p - 1) * s; - setItemSearchResults(allRows.slice(start, start + s)); - setItemTotal(total); - setItemTotalPages(Math.max(1, Math.ceil(total / s))); + setItemSearchResults(rows); + setItemTotal(serverTotal); + setItemTotalPages(Math.max(1, Math.ceil(serverTotal / s))); } catch { /* skip */ } finally { setItemSearchLoading(false); } @@ -1474,15 +1474,7 @@ export default function SalesOrderPage() { onKeyDown={(e) => e.key === "Enter" && triggerNewSearch()} className="h-9 flex-1" /> - +
영업관리
diff --git a/frontend/app/(main)/COMPANY_16/production/plan-management/page.tsx b/frontend/app/(main)/COMPANY_16/production/plan-management/page.tsx index 38b01658..534582f9 100644 --- a/frontend/app/(main)/COMPANY_16/production/plan-management/page.tsx +++ b/frontend/app/(main)/COMPANY_16/production/plan-management/page.tsx @@ -1053,14 +1053,14 @@ export default function ProductionPlanManagementPage() { return (
- + - + 0} onCheckedChange={(c) => toggleAllItemGroups(!!c)} className="h-4 w-4" /> - - 품목코드 - 품목명 + + 품목코드 + 품목명 {ts.visibleColumns.map((col) => ( {col.label} @@ -1073,9 +1073,9 @@ export default function ProductionPlanManagementPage() { if (item._isGroupSummary) { return ( - - - + + + {ts.visibleColumns.map((col) => { const v = (item as any)[col.key]; return ( @@ -1090,14 +1090,14 @@ export default function ProductionPlanManagementPage() { return ( - e.stopPropagation()}> + e.stopPropagation()}> toggleItemGroupSelect(item.item_code)} className="h-4 w-4" /> - toggleItemExpand(item.item_code)}> + toggleItemExpand(item.item_code)}> - toggleItemExpand(item.item_code)}>{item.item_code} - toggleItemExpand(item.item_code)}>{item.item_name} + toggleItemExpand(item.item_code)}>{item.item_code} + toggleItemExpand(item.item_code)}>{item.item_name} {ts.visibleColumns.map((col) => renderGroupCell(col, item))} {expandedItems.has(item.item_code) && item.orders?.map((detail: any) => { @@ -1107,9 +1107,9 @@ export default function ProductionPlanManagementPage() { } return ( - - - + + +
수주번호: {detail.order_no} diff --git a/frontend/app/(main)/COMPANY_16/quality/item-inspection/page.tsx b/frontend/app/(main)/COMPANY_16/quality/item-inspection/page.tsx index 05facbbc..863c0aef 100644 --- a/frontend/app/(main)/COMPANY_16/quality/item-inspection/page.tsx +++ b/frontend/app/(main)/COMPANY_16/quality/item-inspection/page.tsx @@ -424,9 +424,10 @@ export default function ItemInspectionInfoPage() { case "inspection_type": return (
- {group.types.map((t: string) => ( - {t} - ))} + {group.types.map((t: string) => { + const label = inspTypeCatOptions.find((o) => o.code === t)?.label || t; + return {label}; + })}
); @@ -494,7 +495,7 @@ export default function ItemInspectionInfoPage() { : "bg-muted/50 text-muted-foreground border-border hover:bg-muted" )} > - {type} + {inspTypeCatOptions.find((o) => o.code === type)?.label || type} o.code === itemSearchDivision)?.label || ""; + // 코드 또는 라벨이 저장된 경우 모두 조회하기 위해 in 연산자 사용 + const divValues = [itemSearchDivision]; + if (divLabel) divValues.push(divLabel); + filters.push({ columnName: "division", operator: "in", value: divValues }); + } + // 거래처우선 단가방식일 때 거래처에 연결된 품목만 필터링 const isCustomerPrice = masterForm.price_mode === "CAT_MM0BV3OS_41DX" || masterForm.price_mode === "CAT_MLKG7D8K_N8SI"; const partnerId = masterForm.partner_id; @@ -632,7 +641,7 @@ export default function SalesOrderPage() { if (isCustomerPrice && partnerId) { try { const mappingRes = await apiClient.post(`/table-management/tables/customer_item_mapping/data`, { - page: 1, size: 500, + page: 1, size: 5000, dataFilter: { enabled: true, filters: [{ columnName: "customer_id", operator: "equals", value: partnerId }] }, autoFilter: true, }); @@ -642,31 +651,22 @@ export default function SalesOrderPage() { } const res = await apiClient.post(`/table-management/tables/item_info/data`, { - page: 1, size: 500, + page: p, size: s, dataFilter: filters.length > 0 ? { enabled: true, filters } : undefined, autoFilter: true, }); const resData = res.data?.data; - let allRows = resData?.data || resData?.rows || []; + let rows = resData?.data || resData?.rows || []; + const serverTotal = resData?.total || resData?.totalCount || rows.length; - // 거래처우선일 때 연결된 품목만 표시 + // 거래처우선일 때 연결된 품목만 표시 (클라이언트 필터) if (customerItemIds) { - allRows = allRows.filter((item: any) => customerItemIds!.has(item.item_number) || customerItemIds!.has(item.id)); + rows = rows.filter((item: any) => customerItemIds!.has(item.item_number) || customerItemIds!.has(item.id)); } - // 관리품목 필터 (코드/라벨 혼재 대응) - if (itemSearchDivision !== "all") { - const divLabel = categoryOptions["item_division"]?.find((o) => o.code === itemSearchDivision)?.label || ""; - allRows = allRows.filter((item: any) => { - const div = item.division || ""; - return div.includes(itemSearchDivision) || (divLabel && div.includes(divLabel)); - }); - } - const total = allRows.length; - const start = (p - 1) * s; - setItemSearchResults(allRows.slice(start, start + s)); - setItemTotal(total); - setItemTotalPages(Math.max(1, Math.ceil(total / s))); + setItemSearchResults(rows); + setItemTotal(serverTotal); + setItemTotalPages(Math.max(1, Math.ceil(serverTotal / s))); } catch { /* skip */ } finally { setItemSearchLoading(false); } @@ -1474,15 +1474,7 @@ export default function SalesOrderPage() { onKeyDown={(e) => e.key === "Enter" && triggerNewSearch()} className="h-9 flex-1" /> - +
영업관리
diff --git a/frontend/app/(main)/COMPANY_29/production/plan-management/page.tsx b/frontend/app/(main)/COMPANY_29/production/plan-management/page.tsx index 38b01658..534582f9 100644 --- a/frontend/app/(main)/COMPANY_29/production/plan-management/page.tsx +++ b/frontend/app/(main)/COMPANY_29/production/plan-management/page.tsx @@ -1053,14 +1053,14 @@ export default function ProductionPlanManagementPage() { return (
- + - + 0} onCheckedChange={(c) => toggleAllItemGroups(!!c)} className="h-4 w-4" /> - - 품목코드 - 품목명 + + 품목코드 + 품목명 {ts.visibleColumns.map((col) => ( {col.label} @@ -1073,9 +1073,9 @@ export default function ProductionPlanManagementPage() { if (item._isGroupSummary) { return ( - - - + + + {ts.visibleColumns.map((col) => { const v = (item as any)[col.key]; return ( @@ -1090,14 +1090,14 @@ export default function ProductionPlanManagementPage() { return ( - e.stopPropagation()}> + e.stopPropagation()}> toggleItemGroupSelect(item.item_code)} className="h-4 w-4" /> - toggleItemExpand(item.item_code)}> + toggleItemExpand(item.item_code)}> - toggleItemExpand(item.item_code)}>{item.item_code} - toggleItemExpand(item.item_code)}>{item.item_name} + toggleItemExpand(item.item_code)}>{item.item_code} + toggleItemExpand(item.item_code)}>{item.item_name} {ts.visibleColumns.map((col) => renderGroupCell(col, item))} {expandedItems.has(item.item_code) && item.orders?.map((detail: any) => { @@ -1107,9 +1107,9 @@ export default function ProductionPlanManagementPage() { } return ( - - - + + +
수주번호: {detail.order_no} diff --git a/frontend/app/(main)/COMPANY_29/quality/item-inspection/page.tsx b/frontend/app/(main)/COMPANY_29/quality/item-inspection/page.tsx index 05facbbc..863c0aef 100644 --- a/frontend/app/(main)/COMPANY_29/quality/item-inspection/page.tsx +++ b/frontend/app/(main)/COMPANY_29/quality/item-inspection/page.tsx @@ -424,9 +424,10 @@ export default function ItemInspectionInfoPage() { case "inspection_type": return (
- {group.types.map((t: string) => ( - {t} - ))} + {group.types.map((t: string) => { + const label = inspTypeCatOptions.find((o) => o.code === t)?.label || t; + return {label}; + })}
); @@ -494,7 +495,7 @@ export default function ItemInspectionInfoPage() { : "bg-muted/50 text-muted-foreground border-border hover:bg-muted" )} > - {type} + {inspTypeCatOptions.find((o) => o.code === type)?.label || type} o.code === itemSearchDivision)?.label || ""; + // 코드 또는 라벨이 저장된 경우 모두 조회하기 위해 in 연산자 사용 + const divValues = [itemSearchDivision]; + if (divLabel) divValues.push(divLabel); + filters.push({ columnName: "division", operator: "in", value: divValues }); + } + // 거래처우선 단가방식일 때 거래처에 연결된 품목만 필터링 const isCustomerPrice = masterForm.price_mode === "CAT_MM0BV3OS_41DX" || masterForm.price_mode === "CAT_MLKG7D8K_N8SI"; const partnerId = masterForm.partner_id; @@ -632,7 +641,7 @@ export default function SalesOrderPage() { if (isCustomerPrice && partnerId) { try { const mappingRes = await apiClient.post(`/table-management/tables/customer_item_mapping/data`, { - page: 1, size: 500, + page: 1, size: 5000, dataFilter: { enabled: true, filters: [{ columnName: "customer_id", operator: "equals", value: partnerId }] }, autoFilter: true, }); @@ -642,31 +651,22 @@ export default function SalesOrderPage() { } const res = await apiClient.post(`/table-management/tables/item_info/data`, { - page: 1, size: 500, + page: p, size: s, dataFilter: filters.length > 0 ? { enabled: true, filters } : undefined, autoFilter: true, }); const resData = res.data?.data; - let allRows = resData?.data || resData?.rows || []; + let rows = resData?.data || resData?.rows || []; + const serverTotal = resData?.total || resData?.totalCount || rows.length; - // 거래처우선일 때 연결된 품목만 표시 + // 거래처우선일 때 연결된 품목만 표시 (클라이언트 필터) if (customerItemIds) { - allRows = allRows.filter((item: any) => customerItemIds!.has(item.item_number) || customerItemIds!.has(item.id)); + rows = rows.filter((item: any) => customerItemIds!.has(item.item_number) || customerItemIds!.has(item.id)); } - // 관리품목 필터 (코드/라벨 혼재 대응) - if (itemSearchDivision !== "all") { - const divLabel = categoryOptions["item_division"]?.find((o) => o.code === itemSearchDivision)?.label || ""; - allRows = allRows.filter((item: any) => { - const div = item.division || ""; - return div.includes(itemSearchDivision) || (divLabel && div.includes(divLabel)); - }); - } - const total = allRows.length; - const start = (p - 1) * s; - setItemSearchResults(allRows.slice(start, start + s)); - setItemTotal(total); - setItemTotalPages(Math.max(1, Math.ceil(total / s))); + setItemSearchResults(rows); + setItemTotal(serverTotal); + setItemTotalPages(Math.max(1, Math.ceil(serverTotal / s))); } catch { /* skip */ } finally { setItemSearchLoading(false); } @@ -1474,15 +1474,7 @@ export default function SalesOrderPage() { onKeyDown={(e) => e.key === "Enter" && triggerNewSearch()} className="h-9 flex-1" /> - +
영업관리
diff --git a/frontend/app/(main)/COMPANY_30/production/plan-management/page.tsx b/frontend/app/(main)/COMPANY_30/production/plan-management/page.tsx index 38b01658..534582f9 100644 --- a/frontend/app/(main)/COMPANY_30/production/plan-management/page.tsx +++ b/frontend/app/(main)/COMPANY_30/production/plan-management/page.tsx @@ -1053,14 +1053,14 @@ export default function ProductionPlanManagementPage() { return (
- + - + 0} onCheckedChange={(c) => toggleAllItemGroups(!!c)} className="h-4 w-4" /> - - 품목코드 - 품목명 + + 품목코드 + 품목명 {ts.visibleColumns.map((col) => ( {col.label} @@ -1073,9 +1073,9 @@ export default function ProductionPlanManagementPage() { if (item._isGroupSummary) { return ( - - - + + + {ts.visibleColumns.map((col) => { const v = (item as any)[col.key]; return ( @@ -1090,14 +1090,14 @@ export default function ProductionPlanManagementPage() { return ( - e.stopPropagation()}> + e.stopPropagation()}> toggleItemGroupSelect(item.item_code)} className="h-4 w-4" /> - toggleItemExpand(item.item_code)}> + toggleItemExpand(item.item_code)}> - toggleItemExpand(item.item_code)}>{item.item_code} - toggleItemExpand(item.item_code)}>{item.item_name} + toggleItemExpand(item.item_code)}>{item.item_code} + toggleItemExpand(item.item_code)}>{item.item_name} {ts.visibleColumns.map((col) => renderGroupCell(col, item))} {expandedItems.has(item.item_code) && item.orders?.map((detail: any) => { @@ -1107,9 +1107,9 @@ export default function ProductionPlanManagementPage() { } return ( - - - + + +
수주번호: {detail.order_no} diff --git a/frontend/app/(main)/COMPANY_30/quality/item-inspection/page.tsx b/frontend/app/(main)/COMPANY_30/quality/item-inspection/page.tsx index 05facbbc..863c0aef 100644 --- a/frontend/app/(main)/COMPANY_30/quality/item-inspection/page.tsx +++ b/frontend/app/(main)/COMPANY_30/quality/item-inspection/page.tsx @@ -424,9 +424,10 @@ export default function ItemInspectionInfoPage() { case "inspection_type": return (
- {group.types.map((t: string) => ( - {t} - ))} + {group.types.map((t: string) => { + const label = inspTypeCatOptions.find((o) => o.code === t)?.label || t; + return {label}; + })}
); @@ -494,7 +495,7 @@ export default function ItemInspectionInfoPage() { : "bg-muted/50 text-muted-foreground border-border hover:bg-muted" )} > - {type} + {inspTypeCatOptions.find((o) => o.code === type)?.label || type} - + - + 0} onCheckedChange={(c) => toggleAllItemGroups(!!c)} className="h-4 w-4" /> - - 품목코드 - 품목명 + + 품목코드 + 품목명 {ts.visibleColumns.map((col) => ( {col.label} @@ -1073,9 +1073,9 @@ export default function ProductionPlanManagementPage() { if (item._isGroupSummary) { return ( - - - + + + {ts.visibleColumns.map((col) => { const v = (item as any)[col.key]; return ( @@ -1090,14 +1090,14 @@ export default function ProductionPlanManagementPage() { return ( - e.stopPropagation()}> + e.stopPropagation()}> toggleItemGroupSelect(item.item_code)} className="h-4 w-4" /> - toggleItemExpand(item.item_code)}> + toggleItemExpand(item.item_code)}> - toggleItemExpand(item.item_code)}>{item.item_code} - toggleItemExpand(item.item_code)}>{item.item_name} + toggleItemExpand(item.item_code)}>{item.item_code} + toggleItemExpand(item.item_code)}>{item.item_name} {ts.visibleColumns.map((col) => renderGroupCell(col, item))} {expandedItems.has(item.item_code) && item.orders?.map((detail: any) => { @@ -1107,9 +1107,9 @@ export default function ProductionPlanManagementPage() { } return ( - - - + + +
수주번호: {detail.order_no} diff --git a/frontend/app/(main)/COMPANY_7/quality/item-inspection/page.tsx b/frontend/app/(main)/COMPANY_7/quality/item-inspection/page.tsx index 05facbbc..863c0aef 100644 --- a/frontend/app/(main)/COMPANY_7/quality/item-inspection/page.tsx +++ b/frontend/app/(main)/COMPANY_7/quality/item-inspection/page.tsx @@ -424,9 +424,10 @@ export default function ItemInspectionInfoPage() { case "inspection_type": return (
- {group.types.map((t: string) => ( - {t} - ))} + {group.types.map((t: string) => { + const label = inspTypeCatOptions.find((o) => o.code === t)?.label || t; + return {label}; + })}
); @@ -494,7 +495,7 @@ export default function ItemInspectionInfoPage() { : "bg-muted/50 text-muted-foreground border-border hover:bg-muted" )} > - {type} + {inspTypeCatOptions.find((o) => o.code === type)?.label || type} o.code === itemSearchDivision)?.label || ""; + // 코드 또는 라벨이 저장된 경우 모두 조회하기 위해 in 연산자 사용 + const divValues = [itemSearchDivision]; + if (divLabel) divValues.push(divLabel); + filters.push({ columnName: "division", operator: "in", value: divValues }); + } + // 거래처우선 단가방식일 때 거래처에 연결된 품목만 필터링 const isCustomerPrice = masterForm.price_mode === "CAT_MM0BV3OS_41DX" || masterForm.price_mode === "CAT_MLKG7D8K_N8SI"; const partnerId = masterForm.partner_id; @@ -632,7 +641,7 @@ export default function SalesOrderPage() { if (isCustomerPrice && partnerId) { try { const mappingRes = await apiClient.post(`/table-management/tables/customer_item_mapping/data`, { - page: 1, size: 500, + page: 1, size: 5000, dataFilter: { enabled: true, filters: [{ columnName: "customer_id", operator: "equals", value: partnerId }] }, autoFilter: true, }); @@ -642,31 +651,22 @@ export default function SalesOrderPage() { } const res = await apiClient.post(`/table-management/tables/item_info/data`, { - page: 1, size: 500, + page: p, size: s, dataFilter: filters.length > 0 ? { enabled: true, filters } : undefined, autoFilter: true, }); const resData = res.data?.data; - let allRows = resData?.data || resData?.rows || []; + let rows = resData?.data || resData?.rows || []; + const serverTotal = resData?.total || resData?.totalCount || rows.length; - // 거래처우선일 때 연결된 품목만 표시 + // 거래처우선일 때 연결된 품목만 표시 (클라이언트 필터) if (customerItemIds) { - allRows = allRows.filter((item: any) => customerItemIds!.has(item.item_number) || customerItemIds!.has(item.id)); + rows = rows.filter((item: any) => customerItemIds!.has(item.item_number) || customerItemIds!.has(item.id)); } - // 관리품목 필터 (코드/라벨 혼재 대응) - if (itemSearchDivision !== "all") { - const divLabel = categoryOptions["item_division"]?.find((o) => o.code === itemSearchDivision)?.label || ""; - allRows = allRows.filter((item: any) => { - const div = item.division || ""; - return div.includes(itemSearchDivision) || (divLabel && div.includes(divLabel)); - }); - } - const total = allRows.length; - const start = (p - 1) * s; - setItemSearchResults(allRows.slice(start, start + s)); - setItemTotal(total); - setItemTotalPages(Math.max(1, Math.ceil(total / s))); + setItemSearchResults(rows); + setItemTotal(serverTotal); + setItemTotalPages(Math.max(1, Math.ceil(serverTotal / s))); } catch { /* skip */ } finally { setItemSearchLoading(false); } @@ -1474,15 +1474,7 @@ export default function SalesOrderPage() { onKeyDown={(e) => e.key === "Enter" && triggerNewSearch()} className="h-9 flex-1" /> - +
영업관리
diff --git a/frontend/app/(main)/COMPANY_8/production/plan-management/page.tsx b/frontend/app/(main)/COMPANY_8/production/plan-management/page.tsx index 38b01658..534582f9 100644 --- a/frontend/app/(main)/COMPANY_8/production/plan-management/page.tsx +++ b/frontend/app/(main)/COMPANY_8/production/plan-management/page.tsx @@ -1053,14 +1053,14 @@ export default function ProductionPlanManagementPage() { return (
- + - + 0} onCheckedChange={(c) => toggleAllItemGroups(!!c)} className="h-4 w-4" /> - - 품목코드 - 품목명 + + 품목코드 + 품목명 {ts.visibleColumns.map((col) => ( {col.label} @@ -1073,9 +1073,9 @@ export default function ProductionPlanManagementPage() { if (item._isGroupSummary) { return ( - - - + + + {ts.visibleColumns.map((col) => { const v = (item as any)[col.key]; return ( @@ -1090,14 +1090,14 @@ export default function ProductionPlanManagementPage() { return ( - e.stopPropagation()}> + e.stopPropagation()}> toggleItemGroupSelect(item.item_code)} className="h-4 w-4" /> - toggleItemExpand(item.item_code)}> + toggleItemExpand(item.item_code)}> - toggleItemExpand(item.item_code)}>{item.item_code} - toggleItemExpand(item.item_code)}>{item.item_name} + toggleItemExpand(item.item_code)}>{item.item_code} + toggleItemExpand(item.item_code)}>{item.item_name} {ts.visibleColumns.map((col) => renderGroupCell(col, item))} {expandedItems.has(item.item_code) && item.orders?.map((detail: any) => { @@ -1107,9 +1107,9 @@ export default function ProductionPlanManagementPage() { } return ( - - - + + +
수주번호: {detail.order_no} diff --git a/frontend/app/(main)/COMPANY_8/quality/item-inspection/page.tsx b/frontend/app/(main)/COMPANY_8/quality/item-inspection/page.tsx index 05facbbc..863c0aef 100644 --- a/frontend/app/(main)/COMPANY_8/quality/item-inspection/page.tsx +++ b/frontend/app/(main)/COMPANY_8/quality/item-inspection/page.tsx @@ -424,9 +424,10 @@ export default function ItemInspectionInfoPage() { case "inspection_type": return (
- {group.types.map((t: string) => ( - {t} - ))} + {group.types.map((t: string) => { + const label = inspTypeCatOptions.find((o) => o.code === t)?.label || t; + return {label}; + })}
); @@ -494,7 +495,7 @@ export default function ItemInspectionInfoPage() { : "bg-muted/50 text-muted-foreground border-border hover:bg-muted" )} > - {type} + {inspTypeCatOptions.find((o) => o.code === type)?.label || type} o.code === itemSearchDivision)?.label || ""; + // 코드 또는 라벨이 저장된 경우 모두 조회하기 위해 in 연산자 사용 + const divValues = [itemSearchDivision]; + if (divLabel) divValues.push(divLabel); + filters.push({ columnName: "division", operator: "in", value: divValues }); + } + // 거래처우선 단가방식일 때 거래처에 연결된 품목만 필터링 const isCustomerPrice = masterForm.price_mode === "CAT_MM0BV3OS_41DX" || masterForm.price_mode === "CAT_MLKG7D8K_N8SI"; const partnerId = masterForm.partner_id; @@ -632,7 +641,7 @@ export default function SalesOrderPage() { if (isCustomerPrice && partnerId) { try { const mappingRes = await apiClient.post(`/table-management/tables/customer_item_mapping/data`, { - page: 1, size: 500, + page: 1, size: 5000, dataFilter: { enabled: true, filters: [{ columnName: "customer_id", operator: "equals", value: partnerId }] }, autoFilter: true, }); @@ -642,31 +651,22 @@ export default function SalesOrderPage() { } const res = await apiClient.post(`/table-management/tables/item_info/data`, { - page: 1, size: 500, + page: p, size: s, dataFilter: filters.length > 0 ? { enabled: true, filters } : undefined, autoFilter: true, }); const resData = res.data?.data; - let allRows = resData?.data || resData?.rows || []; + let rows = resData?.data || resData?.rows || []; + const serverTotal = resData?.total || resData?.totalCount || rows.length; - // 거래처우선일 때 연결된 품목만 표시 + // 거래처우선일 때 연결된 품목만 표시 (클라이언트 필터) if (customerItemIds) { - allRows = allRows.filter((item: any) => customerItemIds!.has(item.item_number) || customerItemIds!.has(item.id)); + rows = rows.filter((item: any) => customerItemIds!.has(item.item_number) || customerItemIds!.has(item.id)); } - // 관리품목 필터 (코드/라벨 혼재 대응) - if (itemSearchDivision !== "all") { - const divLabel = categoryOptions["item_division"]?.find((o) => o.code === itemSearchDivision)?.label || ""; - allRows = allRows.filter((item: any) => { - const div = item.division || ""; - return div.includes(itemSearchDivision) || (divLabel && div.includes(divLabel)); - }); - } - const total = allRows.length; - const start = (p - 1) * s; - setItemSearchResults(allRows.slice(start, start + s)); - setItemTotal(total); - setItemTotalPages(Math.max(1, Math.ceil(total / s))); + setItemSearchResults(rows); + setItemTotal(serverTotal); + setItemTotalPages(Math.max(1, Math.ceil(serverTotal / s))); } catch { /* skip */ } finally { setItemSearchLoading(false); } @@ -1474,15 +1474,7 @@ export default function SalesOrderPage() { onKeyDown={(e) => e.key === "Enter" && triggerNewSearch()} className="h-9 flex-1" /> - +
영업관리
diff --git a/frontend/app/(main)/COMPANY_9/production/plan-management/page.tsx b/frontend/app/(main)/COMPANY_9/production/plan-management/page.tsx index 38b01658..534582f9 100644 --- a/frontend/app/(main)/COMPANY_9/production/plan-management/page.tsx +++ b/frontend/app/(main)/COMPANY_9/production/plan-management/page.tsx @@ -1053,14 +1053,14 @@ export default function ProductionPlanManagementPage() { return (
- + - + 0} onCheckedChange={(c) => toggleAllItemGroups(!!c)} className="h-4 w-4" /> - - 품목코드 - 품목명 + + 품목코드 + 품목명 {ts.visibleColumns.map((col) => ( {col.label} @@ -1073,9 +1073,9 @@ export default function ProductionPlanManagementPage() { if (item._isGroupSummary) { return ( - - - + + + {ts.visibleColumns.map((col) => { const v = (item as any)[col.key]; return ( @@ -1090,14 +1090,14 @@ export default function ProductionPlanManagementPage() { return ( - e.stopPropagation()}> + e.stopPropagation()}> toggleItemGroupSelect(item.item_code)} className="h-4 w-4" /> - toggleItemExpand(item.item_code)}> + toggleItemExpand(item.item_code)}> - toggleItemExpand(item.item_code)}>{item.item_code} - toggleItemExpand(item.item_code)}>{item.item_name} + toggleItemExpand(item.item_code)}>{item.item_code} + toggleItemExpand(item.item_code)}>{item.item_name} {ts.visibleColumns.map((col) => renderGroupCell(col, item))} {expandedItems.has(item.item_code) && item.orders?.map((detail: any) => { @@ -1107,9 +1107,9 @@ export default function ProductionPlanManagementPage() { } return ( - - - + + +
수주번호: {detail.order_no} diff --git a/frontend/app/(main)/COMPANY_9/quality/item-inspection/page.tsx b/frontend/app/(main)/COMPANY_9/quality/item-inspection/page.tsx index 05facbbc..863c0aef 100644 --- a/frontend/app/(main)/COMPANY_9/quality/item-inspection/page.tsx +++ b/frontend/app/(main)/COMPANY_9/quality/item-inspection/page.tsx @@ -424,9 +424,10 @@ export default function ItemInspectionInfoPage() { case "inspection_type": return (
- {group.types.map((t: string) => ( - {t} - ))} + {group.types.map((t: string) => { + const label = inspTypeCatOptions.find((o) => o.code === t)?.label || t; + return {label}; + })}
); @@ -494,7 +495,7 @@ export default function ItemInspectionInfoPage() { : "bg-muted/50 text-muted-foreground border-border hover:bg-muted" )} > - {type} + {inspTypeCatOptions.find((o) => o.code === type)?.label || type}