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/table/general-evaluation-form-sheet.tsx | |
| parent | f9afa89a4f27283f5b115cd89ececa08145b5c89 (diff) | |
(최겸) 구매 협력업체 정기평가, 가입승인, 기본계약 리비전 등
Diffstat (limited to 'lib/vendor-evaluation-submit/table/general-evaluation-form-sheet.tsx')
| -rw-r--r-- | lib/vendor-evaluation-submit/table/general-evaluation-form-sheet.tsx | 40 |
1 files changed, 34 insertions, 6 deletions
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> |
