From 748f68bb7b5d02450664651ae5025c9a38fb71a5 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Fri, 28 Nov 2025 11:11:39 +0000
Subject: (임수민) 준법, gtc 코멘트 수정
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../basic-contracts-detail-columns.tsx             | 39 ++++++++++++++++++----
 1 file changed, 32 insertions(+), 7 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 047866f7..8783894c 100644
--- a/lib/basic-contract/status-detail/basic-contracts-detail-columns.tsx
+++ b/lib/basic-contract/status-detail/basic-contracts-detail-columns.tsx
@@ -172,12 +172,6 @@ export function getDetailColumns({
               <Mail className="mr-2 h-4 w-4" />
               재발송
             </DropdownMenuItem>
-            <DropdownMenuItem onClick={() => {
-              setRowAction({ type: "view", row });
-            }}>
-              <FileText className="mr-2 h-4 w-4" />
-              상세 정보
-            </DropdownMenuItem>
           </DropdownMenuContent>
         </DropdownMenu>
       )
@@ -305,6 +299,7 @@ export function getDetailColumns({
         const isComplianceContract = contract.templateName?.includes('준법')
         const contractGtcData = gtcData[contract.id]
         const complianceNegotiation = agreementCommentData[contract.id]
+        const hasComplianceRedFlag = !!redFlagData[contract.id]
         const isNegotiationCompleted = !!contract.negotiationCompletedAt
 
         const handleOpenGTC = (e: React.MouseEvent) => {
@@ -312,6 +307,7 @@ export function getDetailColumns({
           
           // 상세보기와 동일하게 contract.id를 경로 파라미터로 사용
           const params = new URLSearchParams();
+          params.set("contractId", contract.id.toString());
           if (contract.templateId) {
             params.set("templateId", contract.templateId.toString());
           }
@@ -394,7 +390,36 @@ export function getDetailColumns({
                     <MessageCircle className="h-3 w-3 mr-1" />
                     협의 진행중 ({complianceNegotiation.commentCount})
                   </Badge>
-                ) : null}
+                ) : (
+                  hasComplianceRedFlag && !isNegotiationCompleted && (
+                    <Badge
+                      variant="outline"
+                      className="text-xs bg-blue-50 text-blue-700 border-blue-200"
+                      title="SHI에서 협의 코멘트를 시작합니다"
+                      onClick={(event) => {
+                        event.stopPropagation()
+                        if (typeof window === "undefined") return
+                        const params = new URLSearchParams()
+                        if (contract.templateId) {
+                          params.set("templateId", contract.templateId.toString())
+                        }
+                        if (contract.vendorId) {
+                          params.set("vendorId", contract.vendorId.toString())
+                        }
+                        if (contract.vendorName) {
+                          params.set("vendorName", contract.vendorName)
+                        }
+                        const query = params.toString()
+                        const complianceUrl = `/evcp/basic-contract/compliance-comments/${contract.id}${query ? `?${query}` : ""}`
+                        window.open(complianceUrl, "_blank", "noopener,noreferrer")
+                      }}
+                      style={{ cursor: "pointer" }}
+                    >
+                      <MessageCircle className="h-3 w-3 mr-1" />
+                      협의 코멘트 작성
+                    </Badge>
+                  )
+                )}
               </div>
             )}
           </div>
-- 
cgit v1.2.3

