docs: [receiving] 입고 품목검색 수정 이력 추가
- 03-17 문서 섹션4 실제 구현에 맞게 수정 (근본원인, 코드경로 정정) - 변경이력 추가: 20260318_receiving_item_search_fix.md - INDEX.md 등록
This commit is contained in:
76
dev/changes/20260318_receiving_item_search_fix.md
Normal file
76
dev/changes/20260318_receiving_item_search_fix.md
Normal file
@@ -0,0 +1,76 @@
|
||||
# 입고등록 품목 검색 필터/페이징 수정
|
||||
|
||||
**날짜:** 2026-03-18
|
||||
**작업자:** Claude Code
|
||||
|
||||
---
|
||||
|
||||
## 변경 개요
|
||||
|
||||
입고등록 화면의 품목 검색에서 **전체 품목이 표시**되고 **20건 제한**이 풀리지 않는 문제를 수정했다.
|
||||
|
||||
### 근본 원인
|
||||
|
||||
React와 API 간 파라미터 이름 불일치:
|
||||
|
||||
| 문제 | React 전송 | API 수신 | 결과 |
|
||||
|------|-----------|---------|------|
|
||||
| 페이징 | `per_page=50` | `size` (기본 20) | per_page 무시 → 20건 |
|
||||
| 품목유형 | `itemType` (camelCase) | `type` / `item_type` | itemType 무시 → 전체 품목 |
|
||||
|
||||
---
|
||||
|
||||
## 수정된 파일
|
||||
|
||||
| 프로젝트 | 파일 | 변경 내용 |
|
||||
|---------|------|----------|
|
||||
| API | `app/Http/Controllers/Api/V1/ItemsController.php` | `per_page`, `itemType` 파라미터 수용 추가 |
|
||||
| React | `src/components/material/ReceivingManagement/ReceivingDetail.tsx` | `ItemSearchModal`에 `itemType="RM,SM,CS"` prop 추가 |
|
||||
|
||||
---
|
||||
|
||||
## 상세 변경 사항
|
||||
|
||||
### 1. API — ItemsController::index()
|
||||
|
||||
```php
|
||||
// AS-IS
|
||||
'size' => $request->input('size', 20),
|
||||
'item_type' => $request->input('type') ?? $request->input('item_type'),
|
||||
|
||||
// TO-BE
|
||||
'size' => $request->input('size') ?? $request->input('per_page', 20),
|
||||
'item_type' => $request->input('type') ?? $request->input('item_type') ?? $request->input('itemType'),
|
||||
```
|
||||
|
||||
- `per_page` 파라미터도 `size`로 매핑 (React 호환)
|
||||
- `itemType` (camelCase) 파라미터도 `item_type`으로 매핑
|
||||
|
||||
### 2. React — ReceivingDetail.tsx
|
||||
|
||||
```typescript
|
||||
<ItemSearchModal
|
||||
...
|
||||
itemType="RM,SM,CS" // 원자재(RM) + 부자재(SM) + 소모품(CS)만
|
||||
/>
|
||||
```
|
||||
|
||||
- 입고 대상인 원자재 성격의 품목만 검색되도록 필터 적용
|
||||
- FG(완제품), PT(부품), SF(반제품), BN(절곡품) 제외
|
||||
|
||||
---
|
||||
|
||||
## 영향 범위
|
||||
|
||||
- `GET /api/v1/items` 엔드포인트: 기존 `size`/`type`/`item_type` 파라미터 동작 변경 없음 (하위호환)
|
||||
- `per_page`, `itemType` 파라미터가 추가로 수용됨 (React `fetchItems()` 호환)
|
||||
|
||||
---
|
||||
|
||||
## 관련 문서
|
||||
|
||||
- [stock-receiving-changes-20260317.md](../frontend/api-specs/stock-receiving-changes-20260317.md) — 섹션 4 체크리스트 업데이트
|
||||
|
||||
---
|
||||
|
||||
**최종 업데이트**: 2026-03-18
|
||||
Reference in New Issue
Block a user