summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoonhoekim <26rote@gmail.com>2025-11-07 09:57:43 +0900
committerjoonhoekim <26rote@gmail.com>2025-11-07 09:57:43 +0900
commit5c02b1cc95503cdd7bcd70c6e5fad848250685ec (patch)
tree94e65fe875e7916c54f026c2e1a87c62b451c2a9
parente21adbaf000c5ca1c2f5211478cac6a2e7fbfdbd (diff)
(김준회) 첨부문서 타입 '구매' 건이 있는 경우에만 결재 호출하도록 변경
-rw-r--r--lib/rfq-last/vendor/rfq-vendor-table.tsx20
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/rfq-last/vendor/rfq-vendor-table.tsx b/lib/rfq-last/vendor/rfq-vendor-table.tsx
index fc98785d..e21ec242 100644
--- a/lib/rfq-last/vendor/rfq-vendor-table.tsx
+++ b/lib/rfq-last/vendor/rfq-vendor-table.tsx
@@ -440,10 +440,12 @@ export function RfqVendorTable({
return;
}
- const hasAttachments = rfqSendData.attachments && rfqSendData.attachments.length > 0;
+ // 🔹 attachment_type이 '구매'인 첨부파일이 있는지 확인
+ const hasPurchaseAttachments = rfqSendData.attachments &&
+ rfqSendData.attachments.some((att: any) => att.attachmentType === '구매');
- // 🔹 첨부파일이 있는 경우: 결재 프로세스 시작
- if (hasAttachments) {
+ // 🔹 '구매' 타입 첨부파일이 있는 경우: 결재 프로세스 시작
+ if (hasPurchaseAttachments) {
// Knox EP ID 확인
if (!session?.user?.epId) {
toast.error("Knox EP ID가 없습니다. 시스템 관리자에게 문의하세요.");
@@ -490,7 +492,7 @@ export function RfqVendorTable({
return;
}
- // 🔹 첨부파일이 없는 경우: 기존 로직 (바로 발송)
+ // 🔹 '구매' 타입 첨부파일이 없는 경우: 기존 로직 (바로 발송)
// 다이얼로그 데이터 설정
setSendDialogData({
rfqInfo: rfqSendData.rfqInfo,
@@ -736,10 +738,12 @@ export function RfqVendorTable({
return;
}
- const hasAttachments = rfqSendData.attachments && rfqSendData.attachments.length > 0;
+ // 🔹 attachment_type이 '구매'인 첨부파일이 있는지 확인
+ const hasPurchaseAttachments = rfqSendData.attachments &&
+ rfqSendData.attachments.some((att: any) => att.attachmentType === '구매');
- // 🔹 첨부파일이 있는 경우: 결재 프로세스
- if (hasAttachments) {
+ // 🔹 '구매' 타입 첨부파일이 있는 경우: 결재 프로세스
+ if (hasPurchaseAttachments) {
if (!session?.user?.epId) {
toast.error("Knox EP ID가 없습니다. 시스템 관리자에게 문의하세요.");
setIsLoadingSendData(false);
@@ -782,7 +786,7 @@ export function RfqVendorTable({
return;
}
- // 🔹 첨부파일이 없는 경우: 기존 로직
+ // 🔹 '구매' 타입 첨부파일이 없는 경우: 기존 로직
setSendDialogData({
rfqInfo: rfqSendData.rfqInfo,
attachments: rfqSendData.attachments || [],