From c34bab591a15163cccdd1344e284bf8e882dd1ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=ED=98=81=EC=84=B1?= Date: Fri, 23 Jan 2026 11:22:57 +0900 Subject: [PATCH] =?UTF-8?q?feat(WEB):=20=EA=B1=B0=EB=9E=98=EC=B2=98=20?= =?UTF-8?q?=EC=83=81=EC=84=B8=20-=20=EC=95=8C=EB=9E=8C=EC=97=90=EC=84=9C?= =?UTF-8?q?=20=EC=8B=A0=EC=9A=A9=EB=B6=84=EC=84=9D=20=EB=AA=A8=EB=8B=AC=20?= =?UTF-8?q?=EC=9E=90=EB=8F=99=20=EC=98=A4=ED=94=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - page.tsx: modal 쿼리 파라미터 읽어서 VendorDetail에 전달 - VendorDetail: openModal prop 추가 및 useEffect로 모달 자동 오픈 - 사용: /accounting/vendors/{id}?modal=credit --- .../(protected)/accounting/vendors/[id]/page.tsx | 3 ++- .../accounting/VendorManagement/VendorDetail.tsx | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/app/[locale]/(protected)/accounting/vendors/[id]/page.tsx b/src/app/[locale]/(protected)/accounting/vendors/[id]/page.tsx index 4d4591a7..c9435d70 100644 --- a/src/app/[locale]/(protected)/accounting/vendors/[id]/page.tsx +++ b/src/app/[locale]/(protected)/accounting/vendors/[id]/page.tsx @@ -8,6 +8,7 @@ export default function VendorDetailPage() { const searchParams = useSearchParams(); const vendorId = params.id as string; const mode = searchParams.get('mode') === 'edit' ? 'edit' : 'view'; + const openModal = searchParams.get('modal'); - return ; + return ; } \ No newline at end of file diff --git a/src/components/accounting/VendorManagement/VendorDetail.tsx b/src/components/accounting/VendorManagement/VendorDetail.tsx index 64dd70b2..5dae3b90 100644 --- a/src/components/accounting/VendorManagement/VendorDetail.tsx +++ b/src/components/accounting/VendorManagement/VendorDetail.tsx @@ -51,6 +51,8 @@ import { interface VendorDetailProps { mode: 'view' | 'edit' | 'new'; vendorId?: string; + /** URL 쿼리 파라미터로 전달된 모달 타입 (예: 'credit') */ + openModal?: string | null; } // 빈 Vendor 데이터 (신규 등록용) @@ -92,7 +94,7 @@ const getEmptyVendor = (): Omit => ({ memos: [], }); -export function VendorDetail({ mode, vendorId }: VendorDetailProps) { +export function VendorDetail({ mode, vendorId, openModal }: VendorDetailProps) { const router = useRouter(); const isViewMode = mode === 'view'; const isNewMode = mode === 'new'; @@ -149,6 +151,13 @@ export function VendorDetail({ mode, vendorId }: VendorDetailProps) { // 신용분석 모달 const [isCreditModalOpen, setIsCreditModalOpen] = useState(false); + // URL 쿼리 파라미터로 모달 자동 오픈 (알람에서 접근 시) + useEffect(() => { + if (openModal === 'credit' && !isLoading) { + setIsCreditModalOpen(true); + } + }, [openModal, isLoading]); + // Validation 함수 const validateForm = useCallback(() => { const errors: Record = {};