Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/app/[locale]/(protected)/construction/project/bidding/estimates/[id]/edit/page.tsx
#	src/app/[locale]/(protected)/construction/project/bidding/estimates/[id]/page.tsx
This commit is contained in:
2026-01-13 19:58:09 +09:00
132 changed files with 19588 additions and 1251 deletions

View File

@@ -0,0 +1,57 @@
'use client';
import { use, useEffect, useState } from 'react';
import { useRouter } from 'next/navigation';
import { ProgressBillingDetailForm } from '@/components/business/construction/progress-billing';
import { getProgressBillingDetail } from '@/components/business/construction/progress-billing/actions';
interface ProgressBillingEditPageProps {
params: Promise<{ id: string }>;
}
export default function ProgressBillingEditPage({ params }: ProgressBillingEditPageProps) {
const { id } = use(params);
const router = useRouter();
const [data, setData] = useState<Awaited<ReturnType<typeof getProgressBillingDetail>>['data']>(undefined);
const [isLoading, setIsLoading] = useState(true);
const [error, setError] = useState<string | null>(null);
useEffect(() => {
getProgressBillingDetail(id)
.then(result => {
if (result.success && result.data) {
setData(result.data);
} else {
setError('기성청구 정보를 찾을 수 없습니다.');
}
})
.catch(() => {
setError('기성청구 정보를 불러오는 중 오류가 발생했습니다.');
})
.finally(() => setIsLoading(false));
}, [id]);
if (isLoading) {
return (
<div className="flex items-center justify-center min-h-[400px]">
<div className="text-muted-foreground"> ...</div>
</div>
);
}
if (error || !data) {
return (
<div className="flex flex-col items-center justify-center min-h-[400px] gap-4">
<div className="text-muted-foreground">{error || '기성청구 정보를 찾을 수 없습니다.'}</div>
<button
onClick={() => router.back()}
className="text-primary hover:underline"
>
</button>
</div>
);
}
return <ProgressBillingDetailForm mode="edit" billingId={id} initialData={data} />;
}

View File

@@ -0,0 +1,57 @@
'use client';
import { use, useEffect, useState } from 'react';
import { useRouter } from 'next/navigation';
import { ProgressBillingDetailForm } from '@/components/business/construction/progress-billing';
import { getProgressBillingDetail } from '@/components/business/construction/progress-billing/actions';
interface ProgressBillingDetailPageProps {
params: Promise<{ id: string }>;
}
export default function ProgressBillingDetailPage({ params }: ProgressBillingDetailPageProps) {
const { id } = use(params);
const router = useRouter();
const [data, setData] = useState<Awaited<ReturnType<typeof getProgressBillingDetail>>['data']>(undefined);
const [isLoading, setIsLoading] = useState(true);
const [error, setError] = useState<string | null>(null);
useEffect(() => {
getProgressBillingDetail(id)
.then(result => {
if (result.success && result.data) {
setData(result.data);
} else {
setError('기성청구 정보를 찾을 수 없습니다.');
}
})
.catch(() => {
setError('기성청구 정보를 불러오는 중 오류가 발생했습니다.');
})
.finally(() => setIsLoading(false));
}, [id]);
if (isLoading) {
return (
<div className="flex items-center justify-center min-h-[400px]">
<div className="text-muted-foreground"> ...</div>
</div>
);
}
if (error || !data) {
return (
<div className="flex flex-col items-center justify-center min-h-[400px] gap-4">
<div className="text-muted-foreground">{error || '기성청구 정보를 찾을 수 없습니다.'}</div>
<button
onClick={() => router.back()}
className="text-primary hover:underline"
>
</button>
</div>
);
}
return <ProgressBillingDetailForm mode="view" billingId={id} initialData={data} />;
}

View File

@@ -0,0 +1,38 @@
'use client';
import { useEffect, useState } from 'react';
import ProgressBillingManagementListClient from '@/components/business/construction/progress-billing/ProgressBillingManagementListClient';
import { getProgressBillingList, getProgressBillingStats } from '@/components/business/construction/progress-billing/actions';
import type { ProgressBilling, ProgressBillingStats } from '@/components/business/construction/progress-billing/types';
export default function ProgressBillingManagementPage() {
const [data, setData] = useState<ProgressBilling[]>([]);
const [stats, setStats] = useState<ProgressBillingStats | undefined>(undefined);
const [isLoading, setIsLoading] = useState(true);
useEffect(() => {
Promise.all([
getProgressBillingList({ size: 1000 }),
getProgressBillingStats(),
])
.then(([listResult, statsResult]) => {
if (listResult.success && listResult.data) {
setData(listResult.data.items);
}
if (statsResult.success && statsResult.data) {
setStats(statsResult.data);
}
})
.finally(() => setIsLoading(false));
}, []);
if (isLoading) {
return (
<div className="flex items-center justify-center min-h-[400px]">
<div className="text-muted-foreground"> ...</div>
</div>
);
}
return <ProgressBillingManagementListClient initialData={data} initialStats={stats} />;
}

