diff options
Diffstat (limited to 'lib/rfq-last/vendor-response/editor/vendor-response-editor.tsx')
| -rw-r--r-- | lib/rfq-last/vendor-response/editor/vendor-response-editor.tsx | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/lib/rfq-last/vendor-response/editor/vendor-response-editor.tsx b/lib/rfq-last/vendor-response/editor/vendor-response-editor.tsx index c983dd55..4c14a7f3 100644 --- a/lib/rfq-last/vendor-response/editor/vendor-response-editor.tsx +++ b/lib/rfq-last/vendor-response/editor/vendor-response-editor.tsx @@ -285,6 +285,21 @@ export default function VendorResponseEditor({ } // 제출일 경우에만 validation 수행 + // 0원 입력 확인 + const items = methods.watch('quotationItems') || [] + const zeroPriceItems = items.filter((item: any) => item.unitPrice === 0 || item.totalPrice === 0) + + if (zeroPriceItems.length > 0) { + const confirmed = window.confirm( + `견적품목 중 ${zeroPriceItems.length}개 항목에 0원이 입력되어 있습니다.\n` + + `계속 제출하시겠습니까?` + ) + if (!confirmed) { + setActiveTab('items') + return + } + } + methods.handleSubmit( (data) => onSubmit(data, isSubmit), (errors) => { @@ -655,13 +670,18 @@ export default function VendorResponseEditor({ type="button" variant="default" onClick={() => handleFormSubmit(true)} // 직접 핸들러 호출 - disabled={loading || !allContractsSigned || isSubmitted} + disabled={loading || !allContractsSigned || isSubmitted || activeTab !== 'attachments'} > {!allContractsSigned ? ( <> <AlertCircle className="h-4 w-4 mr-2" /> 기본계약 서명 필요 </> + ) : activeTab !== 'attachments' ? ( + <> + <AlertCircle className="h-4 w-4 mr-2" /> + 첨부파일 화면에서 제출 가능 + </> ) : loading ? ( <> <div className="h-4 w-4 mr-2 animate-spin rounded-full border-2 border-current border-t-transparent" /> |
