feat(WEB): 절곡품 선생산→재고적재 Phase 2 - 수동 작업지시 및 재고 필터

- WorkOrderCreate: 수동 모드 품목 검색/추가/수량 관리 UI 구현
- WorkOrders/actions: items 파라미터 추가, searchItemsForWorkOrder 함수 추가
- StockStatusList: 품목분류(BENDING/SCREEN/STEEL/ALUMINUM) 필터 추가
- StockStatus/actions: itemCategory 파라미터 지원
This commit is contained in:
2026-02-21 15:46:58 +09:00
parent b9e1b07b3c
commit f5fbe1efc8
4 changed files with 301 additions and 5 deletions

View File

@@ -61,6 +61,7 @@ export function StockStatusList() {
// ===== 검색 및 필터 상태 =====
const [searchTerm, setSearchTerm] = useState('');
const [filterValues, setFilterValues] = useState<Record<string, string | string[]>>({
itemCategory: 'all',
wipStatus: 'all',
useStatus: 'all',
});
@@ -69,10 +70,12 @@ export function StockStatusList() {
const loadData = useCallback(async () => {
try {
setIsLoading(true);
const itemCategory = filterValues.itemCategory as string;
const [stocksResult, statsResult] = await Promise.all([
getStocks({
page: 1,
perPage: 9999, // 전체 데이터 로드 (클라이언트 사이드 필터링)
itemCategory: itemCategory !== 'all' ? itemCategory : undefined,
startDate,
endDate,
}),
@@ -93,7 +96,7 @@ export function StockStatusList() {
} finally {
setIsLoading(false);
}
}, [startDate, endDate]);
}, [startDate, endDate, filterValues.itemCategory]);
// 초기 데이터 로드 및 날짜 변경 시 재로드
useEffect(() => {
@@ -207,9 +210,20 @@ export function StockStatusList() {
},
];
// ===== 필터 설정 (재공품, 상태) =====
// ===== 필터 설정 (카테고리, 재공품, 상태) =====
// 참고: IntegratedListTemplateV2에서 자동으로 '전체' 옵션을 추가하므로 options에서 제외
const filterConfig: FilterFieldConfig[] = [
{
key: 'itemCategory',
label: '품목분류',
type: 'single',
options: [
{ value: 'BENDING', label: '절곡품' },
{ value: 'SCREEN', label: '스크린' },
{ value: 'STEEL', label: '철재' },
{ value: 'ALUMINUM', label: '알루미늄' },
],
},
{
key: 'wipStatus',
label: '재공품',

View File

@@ -222,6 +222,7 @@ function transformApiToStats(data: StockApiStatsResponse): StockStats {
// ===== 재고 목록 조회 =====
export async function getStocks(params?: {
page?: number; perPage?: number; search?: string; itemType?: string;
itemCategory?: string;
status?: string; useStatus?: string; location?: string;
sortBy?: string; sortDir?: string; startDate?: string; endDate?: string;
}) {
@@ -231,6 +232,7 @@ export async function getStocks(params?: {
per_page: params?.perPage,
search: params?.search,
item_type: params?.itemType !== 'all' ? params?.itemType : undefined,
item_category: params?.itemCategory !== 'all' ? params?.itemCategory : undefined,
status: params?.status !== 'all' ? params?.status : undefined,
is_active: params?.useStatus && params.useStatus !== 'all' ? (params.useStatus === 'active' ? '1' : '0') : undefined,
location: params?.location,