diff options
| author | joonhoekim <26rote@gmail.com> | 2025-09-24 17:36:08 +0900 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-09-24 17:36:08 +0900 |
| commit | bf2db28586569499e44b58999f2e0f33ed4cdeb5 (patch) | |
| tree | 9ef9305829fdec30ec7a442f2ba0547a62dba7a9 /lib/avl/table/project-avl-table.tsx | |
| parent | 1bda7f20f113737f4af32495e7ff24f6022dc283 (diff) | |
(김준회) 구매 요청사항 반영 - vendor-pool 및 avl detail (이진용 프로)
Diffstat (limited to 'lib/avl/table/project-avl-table.tsx')
| -rw-r--r-- | lib/avl/table/project-avl-table.tsx | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/lib/avl/table/project-avl-table.tsx b/lib/avl/table/project-avl-table.tsx index 9584c6f9..ad72b221 100644 --- a/lib/avl/table/project-avl-table.tsx +++ b/lib/avl/table/project-avl-table.tsx @@ -177,12 +177,40 @@ export const ProjectAvlTable = forwardRef<ProjectAvlTableRef, ProjectAvlTablePro const projectData = await getProjectInfoByCode(projectCode.trim(), 'both') if (projectData) { + // constructionSector 동적 결정 + let constructionSector = "해양" // 기본값 + if (projectData.source === 'projects') { + // projects 테이블의 경우: type='ship'이면 '조선', 그 외는 '해양' + constructionSector = projectData.type === 'ship' ? "조선" : "해양" + } else if (projectData.source === 'biddingProjects') { + // biddingProjects 테이블의 경우: sector가 'S'이면 '조선', 'M'이면 '해양' + constructionSector = projectData.sector === 'S' ? "조선" : "해양" + } + + // htDivision 동적 결정 + let htDivision = "" // 기본값 + if (constructionSector === "조선") { + // constructionSector가 '조선'인 경우는 항상 H + htDivision = "H" + } else if (projectData.source === 'projects') { + // projects에서는 TYPE_MDG 컬럼이 Top이면 T, Hull이면 H + htDivision = projectData.typeMdg === 'Top' ? "T" : "H" + } else if (projectData.source === 'biddingProjects') { + if (projectData.sector === 'S') { + // biddingProjects에서 sector가 S이면 HtDivision은 항상 H + htDivision = "H" + } else if (projectData.sector === 'M') { + // biddingProjects에서 sector가 M인 경우: pjtType이 TOP이면 'T', HULL이면 'H' + htDivision = projectData.pjtType === 'TOP' ? "T" : "H" + } + } + // 프로젝트 정보 설정 setProjectInfo({ projectName: projectData.projectName || "", - constructionSector: "조선", // 기본값으로 조선 설정 (필요시 로직 변경) + constructionSector: constructionSector, shipType: projectData.shipType || projectData.projectMsrm || "", - htDivision: projectData.projectHtDivision || "" + htDivision: htDivision }) // 검색 상태 설정 @@ -307,6 +335,7 @@ export const ProjectAvlTable = forwardRef<ProjectAvlTableRef, ProjectAvlTablePro getFilteredRowModel: getFilteredRowModel(), manualPagination: true, pageCount, + columnResizeMode: "onChange", state: { pagination, }, |
