feat: 신규 페이지 구현 및 HR/설정 기능 개선
신규 페이지:
- 회계관리: 거래처, 예상비용, 청구서, 발주서
- 게시판: 공지사항, 자료실, 커뮤니티
- 고객센터: 문의/FAQ
- 설정: 계정, 알림, 출퇴근, 팝업, 구독, 결제내역
- 리포트 (차트 시각화)
- 개발자 테스트 URL 페이지
기능 개선:
- HR 직원관리/휴가관리/카드관리 강화
- IntegratedListTemplateV2 확장
- AuthenticatedLayout 패딩 표준화
- 로그인 페이지 UI 개선
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 19:12:34 +09:00
|
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
import { useState } from 'react';
|
|
|
|
|
import { Button } from '@/components/ui/button';
|
|
|
|
|
import { Input } from '@/components/ui/input';
|
|
|
|
|
import { Label } from '@/components/ui/label';
|
|
|
|
|
import {
|
|
|
|
|
Dialog,
|
|
|
|
|
DialogContent,
|
|
|
|
|
DialogHeader,
|
|
|
|
|
DialogTitle,
|
|
|
|
|
} from '@/components/ui/dialog';
|
|
|
|
|
import {
|
|
|
|
|
AlertDialog,
|
|
|
|
|
AlertDialogAction,
|
|
|
|
|
AlertDialogContent,
|
|
|
|
|
AlertDialogDescription,
|
|
|
|
|
AlertDialogFooter,
|
|
|
|
|
AlertDialogHeader,
|
|
|
|
|
AlertDialogTitle,
|
|
|
|
|
} from '@/components/ui/alert-dialog';
|
2026-02-24 13:01:41 +09:00
|
|
|
import { extractDigits } from '@/lib/formatters';
|
feat: 신규 페이지 구현 및 HR/설정 기능 개선
신규 페이지:
- 회계관리: 거래처, 예상비용, 청구서, 발주서
- 게시판: 공지사항, 자료실, 커뮤니티
- 고객센터: 문의/FAQ
- 설정: 계정, 알림, 출퇴근, 팝업, 구독, 결제내역
- 리포트 (차트 시각화)
- 개발자 테스트 URL 페이지
기능 개선:
- HR 직원관리/휴가관리/카드관리 강화
- IntegratedListTemplateV2 확장
- AuthenticatedLayout 패딩 표준화
- 로그인 페이지 UI 개선
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 19:12:34 +09:00
|
|
|
|
|
|
|
|
interface AddCompanyDialogProps {
|
|
|
|
|
open: boolean;
|
|
|
|
|
onOpenChange: (open: boolean) => void;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function AddCompanyDialog({ open, onOpenChange }: AddCompanyDialogProps) {
|
|
|
|
|
const [businessNumber, setBusinessNumber] = useState('');
|
|
|
|
|
const [isLoading, setIsLoading] = useState(false);
|
|
|
|
|
|
|
|
|
|
// Alert 상태
|
|
|
|
|
const [alertOpen, setAlertOpen] = useState(false);
|
|
|
|
|
const [alertMessage, setAlertMessage] = useState('');
|
|
|
|
|
|
|
|
|
|
// 숫자만 입력 가능 (10자리 제한)
|
|
|
|
|
const handleBusinessNumberChange = (value: string) => {
|
2026-02-24 13:01:41 +09:00
|
|
|
const numbersOnly = extractDigits(value);
|
feat: 신규 페이지 구현 및 HR/설정 기능 개선
신규 페이지:
- 회계관리: 거래처, 예상비용, 청구서, 발주서
- 게시판: 공지사항, 자료실, 커뮤니티
- 고객센터: 문의/FAQ
- 설정: 계정, 알림, 출퇴근, 팝업, 구독, 결제내역
- 리포트 (차트 시각화)
- 개발자 테스트 URL 페이지
기능 개선:
- HR 직원관리/휴가관리/카드관리 강화
- IntegratedListTemplateV2 확장
- AuthenticatedLayout 패딩 표준화
- 로그인 페이지 UI 개선
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 19:12:34 +09:00
|
|
|
if (numbersOnly.length <= 10) {
|
|
|
|
|
setBusinessNumber(numbersOnly);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleCancel = () => {
|
|
|
|
|
setBusinessNumber('');
|
|
|
|
|
onOpenChange(false);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleNext = async () => {
|
|
|
|
|
if (businessNumber.length !== 10) {
|
|
|
|
|
setAlertMessage('사업자등록번호는 10자리를 입력해주세요.');
|
|
|
|
|
setAlertOpen(true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setIsLoading(true);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
// TODO: 바로빌 API 연동
|
|
|
|
|
// 1) 사업자등록번호 조회
|
|
|
|
|
// 2) 휴폐업 상태 확인
|
|
|
|
|
// 3) 기존 등록 여부 확인
|
|
|
|
|
|
|
|
|
|
// Mock 로직 - 실제로는 API 응답에 따라 처리
|
|
|
|
|
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
|
|
|
|
|
|
|
|
// 케이스별 처리
|
|
|
|
|
const mockCase = Math.floor(Math.random() * 3);
|
|
|
|
|
|
|
|
|
|
if (mockCase === 0) {
|
|
|
|
|
// 휴폐업 상태
|
|
|
|
|
setAlertMessage('휴폐업 상태인 사업자입니다.');
|
|
|
|
|
} else if (mockCase === 1) {
|
|
|
|
|
// 이미 등록된 번호
|
|
|
|
|
setAlertMessage('등록된 사업자등록번호 입니다.');
|
|
|
|
|
} else {
|
|
|
|
|
// 신규 등록 가능 - 매니저에게 알림
|
|
|
|
|
setAlertMessage('매니저에게 회사 추가 신청 알림을 발송했습니다. 연락을 기다려주세요.');
|
|
|
|
|
setBusinessNumber('');
|
|
|
|
|
onOpenChange(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setAlertOpen(true);
|
2026-03-11 10:27:10 +09:00
|
|
|
} catch (_error) {
|
feat: 신규 페이지 구현 및 HR/설정 기능 개선
신규 페이지:
- 회계관리: 거래처, 예상비용, 청구서, 발주서
- 게시판: 공지사항, 자료실, 커뮤니티
- 고객센터: 문의/FAQ
- 설정: 계정, 알림, 출퇴근, 팝업, 구독, 결제내역
- 리포트 (차트 시각화)
- 개발자 테스트 URL 페이지
기능 개선:
- HR 직원관리/휴가관리/카드관리 강화
- IntegratedListTemplateV2 확장
- AuthenticatedLayout 패딩 표준화
- 로그인 페이지 UI 개선
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 19:12:34 +09:00
|
|
|
setAlertMessage('사업자등록번호 조회 중 오류가 발생했습니다.');
|
|
|
|
|
setAlertOpen(true);
|
|
|
|
|
} finally {
|
|
|
|
|
setIsLoading(false);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<Dialog open={open} onOpenChange={onOpenChange}>
|
|
|
|
|
<DialogContent className="sm:max-w-[400px]">
|
|
|
|
|
<DialogHeader>
|
|
|
|
|
<DialogTitle>회사 추가</DialogTitle>
|
|
|
|
|
</DialogHeader>
|
|
|
|
|
|
|
|
|
|
<div className="space-y-4 py-4">
|
|
|
|
|
<div className="space-y-2">
|
|
|
|
|
<Label htmlFor="businessNumber">사업자등록번호</Label>
|
|
|
|
|
<Input
|
|
|
|
|
id="businessNumber"
|
|
|
|
|
value={businessNumber}
|
|
|
|
|
onChange={(e) => handleBusinessNumberChange(e.target.value)}
|
|
|
|
|
placeholder="숫자 10자리 입력"
|
|
|
|
|
maxLength={10}
|
|
|
|
|
/>
|
|
|
|
|
<p className="text-xs text-muted-foreground">
|
|
|
|
|
숫자만 가능, 10자리
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="flex justify-end gap-2">
|
|
|
|
|
<Button
|
|
|
|
|
variant="outline"
|
|
|
|
|
onClick={handleCancel}
|
|
|
|
|
disabled={isLoading}
|
|
|
|
|
>
|
|
|
|
|
취소
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
onClick={handleNext}
|
|
|
|
|
disabled={isLoading || businessNumber.length !== 10}
|
|
|
|
|
>
|
|
|
|
|
{isLoading ? '조회 중...' : '다음'}
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</DialogContent>
|
|
|
|
|
</Dialog>
|
|
|
|
|
|
|
|
|
|
{/* Alert 다이얼로그 */}
|
|
|
|
|
<AlertDialog open={alertOpen} onOpenChange={setAlertOpen}>
|
|
|
|
|
<AlertDialogContent>
|
|
|
|
|
<AlertDialogHeader>
|
|
|
|
|
<AlertDialogTitle>알림</AlertDialogTitle>
|
|
|
|
|
<AlertDialogDescription>{alertMessage}</AlertDialogDescription>
|
|
|
|
|
</AlertDialogHeader>
|
|
|
|
|
<AlertDialogFooter>
|
|
|
|
|
<AlertDialogAction>확인</AlertDialogAction>
|
|
|
|
|
</AlertDialogFooter>
|
|
|
|
|
</AlertDialogContent>
|
|
|
|
|
</AlertDialog>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
}
|