From 0e1a15c1be7bd9620fc61767b63b5b6f87563b4f Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Thu, 4 Dec 2025 09:08:44 +0000
Subject: (임수민) 준법문의,법무검토 관련 요청사항 작업
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../basic-contracts-detail-columns.tsx             | 39 ++++++++++++++--------
 1 file changed, 25 insertions(+), 14 deletions(-)

(limited to 'lib/basic-contract/status-detail/basic-contracts-detail-columns.tsx')

diff --git a/lib/basic-contract/status-detail/basic-contracts-detail-columns.tsx b/lib/basic-contract/status-detail/basic-contracts-detail-columns.tsx
index aab808b8..de6ba1a9 100644
--- a/lib/basic-contract/status-detail/basic-contracts-detail-columns.tsx
+++ b/lib/basic-contract/status-detail/basic-contracts-detail-columns.tsx
@@ -553,8 +553,8 @@ export function getDetailColumns({
       minSize: 130,
     },
     
-    // 법무검토 상태
-    {
+    // 법무검토 상태 (준법서약 템플릿이 아닐 때만 표시)
+    ...(!isComplianceTemplate ? [{
       accessorKey: "legalReviewStatus",
       header: ({ column }) => (
         <DataTableColumnHeaderSimple column={column} title="법무검토 상태" />
@@ -571,7 +571,30 @@ export function getDetailColumns({
         return <div className="text-sm text-gray-400">-</div>
       },
       minSize: 140,
+    }] : []),
+    
+    // 준법문의 상태 (준법서약 템플릿일 때만 표시)
+    ...(isComplianceTemplate ? [{
+      accessorKey: "complianceReviewStatus",
+      header: ({ column }) => (
+        <DataTableColumnHeaderSimple column={column} title="준법문의 상태" />
+      ),
+      cell: ({ row }) => {
+        const status = row.getValue("complianceReviewStatus") as string | null
+
+        // PRGS_STAT_DSC 연동값 우선 표시
+        if (status) {
+          return <div className="text-sm text-gray-800">{status}</div>
+        }
+
+        // 동기화된 값이 없으면 빈 값 처리
+        return <div className="text-sm text-gray-400">-</div>
+      },
+      minSize: 140,
     },
+    // Red Flag 컬럼들 (준법서약 템플릿일 때만 표시)
+    redFlagColumn,
+    redFlagResolutionColumn] : []),
     
     // 계약완료일
     {
@@ -659,17 +682,5 @@ export function getDetailColumns({
     actionsColumn,
   ]
 
-  // 준법서약 템플릿인 경우 Red Flag 컬럼과 해제 컬럼을 법무검토 상태 뒤에 추가
-  if (isComplianceTemplate) {
-    const legalReviewStatusIndex = baseColumns.findIndex((col) => {
-      // eslint-disable-next-line @typescript-eslint/no-explicit-any
-      return (col as any).accessorKey === 'legalReviewStatus'
-    })
-    
-    if (legalReviewStatusIndex !== -1) {
-      baseColumns.splice(legalReviewStatusIndex + 1, 0, redFlagColumn, redFlagResolutionColumn)
-    }
-  }
-
   return baseColumns
 }
\ No newline at end of file
-- 
cgit v1.2.3

