feat: [재고목록] PT→부분품(재공품) 표시 + 품목유형별 탭 필터 추가

This commit is contained in:
김보곤
2026-03-22 11:00:45 +09:00
parent 57470c1025
commit 2c465e48f0
2 changed files with 35 additions and 14 deletions

View File

@@ -62,6 +62,7 @@ export function StockStatusList() {
const [searchTerm, setSearchTerm] = useState('');
const [filterValues, setFilterValues] = useState<Record<string, string | string[]>>({
itemCategory: 'all',
itemTypeTab: 'all',
wipStatus: 'all',
useStatus: 'all',
});
@@ -117,6 +118,19 @@ export function StockStatusList() {
if (!matchesSearch) return false;
}
// 품목유형 탭 필터
const itemTypeTab = filterValues.itemTypeTab as string;
if (itemTypeTab === 'wip') {
// 재공품: PT 유형 + BD- 코드 (1차 가공품)
if (stock.itemType !== 'PT' && !stock.itemCode.startsWith('BD-')) return false;
} else if (itemTypeTab === 'RM') {
if (stock.itemType !== 'RM') return false;
} else if (itemTypeTab === 'SM') {
if (stock.itemType !== 'SM') return false;
} else if (itemTypeTab === 'CS') {
if (stock.itemType !== 'CS') return false;
}
// 상태 필터
const useStatusFilter = filterValues.useStatus as string;
if (useStatusFilter && useStatusFilter !== 'all') {
@@ -230,9 +244,19 @@ export function StockStatusList() {
},
];
// ===== 필터 설정 (카테고리, 재공품, 상태) =====
// 참고: IntegratedListTemplateV2에서 자동으로 '전체' 옵션을 추가하므로 options에서 제외
// ===== 필터 설정 (품목유형, 카테고리, 상태) =====
const filterConfig: FilterFieldConfig[] = [
{
key: 'itemTypeTab',
label: '품목유형',
type: 'single',
options: [
{ value: 'wip', label: '재공품' },
{ value: 'RM', label: '원자재' },
{ value: 'SM', label: '부자재' },
{ value: 'CS', label: '소모품' },
],
},
{
key: 'itemCategory',
label: '품목분류',
@@ -244,15 +268,6 @@ export function StockStatusList() {
{ value: 'ALUMINUM', label: '알루미늄' },
],
},
{
key: 'wipStatus',
label: '재공품',
type: 'single',
options: [
{ value: 'active', label: '사용' },
{ value: 'inactive', label: '미사용' },
],
},
{
key: 'useStatus',
label: '상태',

View File

@@ -6,16 +6,19 @@
// 품목유형 (Item 모델의 MATERIAL_TYPES)
// API에서는 'RM' | 'SM' | 'CS' 형태를 사용하지만, mock 데이터에서는 legacy 값도 지원
export type ItemType = 'RM' | 'SM' | 'CS' | 'raw_material' | 'bent_part' | 'purchased_part' | 'sub_material' | 'consumable';
export type ItemType = 'RM' | 'SM' | 'CS' | 'PT' | 'FG' | 'SF' | 'raw_material' | 'bent_part' | 'purchased_part' | 'sub_material' | 'consumable';
// 품목유형 라벨
export const ITEM_TYPE_LABELS: Partial<Record<ItemType, string>> = {
RM: '원자재',
SM: '부자재',
CS: '소모품',
PT: '부분품(재공품)',
FG: '완제품',
SF: '반제품',
raw_material: '원자재',
bent_part: '절곡부품',
purchased_part: '구매부품',
bent_part: '부분품(재공품)',
purchased_part: '완제품',
sub_material: '부자재',
consumable: '소모품',
};
@@ -25,6 +28,9 @@ export const ITEM_TYPE_STYLES: Partial<Record<ItemType, string>> = {
RM: 'bg-blue-100 text-blue-800',
SM: 'bg-green-100 text-green-800',
CS: 'bg-orange-100 text-orange-800',
PT: 'bg-purple-100 text-purple-800',
FG: 'bg-teal-100 text-teal-800',
SF: 'bg-indigo-100 text-indigo-800',
raw_material: 'bg-blue-100 text-blue-800',
bent_part: 'bg-purple-100 text-purple-800',
purchased_part: 'bg-teal-100 text-teal-800',