diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-08-22 08:20:45 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-08-22 08:20:45 +0000 |
| commit | d38877eef87917087a4a217bea32ae84d6738a7d (patch) | |
| tree | 8713d9239e6fb34c4ca0704129906044784b30e5 /lib/techsales-rfq/table/detail-table/rfq-detail-table.tsx | |
| parent | e9b1bf22cf2f45a7db8152f7ba83af7799ed71a5 (diff) | |
(최겸) 인포메이션 첨부파일 뷰어 추가
Diffstat (limited to 'lib/techsales-rfq/table/detail-table/rfq-detail-table.tsx')
| -rw-r--r-- | lib/techsales-rfq/table/detail-table/rfq-detail-table.tsx | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/lib/techsales-rfq/table/detail-table/rfq-detail-table.tsx b/lib/techsales-rfq/table/detail-table/rfq-detail-table.tsx index 249a2c74..6ef0f221 100644 --- a/lib/techsales-rfq/table/detail-table/rfq-detail-table.tsx +++ b/lib/techsales-rfq/table/detail-table/rfq-detail-table.tsx @@ -177,8 +177,41 @@ export function RfqDetailTables({ selectedRfq, maxHeight }: RfqDetailTablesProps return;
}
- // contact selection dialog 열기
- setContactSelectionDialogOpen(true);
+ // 선택된 벤더들의 담당자 존재 여부 확인
+ try {
+ const vendorIds = selectedRows.map(row => row.vendorId).filter(Boolean) as number[];
+
+ if (vendorIds.length === 0) {
+ toast.error("유효한 벤더가 선택되지 않았습니다.");
+ return;
+ }
+
+ // 벤더별 담당자 조회
+ const { getTechVendorsContacts } = await import("@/lib/techsales-rfq/service");
+ const contactsResult = await getTechVendorsContacts(vendorIds);
+
+ if (contactsResult.error) {
+ toast.error("벤더 담당자 정보를 불러오는 중 오류가 발생했습니다.");
+ return;
+ }
+
+ // 담당자가 없는 벤더 확인
+ const vendorsWithoutContacts = vendorIds.filter(vendorId => {
+ const vendorContacts = contactsResult.data[vendorId];
+ return !vendorContacts || vendorContacts.contacts.length === 0;
+ });
+
+ if (vendorsWithoutContacts.length > 0) {
+ toast.error("담당자가 지정되지 않은 협력업체가 있습니다.");
+ return;
+ }
+
+ // contact selection dialog 열기
+ setContactSelectionDialogOpen(true);
+ } catch (error) {
+ console.error("벤더 담당자 확인 오류:", error);
+ toast.error("벤더 담당자 정보를 확인하는 중 오류가 발생했습니다.");
+ }
}, [selectedRows, selectedRfqId]);
// contact 기반 RFQ 발송 핸들러
|
