summaryrefslogtreecommitdiff
path: root/lib/rfq-last
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rfq-last')
-rw-r--r--lib/rfq-last/table/rfq-attachments-dialog.tsx88
1 files changed, 44 insertions, 44 deletions
diff --git a/lib/rfq-last/table/rfq-attachments-dialog.tsx b/lib/rfq-last/table/rfq-attachments-dialog.tsx
index 4513b0b0..161e446a 100644
--- a/lib/rfq-last/table/rfq-attachments-dialog.tsx
+++ b/lib/rfq-last/table/rfq-attachments-dialog.tsx
@@ -26,8 +26,8 @@ import { toast } from "sonner"
import { RfqsLastView } from "@/db/schema"
import { getRfqAttachmentsAction } from "../service"
import { downloadFile, quickPreview, smartFileAction, formatFileSize, getFileInfo } from "@/lib/file-download"
-import { syncRfqPosFiles } from "@/lib/pos"
-import { useSession } from "next-auth/react"
+// import { syncRfqPosFiles } from "@/lib/pos" // 주석 처리: ECC 매핑 시 자동 처리로 변경
+// import { useSession } from "next-auth/react" // 주석 처리: 동기화 UI 제거로 불필요
// 첨부파일 타입
interface RfqAttachment {
@@ -57,9 +57,9 @@ export function RfqAttachmentsDialog({ isOpen, onClose, rfqData }: RfqAttachment
const [attachments, setAttachments] = React.useState<RfqAttachment[]>([])
const [isLoading, setIsLoading] = React.useState(false)
const [downloadingFiles, setDownloadingFiles] = React.useState<Set<number>>(new Set())
- const [isSyncing, setIsSyncing] = React.useState(false)
+ // const [isSyncing, setIsSyncing] = React.useState(false) // 주석 처리: 동기화 UI 제거
- const { data: session } = useSession()
+ // const { data: session } = useSession() // 주석 처리: 동기화 UI 제거로 불필요
// 첨부파일 목록 로드
React.useEffect(() => {
@@ -158,48 +158,48 @@ export function RfqAttachmentsDialog({ isOpen, onClose, rfqData }: RfqAttachment
}
}
- // POS 파일 동기화 핸들러
- const handlePosSync = async () => {
- if (!session?.user?.id || !rfqData.id) {
- toast.error("로그인이 필요하거나 RFQ 정보가 없습니다")
- return
- }
+ // POS 파일 동기화 핸들러 - 주석 처리: ECC 매핑 시 자동 처리로 변경
+ // const handlePosSync = async () => {
+ // if (!session?.user?.id || !rfqData.id) {
+ // toast.error("로그인이 필요하거나 RFQ 정보가 없습니다")
+ // return
+ // }
- setIsSyncing(true)
+ // setIsSyncing(true)
- try {
- const result = await syncRfqPosFiles(rfqData.id, parseInt(session.user.id))
+ // try {
+ // const result = await syncRfqPosFiles(rfqData.id, parseInt(session.user.id))
- if (result.success) {
- toast.success(
- `POS 파일 동기화 완료: 성공 ${result.successCount}건, 실패 ${result.failedCount}건`
- )
+ // if (result.success) {
+ // toast.success(
+ // `POS 파일 동기화 완료: 성공 ${result.successCount}건, 실패 ${result.failedCount}건`
+ // )
- // 성공한 경우 첨부파일 목록 새로고침
- if (result.successCount > 0) {
- const refreshResult = await getRfqAttachmentsAction(rfqData.id)
- if (refreshResult.success) {
- setAttachments(refreshResult.data)
- }
- }
+ // // 성공한 경우 첨부파일 목록 새로고침
+ // if (result.successCount > 0) {
+ // const refreshResult = await getRfqAttachmentsAction(rfqData.id)
+ // if (refreshResult.success) {
+ // setAttachments(refreshResult.data)
+ // }
+ // }
- // 상세 결과 표시
- if (result.details.length > 0) {
- const failedItems = result.details.filter(d => d.status === 'failed')
- if (failedItems.length > 0) {
- console.warn("POS 동기화 실패 항목:", failedItems)
- }
- }
- } else {
- toast.error(`POS 파일 동기화 실패: ${result.errors.join(', ')}`)
- }
- } catch (error) {
- console.error("POS 동기화 오류:", error)
- toast.error("POS 파일 동기화 중 오류가 발생했습니다")
- } finally {
- setIsSyncing(false)
- }
- }
+ // // 상세 결과 표시
+ // if (result.details.length > 0) {
+ // const failedItems = result.details.filter(d => d.status === 'failed')
+ // if (failedItems.length > 0) {
+ // console.warn("POS 동기화 실패 항목:", failedItems)
+ // }
+ // }
+ // } else {
+ // toast.error(`POS 파일 동기화 실패: ${result.errors.join(', ')}`)
+ // }
+ // } catch (error) {
+ // console.error("POS 동기화 오류:", error)
+ // toast.error("POS 파일 동기화 중 오류가 발생했습니다")
+ // } finally {
+ // setIsSyncing(false)
+ // }
+ // }
// 첨부파일 타입별 색상
const getAttachmentTypeBadgeVariant = (type: string) => {
@@ -224,8 +224,8 @@ export function RfqAttachmentsDialog({ isOpen, onClose, rfqData }: RfqAttachment
</DialogDescription>
</div>
- {/* POS 동기화 버튼 */}
- <Button
+ {/* POS 동기화 버튼 - 주석 처리: ECC 매핑 시 자동 처리로 변경 */}
+ {/* <Button
variant="outline"
size="sm"
onClick={handlePosSync}
@@ -238,7 +238,7 @@ export function RfqAttachmentsDialog({ isOpen, onClose, rfqData }: RfqAttachment
<RefreshCw className="h-4 w-4" />
)}
{isSyncing ? "동기화 중..." : "POS 파일 동기화"}
- </Button>
+ </Button> */}
</div>
</DialogHeader>