2025-12-26 15:48:08 +09:00
|
|
|
'use client';
|
|
|
|
|
|
2026-01-29 22:56:01 +09:00
|
|
|
/**
|
|
|
|
|
* 공정 상세 페이지 (리디자인)
|
|
|
|
|
*
|
|
|
|
|
* 기획서 스크린샷 1 기준:
|
|
|
|
|
* - 기본 정보: 공정번호, 공정형, 담당부서, 담당자, 생산일자, 상태
|
|
|
|
|
* - 품목 설정 정보: 품목 선택 버튼 + 개수 표시
|
|
|
|
|
* - 단계 테이블: 드래그&드롭 순서변경 + 단계 등록 버튼
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import { useState, useEffect, useCallback, useRef } from 'react';
|
2025-12-26 15:48:08 +09:00
|
|
|
import { useRouter } from 'next/navigation';
|
2026-02-09 17:52:43 +09:00
|
|
|
import { ArrowLeft, Edit, GripVertical, Plus, Package, Trash2 } from 'lucide-react';
|
2025-12-26 15:48:08 +09:00
|
|
|
import { Button } from '@/components/ui/button';
|
|
|
|
|
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
|
|
|
|
import { Badge } from '@/components/ui/badge';
|
|
|
|
|
import { PageLayout } from '@/components/organisms/PageLayout';
|
2026-01-26 15:07:10 +09:00
|
|
|
import { PageHeader } from '@/components/organisms/PageHeader';
|
|
|
|
|
import { useMenuStore } from '@/store/menuStore';
|
feat(WEB): 권한 관리 시스템 구현 및 상세 페이지 권한 통합
- PermissionContext, usePermission 훅, PermissionGuard 컴포넌트 신규 추가
- AccessDenied 접근 거부 페이지 추가
- permissions lib (체커, 매퍼, 타입) 구현
- BadDebtDetail, BoardDetail, LaborDetail, PricingDetail 등 상세 페이지 권한 적용
- ProcessDetail, StepDetail, ItemDetail, PermissionDetail 권한 연동
- RootProvider에 PermissionProvider 통합
- protected layout 권한 체크 추가
- Claude 프로젝트 설정 파일 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 10:17:02 +09:00
|
|
|
import { usePermission } from '@/hooks/usePermission';
|
2026-02-09 17:52:43 +09:00
|
|
|
import { toast } from 'sonner';
|
|
|
|
|
import { DeleteConfirmDialog } from '@/components/ui/confirm-dialog';
|
|
|
|
|
import { getProcessSteps, reorderProcessSteps, deleteProcess } from './actions';
|
2026-01-29 22:56:01 +09:00
|
|
|
import type { Process, ProcessStep } from '@/types/process';
|
2025-12-26 15:48:08 +09:00
|
|
|
|
|
|
|
|
interface ProcessDetailProps {
|
|
|
|
|
process: Process;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function ProcessDetail({ process }: ProcessDetailProps) {
|
|
|
|
|
const router = useRouter();
|
2026-01-26 15:07:10 +09:00
|
|
|
const sidebarCollapsed = useMenuStore((state) => state.sidebarCollapsed);
|
feat(WEB): 권한 관리 시스템 구현 및 상세 페이지 권한 통합
- PermissionContext, usePermission 훅, PermissionGuard 컴포넌트 신규 추가
- AccessDenied 접근 거부 페이지 추가
- permissions lib (체커, 매퍼, 타입) 구현
- BadDebtDetail, BoardDetail, LaborDetail, PricingDetail 등 상세 페이지 권한 적용
- ProcessDetail, StepDetail, ItemDetail, PermissionDetail 권한 연동
- RootProvider에 PermissionProvider 통합
- protected layout 권한 체크 추가
- Claude 프로젝트 설정 파일 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 10:17:02 +09:00
|
|
|
const { canUpdate } = usePermission();
|
2025-12-26 15:48:08 +09:00
|
|
|
|
2026-01-29 22:56:01 +09:00
|
|
|
// 단계 목록 상태
|
|
|
|
|
const [steps, setSteps] = useState<ProcessStep[]>([]);
|
|
|
|
|
const [isStepsLoading, setIsStepsLoading] = useState(true);
|
2025-12-30 17:21:38 +09:00
|
|
|
|
2026-02-09 17:52:43 +09:00
|
|
|
// 삭제 다이얼로그 상태
|
|
|
|
|
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
|
|
|
|
|
const [isDeleting, setIsDeleting] = useState(false);
|
|
|
|
|
|
2026-01-29 22:56:01 +09:00
|
|
|
// 드래그 상태
|
|
|
|
|
const [dragIndex, setDragIndex] = useState<number | null>(null);
|
|
|
|
|
const [dragOverIndex, setDragOverIndex] = useState<number | null>(null);
|
|
|
|
|
const dragNodeRef = useRef<HTMLTableRowElement | null>(null);
|
|
|
|
|
|
|
|
|
|
// 품목 개수 계산 (기존 classificationRules에서 individual 품목)
|
|
|
|
|
const itemCount = process.classificationRules
|
|
|
|
|
.filter((r) => r.registrationType === 'individual')
|
|
|
|
|
.reduce((sum, r) => sum + (r.items?.length || 0), 0);
|
2025-12-30 17:21:38 +09:00
|
|
|
|
2026-01-29 22:56:01 +09:00
|
|
|
// 단계 목록 로드
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
const loadSteps = async () => {
|
|
|
|
|
setIsStepsLoading(true);
|
|
|
|
|
const result = await getProcessSteps(process.id);
|
|
|
|
|
if (result.success && result.data) {
|
|
|
|
|
setSteps(result.data);
|
|
|
|
|
}
|
|
|
|
|
setIsStepsLoading(false);
|
|
|
|
|
};
|
|
|
|
|
loadSteps();
|
|
|
|
|
}, [process.id]);
|
|
|
|
|
|
|
|
|
|
// 네비게이션
|
2025-12-26 15:48:08 +09:00
|
|
|
const handleEdit = () => {
|
2026-01-25 12:27:43 +09:00
|
|
|
router.push(`/ko/master-data/process-management/${process.id}?mode=edit`);
|
2025-12-26 15:48:08 +09:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleList = () => {
|
|
|
|
|
router.push('/ko/master-data/process-management');
|
|
|
|
|
};
|
|
|
|
|
|
2026-01-29 22:56:01 +09:00
|
|
|
const handleAddStep = () => {
|
|
|
|
|
router.push(`/ko/master-data/process-management/${process.id}/steps/new`);
|
2025-12-26 15:48:08 +09:00
|
|
|
};
|
|
|
|
|
|
2026-01-29 22:56:01 +09:00
|
|
|
const handleStepClick = (stepId: string) => {
|
|
|
|
|
router.push(`/ko/master-data/process-management/${process.id}/steps/${stepId}`);
|
|
|
|
|
};
|
|
|
|
|
|
2026-02-09 17:52:43 +09:00
|
|
|
const handleDelete = async () => {
|
|
|
|
|
setIsDeleting(true);
|
|
|
|
|
try {
|
|
|
|
|
const result = await deleteProcess(process.id);
|
|
|
|
|
if (result.success) {
|
|
|
|
|
toast.success('공정이 삭제되었습니다.');
|
|
|
|
|
router.push('/ko/master-data/process-management');
|
|
|
|
|
} else {
|
|
|
|
|
toast.error(result.error || '삭제에 실패했습니다.');
|
|
|
|
|
}
|
|
|
|
|
} catch {
|
|
|
|
|
toast.error('삭제 중 오류가 발생했습니다.');
|
|
|
|
|
} finally {
|
|
|
|
|
setIsDeleting(false);
|
|
|
|
|
setDeleteDialogOpen(false);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2026-01-29 22:56:01 +09:00
|
|
|
// ===== 드래그&드롭 (HTML5 네이티브) =====
|
|
|
|
|
const handleDragStart = useCallback((e: React.DragEvent<HTMLTableRowElement>, index: number) => {
|
|
|
|
|
setDragIndex(index);
|
|
|
|
|
dragNodeRef.current = e.currentTarget;
|
|
|
|
|
e.dataTransfer.effectAllowed = 'move';
|
|
|
|
|
// 약간의 딜레이로 드래그 시작 시 스타일 적용
|
|
|
|
|
requestAnimationFrame(() => {
|
|
|
|
|
if (dragNodeRef.current) {
|
|
|
|
|
dragNodeRef.current.style.opacity = '0.4';
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
const handleDragOver = useCallback((e: React.DragEvent<HTMLTableRowElement>, index: number) => {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
e.dataTransfer.dropEffect = 'move';
|
|
|
|
|
setDragOverIndex(index);
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
const handleDragEnd = useCallback(() => {
|
|
|
|
|
if (dragNodeRef.current) {
|
|
|
|
|
dragNodeRef.current.style.opacity = '1';
|
|
|
|
|
}
|
|
|
|
|
setDragIndex(null);
|
|
|
|
|
setDragOverIndex(null);
|
|
|
|
|
dragNodeRef.current = null;
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
const handleDrop = useCallback((e: React.DragEvent<HTMLTableRowElement>, dropIndex: number) => {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
if (dragIndex === null || dragIndex === dropIndex) return;
|
|
|
|
|
|
|
|
|
|
setSteps((prev) => {
|
|
|
|
|
const updated = [...prev];
|
|
|
|
|
const [moved] = updated.splice(dragIndex, 1);
|
|
|
|
|
updated.splice(dropIndex, 0, moved);
|
2026-02-04 13:13:08 +09:00
|
|
|
const reordered = updated.map((step, i) => ({ ...step, order: i + 1 }));
|
|
|
|
|
|
|
|
|
|
// API 순서 변경 호출
|
|
|
|
|
reorderProcessSteps(
|
|
|
|
|
process.id,
|
|
|
|
|
reordered.map((s) => ({ id: s.id, order: s.order }))
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return reordered;
|
2026-01-29 22:56:01 +09:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
handleDragEnd();
|
2026-02-04 13:13:08 +09:00
|
|
|
}, [dragIndex, handleDragEnd, process.id]);
|
2026-01-29 22:56:01 +09:00
|
|
|
|
2025-12-26 15:48:08 +09:00
|
|
|
return (
|
|
|
|
|
<PageLayout>
|
|
|
|
|
{/* 헤더 */}
|
2026-01-29 22:56:01 +09:00
|
|
|
<PageHeader title="공정 상세" />
|
2025-12-26 15:48:08 +09:00
|
|
|
|
2026-01-26 15:07:10 +09:00
|
|
|
<div className="space-y-6 pb-24">
|
2025-12-26 15:48:08 +09:00
|
|
|
{/* 기본 정보 */}
|
|
|
|
|
<Card>
|
|
|
|
|
<CardHeader className="bg-muted/50">
|
|
|
|
|
<CardTitle className="text-base">기본 정보</CardTitle>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent className="pt-6">
|
feat(WEB): DatePicker 공통화 및 공정관리/작업자화면 대폭 개선
DatePicker 공통화:
- date-picker.tsx 공통 컴포넌트 신규 추가
- 전체 폼 컴포넌트 DatePicker 통일 적용 (50+ 파일)
- DateRangeSelector 개선
공정관리:
- RuleModal 대폭 리팩토링 (-592줄 → 간소화)
- ProcessForm, StepForm 개선
- ProcessDetail 수정, actions 확장
작업자화면:
- WorkerScreen 기능 대폭 확장 (+543줄)
- WorkItemCard 개선
- types 확장
회계/인사/영업/품질:
- BadDebtDetail, BillDetail, DepositDetail, SalesDetail 등 DatePicker 적용
- EmployeeForm, VacationDialog 등 DatePicker 적용
- OrderRegistration, QuoteRegistration DatePicker 적용
- InspectionCreate, InspectionDetail DatePicker 적용
공사관리/CEO대시보드:
- BiddingDetail, ContractDetail, HandoverReport 등 DatePicker 적용
- ScheduleDetailModal, TodayIssueSection 개선
기타:
- WorkOrderCreate/Edit/Detail/List 개선
- ShipmentCreate/Edit, ReceivingDetail 개선
- calendar, calendarEvents 수정
- datepicker 마이그레이션 체크리스트 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 15:48:00 +09:00
|
|
|
{/* Row 1: 공정번호 | 공정명 | 담당부서 | 담당자 */}
|
|
|
|
|
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6">
|
2026-01-29 22:56:01 +09:00
|
|
|
<div className="space-y-1">
|
|
|
|
|
<div className="text-sm text-muted-foreground">공정번호</div>
|
2025-12-26 15:48:08 +09:00
|
|
|
<div className="font-medium">{process.processCode}</div>
|
|
|
|
|
</div>
|
2026-01-26 15:07:10 +09:00
|
|
|
<div className="space-y-1">
|
feat(WEB): DatePicker 공통화 및 공정관리/작업자화면 대폭 개선
DatePicker 공통화:
- date-picker.tsx 공통 컴포넌트 신규 추가
- 전체 폼 컴포넌트 DatePicker 통일 적용 (50+ 파일)
- DateRangeSelector 개선
공정관리:
- RuleModal 대폭 리팩토링 (-592줄 → 간소화)
- ProcessForm, StepForm 개선
- ProcessDetail 수정, actions 확장
작업자화면:
- WorkerScreen 기능 대폭 확장 (+543줄)
- WorkItemCard 개선
- types 확장
회계/인사/영업/품질:
- BadDebtDetail, BillDetail, DepositDetail, SalesDetail 등 DatePicker 적용
- EmployeeForm, VacationDialog 등 DatePicker 적용
- OrderRegistration, QuoteRegistration DatePicker 적용
- InspectionCreate, InspectionDetail DatePicker 적용
공사관리/CEO대시보드:
- BiddingDetail, ContractDetail, HandoverReport 등 DatePicker 적용
- ScheduleDetailModal, TodayIssueSection 개선
기타:
- WorkOrderCreate/Edit/Detail/List 개선
- ShipmentCreate/Edit, ReceivingDetail 개선
- calendar, calendarEvents 수정
- datepicker 마이그레이션 체크리스트 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 15:48:00 +09:00
|
|
|
<div className="text-sm text-muted-foreground">공정명</div>
|
|
|
|
|
<div className="font-medium">{process.processName}</div>
|
2025-12-26 15:48:08 +09:00
|
|
|
</div>
|
2026-01-26 15:07:10 +09:00
|
|
|
<div className="space-y-1">
|
|
|
|
|
<div className="text-sm text-muted-foreground">담당부서</div>
|
2026-01-29 22:56:01 +09:00
|
|
|
<div className="font-medium">{process.department || '-'}</div>
|
2025-12-26 15:48:08 +09:00
|
|
|
</div>
|
2026-01-29 22:56:01 +09:00
|
|
|
<div className="space-y-1">
|
|
|
|
|
<div className="text-sm text-muted-foreground">담당자</div>
|
|
|
|
|
<div className="font-medium">{process.manager || '-'}</div>
|
2025-12-26 15:48:08 +09:00
|
|
|
</div>
|
feat(WEB): DatePicker 공통화 및 공정관리/작업자화면 대폭 개선
DatePicker 공통화:
- date-picker.tsx 공통 컴포넌트 신규 추가
- 전체 폼 컴포넌트 DatePicker 통일 적용 (50+ 파일)
- DateRangeSelector 개선
공정관리:
- RuleModal 대폭 리팩토링 (-592줄 → 간소화)
- ProcessForm, StepForm 개선
- ProcessDetail 수정, actions 확장
작업자화면:
- WorkerScreen 기능 대폭 확장 (+543줄)
- WorkItemCard 개선
- types 확장
회계/인사/영업/품질:
- BadDebtDetail, BillDetail, DepositDetail, SalesDetail 등 DatePicker 적용
- EmployeeForm, VacationDialog 등 DatePicker 적용
- OrderRegistration, QuoteRegistration DatePicker 적용
- InspectionCreate, InspectionDetail DatePicker 적용
공사관리/CEO대시보드:
- BiddingDetail, ContractDetail, HandoverReport 등 DatePicker 적용
- ScheduleDetailModal, TodayIssueSection 개선
기타:
- WorkOrderCreate/Edit/Detail/List 개선
- ShipmentCreate/Edit, ReceivingDetail 개선
- calendar, calendarEvents 수정
- datepicker 마이그레이션 체크리스트 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 15:48:00 +09:00
|
|
|
</div>
|
|
|
|
|
{/* Row 2: 구분 | 생산일자 | 상태 */}
|
|
|
|
|
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 mt-6">
|
|
|
|
|
<div className="space-y-1">
|
|
|
|
|
<div className="text-sm text-muted-foreground">구분</div>
|
|
|
|
|
<div className="font-medium">{process.processCategory || '없음'}</div>
|
|
|
|
|
</div>
|
2026-01-29 22:56:01 +09:00
|
|
|
<div className="space-y-1">
|
|
|
|
|
<div className="text-sm text-muted-foreground">생산일자</div>
|
|
|
|
|
<div className="font-medium">
|
|
|
|
|
{process.useProductionDate ? '사용' : '미사용'}
|
|
|
|
|
</div>
|
2025-12-26 15:48:08 +09:00
|
|
|
</div>
|
2026-01-29 22:56:01 +09:00
|
|
|
<div className="space-y-1">
|
|
|
|
|
<div className="text-sm text-muted-foreground">상태</div>
|
|
|
|
|
<Badge variant={process.status === '사용중' ? 'default' : 'secondary'}>
|
|
|
|
|
{process.status}
|
|
|
|
|
</Badge>
|
2025-12-26 15:48:08 +09:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
|
2026-01-29 22:56:01 +09:00
|
|
|
{/* 품목 설정 정보 */}
|
2025-12-30 17:21:38 +09:00
|
|
|
<Card>
|
|
|
|
|
<CardHeader className="bg-muted/50">
|
2026-01-29 22:56:01 +09:00
|
|
|
<div className="flex items-center justify-between">
|
|
|
|
|
<div>
|
|
|
|
|
<CardTitle className="text-base flex items-center gap-2">
|
|
|
|
|
<Package className="h-4 w-4" />
|
|
|
|
|
품목 설정 정보
|
|
|
|
|
</CardTitle>
|
|
|
|
|
<p className="text-sm text-muted-foreground mt-1">
|
|
|
|
|
품목을 선택하면 이 공정으로 분류됩니다
|
|
|
|
|
</p>
|
2025-12-30 17:21:38 +09:00
|
|
|
</div>
|
2026-01-29 22:56:01 +09:00
|
|
|
<div className="flex items-center gap-3">
|
|
|
|
|
<Badge variant="outline" className="text-sm">
|
|
|
|
|
{itemCount}개
|
2026-01-08 20:57:49 +09:00
|
|
|
</Badge>
|
2026-01-29 22:56:01 +09:00
|
|
|
<Button variant="outline" size="sm" onClick={handleEdit}>
|
feat(WEB): DatePicker 공통화 및 공정관리/작업자화면 대폭 개선
DatePicker 공통화:
- date-picker.tsx 공통 컴포넌트 신규 추가
- 전체 폼 컴포넌트 DatePicker 통일 적용 (50+ 파일)
- DateRangeSelector 개선
공정관리:
- RuleModal 대폭 리팩토링 (-592줄 → 간소화)
- ProcessForm, StepForm 개선
- ProcessDetail 수정, actions 확장
작업자화면:
- WorkerScreen 기능 대폭 확장 (+543줄)
- WorkItemCard 개선
- types 확장
회계/인사/영업/품질:
- BadDebtDetail, BillDetail, DepositDetail, SalesDetail 등 DatePicker 적용
- EmployeeForm, VacationDialog 등 DatePicker 적용
- OrderRegistration, QuoteRegistration DatePicker 적용
- InspectionCreate, InspectionDetail DatePicker 적용
공사관리/CEO대시보드:
- BiddingDetail, ContractDetail, HandoverReport 등 DatePicker 적용
- ScheduleDetailModal, TodayIssueSection 개선
기타:
- WorkOrderCreate/Edit/Detail/List 개선
- ShipmentCreate/Edit, ReceivingDetail 개선
- calendar, calendarEvents 수정
- datepicker 마이그레이션 체크리스트 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 15:48:00 +09:00
|
|
|
공정 품목 선택
|
2026-01-29 22:56:01 +09:00
|
|
|
</Button>
|
2025-12-26 15:48:08 +09:00
|
|
|
</div>
|
2026-01-29 22:56:01 +09:00
|
|
|
</div>
|
2025-12-26 15:48:08 +09:00
|
|
|
</CardHeader>
|
|
|
|
|
</Card>
|
|
|
|
|
|
2026-01-29 22:56:01 +09:00
|
|
|
{/* 단계 테이블 */}
|
2025-12-26 15:48:08 +09:00
|
|
|
<Card>
|
|
|
|
|
<CardHeader className="bg-muted/50">
|
2026-01-29 22:56:01 +09:00
|
|
|
<div className="flex items-center justify-between">
|
|
|
|
|
<CardTitle className="text-base">
|
|
|
|
|
단계
|
|
|
|
|
{!isStepsLoading && (
|
|
|
|
|
<span className="text-sm font-normal text-muted-foreground ml-2">
|
|
|
|
|
총 {steps.length}건
|
|
|
|
|
</span>
|
|
|
|
|
)}
|
|
|
|
|
</CardTitle>
|
|
|
|
|
<Button size="sm" onClick={handleAddStep}>
|
|
|
|
|
<Plus className="h-4 w-4 mr-1" />
|
|
|
|
|
단계 등록
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
2025-12-26 15:48:08 +09:00
|
|
|
</CardHeader>
|
2026-01-29 22:56:01 +09:00
|
|
|
<CardContent className="p-0">
|
|
|
|
|
{isStepsLoading ? (
|
|
|
|
|
<div className="p-8 text-center text-muted-foreground">
|
|
|
|
|
로딩 중...
|
2026-01-26 15:07:10 +09:00
|
|
|
</div>
|
2026-01-29 22:56:01 +09:00
|
|
|
) : steps.length === 0 ? (
|
|
|
|
|
<div className="p-8 text-center text-muted-foreground">
|
|
|
|
|
등록된 단계가 없습니다. [단계 등록] 버튼으로 추가해주세요.
|
2026-01-26 15:07:10 +09:00
|
|
|
</div>
|
2026-01-29 22:56:01 +09:00
|
|
|
) : (
|
|
|
|
|
<div className="overflow-x-auto">
|
|
|
|
|
<table className="w-full">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr className="border-b bg-muted/30">
|
|
|
|
|
<th className="w-10 px-3 py-3 text-center text-xs font-medium text-muted-foreground">
|
|
|
|
|
{/* 드래그 핸들 헤더 */}
|
|
|
|
|
</th>
|
|
|
|
|
<th className="w-14 px-3 py-3 text-center text-xs font-medium text-muted-foreground">
|
|
|
|
|
No.
|
|
|
|
|
</th>
|
|
|
|
|
<th className="px-3 py-3 text-left text-xs font-medium text-muted-foreground">
|
|
|
|
|
단계코드
|
|
|
|
|
</th>
|
|
|
|
|
<th className="px-3 py-3 text-left text-xs font-medium text-muted-foreground">
|
|
|
|
|
단계명
|
|
|
|
|
</th>
|
|
|
|
|
<th className="w-20 px-3 py-3 text-center text-xs font-medium text-muted-foreground">
|
|
|
|
|
필수여부
|
|
|
|
|
</th>
|
|
|
|
|
<th className="w-20 px-3 py-3 text-center text-xs font-medium text-muted-foreground">
|
|
|
|
|
승인여부
|
|
|
|
|
</th>
|
|
|
|
|
<th className="w-20 px-3 py-3 text-center text-xs font-medium text-muted-foreground">
|
|
|
|
|
검사여부
|
|
|
|
|
</th>
|
|
|
|
|
<th className="w-16 px-3 py-3 text-center text-xs font-medium text-muted-foreground">
|
|
|
|
|
사용
|
|
|
|
|
</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
{steps.map((step, index) => (
|
|
|
|
|
<tr
|
|
|
|
|
key={step.id}
|
|
|
|
|
draggable
|
|
|
|
|
onDragStart={(e) => handleDragStart(e, index)}
|
|
|
|
|
onDragOver={(e) => handleDragOver(e, index)}
|
|
|
|
|
onDragEnd={handleDragEnd}
|
|
|
|
|
onDrop={(e) => handleDrop(e, index)}
|
|
|
|
|
onClick={() => handleStepClick(step.id)}
|
|
|
|
|
className={`border-b cursor-pointer transition-colors hover:bg-muted/50 ${
|
|
|
|
|
dragOverIndex === index && dragIndex !== index
|
|
|
|
|
? 'border-t-2 border-t-primary'
|
|
|
|
|
: ''
|
|
|
|
|
}`}
|
|
|
|
|
>
|
|
|
|
|
<td
|
|
|
|
|
className="w-10 px-3 py-3 text-center cursor-grab active:cursor-grabbing"
|
|
|
|
|
onClick={(e) => e.stopPropagation()}
|
|
|
|
|
>
|
|
|
|
|
<GripVertical className="h-4 w-4 text-muted-foreground mx-auto" />
|
|
|
|
|
</td>
|
|
|
|
|
<td className="w-14 px-3 py-3 text-center text-sm text-muted-foreground">
|
|
|
|
|
{index + 1}
|
|
|
|
|
</td>
|
|
|
|
|
<td className="px-3 py-3 text-sm font-mono">
|
|
|
|
|
{step.stepCode}
|
|
|
|
|
</td>
|
|
|
|
|
<td className="px-3 py-3 text-sm font-medium">
|
|
|
|
|
{step.stepName}
|
|
|
|
|
</td>
|
|
|
|
|
<td className="w-20 px-3 py-3 text-center">
|
|
|
|
|
<Badge
|
|
|
|
|
variant={step.isRequired ? 'default' : 'outline'}
|
|
|
|
|
className="text-xs"
|
|
|
|
|
>
|
|
|
|
|
{step.isRequired ? 'Y' : 'N'}
|
|
|
|
|
</Badge>
|
|
|
|
|
</td>
|
|
|
|
|
<td className="w-20 px-3 py-3 text-center">
|
|
|
|
|
<Badge
|
|
|
|
|
variant={step.needsApproval ? 'default' : 'outline'}
|
|
|
|
|
className="text-xs"
|
|
|
|
|
>
|
|
|
|
|
{step.needsApproval ? 'Y' : 'N'}
|
|
|
|
|
</Badge>
|
|
|
|
|
</td>
|
|
|
|
|
<td className="w-20 px-3 py-3 text-center">
|
|
|
|
|
<Badge
|
|
|
|
|
variant={step.needsInspection ? 'default' : 'outline'}
|
|
|
|
|
className="text-xs"
|
|
|
|
|
>
|
|
|
|
|
{step.needsInspection ? 'Y' : 'N'}
|
|
|
|
|
</Badge>
|
|
|
|
|
</td>
|
|
|
|
|
<td className="w-16 px-3 py-3 text-center">
|
|
|
|
|
<Badge
|
|
|
|
|
variant={step.isActive ? 'default' : 'secondary'}
|
|
|
|
|
className="text-xs"
|
|
|
|
|
>
|
|
|
|
|
{step.isActive ? 'Y' : 'N'}
|
|
|
|
|
</Badge>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
))}
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
2025-12-26 15:48:08 +09:00
|
|
|
</div>
|
2026-01-29 22:56:01 +09:00
|
|
|
)}
|
2025-12-26 15:48:08 +09:00
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-01-26 15:07:10 +09:00
|
|
|
{/* 하단 액션 버튼 (sticky) */}
|
2026-01-29 22:56:01 +09:00
|
|
|
<div
|
feat(WEB): 상세 페이지 권한 체계 통합 및 레이아웃/문서 기능 개선
권한 시스템 통합:
- BadDebtDetail, LaborDetail, PricingDetail 권한 로직 정리
- BoardDetail, ClientDetail, ItemDetail 권한 적용 개선
- ProcessDetail, StepDetail, PermissionDetail 권한 리팩토링
- ContractDetail, HandoverReport, ProgressBilling 권한 연동
- ReceivingDetail, ShipmentDetail, WorkOrderDetail 권한 적용
- InspectionDetail, OrderSalesDetail, QuoteFooterBar 권한 개선
기능 개선:
- AuthenticatedLayout 구조 리팩토링
- JointbarInspectionDocument 문서 레이아웃 개선
- PricingTableForm 폼 기능 보강
- DynamicItemForm, SectionsTab 개선
- 주문관리 상세/생산지시 페이지 개선
- VendorLedgerDetail 수정
설정:
- Claude hooks 추가 (빌드 차단, 파일 크기 체크, 미사용 import 체크)
- 품질감사 문서관리 계획 문서 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 20:26:27 +09:00
|
|
|
className={`fixed bottom-4 left-4 right-4 px-4 py-3 bg-background/95 backdrop-blur rounded-xl border shadow-lg z-50 transition-all duration-300 md:bottom-6 md:px-6 md:right-[48px] ${sidebarCollapsed ? 'md:left-[156px]' : 'md:left-[316px]'} flex items-center justify-between`}
|
2026-01-29 22:56:01 +09:00
|
|
|
>
|
feat(WEB): 상세 페이지 권한 체계 통합 및 레이아웃/문서 기능 개선
권한 시스템 통합:
- BadDebtDetail, LaborDetail, PricingDetail 권한 로직 정리
- BoardDetail, ClientDetail, ItemDetail 권한 적용 개선
- ProcessDetail, StepDetail, PermissionDetail 권한 리팩토링
- ContractDetail, HandoverReport, ProgressBilling 권한 연동
- ReceivingDetail, ShipmentDetail, WorkOrderDetail 권한 적용
- InspectionDetail, OrderSalesDetail, QuoteFooterBar 권한 개선
기능 개선:
- AuthenticatedLayout 구조 리팩토링
- JointbarInspectionDocument 문서 레이아웃 개선
- PricingTableForm 폼 기능 보강
- DynamicItemForm, SectionsTab 개선
- 주문관리 상세/생산지시 페이지 개선
- VendorLedgerDetail 수정
설정:
- Claude hooks 추가 (빌드 차단, 파일 크기 체크, 미사용 import 체크)
- 품질감사 문서관리 계획 문서 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 20:26:27 +09:00
|
|
|
<Button variant="outline" onClick={handleList} size="sm" className="md:size-default">
|
|
|
|
|
<ArrowLeft className="h-4 w-4 md:mr-2" />
|
|
|
|
|
<span className="hidden md:inline">목록으로</span>
|
2026-01-26 15:07:10 +09:00
|
|
|
</Button>
|
feat(WEB): 권한 관리 시스템 구현 및 상세 페이지 권한 통합
- PermissionContext, usePermission 훅, PermissionGuard 컴포넌트 신규 추가
- AccessDenied 접근 거부 페이지 추가
- permissions lib (체커, 매퍼, 타입) 구현
- BadDebtDetail, BoardDetail, LaborDetail, PricingDetail 등 상세 페이지 권한 적용
- ProcessDetail, StepDetail, ItemDetail, PermissionDetail 권한 연동
- RootProvider에 PermissionProvider 통합
- protected layout 권한 체크 추가
- Claude 프로젝트 설정 파일 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 10:17:02 +09:00
|
|
|
{canUpdate && (
|
2026-02-09 17:52:43 +09:00
|
|
|
<div className="flex items-center gap-2">
|
|
|
|
|
<Button variant="destructive" onClick={() => setDeleteDialogOpen(true)} size="sm" className="md:size-default">
|
|
|
|
|
<Trash2 className="h-4 w-4 md:mr-2" />
|
|
|
|
|
<span className="hidden md:inline">삭제</span>
|
|
|
|
|
</Button>
|
|
|
|
|
<Button onClick={handleEdit} size="sm" className="md:size-default">
|
|
|
|
|
<Edit className="h-4 w-4 md:mr-2" />
|
|
|
|
|
<span className="hidden md:inline">수정</span>
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
feat(WEB): 권한 관리 시스템 구현 및 상세 페이지 권한 통합
- PermissionContext, usePermission 훅, PermissionGuard 컴포넌트 신규 추가
- AccessDenied 접근 거부 페이지 추가
- permissions lib (체커, 매퍼, 타입) 구현
- BadDebtDetail, BoardDetail, LaborDetail, PricingDetail 등 상세 페이지 권한 적용
- ProcessDetail, StepDetail, ItemDetail, PermissionDetail 권한 연동
- RootProvider에 PermissionProvider 통합
- protected layout 권한 체크 추가
- Claude 프로젝트 설정 파일 추가
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 10:17:02 +09:00
|
|
|
)}
|
2026-01-26 15:07:10 +09:00
|
|
|
</div>
|
2026-02-09 17:52:43 +09:00
|
|
|
|
|
|
|
|
{/* 삭제 확인 다이얼로그 */}
|
|
|
|
|
<DeleteConfirmDialog
|
|
|
|
|
open={deleteDialogOpen}
|
|
|
|
|
onOpenChange={setDeleteDialogOpen}
|
|
|
|
|
description="이 공정을 삭제하시겠습니까? 이 작업은 되돌릴 수 없습니다."
|
|
|
|
|
loading={isDeleting}
|
|
|
|
|
onConfirm={handleDelete}
|
|
|
|
|
/>
|
2025-12-26 15:48:08 +09:00
|
|
|
</PageLayout>
|
|
|
|
|
);
|
2026-01-29 22:56:01 +09:00
|
|
|
}
|