diff options
Diffstat (limited to 'lib/techsales-rfq/vendor-response/table/vendor-quotations-table.tsx')
| -rw-r--r-- | lib/techsales-rfq/vendor-response/table/vendor-quotations-table.tsx | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/lib/techsales-rfq/vendor-response/table/vendor-quotations-table.tsx b/lib/techsales-rfq/vendor-response/table/vendor-quotations-table.tsx index 4c5cdf8e..e79d7c4d 100644 --- a/lib/techsales-rfq/vendor-response/table/vendor-quotations-table.tsx +++ b/lib/techsales-rfq/vendor-response/table/vendor-quotations-table.tsx @@ -218,7 +218,7 @@ export function VendorQuotationsTable({ vendorId, rfqType }: VendorQuotationsTab return data; }, [data.length, data.map(item => `${item.id}-${item.status}-${item.updatedAt}`).join(',')]); - // 첨부파일 시트 열기 함수 + // 첨부파일 시트 열기 함수 (벤더는 RFQ_COMMON 타입만 조회) const openAttachmentsSheet = React.useCallback(async (rfqId: number) => { try { // RFQ 정보 조회 (data에서 rfqId에 해당하는 데이터 찾기) @@ -236,20 +236,22 @@ export function VendorQuotationsTable({ vendorId, rfqType }: VendorQuotationsTab return } - // API 응답을 ExistingTechSalesAttachment 형식으로 변환 - const attachments: ExistingTechSalesAttachment[] = result.data.map(att => ({ - id: att.id, - techSalesRfqId: att.techSalesRfqId || rfqId, - fileName: att.fileName, - originalFileName: att.originalFileName, - filePath: att.filePath, - fileSize: att.fileSize || undefined, - fileType: att.fileType || undefined, - attachmentType: att.attachmentType as "RFQ_COMMON" | "VENDOR_SPECIFIC", - description: att.description || undefined, - createdBy: att.createdBy, - createdAt: att.createdAt, - })) + // API 응답을 ExistingTechSalesAttachment 형식으로 변환하고 RFQ_COMMON 타입만 필터링 + const attachments: ExistingTechSalesAttachment[] = result.data + .filter(att => att.attachmentType === "RFQ_COMMON") // 벤더는 RFQ_COMMON 타입만 조회 + .map(att => ({ + id: att.id, + techSalesRfqId: att.techSalesRfqId || rfqId, + fileName: att.fileName, + originalFileName: att.originalFileName, + filePath: att.filePath, + fileSize: att.fileSize || undefined, + fileType: att.fileType || undefined, + attachmentType: att.attachmentType as "RFQ_COMMON" | "TBE_RESULT" | "CBE_RESULT", + description: att.description || undefined, + createdBy: att.createdBy, + createdAt: att.createdAt, + })) setAttachmentsDefault(attachments) setSelectedRfqForAttachments({ @@ -383,7 +385,7 @@ export function VendorQuotationsTable({ vendorId, rfqType }: VendorQuotationsTab // useDataTable 훅 사용 const { table } = useDataTable({ data: stableData, - columns: columns as any, + columns: columns as any, // 타입 오류 임시 해결 pageCount, rowCount: total, filterFields, @@ -488,8 +490,8 @@ export function VendorQuotationsTable({ vendorId, rfqType }: VendorQuotationsTab onOpenChange={setAttachmentsOpen} defaultAttachments={attachmentsDefault} rfq={selectedRfqForAttachments} - onAttachmentsUpdated={() => {}} // 읽기 전용이므로 빈 함수 - readOnly={true} // 벤더 쪽에서는 항상 읽기 전용 + attachmentType="RFQ_COMMON" // 벤더는 RFQ_COMMON 타입만 조회 + readOnly={true} // 벤더는 항상 읽기 전용 /> {/* 아이템 보기 다이얼로그 */} |
