auto commit
This commit is contained in:
231
WebContent/WEB-INF/view/productionplanning/mBomPopupLeft.jsp
Normal file
231
WebContent/WEB-INF/view/productionplanning/mBomPopupLeft.jsp
Normal file
@@ -0,0 +1,231 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.pms.common.utils.*"%>
|
||||
<%@ page import="java.util.*" %>
|
||||
<%@include file= "/init.jsp" %>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title><%=Constants.SYSTEM_NAME%></title>
|
||||
<link href="/css/tabulator/tabulator.min.css" rel="stylesheet">
|
||||
<script type="text/javascript" src="/js/tabulator/tabulator.min.js"></script>
|
||||
<style>
|
||||
::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
height: 15px;
|
||||
}
|
||||
#mBomTableWrap {
|
||||
width: 99%;
|
||||
margin: 10px auto;
|
||||
}
|
||||
#mBomName {
|
||||
margin-bottom: 10px;
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
}
|
||||
/* Tabulator 커스텀 스타일 */
|
||||
.tabulator-row.level-1 { background-color: #fde9d9 !important; }
|
||||
.tabulator-row.level-2 { background-color: #daeef3 !important; }
|
||||
.tabulator-row.level-3 { background-color: #e4dfec !important; }
|
||||
.tabulator-row.level-4 { background-color: #ebf1de !important; }
|
||||
.tabulator-row.level-5 { background-color: #f2f2f2 !important; }
|
||||
.tabulator-row.level-6 { background-color: #f2dcdb !important; }
|
||||
.tabulator-row.level-7 { background-color: #eeece1 !important; }
|
||||
.tabulator-row.level-8 { background-color: #dce6f1 !important; }
|
||||
.tabulator-row.level-9 { background-color: #FFFFEB !important; }
|
||||
.tabulator-row.level-10 { background-color: #ffffff !important; }
|
||||
</style>
|
||||
<script>
|
||||
var _tabulGrid;
|
||||
|
||||
$(function(){
|
||||
// Tabulator 초기화
|
||||
fn_initGrid();
|
||||
});
|
||||
|
||||
// Tabulator 그리드 초기화
|
||||
function fn_initGrid() {
|
||||
var maxLevel = ${empty MAXLEV ? 1 : MAXLEV};
|
||||
|
||||
// 컬럼 정의
|
||||
var columns = [];
|
||||
|
||||
// 수준 컬럼 그룹
|
||||
var levelColumns = [];
|
||||
for(var i = 1; i <= maxLevel; i++) {
|
||||
levelColumns.push({
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'center',
|
||||
width: 30,
|
||||
title: i,
|
||||
field: 'LEVEL_' + i,
|
||||
formatter: function(cell) {
|
||||
return cell.getValue() === '*' ? '*' : '';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
columns.push({
|
||||
title: '수준',
|
||||
headerHozAlign: 'center',
|
||||
columns: levelColumns
|
||||
});
|
||||
|
||||
// 나머지 컬럼 추가
|
||||
columns.push(
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'left',
|
||||
width: 150,
|
||||
title: '품번',
|
||||
field: 'PART_NO'
|
||||
},
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'left',
|
||||
width: 250,
|
||||
title: '품명',
|
||||
field: 'PART_NAME'
|
||||
},
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'center',
|
||||
width: 80,
|
||||
title: '수량',
|
||||
field: 'QTY_TEMP'
|
||||
},
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'center',
|
||||
width: 100,
|
||||
title: '항목 수량',
|
||||
field: 'ITEM_QTY'
|
||||
},
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'center',
|
||||
width: 80,
|
||||
title: 'Rev',
|
||||
field: 'REVISION'
|
||||
},
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'left',
|
||||
width: 150,
|
||||
title: '규격',
|
||||
field: 'SPEC'
|
||||
},
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'center',
|
||||
width: 100,
|
||||
title: '제품구분',
|
||||
field: 'PRODUCT_NAME'
|
||||
},
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'center',
|
||||
width: 100,
|
||||
title: '상태',
|
||||
field: 'STATUS_NAME'
|
||||
}
|
||||
);
|
||||
|
||||
// Tabulator 생성
|
||||
_tabulGrid = new Tabulator("#mBomTableWrap", {
|
||||
layout: "fitColumns",
|
||||
height: "calc(100vh - 150px)",
|
||||
columns: columns,
|
||||
data: ${bomTreeListJson},
|
||||
rowFormatter: function(row) {
|
||||
var data = row.getData();
|
||||
var level = data.LEVEL || 1;
|
||||
row.getElement().classList.add('level-' + level);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 필터 적용 함수
|
||||
function fn_applyFilter() {
|
||||
var partNo = $("#filterPartNo").val().trim();
|
||||
var partName = $("#filterPartName").val().trim();
|
||||
|
||||
if(!partNo && !partName) {
|
||||
_tabulGrid.clearFilter();
|
||||
return;
|
||||
}
|
||||
|
||||
_tabulGrid.setFilter([
|
||||
[
|
||||
{field: "PART_NO", type: "like", value: partNo},
|
||||
{field: "PART_NAME", type: "like", value: partName}
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
// 필터 초기화 함수
|
||||
function fn_resetFilter() {
|
||||
$("#filterPartNo").val("");
|
||||
$("#filterPartName").val("");
|
||||
_tabulGrid.clearFilter();
|
||||
}
|
||||
|
||||
// M-BOM 조회 (헤더 프레임에서 호출)
|
||||
function fn_searchMbom(searchParams) {
|
||||
$.ajax({
|
||||
url: "/productionplanning/getMbomList.do",
|
||||
method: 'post',
|
||||
data: searchParams,
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
if(data && data.list) {
|
||||
_tabulGrid.setData(data.list);
|
||||
} else {
|
||||
_tabulGrid.setData([]);
|
||||
}
|
||||
},
|
||||
error: function(jqxhr, status, error){
|
||||
console.error("M-BOM 조회 오류:", error);
|
||||
_tabulGrid.setData([]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// M-BOM 트리 데이터 수집 (저장용)
|
||||
function getMbomTreeData() {
|
||||
var allData = _tabulGrid.getData();
|
||||
|
||||
// 데이터 구조 변환 (필요한 필드만 추출)
|
||||
var mbomData = allData.map(function(row) {
|
||||
return {
|
||||
PART_NO: row.PART_NO,
|
||||
PART_NAME: row.PART_NAME,
|
||||
QTY: row.QTY_TEMP || row.ITEM_QTY,
|
||||
LEVEL: row.LEVEL,
|
||||
REVISION: row.REVISION,
|
||||
SPEC: row.SPEC,
|
||||
PRODUCT_NAME: row.PRODUCT_NAME,
|
||||
STATUS_NAME: row.STATUS_NAME,
|
||||
OBJID: row.OBJID
|
||||
};
|
||||
});
|
||||
|
||||
return mbomData;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="mBomName">
|
||||
<c:choose>
|
||||
<c:when test="${not empty ebomInfo}">
|
||||
E-BOM: ${ebomInfo.PART_NO} - ${ebomInfo.PART_NAME}
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
할당된 E-BOM이 없습니다.
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</div>
|
||||
<div id="mBomTableWrap"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user