chore(WEB): 견적 컴포넌트 export 및 발주서 개선

- index.ts: 타입 및 함수 export 정리
- PurchaseOrderDocument.tsx: 발주서 문서 개선
This commit is contained in:
2026-01-06 21:21:10 +09:00
parent 14556251f1
commit 9a134bc83a
2 changed files with 16 additions and 17 deletions

View File

@@ -8,12 +8,14 @@
*/
import { QuoteFormData } from "./QuoteRegistration";
import type { CompanyFormData } from "@/components/settings/CompanyInfoManagement/types";
interface PurchaseOrderDocumentProps {
quote: QuoteFormData;
companyInfo?: CompanyFormData | null;
}
export function PurchaseOrderDocument({ quote }: PurchaseOrderDocumentProps) {
export function PurchaseOrderDocument({ quote, companyInfo }: PurchaseOrderDocumentProps) {
const formatDate = (dateStr: string) => {
if (!dateStr) return '';
const date = new Date(dateStr);
@@ -23,20 +25,17 @@ export function PurchaseOrderDocument({ quote }: PurchaseOrderDocumentProps) {
// 발주번호 생성 (견적번호 기반)
const purchaseOrderNumber = quote.id?.replace('Q', 'KQ#-SC-') + '-01' || 'KQ#-SC-XXXXXX-01';
// BOM에서 부자재 목록 추출 (샘플 데이터)
const materialItems = quote.items?.map((item, index) => ({
no: index + 1,
name: item.productName || '아연도각파이프',
spec: `${item.openWidth}×${item.openHeight}`,
length: Number(item.openHeight) || 3000,
quantity: item.quantity || 1,
note: ''
})) || [
{ no: 1, name: '아연도각파이프', spec: '100-50-2T', length: 3000, quantity: 6, note: '' },
{ no: 2, name: '아연도각파이프', spec: '100-100-2T', length: 3000, quantity: 6, note: '' },
{ no: 3, name: '아연도앵글', spec: '50-50-4T', length: 2500, quantity: 10, note: '' },
{ no: 4, name: '외주 발주 코팅 비비그레스', spec: '', length: 0, quantity: 1, note: '' },
];
// BOM에서 부자재 목록 추출 (견적 품목 데이터 기반)
const materialItems = quote.items?.length > 0
? quote.items.map((item, index) => ({
no: index + 1,
name: item.productName || '스크린셔터',
spec: `${item.openWidth || 0}×${item.openHeight || 0}mm`,
length: Number(item.openHeight) || 0,
quantity: item.quantity || 1,
note: item.guideRailType ? `레일: ${item.guideRailType}` : ''
}))
: [];
return (
<>
@@ -416,7 +415,7 @@ export function PurchaseOrderDocument({ quote }: PurchaseOrderDocumentProps) {
<p> , .</p>
<p> .</p>
<p style={{ marginTop: '10px', textAlign: 'center', fontWeight: '600' }}>
: {quote.writer || '담당자'} | {quote.contact || '031-983-5130'}
: {companyInfo?.managerName || quote.writer || '담당자'} | {companyInfo?.managerPhone || '-'}
</p>
</div>
</div>

View File

@@ -6,7 +6,7 @@
export { QuoteManagementClient } from './QuoteManagementClient';
// 기존 컴포넌트
export { default as QuoteDocument } from './QuoteDocument';
export { QuoteDocument } from './QuoteDocument';
export { QuoteRegistration, INITIAL_QUOTE_FORM } from './QuoteRegistration';
export { QuoteCalculationReport } from './QuoteCalculationReport';
export { PurchaseOrderDocument } from './PurchaseOrderDocument';