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 = {};