From a8674e6b91fb4d356c311fad0251878de154da53 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Mon, 24 Nov 2025 11:16:32 +0000
Subject: (최겸) 구매 입찰 수정(폐찰, 낙찰 결재 기능 추가 등)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../selectors/wbs-code/wbs-code-selector.tsx       | 37 ++++++----------------
 1 file changed, 9 insertions(+), 28 deletions(-)

(limited to 'components/common/selectors/wbs-code/wbs-code-selector.tsx')

diff --git a/components/common/selectors/wbs-code/wbs-code-selector.tsx b/components/common/selectors/wbs-code/wbs-code-selector.tsx
index aa5a6a64..5356c723 100644
--- a/components/common/selectors/wbs-code/wbs-code-selector.tsx
+++ b/components/common/selectors/wbs-code/wbs-code-selector.tsx
@@ -5,10 +5,8 @@
  *
  * @description
  * - 오라클에서 WBS 코드들을 조회
- * - PROJ_NO: 프로젝트 번호
  * - WBS_ELMT: WBS 요소
  * - WBS_ELMT_NM: WBS 요소명
- * - WBS_LVL: WBS 레벨
  */
 
 import { useState, useCallback, useMemo, useTransition } from 'react'
@@ -49,7 +47,6 @@ export interface WbsCodeSelectorProps {
   disabled?: boolean
   placeholder?: string
   className?: string
-  projNo?: string // 프로젝트 번호 필터
 }
 
 export interface WbsCodeItem {
@@ -66,8 +63,7 @@ export function WbsCodeSelector({
   onCodeSelect,
   disabled,
   placeholder = "WBS 코드를 선택하세요",
-  className,
-  projNo
+  className
 }: WbsCodeSelectorProps) {
   const [open, setOpen] = useState(false)
   const [codes, setCodes] = useState<WbsCode[]>([])
@@ -81,7 +77,7 @@ export function WbsCodeSelector({
   // WBS 코드 선택 핸들러
   const handleCodeSelect = useCallback(async (code: WbsCode) => {
     // 이미 선택된 코드를 다시 선택하면 선택 해제
-    if (selectedCode && selectedCode.PROJ_NO === code.PROJ_NO && selectedCode.WBS_ELMT === code.WBS_ELMT) {
+    if (selectedCode && selectedCode.WBS_ELMT === code.WBS_ELMT) {
       onCodeSelect(undefined as any) // 선택 해제를 위해 undefined 전달
       setOpen(false)
       return
@@ -98,34 +94,20 @@ export function WbsCodeSelector({
 
   // 테이블 컬럼 정의
   const columns: ColumnDef<WbsCode>[] = useMemo(() => [
-    {
-      accessorKey: 'PROJ_NO',
-      header: '프로젝트 번호',
-      cell: ({ row }) => (
-        <div className="font-mono text-sm">{row.getValue('PROJ_NO')}</div>
-      ),
-    },
     {
       accessorKey: 'WBS_ELMT',
-      header: 'WBS 요소',
+      header: 'WBS_ELMT',
       cell: ({ row }) => (
         <div className="font-mono text-sm">{row.getValue('WBS_ELMT')}</div>
       ),
     },
     {
       accessorKey: 'WBS_ELMT_NM',
-      header: 'WBS 요소명',
+      header: 'WBS_ELMT_NM',
       cell: ({ row }) => (
         <div>{row.getValue('WBS_ELMT_NM')}</div>
       ),
     },
-    {
-      accessorKey: 'WBS_LVL',
-      header: '레벨',
-      cell: ({ row }) => (
-        <div className="text-center">{row.getValue('WBS_LVL')}</div>
-      ),
-    },
     {
       id: 'actions',
       header: '선택',
@@ -170,7 +152,7 @@ export function WbsCodeSelector({
   const loadCodes = useCallback(async () => {
     startTransition(async () => {
       try {
-        const result = await getWbsCodes(projNo)
+        const result = await getWbsCodes()
 
         if (result.success) {
           setCodes(result.data)
@@ -192,7 +174,7 @@ export function WbsCodeSelector({
         setCodes([])
       }
     })
-  }, [projNo])
+  }, [])
 
   // 다이얼로그 열기 핸들러
   const handleDialogOpenChange = useCallback((newOpen: boolean) => {
@@ -217,8 +199,7 @@ export function WbsCodeSelector({
         >
           {selectedCode ? (
             <div className="flex items-center gap-2 w-full">
-              <span className="font-mono text-sm">[{selectedCode.PROJ_NO}]</span>
-              <span className="font-mono text-sm">{selectedCode.WBS_ELMT}</span>
+              <span className="font-mono text-sm">[{selectedCode.WBS_ELMT}]</span>
               <span className="truncate flex-1 text-left">{selectedCode.WBS_ELMT_NM}</span>
               <Button
                 variant="ghost"
@@ -249,7 +230,7 @@ export function WbsCodeSelector({
           <div className="flex items-center space-x-2">
             <Search className="h-4 w-4" />
             <Input
-              placeholder="프로젝트 번호, WBS 요소, WBS 요소명으로 검색..."
+              placeholder="WBS 요소, WBS 요소명으로 검색..."
               value={globalFilter}
               onChange={(e) => handleSearchChange(e.target.value)}
               className="flex-1"
@@ -296,7 +277,7 @@ export function WbsCodeSelector({
                             )}
                           </TableCell>
                         ))}
-                        {selectedCode && selectedCode.PROJ_NO === row.original.PROJ_NO && selectedCode.WBS_ELMT === row.original.WBS_ELMT && (
+                        {selectedCode && selectedCode.WBS_ELMT === row.original.WBS_ELMT && (
                           <TableCell className="text-right">
                             <span className="text-xs text-muted-foreground">(선택됨)</span>
                           </TableCell>
-- 
cgit v1.2.3

