From d76ab1855ec68432a1b362c5d922af7235658d10 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Tue, 11 Nov 2025 08:44:22 +0000 Subject: (임수민) 구매 피드백 수정사항들 PO 금액 표시, RFQ 품목 컬럼 추가, 스크롤 시 헤더 고정, 납기일과 SAP 한국시간, 히스토리 수정 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/rfq-last/service.ts | 81 ++++++++++++---------- lib/rfq-last/shared/rfq-items-dialog.tsx | 37 ++++++---- .../editor/quotation-items-table.tsx | 2 +- lib/rfq-last/vendor/vendor-detail-dialog.tsx | 4 +- 4 files changed, 70 insertions(+), 54 deletions(-) (limited to 'lib/rfq-last') 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({ )} - +
{isLoading ? ( - + 아이템 자재코드 자재명 + 사양 수량 수량단위 중량 중량단위 - 납기일 + PR 발행일 + PR납기 요청일 PR번호 사양/설계문서 - 비고 @@ -290,6 +292,7 @@ export function RfqItemsDialog({ + ))} @@ -301,21 +304,22 @@ export function RfqItemsDialog({ ) : (
- + 아이템 자재코드 자재명 + 사양 수량 수량단위 중량 중량단위 - 납기일 + PR 발행일 + PR납기 요청일 PR번호 PR 아이템 번호 사양/설계문서 프로젝트 - 비고 @@ -358,6 +362,11 @@ export function RfqItemsDialog({ )} + + + {item.specification?.trim() ? item.specification : "-"} + + {item.quantity ? item.quantity.toLocaleString() : "-"} @@ -378,6 +387,11 @@ export function RfqItemsDialog({ {item.gwUom || "-"} + + + {item.prIssueDate ? format(new Date(item.prIssueDate), "yyyy-MM-dd") : "-"} + + {item.deliveryDate ? format(new Date(item.deliveryDate), "yyyy-MM-dd") : "-"} @@ -446,17 +460,12 @@ export function RfqItemsDialog({ ].filter(Boolean).join(" | ") || "-"} - - - {item.remark ? (item.remark.length > 30 ? `${item.remark.slice(0, 30)}...` : item.remark) : "-"} - - ))}
)} - +
{/* 하단 통계 정보 */} {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 중량단위 단가 총액 - 납기일 + PR납기 요청일 사양/POS 프로젝트 상세 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({
- 납기일 + PR납기 요청일 {data.deliveryDate ? format(new Date(data.deliveryDate), "yyyy-MM-dd") @@ -596,7 +596,7 @@ export function VendorResponseDetailDialog({ 단가 금액 통화 - 납기일 + PR납기 요청일 -- cgit v1.2.3