Files
wace_plm/WebContent/WEB-INF/view/partMng/structurePopupRight.jsp
2025-10-24 15:52:14 +09:00

257 lines
6.0 KiB
Plaintext

<%@ 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.min.js"></script>
<style>
::-webkit-scrollbar {
width: 10px;
}
#structureTableWrap2 .structure_btn {
top: 25px;
}
/* Tabulator 커스텀 스타일 */
.tabulator {
border: 1px solid #ddd;
}
.tabulator .tabulator-header {
background-color: #f0f0f0;
border-bottom: 2px solid #ddd;
}
.tabulator .tabulator-header .tabulator-col {
background-color: #f0f0f0;
border-right: 1px solid #ddd;
}
.tabulator .tabulator-tableHolder .tabulator-table {
background-color: #fff;
}
.tabulator .tabulator-row {
border-bottom: 1px solid #eee;
}
.tabulator .tabulator-row:hover {
background-color: #f5f5f5;
}
.tabulator .tabulator-cell {
padding: 8px;
border-right: 1px solid #eee;
}
</style>
<script>
$(function(){
//저장
$("#btnSave").click(function(){
Swal.fire("save");
});
//end of 저장
//닫기
$("#btnClose").click(function(){
top.opener.window.location.reload();
top.self.close(0);
});
//end of 닫기
//고객사 변경시 차종 조회
$("#search_product_mgmt_objid").change(function(){
fnc_productUPGNEWList(this.value,"","search_product_mgmt_upg", "");
});
//파트넘버 엔터키 event
$("#search_part_no").keyup(function(e){
if(e.keyCode == 13){
$("#btnSearch").trigger("click");
}
});
//end of 파트넘버 엔터키 event
//파트명 엔터키 event
$("#search_part_name").keyup(function(e){
if(e.keyCode == 13){
$("#btnSearch").trigger("click");
}
});
//end of 파트명 엔터키 event
//파트조회
$("#btnSearch").click(function(){
fn_searchPart();
});
//end of 파트조회
//전체선택
$("#allChk").click(function(){
var isChecked = $(this).prop("checked");
if(isChecked){
$(".partChks").prop("checked", true);
}else{
$(".partChks").prop("checked", false);
}
});
fnc_getProductMgmtList("search_product_mgmt_objid","");
fnc_productUPGNEWList("","${resultMap.PRODUCT_MGMT_SPEC}","search_product_mgmt_upg", "");
$('.select2').select2();
// Tabulator 초기화
fn_initRightGrid();
});
var _rightGrid;
function fn_initRightGrid(){
var columns = [
{
formatter: "rowSelection",
titleFormatter: "rowSelection",
headerHozAlign: 'center',
hozAlign: 'center',
width: 50,
headerSort: false,
cellClick: function(e, cell){
e.stopPropagation();
}
},
{
headerHozAlign: 'center',
hozAlign: 'left',
width: 150,
title: '품번',
field: 'PART_NO',
formatter: function(cell) {
var rowData = cell.getData();
return '<a href="#" onclick="openPartMngPopup(\'' + rowData.OBJID + '\');">' + rowData.PART_NO + '</a>';
}
},
{
headerHozAlign: 'center',
hozAlign: 'left',
width: 180,
title: '품명',
field: 'PART_NAME'
},
{
headerHozAlign: 'center',
hozAlign: 'left',
width: 200,
title: '규격',
field: 'SPEC'
},
{
headerHozAlign: 'center',
hozAlign: 'left',
width: 120,
title: 'MAKER',
field: 'MAKER'
}
];
_rightGrid = new Tabulator("#rightPartGrid", {
layout: "fitColumns",
height: "600px",
pagination: false,
columns: columns,
placeholder: "조회된 부품이 없습니다.",
data: []
});
}
function fn_searchPart(){
$.ajax({
url: "/partMng/getPartMngList_ajax.do",
method: 'post',
data: $("#form1").serialize(),
dataType: 'json',
success: function(data) {
// Tabulator에 데이터 설정
if(_rightGrid){
_rightGrid.setData(data);
}
},
error: function(jqxhr, status, error){
Swal.fire('조회 중 오류가 발생했습니다.');
}
});
}
/**
* 파트 상세 공용(View 전용)
*/
function openPartMngPopup(objId){
var hiddenForm = document.hiddenForm;
var url = "/partMng/partMngDetailPopUp.do";
if("" == objId){
Swal.fire("올바르지 않은 접근입니다.");
}
var target = "partMngPopUp";
window.open(url,target,"width=600, height=730, menubars=no, scrollbars=yes, resizable=yes");
hiddenForm.action = url;
hiddenForm.OBJID.value = objId;
hiddenForm.ACTION_TYPE.value = "view";
hiddenForm.target = target;
hiddenForm.submit();
}
</script>
</head>
<body class="backcolor">
<form name="hiddenForm" id="hiddenForm" method="post">
<input type="hidden" name="OBJID" id="OBJID">
<input type="hidden" name="ACTION_TYPE" id="ACTION_TYPE">
</form>
<form name="form1" id="form1" action="" method="post">
<input type="hidden" name="bomReportObjId" id="bomReportObjId" value="${param.OBJID}">
<input type="hidden" name="is_last" id="is_last" value="1">
<input type="hidden" name="searchTargetStatus" id="searchTargetStatus" value="${info.STATUS}">
<div id="structureName2"></div>
<div id="structureTableWrap2" style="">
<!-- 검색 필터 영역 -->
<div id="plmSearchZon">
<table>
<tr>
<td><label for="search_part_no">품번</label></td>
<td>
<input type="text" name="search_part_no" id="search_part_no" value="">
</td>
<td class="label"><label for="search_part_name">품명</label></td>
<td>
<input type="text" name="search_part_name" id="search_part_name" value="">
</td>
</tr>
<tr>
<td><label for="search_spec">규격</label></td>
<td>
<input type="text" name="search_spec" id="search_spec" value="">
</td>
<td class="label"><label for="search_maker">MAKER</label></td>
<td>
<input type="text" name="search_maker" id="search_maker" value="">
</td>
<td>
<input type="button" value="조회" class="plm_btns" id="btnSearch">
</td>
</tr>
</table>
</div>
<div class="plm_table_wrap">
<div id="rightPartGrid"></div>
</div>
</div>
</form>
</body>
</html>