diff --git a/src/components/stocks/StockProductionForm.tsx b/src/components/stocks/StockProductionForm.tsx index 5bf4c0d8..f0958fbb 100644 --- a/src/components/stocks/StockProductionForm.tsx +++ b/src/components/stocks/StockProductionForm.tsx @@ -4,7 +4,7 @@ * 재고생산 등록/수정 폼 * * - 생산사유, 목표재고수량, 메모, 비고 - * - 품목 내역 (ItemAddDialog 사용) + * - 품목 내역 (자동 추가, 수동 추가 불가) * - IntegratedDetailTemplate + renderForm 패턴 */ @@ -24,11 +24,11 @@ import { TableHeader, TableRow, } from '@/components/ui/table'; -import { Package, Plus, Trash2, MessageSquare, ClipboardList } from 'lucide-react'; +import { Package, Trash2, MessageSquare, ClipboardList } from 'lucide-react'; import { toast } from 'sonner'; import { IntegratedDetailTemplate } from '@/components/templates/IntegratedDetailTemplate'; import { FormSection } from '@/components/organisms/FormSection'; -import { ItemAddDialog, type OrderItem } from '@/components/orders/ItemAddDialog'; +import type { OrderItem } from '@/components/orders/ItemAddDialog'; import { formatAmount } from '@/lib/utils/amount'; import { createStockOrder, @@ -139,7 +139,6 @@ export function StockProductionForm({ return INITIAL_FORM; }); - const [isItemDialogOpen, setIsItemDialogOpen] = useState(false); const [fieldErrors, setFieldErrors] = useState>({}); // 필드 에러 초기화 @@ -153,16 +152,6 @@ export function StockProductionForm({ }); }, []); - // 품목 추가 - const handleAddItem = useCallback((item: OrderItem) => { - setForm((prev) => ({ - ...prev, - items: [...prev.items, item], - })); - clearFieldError('items'); - toast.success('품목이 추가되었습니다.'); - }, [clearFieldError]); - // 품목 삭제 const handleRemoveItem = useCallback((itemId: string) => { setForm((prev) => ({ @@ -311,16 +300,6 @@ export function StockProductionForm({ setIsItemDialogOpen(true)} - > - - 품목 추가 - - } > {fieldErrors.items && (

{fieldErrors.items}

@@ -329,16 +308,7 @@ export function StockProductionForm({ {form.items.length === 0 ? (
-

품목을 추가해주세요

- +

품목이 없습니다. 재고생산 저장 시 자동으로 추가됩니다.

) : (
@@ -403,21 +373,13 @@ export function StockProductionForm({ ); return ( - <> - handleSave()} - renderForm={renderFormContent} - /> - - - + handleSave()} + renderForm={renderFormContent} + /> ); }