feat: Daum 우편번호 서비스 연동 및 악성채권 UI 개선
- useDaumPostcode 공통 훅 생성 (Daum Postcode API 연동) - 우편번호 찾기 기능 적용: 악성채권, 거래처, 직원, 회사정보, 주문등록 - 악성채권 페이지 토글 순서 변경 (라벨 → 토글) - 악성채권 토글 기능 수정 (매출/매입 → 등록/해제) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useDaumPostcode } from '@/hooks/useDaumPostcode';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { PageLayout } from '@/components/organisms/PageLayout';
|
||||
import { PageHeader } from '@/components/organisms/PageHeader';
|
||||
@@ -77,6 +78,20 @@ export function EmployeeForm({
|
||||
const router = useRouter();
|
||||
const [formData, setFormData] = useState<EmployeeFormData>(initialFormData);
|
||||
|
||||
// Daum 우편번호 서비스
|
||||
const { openPostcode } = useDaumPostcode({
|
||||
onComplete: (result) => {
|
||||
setFormData(prev => ({
|
||||
...prev,
|
||||
address: {
|
||||
...prev.address,
|
||||
zipCode: result.zonecode,
|
||||
address1: result.address,
|
||||
},
|
||||
}));
|
||||
},
|
||||
});
|
||||
|
||||
// 항목 설정 상태
|
||||
const [showFieldSettings, setShowFieldSettings] = useState(false);
|
||||
const [fieldSettings, setFieldSettings] = useState<FieldSettings>(initialFieldSettings);
|
||||
@@ -367,7 +382,7 @@ export function EmployeeForm({
|
||||
<div className="space-y-2">
|
||||
<Label>주소</Label>
|
||||
<div className="flex gap-2">
|
||||
<Button type="button" variant="default" size="sm" className="bg-blue-500 hover:bg-blue-600">
|
||||
<Button type="button" variant="default" size="sm" onClick={openPostcode} className="bg-blue-500 hover:bg-blue-600">
|
||||
우편번호 찾기
|
||||
</Button>
|
||||
<Input
|
||||
|
||||
Reference in New Issue
Block a user