View File

@@ -9,6 +9,190 @@ interface EstimateEditPageProps {
params: Promise<{ id: string }>;
}
// 목업 데이터 - 추후 API 연동
function getEstimateDetail(id: string): EstimateDetail {
// TODO: 실제 API 연동
const mockData: EstimateDetail = {
id,
estimateCode: '123123',
partnerId: '1',
partnerName: '회사명',
projectName: '현장명',
estimatorId: 'hong',
estimatorName: '이름',
estimateCompanyManager: '홍길동',
estimateCompanyManagerContact: '01012341234',
itemCount: 21,
estimateAmount: 1420000,
completedDate: null,
bidDate: '2025-12-12',
status: 'pending',
createdAt: '2025-12-01',
updatedAt: '2025-12-01',
createdBy: 'hong',
siteBriefing: {
briefingCode: '123123',
partnerName: '회사명',
companyName: '회사명',
briefingDate: '2025-12-12',
attendee: '이름',
},
bidInfo: {
projectName: '현장명',
bidDate: '2025-12-12',
siteCount: 21,
constructionPeriod: '2026-01-01 ~ 2026-12-10',
constructionStartDate: '2026-01-01',
constructionEndDate: '2026-12-10',
vatType: 'excluded',
workReport: '업무 보고 내용',
documents: [
{
id: '1',
fileName: 'abc.zip',
fileUrl: '#',
fileSize: 1024000,
},
],
},
summaryItems: [
{
id: '1',
name: '서터 심창측공사',
quantity: 1,
unit: '식',
materialCost: 78540000,
laborCost: 15410000,
totalCost: 93950000,
remarks: '',
},
],
expenseItems: [
{
id: '1',
name: 'public_1',
amount: 10000,
},
],
priceAdjustments: [
{
id: '1',
category: '배합비',
unitPrice: 10000,
coating: 10000,
batting: 10000,
boxReinforce: 10500,
painting: 10500,
total: 51000,
},
{
id: '2',
category: '재단비',
unitPrice: 1375,
coating: 0,
batting: 0,
boxReinforce: 0,
painting: 0,
total: 1375,
},
{
id: '3',
category: '판매단가',
unitPrice: 0,
coating: 10000,
batting: 10000,
boxReinforce: 10500,
painting: 10500,
total: 41000,
},
{
id: '4',
category: '조립단가',
unitPrice: 10300,
coating: 10300,
batting: 10300,
boxReinforce: 10500,
painting: 10200,
total: 51600,
},
],
detailItems: [
{
id: '1',
no: 1,
name: 'FS530외/주차',
material: 'screen',
width: 2350,
height: 2500,
quantity: 1,
box: 1,
assembly: 0,
coating: 0,
batting: 0,
mounting: 0,
fitting: 0,
controller: 0,
widthConstruction: 0,
heightConstruction: 0,
materialCost: 1420000,
laborCost: 510000,
quantityPrice: 1930000,
expenseQuantity: 5500,
expenseTotal: 5500,
totalCost: 1930000,
otherCost: 0,
marginCost: 0,
totalPrice: 1930000,
unitPrice: 1420000,
expense: 0,
marginRate: 0,
unitQuantity: 1,
expenseResult: 0,
marginActual: 0,
},
{
id: '2',
no: 2,
name: 'FS530외/주차',
material: 'screen',
width: 7500,
height: 2500,
quantity: 1,
box: 1,
assembly: 0,
coating: 0,
batting: 0,
mounting: 0,
fitting: 0,
controller: 0,
widthConstruction: 0,
heightConstruction: 0,
materialCost: 4720000,
laborCost: 780000,
quantityPrice: 5500000,
expenseQuantity: 5500,
expenseTotal: 5500,
totalCost: 5500000,
otherCost: 0,
marginCost: 0,
totalPrice: 5500000,
unitPrice: 4720000,
expense: 0,
marginRate: 0,
unitQuantity: 1,
expenseResult: 0,
marginActual: 0,
},
],
approval: {
approvers: [],
references: [],
},
};
return mockData;
}
export default function EstimateEditPage({ params }: EstimateEditPageProps) {
const { id } = use(params);
const [data, setData] = useState<EstimateDetail | null>(null);

View File

@@ -9,6 +9,190 @@ interface EstimateDetailPageProps {
params: Promise<{ id: string }>;
}
// 목업 데이터 - 추후 API 연동
function getEstimateDetail(id: string): EstimateDetail {
// TODO: 실제 API 연동
const mockData: EstimateDetail = {
id,
estimateCode: '123123',
partnerId: '1',
partnerName: '회사명',
projectName: '현장명',
estimatorId: 'hong',
estimatorName: '이름',
estimateCompanyManager: '홍길동',
estimateCompanyManagerContact: '01012341234',
itemCount: 21,
estimateAmount: 1420000,
completedDate: null,
bidDate: '2025-12-12',
status: 'pending',
createdAt: '2025-12-01',
updatedAt: '2025-12-01',
createdBy: 'hong',
siteBriefing: {
briefingCode: '123123',
partnerName: '회사명',
companyName: '회사명',
briefingDate: '2025-12-12',
attendee: '이름',
},
bidInfo: {
projectName: '현장명',
bidDate: '2025-12-12',
siteCount: 21,
constructionPeriod: '2026-01-01 ~ 2026-12-10',
constructionStartDate: '2026-01-01',
constructionEndDate: '2026-12-10',
vatType: 'excluded',
workReport: '업무 보고 내용',
documents: [
{
id: '1',
fileName: 'abc.zip',
fileUrl: '#',
fileSize: 1024000,
},
],
},
summaryItems: [
{
id: '1',
name: '서터 심창측공사',
quantity: 1,
unit: '식',
materialCost: 78540000,
laborCost: 15410000,
totalCost: 93950000,
remarks: '',
},
],
expenseItems: [
{
id: '1',
name: 'public_1',
amount: 10000,
},
],
priceAdjustments: [
{
id: '1',
category: '배합비',
unitPrice: 10000,
coating: 10000,
batting: 10000,
boxReinforce: 10500,
painting: 10500,
total: 51000,
},
{
id: '2',
category: '재단비',
unitPrice: 1375,
coating: 0,
batting: 0,
boxReinforce: 0,
painting: 0,
total: 1375,
},
{
id: '3',
category: '판매단가',
unitPrice: 0,
coating: 10000,
batting: 10000,
boxReinforce: 10500,
painting: 10500,
total: 41000,
},
{
id: '4',
category: '조립단가',
unitPrice: 10300,
coating: 10300,
batting: 10300,
boxReinforce: 10500,
painting: 10200,
total: 51600,
},
],
detailItems: [
{
id: '1',
no: 1,
name: 'FS530외/주차',
material: 'screen',
width: 2350,
height: 2500,
quantity: 1,
box: 1,
assembly: 0,
coating: 0,
batting: 0,
mounting: 0,
fitting: 0,
controller: 0,
widthConstruction: 0,
heightConstruction: 0,
materialCost: 1420000,
laborCost: 510000,
quantityPrice: 1930000,
expenseQuantity: 5500,
expenseTotal: 5500,
totalCost: 1930000,
otherCost: 0,
marginCost: 0,
totalPrice: 1930000,
unitPrice: 1420000,
expense: 0,
marginRate: 0,
unitQuantity: 1,
expenseResult: 0,
marginActual: 0,
},
{
id: '2',
no: 2,
name: 'FS530외/주차',
material: 'screen',
width: 7500,
height: 2500,
quantity: 1,
box: 1,
assembly: 0,
coating: 0,
batting: 0,
mounting: 0,
fitting: 0,
controller: 0,
widthConstruction: 0,
heightConstruction: 0,
materialCost: 4720000,
laborCost: 780000,
quantityPrice: 5500000,
expenseQuantity: 5500,
expenseTotal: 5500,
totalCost: 5500000,
otherCost: 0,
marginCost: 0,
totalPrice: 5500000,
unitPrice: 4720000,
expense: 0,
marginRate: 0,
unitQuantity: 1,
expenseResult: 0,
marginActual: 0,
},
],
approval: {
approvers: [],
references: [],
},
};
return mockData;
}
export default function EstimateDetailPage({ params }: EstimateDetailPageProps) {
const { id } = use(params);
const [data, setData] = useState<EstimateDetail | null>(null);

View File

@@ -0,0 +1,16 @@
'use client';
import { use } from 'react';
import ConstructionDetailClient from '@/components/business/construction/management/ConstructionDetailClient';
interface PageProps {
params: Promise<{
id: string;
}>;
}
export default function ConstructionManagementEditPage({ params }: PageProps) {
const { id } = use(params);
return <ConstructionDetailClient id={id} mode="edit" />;
}

View File

@@ -0,0 +1,16 @@
'use client';
import { use } from 'react';
import ConstructionDetailClient from '@/components/business/construction/management/ConstructionDetailClient';
interface PageProps {
params: Promise<{
id: string;
}>;
}
export default function ConstructionManagementDetailPage({ params }: PageProps) {
const { id } = use(params);
return <ConstructionDetailClient id={id} mode="view" />;
}

View File

@@ -0,0 +1,52 @@
'use client';
import { useEffect, useState } from 'react';
import ConstructionManagementListClient from '@/components/business/construction/management/ConstructionManagementListClient';
import {
getConstructionManagementList,
getConstructionManagementStats,
} from '@/components/business/construction/management/actions';
import type {
ConstructionManagement,
ConstructionManagementStats,
} from '@/components/business/construction/management/types';
export default function ConstructionManagementPage() {
const [data, setData] = useState<ConstructionManagement[]>([]);
const [stats, setStats] = useState<ConstructionManagementStats | undefined>(undefined);
const [isLoading, setIsLoading] = useState(true);
useEffect(() => {
const loadData = async () => {
try {
const [listResult, statsResult] = await Promise.all([
getConstructionManagementList({ size: 1000 }),
getConstructionManagementStats(),
]);
if (listResult.success && listResult.data) {
setData(listResult.data.items);
}
if (statsResult.success && statsResult.data) {
setStats(statsResult.data);
}
} catch (error) {
console.error('Failed to load construction management data:', error);
} finally {
setIsLoading(false);
}
};
loadData();
}, []);
if (isLoading) {
return (
<div className="flex items-center justify-center min-h-[400px]">
<div className="text-muted-foreground"> ...</div>
</div>
);
}
return <ConstructionManagementListClient initialData={data} initialStats={stats} />;
}

View File

@@ -0,0 +1,45 @@
'use client';
import { useEffect, useState } from 'react';
import { useSearchParams } from 'next/navigation';
import ContractDetailForm from '@/components/business/construction/contract/ContractDetailForm';
import { getContractDetail } from '@/components/business/construction/contract';
import type { ContractDetail } from '@/components/business/construction/contract/types';
export default function ContractCreatePage() {
const searchParams = useSearchParams();
const baseContractId = searchParams.get('baseContractId');
const [baseData, setBaseData] = useState<ContractDetail | undefined>(undefined);
const [isLoading, setIsLoading] = useState(!!baseContractId);
useEffect(() => {
if (baseContractId) {
// 변경 계약서 생성: 기존 계약 데이터 복사
getContractDetail(baseContractId)
.then(result => {
if (result.success && result.data) {
setBaseData(result.data);
}
})
.finally(() => setIsLoading(false));
}
}, [baseContractId]);
if (isLoading) {
return (
<div className="flex items-center justify-center min-h-[400px]">
<div className="text-muted-foreground"> ...</div>
</div>
);
}
return (
<ContractDetailForm
mode="create"
contractId=""
initialData={baseData}
isChangeContract={!!baseContractId}
/>
);
}

View File

@@ -0,0 +1,53 @@
'use client';
import { useEffect, useState } from 'react';
import { useParams } from 'next/navigation';
import IssueDetailForm from '@/components/business/construction/issue-management/IssueDetailForm';
import { getIssue } from '@/components/business/construction/issue-management/actions';
import type { Issue } from '@/components/business/construction/issue-management/types';
export default function IssueEditPage() {
const params = useParams();
const id = params.id as string;
const [issue, setIssue] = useState<Issue | undefined>(undefined);
const [isLoading, setIsLoading] = useState(true);
const [error, setError] = useState<string | null>(null);
useEffect(() => {
const loadData = async () => {
try {
const result = await getIssue(id);
if (result.success && result.data) {
setIssue(result.data);
} else {
setError(result.error || '이슈를 찾을 수 없습니다.');
}
} catch {
setError('이슈 조회에 실패했습니다.');
} finally {
setIsLoading(false);
}
};
loadData();
}, [id]);
if (isLoading) {
return (
<div className="flex items-center justify-center min-h-[400px]">
<div className="text-muted-foreground"> ...</div>
</div>
);
}
if (error) {
return (
<div className="flex items-center justify-center min-h-[400px]">
<div className="text-red-500">{error}</div>
</div>
);
}
return <IssueDetailForm issue={issue} mode="edit" />;
}

View File

@@ -0,0 +1,53 @@
'use client';
import { useEffect, useState } from 'react';
import { useParams } from 'next/navigation';
import IssueDetailForm from '@/components/business/construction/issue-management/IssueDetailForm';
import { getIssue } from '@/components/business/construction/issue-management/actions';
import type { Issue } from '@/components/business/construction/issue-management/types';
export default function IssueDetailPage() {
const params = useParams();
const id = params.id as string;
const [issue, setIssue] = useState<Issue | undefined>(undefined);
const [isLoading, setIsLoading] = useState(true);
const [error, setError] = useState<string | null>(null);
useEffect(() => {
const loadData = async () => {
try {
const result = await getIssue(id);
if (result.success && result.data) {
setIssue(result.data);
} else {
setError(result.error || '이슈를 찾을 수 없습니다.');
}
} catch {
setError('이슈 조회에 실패했습니다.');
} finally {
setIsLoading(false);
}
};
loadData();
}, [id]);
if (isLoading) {
return (
<div className="flex items-center justify-center min-h-[400px]">
<div className="text-muted-foreground"> ...</div>
</div>
);
}
if (error) {
return (
<div className="flex items-center justify-center min-h-[400px]">
<div className="text-red-500">{error}</div>
</div>
);
}
return <IssueDetailForm issue={issue} mode="view" />;
}

View File

@@ -0,0 +1,7 @@
'use client';
import IssueDetailForm from '@/components/business/construction/issue-management/IssueDetailForm';
export default function IssueNewPage() {
return <IssueDetailForm mode="create" />;
}

View File

@@ -0,0 +1,52 @@
'use client';
import { useEffect, useState } from 'react';
import IssueManagementListClient from '@/components/business/construction/issue-management/IssueManagementListClient';
import {
getIssueList,
getIssueStats,
} from '@/components/business/construction/issue-management/actions';
import type {
Issue,
IssueStats,
} from '@/components/business/construction/issue-management/types';
export default function IssueManagementPage() {
const [data, setData] = useState<Issue[]>([]);
const [stats, setStats] = useState<IssueStats | undefined>(undefined);
const [isLoading, setIsLoading] = useState(true);
useEffect(() => {
const loadData = async () => {
try {
const [listResult, statsResult] = await Promise.all([
getIssueList({ size: 1000 }),
getIssueStats(),
]);
if (listResult.success && listResult.data) {
setData(listResult.data.items);
}
if (statsResult.success && statsResult.data) {
setStats(statsResult.data);
}
} catch (error) {
console.error('Failed to load issue management data:', error);
} finally {
setIsLoading(false);
}
};
loadData();
}, []);
if (isLoading) {
return (
<div className="flex items-center justify-center min-h-[400px]">
<div className="text-muted-foreground"> ...</div>
</div>
);
}
return <IssueManagementListClient initialData={data} initialStats={stats} />;
}

View File

@@ -0,0 +1,17 @@
'use client';
import { use } from 'react';
import ProjectDetailClient from '@/components/business/construction/management/ProjectDetailClient';
interface PageProps {
params: Promise<{
id: string;
locale: string;
}>;
}
export default function ProjectDetailPage({ params }: PageProps) {
const { id } = use(params);
return <ProjectDetailClient projectId={id} />;
}

View File

@@ -0,0 +1,7 @@
'use client';
import { ProjectListClient } from '@/components/business/construction/management';
export default function ProjectManagementPage() {
return <ProjectListClient />;
}

View File

@@ -0,0 +1,5 @@
import { UtilityManagementListClient } from '@/components/business/construction/utility-management';
export default function UtilityManagementPage() {
return <UtilityManagementListClient />;
}

View File

@@ -0,0 +1,32 @@
'use client';
import { useEffect, useState } from 'react';
import WorkerStatusListClient from '@/components/business/construction/worker-status/WorkerStatusListClient';
import { getWorkerStatusList, getWorkerStatusStats } from '@/components/business/construction/worker-status/actions';
import type { WorkerStatus, WorkerStatusStats } from '@/components/business/construction/worker-status/types';
import { ContentLoadingSpinner } from '@/components/ui/loading-spinner';
export default function WorkerStatusPage() {
const [data, setData] = useState<WorkerStatus[]>([]);
const [stats, setStats] = useState<WorkerStatusStats | undefined>(undefined);
const [isLoading, setIsLoading] = useState(true);
useEffect(() => {
Promise.all([getWorkerStatusList(), getWorkerStatusStats()])
.then(([listResult, statsResult]) => {
if (listResult.success && listResult.data) {
setData(listResult.data.items);
}
if (statsResult.success && statsResult.data) {
setStats(statsResult.data);
}
})
.finally(() => setIsLoading(false));
}, []);
if (isLoading) {
return <ContentLoadingSpinner />;
}
return <WorkerStatusListClient initialData={data} initialStats={stats} />;
}

View File

@@ -1,22 +1,28 @@
'use client';
import { useRouter } from 'next/navigation';
import { useRouter, useParams } from 'next/navigation';
import { toast } from 'sonner';
import { EmployeeForm } from '@/components/hr/EmployeeManagement/EmployeeForm';
import { createEmployee } from '@/components/hr/EmployeeManagement/actions';
import type { EmployeeFormData } from '@/components/hr/EmployeeManagement/types';
export default function EmployeeNewPage() {
const router = useRouter();
const params = useParams();
const locale = params.locale as string || 'ko';
const handleSave = async (data: EmployeeFormData) => {
try {
const result = await createEmployee(data);
if (result.success) {
router.push('/ko/hr/employee-management');
toast.success('사원이 등록되었습니다.');
router.push(`/${locale}/hr/employee-management`);
} else {
toast.error(result.error || '사원 등록에 실패했습니다.');
console.error('[EmployeeNewPage] Create failed:', result.error);
}
} catch (error) {
toast.error('서버 오류가 발생했습니다.');
console.error('[EmployeeNewPage] Create error:', error);
}
};

View File

@@ -1,13 +1,14 @@
'use client';
import React, { useState, useMemo } from 'react';
import { ChevronDown, ChevronRight, Check, Search, X } from 'lucide-react';
import { ChevronDown, ChevronRight, Check } from 'lucide-react';
import { cn } from '@/lib/utils';
import type { ChecklistCategory, ChecklistSubItem } from '../types';
interface Day1ChecklistPanelProps {
categories: ChecklistCategory[];
selectedSubItemId: string | null;
searchTerm: string;
onSubItemSelect: (categoryId: string, subItemId: string) => void;
onSubItemToggle: (categoryId: string, subItemId: string, isCompleted: boolean) => void;
}
@@ -15,13 +16,13 @@ interface Day1ChecklistPanelProps {
export function Day1ChecklistPanel({
categories,
selectedSubItemId,
searchTerm,
onSubItemSelect,
onSubItemToggle,
}: Day1ChecklistPanelProps) {
const [expandedCategories, setExpandedCategories] = useState<Set<string>>(
new Set(categories.map(c => c.id)) // 기본적으로 모두 펼침
);
const [searchTerm, setSearchTerm] = useState('');
// 검색 필터링된 카테고리
const filteredCategories = useMemo(() => {
@@ -74,10 +75,6 @@ export function Day1ChecklistPanel({
return { completed, total: originalCategory.subItems.length };
};
const clearSearch = () => {
setSearchTerm('');
};
// 검색 결과 하이라이트
const highlightText = (text: string, term: string) => {
if (!term.trim()) return text;
@@ -96,29 +93,9 @@ export function Day1ChecklistPanel({
return (
<div className="bg-white rounded-lg border border-gray-200 overflow-hidden h-full flex flex-col">
{/* 헤더 + 검색 */}
{/* 헤더 */}
<div className="bg-gray-100 px-2 sm:px-4 py-2 sm:py-3 border-b border-gray-200">
<h3 className="font-semibold text-gray-900 text-sm sm:text-base mb-2"> </h3>
{/* 검색 입력 */}
<div className="relative">
<Search className="absolute left-2 sm:left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" />
<input
type="text"
placeholder="항목 검색..."
value={searchTerm}
onChange={(e) => setSearchTerm(e.target.value)}
className="w-full pl-8 sm:pl-9 pr-8 py-1.5 sm:py-2 text-sm border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
/>
{searchTerm && (
<button
type="button"
onClick={clearSearch}
className="absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-gray-200 rounded-full transition-colors"
>
<X className="h-4 w-4 text-gray-400" />
</button>
)}
</div>
<h3 className="font-semibold text-gray-900 text-sm sm:text-base"> </h3>
{/* 검색 결과 카운트 */}
{searchTerm && (
<div className="mt-1.5 sm:mt-2 text-xs text-gray-500">

View File

@@ -270,6 +270,16 @@ export default function QualityInspectionPage() {
</div>
)}
{/* 공통 필터 (1일차/2일차 모두 사용) */}
<Filters
selectedYear={selectedYear}
selectedQuarter={selectedQuarter}
searchTerm={searchTerm}
onYearChange={handleYearChange}
onQuarterChange={handleQuarterChange}
onSearchChange={handleSearchChange}
/>
{activeDay === 1 ? (
// ===== 1일차: 기준/매뉴얼 심사 =====
<div className="flex-1 grid grid-cols-12 gap-3 sm:gap-4 lg:min-h-0">
@@ -284,6 +294,7 @@ export default function QualityInspectionPage() {
<Day1ChecklistPanel
categories={filteredDay1Categories}
selectedSubItemId={selectedSubItemId}
searchTerm={searchTerm}
onSubItemSelect={handleSubItemSelect}
onSubItemToggle={handleSubItemToggle}
/>
@@ -315,17 +326,7 @@ export default function QualityInspectionPage() {
</div>
) : (
// ===== 2일차: 로트추적 심사 =====
<>
<Filters
selectedYear={selectedYear}
selectedQuarter={selectedQuarter}
searchTerm={searchTerm}
onYearChange={handleYearChange}
onQuarterChange={handleQuarterChange}
onSearchChange={handleSearchChange}
/>
<div className="flex-1 grid grid-cols-12 gap-3 sm:gap-4 lg:gap-6 lg:min-h-0">
<div className="flex-1 grid grid-cols-12 gap-3 sm:gap-4 lg:gap-6 lg:min-h-0">
<div className="col-span-12 lg:col-span-3 min-h-[250px] sm:min-h-[300px] lg:min-h-0 lg:h-full overflow-auto lg:overflow-hidden">
<ReportList
reports={filteredReports}
@@ -352,7 +353,6 @@ export default function QualityInspectionPage() {
/>
</div>
</div>
</>
)}
{/* 설정 패널 */}

View File

@@ -0,0 +1,54 @@
/**
* 견적 등록 테스트 페이지 (V2 UI)
*
* 새로운 자동 견적 산출 UI 테스트용
* 기존 견적 등록 페이지는 수정하지 않음
*/
"use client";
import { useRouter } from "next/navigation";
import { useState } from "react";
import { QuoteRegistrationV2, QuoteFormDataV2 } from "@/components/quotes/QuoteRegistrationV2";
import { toast } from "sonner";
export default function QuoteTestNewPage() {
const router = useRouter();
const [isSaving, setIsSaving] = useState(false);
const handleBack = () => {
router.push("/sales/quote-management");
};
const handleSave = async (data: QuoteFormDataV2, saveType: "temporary" | "final") => {
setIsSaving(true);
try {
// TODO: API 연동 시 실제 저장 로직 구현
console.log("[테스트] 저장 데이터:", data);
console.log("[테스트] 저장 타입:", saveType);
// 테스트용 지연
await new Promise((resolve) => setTimeout(resolve, 1000));
toast.success(`[테스트] ${saveType === "temporary" ? "임시" : "최종"} 저장 완료`);
// 저장 후 상세 페이지로 이동 (테스트용으로 ID=1 사용)
if (saveType === "final") {
router.push("/sales/quote-management/test/1");
}
} catch (error) {
toast.error("저장 중 오류가 발생했습니다.");
} finally {
setIsSaving(false);
}
};
return (
<QuoteRegistrationV2
mode="create"
onBack={handleBack}
onSave={handleSave}
isLoading={isSaving}
/>
);
}

View File

@@ -0,0 +1,152 @@
/**
* 견적 수정 테스트 페이지 (V2 UI)
*
* 새로운 자동 견적 산출 UI 테스트용
* 기존 견적 수정 페이지는 수정하지 않음
*/
"use client";
import { useRouter, useParams } from "next/navigation";
import { useState, useEffect } from "react";
import { QuoteRegistrationV2, QuoteFormDataV2 } from "@/components/quotes/QuoteRegistrationV2";
import { ContentLoadingSpinner } from "@/components/ui/loading-spinner";
import { toast } from "sonner";
// 테스트용 목업 데이터
const MOCK_DATA: QuoteFormDataV2 = {
id: "1",
registrationDate: "2026-01-12",
writer: "드미트리",
clientId: "1",
clientName: "아크다이레드",
siteName: "강남 테스트 현장",
manager: "김담당",
contact: "010-1234-5678",
dueDate: "2026-02-01",
remarks: "테스트 비고 내용입니다.",
status: "draft",
locations: [
{
id: "loc-1",
floor: "1층",
code: "FSS-01",
openWidth: 5000,
openHeight: 3000,
productCode: "KSS01",
productName: "방화스크린",
quantity: 1,
guideRailType: "wall",
motorPower: "single",
controller: "basic",
wingSize: 50,
inspectionFee: 50000,
unitPrice: 1645200,
totalPrice: 1645200,
},
{
id: "loc-2",
floor: "3층",
code: "FST-30",
openWidth: 7500,
openHeight: 3300,
productCode: "KSS02",
productName: "방화스크린2",
quantity: 1,
guideRailType: "wall",
motorPower: "single",
controller: "smart",
wingSize: 50,
inspectionFee: 50000,
unitPrice: 2589198,
totalPrice: 2589198,
},
{
id: "loc-3",
floor: "5층",
code: "FSS-50",
openWidth: 6000,
openHeight: 2800,
productCode: "KSS01",
productName: "방화스크린",
quantity: 2,
guideRailType: "floor",
motorPower: "three",
controller: "premium",
wingSize: 50,
inspectionFee: 50000,
unitPrice: 1721214,
totalPrice: 3442428,
},
],
};
export default function QuoteTestEditPage() {
const router = useRouter();
const params = useParams();
const quoteId = params.id as string;
const [quote, setQuote] = useState<QuoteFormDataV2 | null>(null);
const [isLoading, setIsLoading] = useState(true);
const [isSaving, setIsSaving] = useState(false);
useEffect(() => {
// 테스트용 데이터 로드 시뮬레이션
const loadQuote = async () => {
setIsLoading(true);
try {
// 실제로는 API 호출
await new Promise((resolve) => setTimeout(resolve, 500));
setQuote({ ...MOCK_DATA, id: quoteId });
} catch (error) {
toast.error("견적 정보를 불러오는데 실패했습니다.");
router.push("/sales/quote-management");
} finally {
setIsLoading(false);
}
};
loadQuote();
}, [quoteId, router]);
const handleBack = () => {
router.push("/sales/quote-management");
};
const handleSave = async (data: QuoteFormDataV2, saveType: "temporary" | "final") => {
setIsSaving(true);
try {
// TODO: API 연동 시 실제 저장 로직 구현
console.log("[테스트] 수정 데이터:", data);
console.log("[테스트] 저장 타입:", saveType);
// 테스트용 지연
await new Promise((resolve) => setTimeout(resolve, 1000));
toast.success(`[테스트] ${saveType === "temporary" ? "임시" : "최종"} 저장 완료`);
// 저장 후 상세 페이지로 이동
if (saveType === "final") {
router.push(`/sales/quote-management/test/${quoteId}`);
}
} catch (error) {
toast.error("저장 중 오류가 발생했습니다.");
} finally {
setIsSaving(false);
}
};
if (isLoading) {
return <ContentLoadingSpinner text="견적 정보를 불러오는 중..." />;
}
return (
<QuoteRegistrationV2
mode="edit"
onBack={handleBack}
onSave={handleSave}
initialData={quote}
isLoading={isSaving}
/>
);
}

View File

@@ -0,0 +1,126 @@
/**
* 견적 상세 테스트 페이지 (V2 UI)
*
* 새로운 자동 견적 산출 UI 테스트용
* 기존 견적 상세 페이지는 수정하지 않음
*/
"use client";
import { useRouter, useParams } from "next/navigation";
import { useState, useEffect } from "react";
import { QuoteRegistrationV2, QuoteFormDataV2, LocationItem } from "@/components/quotes/QuoteRegistrationV2";
import { ContentLoadingSpinner } from "@/components/ui/loading-spinner";
import { toast } from "sonner";
// 테스트용 목업 데이터
const MOCK_DATA: QuoteFormDataV2 = {
id: "1",
registrationDate: "2026-01-12",
writer: "드미트리",
clientId: "1",
clientName: "아크다이레드",
siteName: "강남 테스트 현장",
manager: "김담당",
contact: "010-1234-5678",
dueDate: "2026-02-01",
remarks: "테스트 비고 내용입니다.",
status: "draft",
locations: [
{
id: "loc-1",
floor: "1층",
code: "FSS-01",
openWidth: 5000,
openHeight: 3000,
productCode: "KSS01",
productName: "방화스크린",
quantity: 1,
guideRailType: "wall",
motorPower: "single",
controller: "basic",
wingSize: 50,
inspectionFee: 50000,
unitPrice: 1645200,
totalPrice: 1645200,
},
{
id: "loc-2",
floor: "3층",
code: "FST-30",
openWidth: 7500,
openHeight: 3300,
productCode: "KSS02",
productName: "방화스크린2",
quantity: 1,
guideRailType: "wall",
motorPower: "single",
controller: "smart",
wingSize: 50,
inspectionFee: 50000,
unitPrice: 2589198,
totalPrice: 2589198,
},
{
id: "loc-3",
floor: "5층",
code: "FSS-50",
openWidth: 6000,
openHeight: 2800,
productCode: "KSS01",
productName: "방화스크린",
quantity: 2,
guideRailType: "floor",
motorPower: "three",
controller: "premium",
wingSize: 50,
inspectionFee: 50000,
unitPrice: 1721214,
totalPrice: 3442428,
},
],
};
export default function QuoteTestDetailPage() {
const router = useRouter();
const params = useParams();
const quoteId = params.id as string;
const [quote, setQuote] = useState<QuoteFormDataV2 | null>(null);
const [isLoading, setIsLoading] = useState(true);
useEffect(() => {
// 테스트용 데이터 로드 시뮬레이션
const loadQuote = async () => {
setIsLoading(true);
try {
// 실제로는 API 호출
await new Promise((resolve) => setTimeout(resolve, 500));
setQuote({ ...MOCK_DATA, id: quoteId });
} catch (error) {
toast.error("견적 정보를 불러오는데 실패했습니다.");
router.push("/sales/quote-management");
} finally {
setIsLoading(false);
}
};
loadQuote();
}, [quoteId, router]);
const handleBack = () => {
router.push("/sales/quote-management");
};
if (isLoading) {
return <ContentLoadingSpinner text="견적 정보를 불러오는 중..." />;
}
return (
<QuoteRegistrationV2
mode="view"
onBack={handleBack}
initialData={quote}
/>
);
}

View File

@@ -284,6 +284,25 @@
transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
/* Bell ringing animation for notifications */
@keyframes bell-ring {
0%, 100% { transform: rotate(0deg); }
10% { transform: rotate(14deg); }
20% { transform: rotate(-12deg); }
30% { transform: rotate(10deg); }
40% { transform: rotate(-8deg); }
50% { transform: rotate(6deg); }
60% { transform: rotate(-4deg); }
70% { transform: rotate(2deg); }
80% { transform: rotate(-1deg); }
90% { transform: rotate(0deg); }
}
.animate-bell-ring {
animation: bell-ring 1s ease-in-out infinite;
transform-origin: top center;
}
/* Custom scrollbar */
::-webkit-scrollbar {
width: 8px;