diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-09-30 06:41:26 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-09-30 06:41:26 +0000 |
| commit | 9e3458481a65bb5572b7f1916e7c068b54a434c5 (patch) | |
| tree | 27cc8dfd5fc0ed2efba4b87998caf6b2747ad312 /lib/vendor-evaluation-submit | |
| parent | f9afa89a4f27283f5b115cd89ececa08145b5c89 (diff) | |
(최겸) 구매 협력업체 정기평가, 가입승인, 기본계약 리비전 등
Diffstat (limited to 'lib/vendor-evaluation-submit')
| -rw-r--r-- | lib/vendor-evaluation-submit/table/esg-evaluation-form-sheet.tsx | 15 | ||||
| -rw-r--r-- | lib/vendor-evaluation-submit/table/general-evaluation-form-sheet.tsx | 40 |
2 files changed, 42 insertions, 13 deletions
diff --git a/lib/vendor-evaluation-submit/table/esg-evaluation-form-sheet.tsx b/lib/vendor-evaluation-submit/table/esg-evaluation-form-sheet.tsx index 8261bb7b..0ebe1f8c 100644 --- a/lib/vendor-evaluation-submit/table/esg-evaluation-form-sheet.tsx +++ b/lib/vendor-evaluation-submit/table/esg-evaluation-form-sheet.tsx @@ -196,11 +196,11 @@ export function EsgEvaluationFormSheet({ // 평균 점수 재계산 await recalculateEvaluationProgress(submission.id) - toast.success('모든 ESG 평가가 저장되었습니다.') + toast.success('모든 ESG 자가평가서가 저장되었습니다.') onSuccess() } catch (error) { console.error('Error saving all ESG responses:', error) - toast.error('ESG 평가 저장에 실패했습니다.') + toast.error('ESG 자가평가서 저장에 실패했습니다.') } finally { setIsSaving(false) } @@ -285,7 +285,7 @@ const handleExportData = async () => { link.click() document.body.removeChild(link) - toast.success('ESG 평가 문항이 다운로드되었습니다.') + toast.success('ESG 자가평가서 문항이 다운로드되었습니다.') } // 진행률 및 점수 계산 @@ -352,7 +352,7 @@ const handleExportData = async () => { <div className="flex items-center justify-center h-full"> <div className="text-center space-y-4"> <div className="animate-spin rounded-full h-8 w-8 border-b-2 border-gray-900 mx-auto"></div> - <p>ESG 평가 데이터를 불러오는 중...</p> + <p>ESG 자가평가서 데이터를 불러오는 중...</p> </div> </div> </SheetContent> @@ -366,9 +366,10 @@ const handleExportData = async () => { <SheetHeader> <div className="flex items-center justify-between"> <div> - <SheetTitle>ESG 평가 작성</SheetTitle> + <SheetTitle>ESG 자가평가서 작성</SheetTitle> <SheetDescription> - {formData?.submission.vendorName}의 ESG 평가를 작성해주세요. + {formData?.submission.vendorName}의 ESG 자가평가서를 작성해주세요. <br/> + 우측의 "내보내기" 버튼을 클릭하시면 전체 질문을 엑셀로 다운로드 받아 답변 작성에 참고할 수 있습니다. </SheetDescription> </div> <Button @@ -590,7 +591,7 @@ const handleExportData = async () => { {progress.percentage === 100 ? ( <div className="flex items-center gap-2 text-green-600"> <CheckIcon className="h-4 w-4" /> - 모든 ESG 평가가 완료되었습니다 + 모든 ESG 자가평가서가 완료되었습니다 </div> ) : ( <div className="flex items-center gap-2"> diff --git a/lib/vendor-evaluation-submit/table/general-evaluation-form-sheet.tsx b/lib/vendor-evaluation-submit/table/general-evaluation-form-sheet.tsx index bda087bb..685530e6 100644 --- a/lib/vendor-evaluation-submit/table/general-evaluation-form-sheet.tsx +++ b/lib/vendor-evaluation-submit/table/general-evaluation-form-sheet.tsx @@ -389,8 +389,33 @@ export function GeneralEvaluationFormSheet({ <div className="flex-1 overflow-y-auto min-h-0"> <ScrollArea className="h-full pr-4"> <div className="space-y-6"> - {formData.evaluations.map((item, index) => ( - <Card key={item.evaluation.id}> + {Object.entries( + formData.evaluations.reduce((groups, item) => { + const category = item.evaluation.category || '기타' + if (!groups[category]) { + groups[category] = [] + } + groups[category].push(item) + return groups + }, {} as Record<string, typeof formData.evaluations>) + ) + .sort(([a], [b]) => a.localeCompare(b)) + .map(([category, items]) => ( + <div key={category} className="mb-6"> + <div className="mb-3 pb-2 border-b border-gray-300"> + <h3 className="text-lg font-semibold text-gray-800"> + {category} + </h3> + </div> + <div className="space-y-4"> + {[...items] + .sort((a, b) => { + const aNum = parseInt(String(a.evaluation.serialNumber).replace(/^\D+/g, '') || '0') + const bNum = parseInt(String(b.evaluation.serialNumber).replace(/^\D+/g, '') || '0') + return aNum - bNum + }) + .map((item, index) => ( + <Card key={item.evaluation.id}> <CardHeader> <CardTitle className="text-base flex items-center justify-between"> <div className="flex items-center gap-2"> @@ -554,11 +579,14 @@ export function GeneralEvaluationFormSheet({ ))} </div> )} + </div> + </CardContent> + </Card> + ))} + </div> + </div> + ))} </div> - </CardContent> - </Card> - ))} - </div> </ScrollArea> </div> |
