mbom 선택 하이라이트 기능 추가

This commit is contained in:
2026-01-15 14:40:26 +09:00
parent f4d7d343d9
commit 1371733a37
2 changed files with 40 additions and 6 deletions

View File

@@ -47,6 +47,12 @@ body {
background-color: #fff9c4 !important; background-color: #fff9c4 !important;
} }
/* 선택된 행 하이라이트 스타일 */
.tabulator-row.row-selected {
background-color: #b8daff !important;
border: 1px solid #007bff !important;
}
/* Select2 in Tabulator 스타일 */ /* Select2 in Tabulator 스타일 */
.tabulator-cell .select2-container { .tabulator-cell .select2-container {
width: 100% !important; width: 100% !important;
@@ -72,6 +78,7 @@ body {
</style> </style>
<script> <script>
var _tabulGrid; var _tabulGrid;
var selectedRowData = null; // 선택된 행 데이터
// 프로젝트 수주수량 (최상위 프레임에서 가져오기) // 프로젝트 수주수량 (최상위 프레임에서 가져오기)
var projectQuantity = 1; // 기본값 var projectQuantity = 1; // 기본값
@@ -256,7 +263,9 @@ function fn_initGrid() {
levelColumns.push({ levelColumns.push({
headerHozAlign: 'center', headerHozAlign: 'center',
hozAlign: 'center', hozAlign: 'center',
width: 10, width: 25,
minWidth: 25,
maxWidth: 25,
title: i, title: i,
field: 'LEVEL_' + i, field: 'LEVEL_' + i,
formatter: function(cell) { formatter: function(cell) {
@@ -293,7 +302,7 @@ function fn_initGrid() {
{ {
headerHozAlign: 'center', headerHozAlign: 'center',
hozAlign: 'center', hozAlign: 'center',
width: 60, width: 50,
title: '수량', title: '수량',
field: 'QTY_TEMP', field: 'QTY_TEMP',
visible: true visible: true
@@ -339,7 +348,7 @@ function fn_initGrid() {
{ {
headerHozAlign: 'center', headerHozAlign: 'center',
hozAlign: 'center', hozAlign: 'center',
width: 60, width: 50,
title: '3D', title: '3D',
field: 'CU01_CNT', field: 'CU01_CNT',
visible: true, visible: true,
@@ -351,7 +360,7 @@ function fn_initGrid() {
{ {
headerHozAlign: 'center', headerHozAlign: 'center',
hozAlign: 'center', hozAlign: 'center',
width: 60, width: 50,
title: '2D', title: '2D',
field: 'CU02_CNT', field: 'CU02_CNT',
visible: true, visible: true,
@@ -430,7 +439,7 @@ function fn_initGrid() {
{ {
headerHozAlign: 'center', headerHozAlign: 'center',
hozAlign: 'center', hozAlign: 'center',
width: 100, width: 70,
title: '자급/사급', title: '자급/사급',
field: 'SUPPLY_TYPE', field: 'SUPPLY_TYPE',
titleFormatter: function() { return '<span class="editable-header">자급/사급</span>'; }, titleFormatter: function() { return '<span class="editable-header">자급/사급</span>'; },
@@ -877,6 +886,26 @@ function fn_initGrid() {
} }
}); });
// 행 클릭 시 선택 처리 이벤트
_tabulGrid.on("rowClick", function(e, row) {
// 링크 클릭 시에는 기본 동작 유지
if($(e.target).is('a')) {
return;
}
// 기존 선택 해제
$('.tabulator-row.row-selected').removeClass('row-selected');
$('input[name=checkedPartNo]').prop('checked', false);
// 현재 행 선택
$(row.getElement()).addClass('row-selected');
var rowData = row.getData();
selectedRowData = rowData;
// 해당 행의 라디오 버튼 선택
$(row.getElement()).find('input[name=checkedPartNo]').prop('checked', true);
});
// 셀 편집 이벤트 등록 // 셀 편집 이벤트 등록
_tabulGrid.on("cellEdited", function(cell) { _tabulGrid.on("cellEdited", function(cell) {
var field = cell.getField(); var field = cell.getField();
@@ -1016,6 +1045,11 @@ function applyBulkDeadline(processingDeadline, grindingDeadline) {
} }
*/ */
// 선택된 행 데이터 가져오기 (Center 프레임에서 사용)
function getSelectedRowData() {
return selectedRowData;
}
// M-BOM 트리 데이터 수집 (저장용) // M-BOM 트리 데이터 수집 (저장용)
function getMbomTreeData() { function getMbomTreeData() {
var allData = _tabulGrid.getData(); var allData = _tabulGrid.getData();

View File

@@ -415,7 +415,7 @@ function fn_save(){
<option value="R" ${info.BLAME_DECISION eq 'R' ? 'selected' : ''}>RPS</option> <option value="R" ${info.BLAME_DECISION eq 'R' ? 'selected' : ''}>RPS</option>
<option value="C" ${info.BLAME_DECISION eq 'C' ? 'selected' : ''}>고객사</option> <option value="C" ${info.BLAME_DECISION eq 'C' ? 'selected' : ''}>고객사</option>
<option value="O" ${info.BLAME_DECISION eq 'O' ? 'selected' : ''}>외주업체</option> <option value="O" ${info.BLAME_DECISION eq 'O' ? 'selected' : ''}>외주업체</option>
<option value="O" ${info.BLAME_DECISION eq 'E' ? 'selected' : ''}>단순문의</option> <option value="E" ${info.BLAME_DECISION eq 'E' ? 'selected' : ''}>단순문의</option>
</select> </select>
</td> </td>
<td class="input_title"><label>상태 <span style="color:red;">*</span></label></td> <td class="input_title"><label>상태 <span style="color:red;">*</span></label></td>