From 4ee8b24cfadf47452807fa2af801385ed60ab47c Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Mon, 15 Sep 2025 14:41:01 +0000
Subject: (대표님) 작업사항 - rfqLast, tbeLast, pdfTron, userAuth
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/tbe-last/table/pr-items-dialog.tsx | 83 ++++++++++++++++++++++++++++++++++
 1 file changed, 83 insertions(+)
 create mode 100644 lib/tbe-last/table/pr-items-dialog.tsx

(limited to 'lib/tbe-last/table/pr-items-dialog.tsx')

diff --git a/lib/tbe-last/table/pr-items-dialog.tsx b/lib/tbe-last/table/pr-items-dialog.tsx
new file mode 100644
index 00000000..780d4b5b
--- /dev/null
+++ b/lib/tbe-last/table/pr-items-dialog.tsx
@@ -0,0 +1,83 @@
+// lib/tbe-last/table/dialogs/pr-items-dialog.tsx
+
+"use client"
+
+import * as React from "react"
+import { 
+  Dialog, 
+  DialogContent, 
+  DialogHeader, 
+  DialogTitle,
+  DialogDescription 
+} from "@/components/ui/dialog"
+import { Badge } from "@/components/ui/badge"
+import { formatDate } from "@/lib/utils"
+
+interface PrItemsDialogProps {
+  open: boolean
+  onOpenChange: (open: boolean) => void
+  sessionDetail: any
+  isLoading: boolean
+}
+
+export function PrItemsDialog({ 
+  open, 
+  onOpenChange, 
+  sessionDetail, 
+  isLoading 
+}: PrItemsDialogProps) {
+  return (
+    <Dialog open={open} onOpenChange={onOpenChange}>
+      <DialogContent className="max-w-4xl max-h-[80vh] overflow-y-auto">
+        <DialogHeader>
+          <DialogTitle>PR Items</DialogTitle>
+          <DialogDescription>
+            Purchase Request items for this RFQ
+          </DialogDescription>
+        </DialogHeader>
+        {isLoading ? (
+          <div className="p-8 text-center">Loading...</div>
+        ) : sessionDetail?.prItems ? (
+          <div className="border rounded-lg">
+            <table className="w-full text-sm">
+              <thead>
+                <tr className="border-b bg-muted/50">
+                  <th className="text-left p-2">PR No</th>
+                  <th className="text-left p-2">Material Code</th>
+                  <th className="text-left p-2">Description</th>
+                  <th className="text-left p-2">Size</th>
+                  <th className="text-left p-2">Qty</th>
+                  <th className="text-left p-2">Unit</th>
+                  <th className="text-left p-2">Delivery</th>
+                  <th className="text-left p-2">Major</th>
+                </tr>
+              </thead>
+              <tbody>
+                {sessionDetail.prItems.map((item: any) => (
+                  <tr key={item.id} className="border-b hover:bg-muted/20">
+                    <td className="p-2">{item.prNo}</td>
+                    <td className="p-2">{item.materialCode}</td>
+                    <td className="p-2">{item.materialDescription}</td>
+                    <td className="p-2">{item.size || "-"}</td>
+                    <td className="p-2 text-right">{item.quantity}</td>
+                    <td className="p-2">{item.uom}</td>
+                    <td className="p-2">
+                      {item.deliveryDate ? formatDate(item.deliveryDate, "KR") : "-"}
+                    </td>
+                    <td className="p-2 text-center">
+                      {item.majorYn && <Badge variant="default">Major</Badge>}
+                    </td>
+                  </tr>
+                ))}
+              </tbody>
+            </table>
+          </div>
+        ) : (
+          <div className="p-8 text-center text-muted-foreground">
+            No PR items available
+          </div>
+        )}
+      </DialogContent>
+    </Dialog>
+  )
+}
\ No newline at end of file
-- 
cgit v1.2.3

