feat:품목 검색 모달에 수입검사 배지 추가

- ItemMaster 타입에 hasInspectionTemplate 필드 추가
- API 응답 변환 함수에 has_inspection_template 매핑
- 수입검사 양식 연결 품목에 녹색 배지 표시
This commit is contained in:
2026-02-05 21:58:06 +09:00
parent efcc645e24
commit f1e369df9f
3 changed files with 12 additions and 2 deletions

View File

@@ -179,9 +179,14 @@ export function ItemSearchModal({
className="p-3 hover:bg-blue-50 cursor-pointer transition-colors"
>
<div className="flex items-center justify-between">
<div>
<div className="flex items-center gap-2">
<span className="font-semibold text-gray-900">{item.itemCode}</span>
<span className="ml-2 text-sm text-gray-600">{item.itemName}</span>
<span className="text-sm text-gray-600">{item.itemName}</span>
{item.hasInspectionTemplate && (
<span className="text-xs text-white bg-green-500 px-1.5 py-0.5 rounded">
</span>
)}
</div>
{item.unit && (
<span className="text-xs text-gray-400 bg-gray-100 px-2 py-0.5 rounded">

View File

@@ -104,6 +104,9 @@ interface ApiItemResponse {
itemName?: string;
itemType?: string;
isActive?: boolean;
// 수입검사 양식 연결 여부
has_inspection_template?: boolean;
hasInspectionTemplate?: boolean;
}
function transformItemFromApi(apiItem: ApiItemResponse): ItemMaster {
@@ -117,6 +120,7 @@ function transformItemFromApi(apiItem: ApiItemResponse): ItemMaster {
unit: apiItem.unit || '',
specification: apiItem.specification || '',
isActive: apiItem.is_active === true || apiItem.is_active === 1 || apiItem.isActive === true,
hasInspectionTemplate: apiItem.has_inspection_template === true || apiItem.hasInspectionTemplate === true,
currentRevision: 0,
isFinal: false,
createdAt: '',

View File

@@ -132,6 +132,7 @@ export interface ItemMaster {
unit: string; // 단위 (EA, SET, KG, M 등)
specification?: string; // 규격
isActive?: boolean; // 활성/비활성
hasInspectionTemplate?: boolean; // 수입검사 양식 연결 여부
// === 분류 ===
category1?: string; // 대분류