From 4a6149963d8df967a8b00c5943a0f6558cd8eea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9C=A0=EB=B3=91=EC=B2=A0?= Date: Tue, 20 Jan 2026 19:47:24 +0900 Subject: [PATCH] =?UTF-8?q?feat(WEB):=20=EA=B2=AC=EC=A0=81=20=EB=93=B1?= =?UTF-8?q?=EB=A1=9D=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20IntegratedDetailTemplate=20=EB=A7=88=EC=9D=B4?= =?UTF-8?q?=EA=B7=B8=EB=A0=88=EC=9D=B4=EC=85=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - test-new 페이지 IntegratedDetailTemplate 적용 - quoteCreateConfig 추가 Co-Authored-By: Claude --- .../sales/quote-management/test-new/page.tsx | 57 ++++++++++++------- src/components/quotes/quoteConfig.ts | 16 ++++++ 2 files changed, 53 insertions(+), 20 deletions(-) diff --git a/src/app/[locale]/(protected)/sales/quote-management/test-new/page.tsx b/src/app/[locale]/(protected)/sales/quote-management/test-new/page.tsx index 872bc423..90c78208 100644 --- a/src/app/[locale]/(protected)/sales/quote-management/test-new/page.tsx +++ b/src/app/[locale]/(protected)/sales/quote-management/test-new/page.tsx @@ -1,54 +1,71 @@ /** * 견적 등록 테스트 페이지 (V2 UI) * + * IntegratedDetailTemplate 마이그레이션 (2026-01-20) * 새로운 자동 견적 산출 UI 테스트용 - * 기존 견적 등록 페이지는 수정하지 않음 */ -"use client"; +'use client'; -import { useRouter } from "next/navigation"; -import { useState } from "react"; -import { QuoteRegistrationV2, QuoteFormDataV2 } from "@/components/quotes/QuoteRegistrationV2"; -import { toast } from "sonner"; +import { useRouter } from 'next/navigation'; +import { useState, useCallback } from 'react'; +import { QuoteRegistrationV2, QuoteFormDataV2 } from '@/components/quotes/QuoteRegistrationV2'; +import { IntegratedDetailTemplate } from '@/components/templates/IntegratedDetailTemplate'; +import { quoteCreateConfig } from '@/components/quotes/quoteConfig'; +import { toast } from 'sonner'; export default function QuoteTestNewPage() { const router = useRouter(); const [isSaving, setIsSaving] = useState(false); - const handleBack = () => { - router.push("/sales/quote-management"); - }; + const handleBack = useCallback(() => { + router.push('/sales/quote-management'); + }, [router]); - const handleSave = async (data: QuoteFormDataV2, saveType: "temporary" | "final") => { + const handleSave = useCallback(async (data: QuoteFormDataV2, saveType: 'temporary' | 'final') => { setIsSaving(true); try { // TODO: API 연동 시 실제 저장 로직 구현 - console.log("[테스트] 저장 데이터:", data); - console.log("[테스트] 저장 타입:", saveType); + console.log('[테스트] 저장 데이터:', data); + console.log('[테스트] 저장 타입:', saveType); // 테스트용 지연 await new Promise((resolve) => setTimeout(resolve, 1000)); - toast.success(`[테스트] ${saveType === "temporary" ? "임시" : "최종"} 저장 완료`); + toast.success(`[테스트] ${saveType === 'temporary' ? '임시' : '최종'} 저장 완료`); // 저장 후 상세 페이지로 이동 (테스트용으로 ID=1 사용) - if (saveType === "final") { - router.push("/sales/quote-management/test/1"); + if (saveType === 'final') { + router.push('/sales/quote-management/test/1'); } } catch (error) { - toast.error("저장 중 오류가 발생했습니다."); + toast.error('저장 중 오류가 발생했습니다.'); } finally { setIsSaving(false); } - }; + }, [router]); + + // 폼 콘텐츠 렌더링 + const renderFormContent = useCallback(() => { + return ( + + ); + }, [handleBack, handleSave, isSaving]); return ( - ); } diff --git a/src/components/quotes/quoteConfig.ts b/src/components/quotes/quoteConfig.ts index 754d37f3..a93f78e1 100644 --- a/src/components/quotes/quoteConfig.ts +++ b/src/components/quotes/quoteConfig.ts @@ -27,3 +27,19 @@ export const quoteConfig: DetailConfig = { backLabel: '목록', }, }; + +/** + * 견적 등록 페이지 Config + */ +export const quoteCreateConfig: DetailConfig = { + title: '견적', + description: '새 견적을 등록합니다', + icon: FileText, + basePath: '/sales/quote-management', + fields: [], + actions: { + showBack: true, + showSave: false, // QuoteFooterBar에서 처리 + backLabel: '목록', + }, +};