From b54f6f03150dd78d86db62201b6386bf14b72394 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Wed, 15 Oct 2025 12:52:11 +0000 Subject: (대표님) 커버, 데이터룸, 파일매니저, 담당자할당 등 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/rfq-last/service.ts | 1 + lib/rfq-last/table/rfq-assign-pic-dialog.tsx | 36 ++++++++---------------- lib/rfq-last/table/rfq-table-toolbar-actions.tsx | 28 ++++++++++++------ lib/rfq-last/vendor/rfq-vendor-table.tsx | 32 +++++++++++++++++---- 4 files changed, 58 insertions(+), 39 deletions(-) (limited to 'lib/rfq-last') diff --git a/lib/rfq-last/service.ts b/lib/rfq-last/service.ts index d4efb81d..8475aac0 100644 --- a/lib/rfq-last/service.ts +++ b/lib/rfq-last/service.ts @@ -100,6 +100,7 @@ export async function getRfqs(input: GetRfqsSchema) { ilike(rfqsLastView.packageNo, s), ilike(rfqsLastView.packageName, s), ilike(rfqsLastView.picName, s), + ilike(rfqsLastView.picCode, s), ilike(rfqsLastView.engPicName, s), ilike(rfqsLastView.projectCode, s), ilike(rfqsLastView.projectName, s), diff --git a/lib/rfq-last/table/rfq-assign-pic-dialog.tsx b/lib/rfq-last/table/rfq-assign-pic-dialog.tsx index 9ca34ccd..70d2ed7e 100644 --- a/lib/rfq-last/table/rfq-assign-pic-dialog.tsx +++ b/lib/rfq-last/table/rfq-assign-pic-dialog.tsx @@ -39,15 +39,6 @@ export function RfqAssignPicDialog({ const [selectedCode, setSelectedCode] = React.useState(undefined); const [selectorOpen, setSelectorOpen] = React.useState(false); - // ITB만 필터링 (rfqCode가 "I"로 시작하는 것) - const itbCodes = React.useMemo(() => { - return selectedRfqCodes.filter(code => code.startsWith("I")); - }, [selectedRfqCodes]); - - const itbIds = React.useMemo(() => { - return selectedRfqIds.filter((id, index) => selectedRfqCodes[index]?.startsWith("I")); - }, [selectedRfqIds, selectedRfqCodes]); - // 다이얼로그 열릴 때 초기화 React.useEffect(() => { if (open) { @@ -81,15 +72,15 @@ export function RfqAssignPicDialog({ return; } - if (itbIds.length === 0) { - toast.error("선택한 항목 중 ITB가 없습니다"); + if (selectedRfqIds.length === 0) { + toast.error("담당자 지정이 가능한 ITB가 없습니다"); return; } setIsAssigning(true); try { const result = await assignPicToRfqs({ - rfqIds: itbIds, + rfqIds: selectedRfqIds, picUserId: selectedCode.user.id, }); @@ -127,32 +118,27 @@ export function RfqAssignPicDialog({
- {itbCodes.length}건 - {itbCodes.length !== selectedRfqCodes.length && ( - - (전체 {selectedRfqCodes.length}건 중) - - )} + {selectedRfqCodes.length}건
- {itbCodes.slice(0, 10).map((code, index) => ( + {selectedRfqCodes.slice(0, 10).map((code, index) => ( {code} ))} - {itbCodes.length > 10 && ( + {selectedRfqCodes.length > 10 && ( - +{itbCodes.length - 10}개 + +{selectedRfqCodes.length - 10}개 )}
- {itbCodes.length === 0 && ( + {selectedRfqCodes.length === 0 && ( - 선택한 항목 중 ITB (I로 시작하는 코드)가 없습니다. + 담당자 지정이 가능한 ITB가 없습니다. (상태가 "RFQ 생성" 또는 "구매담당지정"인 ITB만 가능) )} @@ -165,7 +151,7 @@ export function RfqAssignPicDialog({ type="button" variant="outline" className="w-full justify-start h-auto min-h-[40px]" - disabled={itbCodes.length === 0} + disabled={selectedRfqCodes.length === 0} onClick={() => setSelectorOpen(true)} > {selectedCode ? ( @@ -227,7 +213,7 @@ export function RfqAssignPicDialog({

선택한 ITB에 구매 담당자를 지정합니다

- {selectedRfqData.itbCount !== selectedRfqData.totalCount && ( + {selectedRfqData.assignableItbCount !== selectedRfqData.itbCount && (

- 전체 {selectedRfqData.totalCount}건 중 ITB {selectedRfqData.itbCount}건만 지정됩니다 + 전체 ITB {selectedRfqData.itbCount}건 중 {selectedRfqData.assignableItbCount}건만 지정 가능합니다

)}
@@ -103,7 +113,7 @@ export function RfqTableToolbarActions({ {selectedRfqData.totalCount !== selectedRfqData.itbCount && ( - ITB {selectedRfqData.itbCount}건 + ITB {selectedRfqData.itbCount}건 (지정가능 {selectedRfqData.assignableItbCount}건) )} @@ -139,8 +149,8 @@ export function RfqTableToolbarActions({ diff --git a/lib/rfq-last/vendor/rfq-vendor-table.tsx b/lib/rfq-last/vendor/rfq-vendor-table.tsx index dc5564e2..428160d5 100644 --- a/lib/rfq-last/vendor/rfq-vendor-table.tsx +++ b/lib/rfq-last/vendor/rfq-vendor-table.tsx @@ -753,8 +753,10 @@ export function RfqVendorTable({ filterFn: createFilterFn("text"), cell: ({ row }) => { - const status = row.original.tbeStatus; + const status = row.original.tbeStatus?.trim(); + const rfqCode = row.original.rfqCode?.trim(); + // 생성중/준비중은 대기 표시(비클릭) if (!status || status === "준비중") { return ( @@ -772,8 +774,28 @@ export function RfqVendorTable({ "취소": { variant: "destructive", icon: }, }[status] || { variant: "outline", icon: null, color: "text-gray-600" }; + const isClickable = !!rfqCode; + return ( - + { + if (!isClickable) return; + e.stopPropagation(); + e.preventDefault(); + router.push(`/evcp/tbe-last?search=${encodeURIComponent(rfqCode!)}`); + // window.open( + // `/evcp/tbe-last?search=${encodeURIComponent(rfqCode!)}`, + // "_blank", + // "noopener,noreferrer" + // ); + // 새 창으로 이동 + }} + title={isClickable ? `TBE로 이동: ${rfqCode}` : undefined} + > {statusConfig.icon} {status} @@ -802,19 +824,19 @@ export function RfqVendorTable({ "Acceptable": { variant: "success", icon: , - text: "적합", + text: "Acceptable", color: "bg-green-50 text-green-700 border-green-200" }, "Acceptable with Comment": { variant: "warning", icon: , - text: "조건부 적합", + text: "Acceptable with Comment", color: "bg-yellow-50 text-yellow-700 border-yellow-200" }, "Not Acceptable": { variant: "destructive", icon: , - text: "부적합", + text: "Not Acceptable", color: "bg-red-50 text-red-700 border-red-200" }, }[result]; -- cgit v1.2.3