feat(WEB): 회계 폼 useDevFill 훅 추가 및 출금 필드 편집 가능하게 변경

- DepositDetailClientV2: 입금 폼 자동채우기 훅 추가
- WithdrawalDetailClientV2: 출금 폼 자동채우기 훅 추가
- withdrawalDetailConfig: 출금일, 출금계좌, 수취인명, 출금금액 편집 가능하게 변경
- DocumentCreate: 매입(지출결의서) 폼 자동채우기 훅 추가
This commit is contained in:
2026-01-22 19:45:52 +09:00
parent 92af11c787
commit 390c1a8450
4 changed files with 58 additions and 14 deletions

View File

@@ -42,6 +42,7 @@ import type {
ExpenseEstimateData,
} from './types';
import { isNextRedirectError } from '@/lib/utils/redirect-error';
import { useDevFill, generatePurchaseApprovalData } from '@/components/dev';
// 초기 데이터 - SSR에서는 빈 문자열, 클라이언트에서 날짜 설정
const getInitialBasicInfo = (): BasicInfo => ({
@@ -119,6 +120,23 @@ export function DocumentCreate() {
// 미리보기 모달 상태
const [isPreviewOpen, setIsPreviewOpen] = useState(false);
// ===== DevFill: 자동 입력 기능 =====
useDevFill('purchaseApproval', useCallback(() => {
if (!isEditMode && !isCopyMode) {
const mockData = generatePurchaseApprovalData();
setBasicInfo(prev => ({
...prev,
...mockData.basicInfo,
draftDate: prev.draftDate || mockData.basicInfo.draftDate,
}));
setProposalData(prev => ({
...prev,
...mockData.proposalData,
}));
toast.success('지출결의서 데이터가 자동 입력되었습니다.');
}
}, [isEditMode, isCopyMode]));
// 수정 모드: 문서 로드
useEffect(() => {
if (!isEditMode || !documentId) return;