feat(WEB): 공정관리 드래그 순서변경, 수주서/출고증 리디자인, 체크리스트 관리 추가

- 공정관리: 드래그&드롭 순서 변경 기능 추가 (reorderProcesses API)
- 수주서(SalesOrderDocument): 기획서 D1.8 기준 리디자인, 출고증과 동일 자재 섹션 구조
- 출고증(ShipmentOrderDocument): 레이아웃 개선
- 체크리스트 관리 페이지 신규 추가 (master-data/checklist-management)
- QMS 품질감사: 타입 및 목데이터 수정
- menuRefresh 유틸 정리

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
유병철
2026-02-09 17:52:43 +09:00
parent ce36101929
commit 3ea6a57a10
26 changed files with 3398 additions and 829 deletions

View File

@@ -1,11 +1,12 @@
'use client';
/**
* 출고 문서 공통 컴포넌트 (수주서 레이아웃 기반)
* - 출고증, 납품확인서에서 제목만 변경하여 사용
* - 수주서(SalesOrderDocument)와 동일한 레이아웃
* 출고 문서 공통 컴포넌트 (기획서 D1.8 기준 리디자인)
* - 출고증: showDispatchInfo + showLotColumn
* - 납품확인서: 기본값 (배차정보 없음, LOT 컬럼 없음)
*/
import { useState } from 'react';
import type { ShipmentDetail } from '../types';
import { DELIVERY_METHOD_LABELS } from '../types';
import { ConstructionApprovalTable } from '@/components/document-system';
@@ -14,56 +15,78 @@ interface ShipmentOrderDocumentProps {
title: string;
data: ShipmentDetail;
showDispatchInfo?: boolean;
showLotColumn?: boolean;
}
export function ShipmentOrderDocument({ title, data, showDispatchInfo = false }: ShipmentOrderDocumentProps) {
// 스크린 제품 필터링 (productGroups 기반)
const screenProducts = data.productGroups.filter(g =>
g.productName?.includes('스크린') ||
g.productName?.includes('방화') ||
g.productName?.includes('셔터')
);
// ===== 문서 전용 목데이터 =====
// 전체 부품 목록
const allParts = [
...data.productGroups.flatMap(g => g.parts),
...data.otherParts,
];
const MOCK_SCREEN_ROWS = [
{ no: 1, type: '이(마)', code: 'FA123', openW: 4300, openH: 4300, madeW: 4300, madeH: 3000, guideRail: '백면형', shaft: 5, caseInch: 5, bracket: '500X300 380X180', capacity: 300, finish: 'SUS마감' },
{ no: 2, type: '이(마)', code: 'FA123', openW: 4300, openH: 4300, madeW: 4300, madeH: 3000, guideRail: '백면형', shaft: 5, caseInch: 5, bracket: '500X300 380X180', capacity: 300, finish: 'SUS마감' },
];
// 모터 아이템 필터링
const motorItems = allParts.filter(part =>
part.itemName?.includes('모터')
);
const MOCK_STEEL_ROWS = [
{ no: 1, code: 'FA123', openW: 4300, openH: 3000, madeW: 4300, madeH: 3000, guideRail: '백면형', shaft: 5, jointBar: 5, caseInch: 5, bracket: '500X300 380X180', capacity: 300, finish: 'SUS마감' },
{ no: 2, code: 'FA123', openW: 4300, openH: 3000, madeW: 4300, madeH: 3000, guideRail: '백면형', shaft: 5, jointBar: 5, caseInch: 5, bracket: '500X300 380X180', capacity: 300, finish: 'SUS마감' },
];
// 브라켓 아이템 필터링
const bracketItems = allParts.filter(part =>
part.itemName?.includes('브라켓')
);
const MOCK_MOTOR_LEFT = [
{ item: '모터', type: '380V 단상', spec: 'KD-150K', qty: 6, lot: '123123' },
{ item: '브라켓트', type: '-', spec: '380X180', qty: 6, lot: '123123' },
{ item: '앵글', type: '밑침통 영금', spec: '40*40*380', qty: 4, lot: '123123' },
];
// 가이드레일 아이템 필터링
const guideRailItems = allParts.filter(part =>
part.itemName?.includes('가이드') ||
part.itemName?.includes('레일')
);
const MOCK_MOTOR_RIGHT = [
{ item: '전동개폐기', type: '릴박스', spec: '-', qty: 1, lot: '123123' },
{ item: '전동개폐기', type: '매입', spec: '-', qty: 1, lot: '123123' },
];
// 케이스 아이템 필터링
const caseItems = allParts.filter(part =>
part.itemName?.includes('케이스') ||
part.itemName?.includes('셔터박스')
);
const MOCK_GUIDE_RAIL_ITEMS = [
{ name: '항목명', spec: 'L: 3,000', qty: 22 },
{ name: '하부BASE', spec: '130X80', qty: 22 },
];
// 하단마감재 아이템 필터링
const bottomFinishItems = allParts.filter(part =>
part.itemName?.includes('하단') ||
part.itemName?.includes('마감')
);
const MOCK_GUIDE_SMOKE = { name: '연기차단재(W50)', spec: '2,438', qty: 4 };
const MOCK_CASE_ITEMS = [
{ name: '500X330', spec: 'L: 4,000', qty: 3 },
{ name: '500X330', spec: 'L: 5,000', qty: 4 },
{ name: '상부덮개', spec: '1219X389', qty: 55 },
{ name: '측면부 (마구리)', spec: '500X355', qty: '500X355' },
];
const MOCK_CASE_SMOKE = { name: '연기차단재(W80)', spec: '3,000', qty: 4 };
const MOCK_BOTTOM_SCREEN = [
{ name: '하단마감재', spec: '60X40', l1: 'L: 3,000', q1: 6, name2: '하단마감재', spec2: '60X40', l2: 'L: 4,000', q2: 6 },
{ name: '하단보강엘비', spec: '60X17', l1: 'L: 3,000', q1: 6, name2: '하단보강엘비', spec2: '60X17', l2: 'L: 4,000', q2: 6 },
{ name: '하단보강평철', spec: '-', l1: 'L: 3,000', q1: 6, name2: '하단보강평철', spec2: '-', l2: 'L: 4,000', q2: 6 },
{ name: '하단무게평철', spec: '50X12T', l1: 'L: 3,000', q1: 6, name2: '하단무게평철', spec2: '50X12T', l2: 'L: 4,000', q2: 6 },
];
const MOCK_BOTTOM_STEEL = { spec: '60X40', length: 'L: 3,000', qty: 22 };
const MOCK_SUBSIDIARY = [
{ leftItem: '감기사프트', leftSpec: '4인치 4500', leftQty: 6, rightItem: '각파이프', rightSpec: '6000', rightQty: 4 },
{ leftItem: '조인트바', leftSpec: '300', leftQty: 6, rightItem: '환봉', rightSpec: '3000', rightQty: 5 },
];
// ===== 공통 스타일 =====
const thBase = 'border-r border-gray-400 px-1 py-1';
const tdBase = 'border-r border-gray-300 px-1 py-1';
const tdCenter = `${tdBase} text-center`;
const imgPlaceholder = 'flex items-center justify-center border border-dashed border-gray-300 text-gray-400';
export function ShipmentOrderDocument({ title, data, showDispatchInfo = false, showLotColumn = false }: ShipmentOrderDocumentProps) {
const [bottomFinishView, setBottomFinishView] = useState<'screen' | 'steel'>('screen');
const deliveryMethodLabel = DELIVERY_METHOD_LABELS[data.deliveryMethod] || '-';
const fullAddress = [data.address, data.addressDetail].filter(Boolean).join(' ') || data.deliveryAddress || '-';
const motorRows = Math.max(MOCK_MOTOR_LEFT.length, MOCK_MOTOR_RIGHT.length);
return (
<div className="bg-white p-8 min-h-full text-[11px]">
{/* 헤더: 제목 (좌측) + 결재란 (우측) */}
{/* ========== 헤더: 제목 + 결재란 ========== */}
<div className="flex justify-between items-start mb-4">
<div>
<h1 className="text-2xl font-bold tracking-widest mb-2">{title}</h1>
@@ -74,30 +97,26 @@ export function ShipmentOrderDocument({ title, data, showDispatchInfo = false }:
</div>
</div>
</div>
{/* 결재란 (우측) */}
<ConstructionApprovalTable
approvers={{ writer: { name: '홍길동' } }}
/>
<ConstructionApprovalTable approvers={{ writer: { name: '홍길동' } }} />
</div>
{/* 상품명 / 제품명 / 로트번호 / 인정번호 */}
{/* ========== 로트번호 / 제품명 / 제품코드 / 인정번호 ========== */}
<table className="border border-gray-400 w-full mb-3 text-[10px]">
<tbody>
<tr>
<td className="bg-gray-100 px-2 py-1 font-medium border-r border-gray-400 whitespace-nowrap"></td>
<td className="px-2 py-1 border-r border-gray-400">{data.productGroups[0]?.productName || '-'}</td>
<td className="bg-gray-100 px-2 py-1 font-medium border-r border-gray-400 whitespace-nowrap"></td>
<td className="px-2 py-1 border-r border-gray-400">{data.products[0]?.itemName || '-'}</td>
<td className="bg-gray-100 px-2 py-1 font-medium border-r border-gray-400 whitespace-nowrap"></td>
<td className="px-2 py-1 border-r border-gray-400">{data.lotNo}</td>
<td className="bg-gray-100 px-2 py-1 font-medium border-r border-gray-400 whitespace-nowrap"></td>
<td className="px-2 py-1 border-r border-gray-400">{data.productGroups[0]?.productName || '-'}</td>
<td className="bg-gray-100 px-2 py-1 font-medium border-r border-gray-400 whitespace-nowrap"></td>
<td className="px-2 py-1 border-r border-gray-400">KWS01</td>
<td className="bg-gray-100 px-2 py-1 font-medium border-r border-gray-400 whitespace-nowrap"></td>
<td className="px-2 py-1">-</td>
<td className="px-2 py-1">ABC1234</td>
</tr>
</tbody>
</table>
{/* 3열 섹션: 신청업체 | 신청내용 | 납품정보 */}
{/* ========== 3열 섹션: 신청업체 | 신청내용 | 납품정보 ========== */}
<div className="border border-gray-400 mb-4">
<div className="grid grid-cols-3">
{/* 신청업체 */}
@@ -110,21 +129,17 @@ export function ShipmentOrderDocument({ title, data, showDispatchInfo = false }:
<td className="px-2 py-1">{data.scheduledDate}</td>
</tr>
<tr className="border-b border-gray-300">
<td className="bg-gray-100 px-2 py-1 font-medium"></td>
<td className="bg-gray-100 px-2 py-1 font-medium"></td>
<td className="px-2 py-1">{data.customerName}</td>
</tr>
<tr className="border-b border-gray-300">
<td className="bg-gray-100 px-2 py-1 font-medium"> </td>
<td className="px-2 py-1">{data.registrant || '-'}</td>
</tr>
<tr className="border-b border-gray-300">
<tr>
<td className="bg-gray-100 px-2 py-1 font-medium"> </td>
<td className="px-2 py-1">{data.driverContact || '-'}</td>
</tr>
<tr>
<td className="bg-gray-100 px-2 py-1 font-medium"> </td>
<td className="px-2 py-1">{fullAddress}</td>
</tr>
</tbody>
</table>
</div>
@@ -146,14 +161,10 @@ export function ShipmentOrderDocument({ title, data, showDispatchInfo = false }:
<td className="bg-gray-100 px-2 py-1 font-medium"></td>
<td className="px-2 py-1">{data.shipmentDate || data.scheduledDate}</td>
</tr>
<tr className="border-b border-gray-300">
<tr>
<td className="bg-gray-100 px-2 py-1 font-medium"></td>
<td className="px-2 py-1">{data.productGroups.length}</td>
</tr>
<tr>
<td className="bg-gray-100 px-2 py-1 font-medium">&nbsp;</td>
<td className="px-2 py-1">&nbsp;</td>
</tr>
</tbody>
</table>
</div>
@@ -175,21 +186,22 @@ export function ShipmentOrderDocument({ title, data, showDispatchInfo = false }:
<td className="bg-gray-100 px-2 py-1 font-medium"></td>
<td className="px-2 py-1">{data.receiverContact || '-'}</td>
</tr>
<tr className="border-b border-gray-300">
<tr>
<td className="bg-gray-100 px-2 py-1 font-medium"></td>
<td className="px-2 py-1">{deliveryMethodLabel}</td>
</tr>
<tr>
<td className="bg-gray-100 px-2 py-1 font-medium">&nbsp;</td>
<td className="px-2 py-1">&nbsp;</td>
</tr>
</tbody>
</table>
</div>
</div>
{/* 배송지 주소 - 한 줄 병합 */}
<div className="border-t border-gray-400 flex">
<div className="bg-gray-100 px-2 py-1 w-20 shrink-0 font-medium"> </div>
<div className="px-2 py-1 flex-1">{fullAddress}</div>
</div>
</div>
{/* 배차정보 (출고증에서만 표시) */}
{/* ========== 배차정보 (출고증에서만) ========== */}
{showDispatchInfo && (() => {
const dispatch = data.vehicleDispatches[0];
return (
@@ -221,366 +233,406 @@ export function ShipmentOrderDocument({ title, data, showDispatchInfo = false }:
);
})()}
<p className="text-[10px] mb-4"> .</p>
{/* ========== 자재 및 철거 내역 헤더 ========== */}
<div className="bg-gray-800 text-white text-center py-2 font-bold mb-4">
</div>
{/* 1. 스크린 테이블 */}
{/* ========== 1. 스크린 ========== */}
<div className="mb-4">
<p className="font-bold mb-2">1. </p>
<div className="border border-gray-400">
<table className="w-full">
<thead>
<tr className="bg-gray-100 border-b border-gray-400">
<th className="border-r border-gray-400 px-1 py-1 w-8" rowSpan={2}>No</th>
<th className="border-r border-gray-400 px-1 py-1 w-16" rowSpan={2}></th>
<th className="border-r border-gray-400 px-1 py-1 w-14" rowSpan={2}></th>
<th className="border-r border-gray-400 px-1 py-1" colSpan={2}></th>
<th className="border-r border-gray-400 px-1 py-1" colSpan={2}></th>
<th className="border-r border-gray-400 px-1 py-1 w-24" rowSpan={2}><br/></th>
<th className="border-r border-gray-400 px-1 py-1 w-14" rowSpan={2}><br/>()</th>
<th className="border-r border-gray-400 px-1 py-1 w-14" rowSpan={2}><br/>()</th>
<th className="border-r border-gray-400 px-1 py-1" colSpan={2}></th>
<th className={`${thBase} w-8`} rowSpan={2}>No</th>
<th className={`${thBase} w-14`} rowSpan={2}></th>
<th className={`${thBase} w-14`} rowSpan={2}></th>
<th className={thBase} colSpan={2}></th>
<th className={thBase} colSpan={2}></th>
<th className={`${thBase} w-16`} rowSpan={2}><br /></th>
<th className={`${thBase} w-14`} rowSpan={2}><br />()</th>
<th className={`${thBase} w-14`} rowSpan={2}><br />()</th>
<th className={thBase} colSpan={2}></th>
<th className="px-1 py-1 w-16" rowSpan={2}></th>
</tr>
<tr className="bg-gray-50 border-b border-gray-400 text-[9px]">
<th className="border-r border-gray-400 px-1"></th>
<th className="border-r border-gray-400 px-1"></th>
<th className="border-r border-gray-400 px-1"></th>
<th className="border-r border-gray-400 px-1"></th>
<th className="border-r border-gray-400 px-1"></th>
<th className="border-r border-gray-400 px-1">Kg</th>
<th className={thBase}></th>
<th className={thBase}></th>
<th className={thBase}></th>
<th className={thBase}></th>
<th className={thBase}></th>
<th className={thBase}>Kg</th>
</tr>
</thead>
<tbody>
{screenProducts.length > 0 ? (
screenProducts.map((group, index) => {
// specification에서 가로x세로 파싱 (예: "2000 x 2500 mm")
const specMatch = group.specification?.match(/(\d+)\s*[xX×]\s*(\d+)/);
const width = specMatch ? specMatch[1] : '-';
const height = specMatch ? specMatch[2] : '-';
return (
<tr key={group.id} className="border-b border-gray-300">
<td className="border-r border-gray-300 px-1 py-1 text-center">{index + 1}</td>
<td className="border-r border-gray-300 px-1 py-1 text-center">{group.productName || '-'}</td>
<td className="border-r border-gray-300 px-1 py-1 text-center">-</td>
<td className="border-r border-gray-300 px-1 py-1 text-center">{width}</td>
<td className="border-r border-gray-300 px-1 py-1 text-center">{height}</td>
<td className="border-r border-gray-300 px-1 py-1 text-center">{width}</td>
<td className="border-r border-gray-300 px-1 py-1 text-center">{height}</td>
<td className="border-r border-gray-300 px-1 py-1 text-center text-[9px]"><br/>(120X70)</td>
<td className="border-r border-gray-300 px-1 py-1 text-center">5</td>
<td className="border-r border-gray-300 px-1 py-1 text-center">5</td>
<td className="border-r border-gray-300 px-1 py-1 text-center">380X180</td>
<td className="border-r border-gray-300 px-1 py-1 text-center">300</td>
<td className="px-1 py-1 text-center">SUS마감</td>
</tr>
);
})
) : (
<tr>
<td colSpan={13} className="px-2 py-3 text-center text-gray-400">
</td>
{MOCK_SCREEN_ROWS.map((row) => (
<tr key={row.no} className="border-b border-gray-300">
<td className={tdCenter}>{row.no}</td>
<td className={tdCenter}>{row.type}</td>
<td className={tdCenter}>{row.code}</td>
<td className={tdCenter}>{row.openW.toLocaleString()}</td>
<td className={tdCenter}>{row.openH.toLocaleString()}</td>
<td className={tdCenter}>{row.madeW.toLocaleString()}</td>
<td className={tdCenter}>{row.madeH.toLocaleString()}</td>
<td className={tdCenter}>{row.guideRail}</td>
<td className={tdCenter}>{row.shaft}</td>
<td className={tdCenter}>{row.caseInch}</td>
<td className={tdCenter}>{row.bracket}</td>
<td className={tdCenter}>{row.capacity}</td>
<td className="px-1 py-1 text-center">{row.finish}</td>
</tr>
)}
))}
</tbody>
</table>
</div>
</div>
{/* 2. 모터 테이블 */}
{/* ========== 2. 절재 ========== */}
<div className="mb-4">
<p className="font-bold mb-2">2. </p>
<p className="font-bold mb-2">2. </p>
<div className="border border-gray-400">
<table className="w-full">
<thead>
<tr className="bg-gray-100 border-b border-gray-400">
<th className="border-r border-gray-400 px-2 py-1 w-28"></th>
<th className="border-r border-gray-400 px-2 py-1 w-20"></th>
<th className="border-r border-gray-400 px-2 py-1 w-28"></th>
<th className="border-r border-gray-400 px-2 py-1 w-14"></th>
<th className="border-r border-gray-400 px-2 py-1 w-28"></th>
<th className="border-r border-gray-400 px-2 py-1 w-20"></th>
<th className="border-r border-gray-400 px-2 py-1 w-28"></th>
<th className="px-2 py-1 w-14"></th>
<th className={`${thBase} w-8`} rowSpan={2}>No.</th>
<th className={`${thBase} w-14`} rowSpan={2}></th>
<th className={thBase} colSpan={2}></th>
<th className={thBase} colSpan={2}></th>
<th className={`${thBase} w-16`} rowSpan={2}><br /></th>
<th className={`${thBase} w-14`} rowSpan={2}><br />()</th>
<th className={`${thBase} w-14`} rowSpan={2}><br />()</th>
<th className={`${thBase} w-14`} rowSpan={2}><br />()</th>
<th className={thBase} colSpan={2}></th>
<th className="px-1 py-1 w-16" rowSpan={2}></th>
</tr>
<tr className="bg-gray-50 border-b border-gray-400 text-[9px]">
<th className={thBase}></th>
<th className={thBase}></th>
<th className={thBase}></th>
<th className={thBase}></th>
<th className={thBase}></th>
<th className={thBase}>Kg</th>
</tr>
</thead>
<tbody>
{(motorItems.length > 0 || bracketItems.length > 0) ? (
<>
{/* 모터 행 */}
<tr className="border-b border-gray-300">
<td className="border-r border-gray-300 px-2 py-1">(380V )</td>
<td className="border-r border-gray-300 px-2 py-1"> </td>
<td className="border-r border-gray-300 px-2 py-1">{motorItems[0]?.specification || 'KD-150K'}</td>
<td className="border-r border-gray-300 px-2 py-1 text-center">{motorItems[0]?.quantity ?? '-'}</td>
<td className="border-r border-gray-300 px-2 py-1">(380V )</td>
<td className="border-r border-gray-300 px-2 py-1"> </td>
<td className="border-r border-gray-300 px-2 py-1">{motorItems[1]?.specification || 'KD-150K'}</td>
<td className="px-2 py-1 text-center">{motorItems[1]?.quantity ?? '-'}</td>
</tr>
{/* 브라켓트 행 */}
<tr className="border-b border-gray-300">
<td className="border-r border-gray-300 px-2 py-1"></td>
<td className="border-r border-gray-300 px-2 py-1"></td>
<td className="border-r border-gray-300 px-2 py-1">{bracketItems[0]?.specification || '380X180 [2-4"]'}</td>
<td className="border-r border-gray-300 px-2 py-1 text-center">{bracketItems[0]?.quantity ?? '-'}</td>
<td className="border-r border-gray-300 px-2 py-1"></td>
<td className="border-r border-gray-300 px-2 py-1"></td>
<td className="border-r border-gray-300 px-2 py-1">{bracketItems[1]?.specification || '380X180 [2-4"]'}</td>
<td className="px-2 py-1 text-center">{bracketItems[1]?.quantity ?? '-'}</td>
</tr>
{/* 브라켓트 추가 행 */}
<tr className="border-b border-gray-300">
<td className="border-r border-gray-300 px-2 py-1"></td>
<td className="border-r border-gray-300 px-2 py-1"> </td>
<td className="border-r border-gray-300 px-2 py-1">{bracketItems[2]?.specification || '∠40-40 L380'}</td>
<td className="border-r border-gray-300 px-2 py-1 text-center">{bracketItems[2]?.quantity ?? '-'}</td>
<td className="border-r border-gray-300 px-2 py-1"></td>
<td className="border-r border-gray-300 px-2 py-1"></td>
<td className="border-r border-gray-300 px-2 py-1"></td>
<td className="px-2 py-1 text-center"></td>
</tr>
</>
) : (
<tr>
<td colSpan={8} className="px-2 py-3 text-center text-gray-400">
/
</td>
{MOCK_STEEL_ROWS.map((row) => (
<tr key={row.no} className="border-b border-gray-300">
<td className={tdCenter}>{row.no}</td>
<td className={tdCenter}>{row.code}</td>
<td className={tdCenter}>{row.openW.toLocaleString()}</td>
<td className={tdCenter}>{row.openH.toLocaleString()}</td>
<td className={tdCenter}>{row.madeW.toLocaleString()}</td>
<td className={tdCenter}>{row.madeH.toLocaleString()}</td>
<td className={tdCenter}>{row.guideRail}</td>
<td className={tdCenter}>{row.shaft}</td>
<td className={tdCenter}>{row.jointBar}</td>
<td className={tdCenter}>{row.caseInch}</td>
<td className={tdCenter}>{row.bracket}</td>
<td className={tdCenter}>{row.capacity}</td>
<td className="px-1 py-1 text-center">{row.finish}</td>
</tr>
)}
))}
</tbody>
</table>
</div>
</div>
{/* 3. 절곡물 */}
{/* ========== 3. 모터 ========== */}
<div className="mb-4">
<p className="font-bold mb-2">3. </p>
{/* 3-1. 가이드레일 */}
<div className="mb-3">
<p className="text-[10px] font-medium mb-1">3-1. - EGI 1.5ST + EGI 1.1ST + SUS 1.1ST</p>
<div className="border border-gray-400">
<table className="w-full">
<thead>
<tr className="bg-gray-100 border-b border-gray-400">
<th className="border-r border-gray-400 px-2 py-1 w-24"> (120X70)</th>
<th className="border-r border-gray-400 px-2 py-1 w-16"></th>
<th className="border-r border-gray-400 px-2 py-1 w-12"></th>
<th className="border-r border-gray-400 px-2 py-1 w-24"> (120X120)</th>
<th className="border-r border-gray-400 px-2 py-1 w-16"></th>
<th className="px-2 py-1 w-12"></th>
</tr>
</thead>
<tbody>
{guideRailItems.length > 0 ? (
<>
<tr className="border-b border-gray-300">
<td className="border-r border-gray-300 px-2 py-1 text-center text-gray-400" rowSpan={4}>
<div className="flex items-center justify-center h-20 border border-dashed border-gray-300">
IMG
</div>
</td>
<td className="border-r border-gray-300 px-2 py-1 text-center">L: 3,000</td>
<td className="border-r border-gray-300 px-2 py-1 text-center">{guideRailItems[0]?.quantity ?? 22}</td>
<td className="border-r border-gray-300 px-2 py-1 text-center text-gray-400" rowSpan={4}>
<div className="flex items-center justify-center h-20 border border-dashed border-gray-300">
IMG
</div>
</td>
<td className="border-r border-gray-300 px-2 py-1 text-center">L: 3,000</td>
<td className="px-2 py-1 text-center">{guideRailItems[1]?.quantity ?? 22}</td>
</tr>
<tr className="border-b border-gray-300">
<td className="border-r border-gray-300 px-2 py-1 text-center text-[9px]">BASE<br/>[130X80]</td>
<td className="border-r border-gray-300 px-2 py-1 text-center">22</td>
<td className="border-r border-gray-300 px-2 py-1 text-center"></td>
<td className="px-2 py-1 text-center"></td>
</tr>
<tr className="border-b border-gray-300">
<td className="border-r border-gray-300 px-2 py-1 text-center"></td>
<td className="border-r border-gray-300 px-2 py-1 text-center"></td>
<td className="border-r border-gray-300 px-2 py-1 text-center"></td>
<td className="px-2 py-1 text-center"></td>
</tr>
<tr className="border-b border-gray-300">
<td className="border-r border-gray-300 px-2 py-1 text-center bg-gray-100"></td>
<td className="border-r border-gray-300 px-2 py-1 text-center">KSS01</td>
<td className="border-r border-gray-300 px-2 py-1 text-center bg-gray-100"></td>
<td className="px-2 py-1 text-center">KSS01</td>
</tr>
</>
) : (
<tr>
<td colSpan={6} className="px-2 py-2 text-center text-gray-400">
</td>
<p className="font-bold mb-2">3. </p>
<div className="border border-gray-400">
<table className="w-full">
<thead>
<tr className="bg-gray-100 border-b border-gray-400">
<th className={`${thBase} w-20`}></th>
<th className={`${thBase} w-20`}></th>
<th className={`${thBase} w-20`}></th>
<th className={`${thBase} w-10`}></th>
{showLotColumn && <th className={`${thBase} w-16`}> LOT</th>}
<th className={`${thBase} w-20`}></th>
<th className={`${thBase} w-20`}></th>
<th className={`${thBase} w-20`}></th>
<th className={showLotColumn ? `${thBase} w-10` : 'px-1 py-1 w-10'}></th>
{showLotColumn && <th className="px-1 py-1 w-16"> LOT</th>}
</tr>
</thead>
<tbody>
{Array.from({ length: motorRows }).map((_, i) => {
const left = MOCK_MOTOR_LEFT[i];
const right = MOCK_MOTOR_RIGHT[i];
return (
<tr key={i} className="border-b border-gray-300">
<td className={tdBase}>{left?.item || ''}</td>
<td className={tdBase}>{left?.type || ''}</td>
<td className={tdBase}>{left?.spec || ''}</td>
<td className={tdCenter}>{left?.qty ?? ''}</td>
{showLotColumn && <td className={tdCenter}>{left?.lot || ''}</td>}
<td className={tdBase}>{right?.item || ''}</td>
<td className={tdBase}>{right?.type || ''}</td>
<td className={tdBase}>{right?.spec || ''}</td>
<td className={showLotColumn ? tdCenter : 'px-1 py-1 text-center'}>{right?.qty ?? ''}</td>
{showLotColumn && <td className="px-1 py-1 text-center">{right?.lot || ''}</td>}
</tr>
)}
</tbody>
</table>
</div>
{/* 연기차단재 정보 */}
<div className="mt-2 border border-gray-400">
<table className="w-full text-[10px]">
<tbody>
<tr>
<td className="border-r border-gray-300 px-2 py-1 w-32" rowSpan={2}>
<div className="font-medium">(W50)</div>
<div> </div>
<div className="text-red-600 font-medium"> </div>
</td>
<td className="border-r border-gray-300 px-2 py-1 w-32" rowSpan={2}>
<div>EGI 0.8T +</div>
<div></div>
</td>
<td className="border-r border-gray-300 px-2 py-1 text-center text-gray-400 w-20" rowSpan={2}>
<div className="flex items-center justify-center h-10 border border-dashed border-gray-300">
IMG
</div>
</td>
<td className="border-r border-gray-300 px-2 py-1 bg-gray-100"></td>
<td className="border-r border-gray-300 px-2 py-1 text-center">3,000</td>
<td className="px-2 py-1 text-center">4,000</td>
</tr>
<tr>
<td className="border-r border-gray-300 px-2 py-1 bg-gray-100"></td>
<td className="border-r border-gray-300 px-2 py-1 text-center">44</td>
<td className="px-2 py-1 text-center">1</td>
</tr>
</tbody>
</table>
</div>
<div className="mt-2 text-[10px]">
<span className="font-medium"> </span>
</div>
</div>
{/* 3-2. 케이스(셔터박스) */}
<div className="mb-3">
<p className="text-[10px] font-medium mb-1">3-2. () - EGI 1.5ST</p>
<div className="border border-gray-400">
<table className="w-full">
<thead>
<tr className="bg-gray-100 border-b border-gray-400">
<th className="border-r border-gray-400 px-2 py-1 w-24">&nbsp;</th>
<th className="border-r border-gray-400 px-2 py-1 w-24"></th>
<th className="border-r border-gray-400 px-2 py-1 w-20"></th>
<th className="border-r border-gray-400 px-2 py-1 w-12"></th>
<th className="border-r border-gray-400 px-2 py-1 w-20"></th>
<th className="px-2 py-1 w-12"></th>
</tr>
</thead>
<tbody>
{caseItems.length > 0 ? (
<tr className="border-b border-gray-300">
<td className="border-r border-gray-300 px-2 py-1 text-center text-gray-400" rowSpan={3}>
<div className="flex items-center justify-center h-16 border border-dashed border-gray-300">
IMG
</div>
</td>
<td className="border-r border-gray-300 px-2 py-1 text-center text-[9px]">
500X330<br/>(150X300,<br/>400K원)
</td>
<td className="border-r border-gray-300 px-2 py-1 text-center text-[9px]">
L: 4,000<br/>L: 5,000<br/><br/>(1219X389)
</td>
<td className="border-r border-gray-300 px-2 py-1 text-center text-[9px]">
3<br/>4<br/>55
</td>
<td className="border-r border-gray-300 px-2 py-1 text-center">500X355</td>
<td className="px-2 py-1 text-center">22</td>
</tr>
) : (
<tr>
<td colSpan={6} className="px-2 py-2 text-center text-gray-400">
</td>
</tr>
)}
</tbody>
</table>
</div>
{/* 연기차단재 정보 */}
<div className="mt-2 border border-gray-400">
<table className="w-full text-[10px]">
<tbody>
<tr>
<td className="border-r border-gray-300 px-2 py-1 w-32" rowSpan={2}>
<div className="font-medium">(W50)</div>
<div> , </div>
<div className="text-red-600 font-medium"> </div>
</td>
<td className="border-r border-gray-300 px-2 py-1 w-32" rowSpan={2}>
<div>EGI 0.8T +</div>
<div></div>
</td>
<td className="border-r border-gray-300 px-2 py-1 text-center text-gray-400 w-20" rowSpan={2}>
<div className="flex items-center justify-center h-10 border border-dashed border-gray-300">
IMG
</div>
</td>
<td className="border-r border-gray-300 px-2 py-1 bg-gray-100"></td>
<td className="px-2 py-1 text-center">3,000</td>
</tr>
<tr>
<td className="border-r border-gray-300 px-2 py-1 bg-gray-100"></td>
<td className="px-2 py-1 text-center">44</td>
</tr>
</tbody>
</table>
</div>
</div>
{/* 3-3. 하단마감재 */}
<div className="mb-3">
<p className="text-[10px] font-medium mb-1">3-3. - (EGI 1.5ST) + (EGI 1.5ST) + (EGI 1.1ST) + (50X12T)</p>
<div className="border border-gray-400">
<table className="w-full">
<thead>
<tr className="bg-gray-100 border-b border-gray-400">
<th className="border-r border-gray-400 px-2 py-1 w-20"></th>
<th className="border-r border-gray-400 px-2 py-1 w-16"></th>
<th className="border-r border-gray-400 px-2 py-1 w-12"></th>
<th className="border-r border-gray-400 px-2 py-1 w-20"></th>
<th className="border-r border-gray-400 px-2 py-1 w-16"></th>
<th className="border-r border-gray-400 px-2 py-1 w-12"></th>
<th className="border-r border-gray-400 px-2 py-1 w-20"></th>
<th className="border-r border-gray-400 px-2 py-1 w-16"></th>
<th className="px-2 py-1 w-12"></th>
</tr>
</thead>
<tbody>
{bottomFinishItems.length > 0 ? (
<tr className="border-b border-gray-300">
<td className="border-r border-gray-300 px-2 py-1 text-[9px]"><br/>(60X40)</td>
<td className="border-r border-gray-300 px-2 py-1 text-center">L: 4,000</td>
<td className="border-r border-gray-300 px-2 py-1 text-center">11</td>
<td className="border-r border-gray-300 px-2 py-1 text-[9px]"><br/>(60X17)</td>
<td className="border-r border-gray-300 px-2 py-1 text-center">L: 4,000</td>
<td className="border-r border-gray-300 px-2 py-1 text-center">11</td>
<td className="border-r border-gray-300 px-2 py-1 text-[9px]"><br/>[50X12T]</td>
<td className="border-r border-gray-300 px-2 py-1 text-center">L: 4,000</td>
<td className="px-2 py-1 text-center">11</td>
</tr>
) : (
<tr>
<td colSpan={9} className="px-2 py-2 text-center text-gray-400">
</td>
</tr>
)}
</tbody>
</table>
</div>
);
})}
</tbody>
</table>
</div>
</div>
{/* 특이사항 */}
{/* ========== 4. 절곡물 ========== */}
<div className="mb-4">
<p className="font-bold mb-2">4. </p>
{/* 4-1. 가이드레일 */}
<div className="mb-3">
<p className="text-[10px] font-medium mb-1">4-1. - EGI 1.5ST + EGI 1.1ST + SUS 1.1ST</p>
{/* 메인 테이블 */}
<div className="border border-gray-400">
<table className="w-full">
<thead>
<tr className="bg-gray-100 border-b border-gray-400">
<th className={`${thBase} w-32`}> (120X70)</th>
<th className={`${thBase} w-24`}></th>
<th className={`${thBase} w-20`}></th>
<th className="px-1 py-1 w-14"></th>
</tr>
</thead>
<tbody>
{MOCK_GUIDE_RAIL_ITEMS.map((item, i) => (
<tr key={i} className="border-b border-gray-300">
{i === 0 && (
<td className={tdCenter} rowSpan={MOCK_GUIDE_RAIL_ITEMS.length}>
<div className={`${imgPlaceholder} h-20 w-full`}>IMG</div>
</td>
)}
<td className={tdCenter}>{item.name}</td>
<td className={tdCenter}>{item.spec}</td>
<td className="px-1 py-1 text-center">{item.qty}</td>
</tr>
))}
</tbody>
</table>
</div>
{/* 연기차단재 */}
<div className="mt-1 border border-gray-400">
<table className="w-full">
<thead>
<tr className="bg-gray-50 border-b border-gray-400 text-[10px]">
<th className={`${thBase} w-32`}>&nbsp;</th>
<th className={`${thBase} w-24`}></th>
<th className={`${thBase} w-20`}></th>
<th className="px-1 py-1 w-14"></th>
</tr>
</thead>
<tbody>
<tr className="border-b border-gray-300">
<td className={tdCenter}>
<div className={`${imgPlaceholder} h-14 w-full`}>IMG</div>
</td>
<td className={tdCenter}>{MOCK_GUIDE_SMOKE.name}</td>
<td className={tdCenter}>{MOCK_GUIDE_SMOKE.spec}</td>
<td className="px-1 py-1 text-center">{MOCK_GUIDE_SMOKE.qty}</td>
</tr>
</tbody>
</table>
</div>
<p className="mt-1 text-[10px]">
<span className="font-medium">* <span className="text-red-600 font-bold"></span> </span> - EGI 0.8T +
</p>
</div>
{/* 4-2. 케이스(셔터박스) */}
<div className="mb-3">
<p className="text-[10px] font-medium mb-1">4-2. () - EGI 1.5ST</p>
{/* 메인 테이블 */}
<div className="border border-gray-400">
<table className="w-full">
<thead>
<tr className="bg-gray-100 border-b border-gray-400">
<th className={`${thBase} w-32`}>&nbsp;</th>
<th className={`${thBase} w-24`}></th>
<th className={`${thBase} w-20`}></th>
<th className="px-1 py-1 w-14"></th>
</tr>
</thead>
<tbody>
{MOCK_CASE_ITEMS.map((item, i) => (
<tr key={i} className="border-b border-gray-300">
{i === 0 && (
<td className={tdCenter} rowSpan={MOCK_CASE_ITEMS.length}>
<div className={`${imgPlaceholder} h-24 w-full`}>IMG</div>
</td>
)}
<td className={tdCenter}>{item.name}</td>
<td className={tdCenter}>{item.spec}</td>
<td className="px-1 py-1 text-center">{item.qty}</td>
</tr>
))}
</tbody>
</table>
</div>
{/* 연기차단재 */}
<div className="mt-1 border border-gray-400">
<table className="w-full">
<thead>
<tr className="bg-gray-50 border-b border-gray-400 text-[10px]">
<th className={`${thBase} w-32`}>&nbsp;</th>
<th className={`${thBase} w-24`}></th>
<th className={`${thBase} w-20`}></th>
<th className="px-1 py-1 w-14"></th>
</tr>
</thead>
<tbody>
<tr className="border-b border-gray-300">
<td className={tdCenter}>
<div className={`${imgPlaceholder} h-14 w-full`}>IMG</div>
</td>
<td className={tdCenter}>{MOCK_CASE_SMOKE.name}</td>
<td className={tdCenter}>{MOCK_CASE_SMOKE.spec}</td>
<td className="px-1 py-1 text-center">{MOCK_CASE_SMOKE.qty}</td>
</tr>
</tbody>
</table>
</div>
<p className="mt-1 text-[10px]">
<span className="font-medium">* , <span className="text-red-600 font-bold"></span> </span> - EGI 0.8T +
</p>
</div>
{/* 4-3. 하단마감재 (토글: 스크린 / 절재) */}
<div className="mb-3">
{/* 토글 버튼 */}
<div className="flex items-center gap-2 mb-2">
<button
onClick={() => setBottomFinishView('screen')}
className={`px-3 py-1 text-[10px] font-bold border rounded ${
bottomFinishView === 'screen'
? 'bg-gray-800 text-white border-gray-800'
: 'bg-white text-gray-600 border-gray-400 hover:bg-gray-100'
}`}
>
#
</button>
<button
onClick={() => setBottomFinishView('steel')}
className={`px-3 py-1 text-[10px] font-bold border rounded ${
bottomFinishView === 'steel'
? 'bg-gray-800 text-white border-gray-800'
: 'bg-white text-gray-600 border-gray-400 hover:bg-gray-100'
}`}
>
#
</button>
</div>
{bottomFinishView === 'screen' ? (
<>
<p className="text-[10px] font-medium mb-1">
4-3. - (EGI 1.5ST) + (EGI 1.5ST) + (EGI 1.1ST) + (50X12T)
</p>
<div className="border border-gray-400">
<table className="w-full">
<thead>
<tr className="bg-gray-100 border-b border-gray-400">
<th className={`${thBase} w-20`}></th>
<th className={`${thBase} w-14`}></th>
<th className={`${thBase} w-16`}></th>
<th className={`${thBase} w-10`}></th>
<th className={`${thBase} w-20`}></th>
<th className={`${thBase} w-14`}></th>
<th className={`${thBase} w-16`}></th>
<th className="px-1 py-1 w-10"></th>
</tr>
</thead>
<tbody>
{MOCK_BOTTOM_SCREEN.map((row, i) => (
<tr key={i} className="border-b border-gray-300">
<td className={tdBase}>{row.name}</td>
<td className={tdCenter}>{row.spec}</td>
<td className={tdCenter}>{row.l1}</td>
<td className={tdCenter}>{row.q1}</td>
<td className={tdBase}>{row.name2}</td>
<td className={tdCenter}>{row.spec2}</td>
<td className={tdCenter}>{row.l2}</td>
<td className="px-1 py-1 text-center">{row.q2}</td>
</tr>
))}
</tbody>
</table>
</div>
</>
) : (
<>
<p className="text-[10px] font-medium mb-1">
4-3. -EGI 1.5ST
</p>
<div className="border border-gray-400">
<table className="w-full">
<thead>
<tr className="bg-gray-100 border-b border-gray-400">
<th className={`${thBase} w-32`}></th>
<th className={`${thBase} w-14`}></th>
<th className={`${thBase} w-16`}></th>
<th className="px-1 py-1 w-10"></th>
</tr>
</thead>
<tbody>
<tr className="border-b border-gray-300">
<td className={tdCenter}>
<div className={`${imgPlaceholder} h-16 w-full`}>IMG</div>
</td>
<td className={tdCenter}>{MOCK_BOTTOM_STEEL.spec}</td>
<td className={tdCenter}>{MOCK_BOTTOM_STEEL.length}</td>
<td className="px-1 py-1 text-center">{MOCK_BOTTOM_STEEL.qty}</td>
</tr>
</tbody>
</table>
</div>
</>
)}
</div>
</div>
{/* ========== 5. 부자재 ========== */}
<div className="mb-4">
<p className="font-bold mb-2">5. </p>
<div className="border border-gray-400">
<table className="w-full">
<thead>
<tr className="bg-gray-100 border-b border-gray-400">
<th className={`${thBase} w-24`}></th>
<th className={`${thBase} w-20`}></th>
<th className={`${thBase} w-10`}></th>
<th className={`${thBase} w-24`}></th>
<th className={`${thBase} w-20`}></th>
<th className="px-1 py-1 w-10"></th>
</tr>
</thead>
<tbody>
{MOCK_SUBSIDIARY.map((row, i) => (
<tr key={i} className="border-b border-gray-300">
<td className={tdBase}>{row.leftItem}</td>
<td className={tdCenter}>{row.leftSpec}</td>
<td className={tdCenter}>{row.leftQty}</td>
<td className={tdBase}>{row.rightItem}</td>
<td className={tdCenter}>{row.rightSpec}</td>
<td className="px-1 py-1 text-center">{row.rightQty}</td>
</tr>
))}
</tbody>
</table>
</div>
</div>
{/* ========== 특이사항 ========== */}
{data.remarks && (
<div className="mb-4">
<p className="font-bold mb-2"> </p>

View File

@@ -13,5 +13,5 @@ interface ShippingSlipProps {
}
export function ShippingSlip({ data }: ShippingSlipProps) {
return <ShipmentOrderDocument title="출 고 증" data={data} showDispatchInfo />;
return <ShipmentOrderDocument title="출 고 증" data={data} showDispatchInfo showLotColumn />;
}