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

---
 .../wbs-code/wbs-code-single-selector.tsx          | 40 ++++++----------------
 1 file changed, 11 insertions(+), 29 deletions(-)

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

diff --git a/components/common/selectors/wbs-code/wbs-code-single-selector.tsx b/components/common/selectors/wbs-code/wbs-code-single-selector.tsx
index 77a32afe..5c84b8c2 100644
--- a/components/common/selectors/wbs-code/wbs-code-single-selector.tsx
+++ b/components/common/selectors/wbs-code/wbs-code-single-selector.tsx
@@ -49,7 +49,6 @@ export interface WbsCodeSingleSelectorProps {
   title?: string
   description?: string
   showConfirmButtons?: boolean
-  projNo?: string // 프로젝트 번호 필터
 }
 
 export function WbsCodeSingleSelector({
@@ -61,8 +60,7 @@ export function WbsCodeSingleSelector({
   onCancel,
   title = "WBS 코드 선택",
   description = "WBS 코드를 선택하세요",
-  showConfirmButtons = false,
-  projNo
+  showConfirmButtons = false
 }: WbsCodeSingleSelectorProps) {
   const [codes, setCodes] = useState<WbsCode[]>([])
   const [sorting, setSorting] = useState<SortingState>([])
@@ -77,7 +75,7 @@ export function WbsCodeSingleSelector({
   const handleCodeSelect = useCallback((code: WbsCode) => {
     // 이미 선택된 코드를 다시 선택하면 선택 해제
     const currentSelected = showConfirmButtons ? tempSelectedCode : selectedCode
-    if (currentSelected && currentSelected.WBS_ELMT === code.WBS_ELMT && currentSelected.PROJ_NO === code.PROJ_NO) {
+    if (currentSelected && currentSelected.WBS_ELMT === code.WBS_ELMT) {
       if (showConfirmButtons) {
         setTempSelectedCode(undefined)
       } else {
@@ -113,41 +111,27 @@ export function WbsCodeSingleSelector({
 
   // 테이블 컬럼 정의
   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: '선택',
       cell: ({ row }) => {
         const isSelected = showConfirmButtons
-          ? tempSelectedCode?.WBS_ELMT === row.original.WBS_ELMT && tempSelectedCode?.PROJ_NO === row.original.PROJ_NO
-          : selectedCode?.WBS_ELMT === row.original.WBS_ELMT && selectedCode?.PROJ_NO === row.original.PROJ_NO
+          ? tempSelectedCode?.WBS_ELMT === row.original.WBS_ELMT
+          : selectedCode?.WBS_ELMT === row.original.WBS_ELMT
 
         return (
           <Button
@@ -191,7 +175,7 @@ export function WbsCodeSingleSelector({
   const loadCodes = useCallback(async () => {
     startTransition(async () => {
       try {
-        const result = await getWbsCodes(projNo)
+        const result = await getWbsCodes()
 
         if (result.success) {
           setCodes(result.data)
@@ -213,7 +197,7 @@ export function WbsCodeSingleSelector({
         setCodes([])
       }
     })
-  }, [projNo])
+  }, [])
 
   // 다이얼로그 열릴 때 코드 로드 (open prop 변화 감지)
   useEffect(() => {
@@ -268,8 +252,7 @@ export function WbsCodeSingleSelector({
                 </Button>
               </div>
               <div className="flex items-center gap-2 mt-1">
-                <span className="font-mono text-sm">[{currentSelectedCode.PROJ_NO}]</span>
-                <span className="font-mono text-sm">{currentSelectedCode.WBS_ELMT}</span>
+                <span className="font-mono text-sm">[{currentSelectedCode.WBS_ELMT}]</span>
                 <span>{currentSelectedCode.WBS_ELMT_NM}</span>
               </div>
             </div>
@@ -278,7 +261,7 @@ export function WbsCodeSingleSelector({
           <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"
@@ -311,8 +294,7 @@ export function WbsCodeSingleSelector({
                 <TableBody>
                   {table.getRowModel().rows?.length ? (
                     table.getRowModel().rows.map((row) => {
-                      const isRowSelected = currentSelectedCode?.WBS_ELMT === row.original.WBS_ELMT &&
-                                           currentSelectedCode?.PROJ_NO === row.original.PROJ_NO
+                      const isRowSelected = currentSelectedCode?.WBS_ELMT === row.original.WBS_ELMT
                       return (
                         <TableRow
                           key={row.id}
-- 
cgit v1.2.3

