From e84cf02a1cb4959a9d3bb5bbf37885c13a447f78 Mon Sep 17 00:00:00 2001 From: joonhoekim <26rote@gmail.com> Date: Mon, 13 Oct 2025 17:29:33 +0900 Subject: (김준회) SHI/벤더 PO 구현 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/contract/contract-info-card.tsx | 104 ++++++++++++++++++++++++++++ components/contract/contract-items-card.tsx | 76 ++++++++++++++++++++ 2 files changed, 180 insertions(+) create mode 100644 components/contract/contract-info-card.tsx create mode 100644 components/contract/contract-items-card.tsx (limited to 'components') diff --git a/components/contract/contract-info-card.tsx b/components/contract/contract-info-card.tsx new file mode 100644 index 00000000..8b9c5103 --- /dev/null +++ b/components/contract/contract-info-card.tsx @@ -0,0 +1,104 @@ +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" +import { Button } from "@/components/ui/button" +import { formatCurrency, formatDate } from "@/lib/utils" +import { FileText, DollarSign } from "lucide-react" + +interface ContractInfoCardProps { + contract: { + contractName?: string | null + createdAt?: Date | string | null + startDate?: string | null + endDate?: string | null + contractDate?: Date | string | null + purchaseGroup?: string | null + totalAmount?: number | string | null + currency?: string | null + paymentTerms?: string | null + deliveryTerms?: string | null + } +} + +export function ContractInfoCard({ contract }: ContractInfoCardProps) { + return ( + + + 계약조건 + + +
+
+

계약명

+

{contract.contractName || "-"}

+
+
+

계약요청일

+

+ {formatDate(contract.createdAt)} +

+
+
+

계약기간

+

+ {contract.startDate && contract.endDate + ? `${formatDate(contract.startDate)} ~ ${formatDate(contract.endDate)}` + : "-"} +

+
+
+

계약체결일

+

+ {formatDate(contract.contractDate)} +

+
+
+

SHI 계약담당자

+

{contract.purchaseGroup || "-"}

+
+
+

연계입찰/견적번호

+

-

+
+
+

계약유효기간

+

+ {contract.startDate && contract.endDate + ? `${formatDate(contract.startDate)} ~ ${formatDate(contract.endDate)}` + : "-"} +

+
+
+

계약금액

+

+ {contract.totalAmount + ? formatCurrency( + parseFloat(contract.totalAmount.toString()), + contract.currency || "KRW" + ) + : "-"} +

+
+
+

지불조건

+

{contract.paymentTerms || "-"}

+
+
+

인도조건

+

{contract.deliveryTerms || "-"}

+
+
+ +
+ + +
+
+
+ ) +} + diff --git a/components/contract/contract-items-card.tsx b/components/contract/contract-items-card.tsx new file mode 100644 index 00000000..0d43f979 --- /dev/null +++ b/components/contract/contract-items-card.tsx @@ -0,0 +1,76 @@ +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" +import { formatCurrency } from "@/lib/utils" + +interface ContractItem { + materialNo?: string + itemDescription?: string + specification?: string + quantity?: number + quantityUnit?: string + unitPrice?: number | string + contractAmount?: number | string +} + +interface ContractItemsCardProps { + items: ContractItem[] + currency?: string +} + +export function ContractItemsCard({ items, currency = "KRW" }: ContractItemsCardProps) { + if (!items || items.length === 0) { + return null + } + + return ( + + + 계약 품목 + + +
+ + + + + + + + + + + + + {items.map((item, idx) => ( + + + + + + + + + ))} + +
자재번호품목/자재내역규격수량단가금액
{item.materialNo || "-"}{item.itemDescription || "-"}{item.specification || "-"} + {item.quantity} {item.quantityUnit || ""} + + {item.unitPrice + ? formatCurrency( + parseFloat(item.unitPrice.toString()), + currency + ) + : "-"} + + {item.contractAmount + ? formatCurrency( + parseFloat(item.contractAmount.toString()), + currency + ) + : "-"} +
+
+
+
+ ) +} + -- cgit v1.2.3