diff options
Diffstat (limited to 'lib/rfq-last')
| -rw-r--r-- | lib/rfq-last/service.ts | 81 | ||||
| -rw-r--r-- | lib/rfq-last/shared/rfq-items-dialog.tsx | 37 | ||||
| -rw-r--r-- | lib/rfq-last/vendor-response/editor/quotation-items-table.tsx | 2 | ||||
| -rw-r--r-- | lib/rfq-last/vendor/vendor-detail-dialog.tsx | 4 |
4 files changed, 70 insertions, 54 deletions
diff --git a/lib/rfq-last/service.ts b/lib/rfq-last/service.ts index 462b5604..52d67280 100644 --- a/lib/rfq-last/service.ts +++ b/lib/rfq-last/service.ts @@ -669,41 +669,48 @@ export async function getRfqItemsAction(rfqId: number) { .where(eq(prItemsLastView.rfqsLastId, rfqId)) .orderBy(prItemsLastView.majorYn, prItemsLastView.rfqItem, prItemsLastView.materialCode) - const formattedItems = items.map(item => ({ - id: item.id, - rfqsLastId: item.rfqsLastId, - rfqItem: item.rfqItem, - prItem: item.prItem, - prNo: item.prNo, - materialCode: item.materialCode, - materialCategory: item.materialCategory, - acc: item.acc, - materialDescription: item.materialDescription, - size: item.size, - deliveryDate: item.deliveryDate, - quantity: Number(item.quantity) || 0, // 여기서 숫자로 변환 - uom: item.uom, - grossWeight: Number(item.grossWeight) || 0, // 여기서 숫자로 변환 - gwUom: item.gwUom, - specNo: item.specNo, - specUrl: item.specUrl, - trackingNo: item.trackingNo, - majorYn: item.majorYn, - remark: item.remark, - projectDef: item.projectDef, - projectSc: item.projectSc, - projectKl: item.projectKl, - projectLc: item.projectLc, - projectDl: item.projectDl, - // RFQ 관련 정보 - rfqCode: item.rfqCode, - rfqType: item.rfqType, - rfqTitle: item.rfqTitle, - itemCode: item.itemCode, - itemName: item.itemName, - projectCode: item.projectCode, - projectName: item.projectName, - })) + const formattedItems = items.map(item => { + const specification = + (item as { specification?: string | null }).specification ?? null + + return { + id: item.id, + rfqsLastId: item.rfqsLastId, + rfqItem: item.rfqItem, + prItem: item.prItem, + prNo: item.prNo, + materialCode: item.materialCode, + materialCategory: item.materialCategory, + acc: item.acc, + materialDescription: item.materialDescription, + size: item.size, + deliveryDate: item.deliveryDate, + quantity: Number(item.quantity) || 0, // 여기서 숫자로 변환 + uom: item.uom, + grossWeight: Number(item.grossWeight) || 0, // 여기서 숫자로 변환 + gwUom: item.gwUom, + specNo: item.specNo, + specUrl: item.specUrl, + trackingNo: item.trackingNo, + specification, + majorYn: item.majorYn, + remark: item.remark, + projectDef: item.projectDef, + projectSc: item.projectSc, + projectKl: item.projectKl, + projectLc: item.projectLc, + projectDl: item.projectDl, + prIssueDate: item.prIssueDate ? new Date(item.prIssueDate) : null, + // RFQ 관련 정보 + rfqCode: item.rfqCode, + rfqType: item.rfqType, + rfqTitle: item.rfqTitle, + itemCode: item.itemCode, + itemName: item.itemName, + projectCode: item.projectCode, + projectName: item.projectName, + } + }) // 주요 품목과 일반 품목 분리 및 통계 const majorItems = formattedItems.filter(item => item.majorYn) @@ -5068,11 +5075,11 @@ export async function updateShortList( }) ); - // 2-3. RFQ 상태를 "Short List 확정"으로 업데이트 + // 2-3. RFQ 상태를 "TBE 요청"으로 업데이트 await tx .update(rfqsLast) .set({ - status: "Short List 확정" as RfqStatus, + status: "TBE 요청" as RfqStatus, updatedBy: Number(session.user.id), updatedAt: new Date() }) diff --git a/lib/rfq-last/shared/rfq-items-dialog.tsx b/lib/rfq-last/shared/rfq-items-dialog.tsx index 4b41897b..f3095c98 100644 --- a/lib/rfq-last/shared/rfq-items-dialog.tsx +++ b/lib/rfq-last/shared/rfq-items-dialog.tsx @@ -20,7 +20,6 @@ import { } from "@/components/ui/table" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" -import { ScrollArea } from "@/components/ui/scroll-area" import { Skeleton } from "@/components/ui/skeleton" import { Separator } from "@/components/ui/separator" import { toast } from "sonner" @@ -49,6 +48,7 @@ interface RfqItem { specNo: string | null specUrl: string | null trackingNo: string | null + specification: string | null majorYn: boolean | null remark: string | null projectDef: string | null @@ -56,6 +56,7 @@ interface RfqItem { projectKl: string | null projectLc: string | null projectDl: string | null + prIssueDate: Date | null // RFQ 관련 정보 rfqCode: string | null rfqType: string | null @@ -258,22 +259,23 @@ export function RfqItemsDialog({ </> )} - <ScrollArea className="flex-1"> + <div className="flex-1 overflow-auto"> {isLoading ? ( <Table> - <TableHeader> + <TableHeader className="sticky top-0 z-10 bg-background"> <TableRow> <TableHead className="w-[60px]">아이템</TableHead> <TableHead className="w-[120px]">자재코드</TableHead> <TableHead>자재명</TableHead> + <TableHead className="w-[140px]">사양</TableHead> <TableHead className="w-[80px]">수량</TableHead> <TableHead className="w-[60px]">수량단위</TableHead> <TableHead className="w-[80px]">중량</TableHead> <TableHead className="w-[60px]">중량단위</TableHead> - <TableHead className="w-[100px]">납기일</TableHead> + <TableHead className="w-[110px]">PR 발행일</TableHead> + <TableHead className="w-[100px]">PR납기 요청일</TableHead> <TableHead className="w-[100px]">PR번호</TableHead> <TableHead className="w-[120px]">사양/설계문서</TableHead> - <TableHead>비고</TableHead> </TableRow> </TableHeader> <TableBody> @@ -290,6 +292,7 @@ export function RfqItemsDialog({ <TableCell><Skeleton className="h-8 w-full" /></TableCell> <TableCell><Skeleton className="h-8 w-full" /></TableCell> <TableCell><Skeleton className="h-8 w-full" /></TableCell> + <TableCell><Skeleton className="h-8 w-full" /></TableCell> </TableRow> ))} </TableBody> @@ -301,21 +304,22 @@ export function RfqItemsDialog({ </div> ) : ( <Table> - <TableHeader> + <TableHeader className="sticky top-0 z-10 bg-background"> <TableRow> <TableHead className="w-[60px]">아이템</TableHead> <TableHead className="w-[120px]">자재코드</TableHead> <TableHead>자재명</TableHead> + <TableHead className="w-[140px]">사양</TableHead> <TableHead className="w-[80px]">수량</TableHead> <TableHead className="w-[60px]">수량단위</TableHead> <TableHead className="w-[80px]">중량</TableHead> <TableHead className="w-[60px]">중량단위</TableHead> - <TableHead className="w-[100px]">납기일</TableHead> + <TableHead className="w-[110px]">PR 발행일</TableHead> + <TableHead className="w-[100px]">PR납기 요청일</TableHead> <TableHead className="w-[100px]">PR번호</TableHead> <TableHead className="w-[100px]">PR 아이템 번호</TableHead> <TableHead className="w-[120px]">사양/설계문서</TableHead> <TableHead className="w-[100px]">프로젝트</TableHead> - <TableHead>비고</TableHead> </TableRow> </TableHeader> <TableBody> @@ -360,6 +364,11 @@ export function RfqItemsDialog({ </TableCell> <TableCell> <span className="text-sm font-medium"> + {item.specification?.trim() ? item.specification : "-"} + </span> + </TableCell> + <TableCell> + <span className="text-sm font-medium"> {item.quantity ? item.quantity.toLocaleString() : "-"} </span> </TableCell> @@ -379,6 +388,11 @@ export function RfqItemsDialog({ </span> </TableCell> <TableCell> + <span className="text-sm font-medium"> + {item.prIssueDate ? format(new Date(item.prIssueDate), "yyyy-MM-dd") : "-"} + </span> + </TableCell> + <TableCell> <span className="text-sm"> {item.deliveryDate ? format(new Date(item.deliveryDate), "yyyy-MM-dd") : "-"} </span> @@ -446,17 +460,12 @@ export function RfqItemsDialog({ ].filter(Boolean).join(" | ") || "-"} </div> </TableCell> - <TableCell> - <span className="text-xs" title={item.remark || ""}> - {item.remark ? (item.remark.length > 30 ? `${item.remark.slice(0, 30)}...` : item.remark) : "-"} - </span> - </TableCell> </TableRow> ))} </TableBody> </Table> )} - </ScrollArea> + </div> {/* 하단 통계 정보 */} {statistics && !isLoading && ( diff --git a/lib/rfq-last/vendor-response/editor/quotation-items-table.tsx b/lib/rfq-last/vendor-response/editor/quotation-items-table.tsx index b0c1488a..d2e0ff0b 100644 --- a/lib/rfq-last/vendor-response/editor/quotation-items-table.tsx +++ b/lib/rfq-last/vendor-response/editor/quotation-items-table.tsx @@ -483,7 +483,7 @@ export default function QuotationItemsTable({ prItems }: QuotationItemsTableProp <TableHead className="w-[60px]">중량단위</TableHead> <TableHead className="w-[150px]">단가</TableHead> <TableHead className="text-right w-[150px]">총액</TableHead> - <TableHead className="w-[150px]">납기일</TableHead> + <TableHead className="w-[150px]">PR납기 요청일</TableHead> <TableHead className="w-[180px]">사양/POS</TableHead> <TableHead className="w-[120px]">프로젝트</TableHead> <TableHead className="w-[80px]">상세</TableHead> diff --git a/lib/rfq-last/vendor/vendor-detail-dialog.tsx b/lib/rfq-last/vendor/vendor-detail-dialog.tsx index 0eee1b8b..f379b032 100644 --- a/lib/rfq-last/vendor/vendor-detail-dialog.tsx +++ b/lib/rfq-last/vendor/vendor-detail-dialog.tsx @@ -398,7 +398,7 @@ export function VendorResponseDetailDialog({ </div> <div className="space-y-3"> <div className="flex items-center justify-between"> - <span className="text-sm text-muted-foreground">납기일</span> + <span className="text-sm text-muted-foreground">PR납기 요청일</span> <span className="text-sm"> {data.deliveryDate ? format(new Date(data.deliveryDate), "yyyy-MM-dd") @@ -596,7 +596,7 @@ export function VendorResponseDetailDialog({ <TableHead className="text-right">단가</TableHead> <TableHead className="text-right">금액</TableHead> <TableHead>통화</TableHead> - <TableHead>납기일</TableHead> + <TableHead>PR납기 요청일</TableHead> </TableRow> </TableHeader> <TableBody> |
