diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/basic-contract/template/update-basicContract-sheet.tsx | 1 | ||||
| -rw-r--r-- | lib/techsales-rfq/service.ts | 2 | ||||
| -rw-r--r-- | lib/techsales-rfq/table/detail-table/rfq-detail-table.tsx | 37 |
3 files changed, 37 insertions, 3 deletions
diff --git a/lib/basic-contract/template/update-basicContract-sheet.tsx b/lib/basic-contract/template/update-basicContract-sheet.tsx index 0236fda5..90bb81a4 100644 --- a/lib/basic-contract/template/update-basicContract-sheet.tsx +++ b/lib/basic-contract/template/update-basicContract-sheet.tsx @@ -102,6 +102,7 @@ export function UpdateTemplateSheet({ template, onSuccess, ...props }: UpdateTem // FormData 객체 생성하여 파일과 데이터를 함께 전송 const formData = new FormData(); + formData.append("templateName", template.templateName); // 기존 템플릿 이름 추가 formData.append("legalReviewRequired", input.legalReviewRequired.toString()); if (input.file) { diff --git a/lib/techsales-rfq/service.ts b/lib/techsales-rfq/service.ts index 5ec02f63..3736bf76 100644 --- a/lib/techsales-rfq/service.ts +++ b/lib/techsales-rfq/service.ts @@ -1758,7 +1758,7 @@ export async function processTechSalesRfqAttachments(params: { // 1. 삭제할 첨부파일 처리
if (deleteAttachmentIds.length > 0) {
const attachmentsToDelete = await tx.query.techSalesAttachments.findMany({
- where: sql`${techSalesAttachments.id} IN (${deleteAttachmentIds.join(',')})`
+ where: inArray(techSalesAttachments.id, deleteAttachmentIds)
});
for (const attachment of attachmentsToDelete) {
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 발송 핸들러
|
