445 lines
14 KiB
Plaintext
445 lines
14 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_jqGrid.jsp"%>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<title><%=Constants.SYSTEM_NAME%></title>
|
|
<script>
|
|
$(document).ready(function(){
|
|
|
|
//체크박스 전체선택/전체해제
|
|
$("#allCheck").click(function() {
|
|
if ($("#allCheck").prop("checked")) {
|
|
$("input[type=checkbox]").prop("checked", true);
|
|
} else {
|
|
$("input[type=checkbox]").prop("checked", false);
|
|
}
|
|
});
|
|
|
|
$("#product_code").change(function(){
|
|
//fnc_productUPGNEWList(this.value,"","upg_no", "");
|
|
fn_productSpecList(this.value, "product_mgmt_spec", "${param.product_mgmt_spec}");
|
|
});
|
|
$("#product_mgmt_spec").change(function(){
|
|
fnc_productUPGNEWList("",this.value,"upg_no", "${param.upg_no}");
|
|
});
|
|
|
|
fn_productSpecList("${param.product_code}", "product_mgmt_spec", "${param.product_mgmt_spec}");
|
|
|
|
fnc_productUPGNEWList("","${param.product_mgmt_spec}","upg_no", "${param.upg_no}");
|
|
|
|
$("input[type=text]").keyup(function(e){
|
|
if(e.keyCode == 13){
|
|
$("#btnSearch").trigger("click");
|
|
}
|
|
});
|
|
$("#btnSearch").click(function(){
|
|
$("#search_partNo").val($.trim($("#search_partNo").val()));
|
|
$("#search_partName").val($.trim($("#search_partName").val()));
|
|
|
|
fn_search();
|
|
});
|
|
$("#btnExcel").click(function(){
|
|
|
|
$("#search_partNo").val($.trim($("#search_partNo").val()));
|
|
$("#search_partName").val($.trim($("#search_partName").val()));
|
|
|
|
fn_excelExport($("#mainGrid"),"BOM_REPORT_역전개");
|
|
});
|
|
|
|
//1level만 활성화 시킨다.
|
|
//$(".dataTr").each(function(i){
|
|
// var lev = $(this).attr("data-LEVEL");
|
|
// if(lev == 1){
|
|
// $(this).show();
|
|
// }else{
|
|
// $(this).hide();
|
|
// }
|
|
//});
|
|
$(".btnToggle").click(function(){
|
|
var src = $(this).attr("src");
|
|
if(src.indexOf("Plus")>-1){
|
|
$(this).attr("src", "/images/btnMinus.png");
|
|
}else if(src.indexOf("Minus")>-1){
|
|
$(this).attr("src", "/images/btnPlus.png");
|
|
}
|
|
|
|
var choosedTr = $(this).parents(".dataTr:first");
|
|
var choosedBRObjId = $(choosedTr).attr("data-BOM_REPORT_OBJID");
|
|
var choosedPath = $(choosedTr).attr("data-PATH").replaceAll("{","").replaceAll("}","");
|
|
|
|
$(".dataTr").each(function(i){
|
|
var _lev = $(this).attr("data-LEVEL");
|
|
var _BRObjId = $(this).attr("data-BOM_REPORT_OBJID");
|
|
var _Path = $(this).attr("data-PATH").replaceAll("{","").replaceAll("}","");
|
|
|
|
if(_lev == 1 || _BRObjId != choosedBRObjId){
|
|
return true;
|
|
}
|
|
|
|
if(_Path.indexOf(choosedPath)>-1){
|
|
$(this).toggle();
|
|
}
|
|
});
|
|
});
|
|
|
|
//level별 색상
|
|
$(".dataTr").each(function(i){
|
|
var lev = $(this).attr("data-LEVEL");
|
|
if(lev == 1){
|
|
$(this).css("background-color", "#fde9d9");
|
|
}else if(lev == 2){
|
|
$(this).css("background-color", "#daeef3");
|
|
}else if(lev == 3){
|
|
$(this).css("background-color", "#e4dfec");
|
|
}else if(lev == 4){
|
|
$(this).css("background-color", "#ebf1de");
|
|
}else if(lev == 5){
|
|
$(this).css("background-color", "#f2f2f2");
|
|
}else if(lev == 6){
|
|
$(this).css("background-color", "#f2dcdb");
|
|
}else if(lev == 7){
|
|
$(this).css("background-color", "#eeece1");
|
|
}else if(lev == 8){
|
|
$(this).css("background-color", "#dce6f1");
|
|
}else if(lev == 9){
|
|
$(this).css("background-color", "#FFFFEB");
|
|
}else if(lev == 10){
|
|
$(this).css("background-color", "#ffffff");
|
|
}
|
|
});
|
|
|
|
//$(".btnPartDetail").click(function(){
|
|
// var objId = $(this).attr("data-PART_OBJID");
|
|
// fn_openPartPopup(objId);
|
|
//});
|
|
});
|
|
|
|
//양산제품에 해당하는 SPEC 정보 목록을 가져온다.
|
|
function fn_productSpecList(productObjId,selectboxId,selectedVal){
|
|
|
|
$("#"+selectboxId).empty();
|
|
|
|
$("#"+selectboxId).append("<option value=''>선택</option>");
|
|
|
|
if("" != productObjId){
|
|
$.ajax({
|
|
url:"/common/getProductSPECList.do",
|
|
type:"POST",
|
|
data:{"isJson":true,"TARGET_OBJID":productObjId},
|
|
dataType:"json",
|
|
async:false,
|
|
success:function(data){
|
|
resultList = data
|
|
|
|
if(0 < resultList.length){
|
|
for (var i = 0; i < resultList.length; i++) {
|
|
var commonCodeId = resultList[i].OBJID;
|
|
var commonCodeName = resultList[i].SPEC_NAME;
|
|
|
|
$("#"+selectboxId).append("<option value='"+commonCodeId+"'>"+commonCodeName+"</option>");
|
|
}
|
|
$("#"+selectboxId).val(selectedVal);
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function fn_productUPGList(productMgmtObjId,selectboxId,selectedVal){
|
|
|
|
$("#"+selectboxId).empty();
|
|
|
|
$("#"+selectboxId).append("<option value=''>선택</option>");
|
|
|
|
if("" != productMgmtObjId){
|
|
$.ajax({
|
|
url:"/common/getProductUPGList.do",
|
|
type:"POST",
|
|
data:{"isJson":true,"PRODUCT_MGMT_OBJID":productMgmtObjId},
|
|
dataType:"json",
|
|
async:false,
|
|
success:function(data){
|
|
|
|
resultList = data
|
|
|
|
if(0 < resultList.length){
|
|
for (var i = 0; i < resultList.length; i++) {
|
|
var commonCodeId = resultList[i].CODE;
|
|
var commonCodeName = resultList[i].UPG_NAME+"("+resultList[i].SPEC_NAME+")";
|
|
|
|
$("#"+selectboxId).append("<option value='"+commonCodeId+"'>"+commonCodeName+"</option>");
|
|
}
|
|
$("#"+selectboxId).val(selectedVal);
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function fn_check(){
|
|
var product_code = fnc_checkNull($("#product_code").val());
|
|
var product_mgmt_spec = fnc_checkNull($("#product_mgmt_spec").val());
|
|
var upg_no = fnc_checkNull($("#upg_no").val());
|
|
var partNo = fnc_checkNull($("#search_partNo").val());
|
|
var partName = fnc_checkNull($("#search_partName").val());
|
|
|
|
if(product_code == "" && product_mgmt_spec == "" && upg_no == ""){
|
|
Swal.fire("조회조건을 설정해주시기 바랍니다.");
|
|
return false;
|
|
}
|
|
|
|
if(partName == "" && partNo.length < 5){
|
|
Swal.fire("Part No는 최소 5자이상 입력하시기 바랍니다.");
|
|
return false;
|
|
}
|
|
|
|
if(partNo == "" && partName.length < 5){
|
|
Swal.fire("Part Name은 최소 5자이상 입력하시기 바랍니다.");
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
function fn_openPartPopup(objId){
|
|
window.open("/partMng/partMngDetailPopUp.do?OBJID="+objId, "tempPartListPopup", "width=600, height=700, toolbar=no, status=no, menubar=no, location=no, scrollbars=yes, resizable=yes");
|
|
}
|
|
|
|
|
|
function fn_search(){
|
|
if(fn_check()){
|
|
document.form1.actionType.value = "search";
|
|
document.form1.action = "/partmgmt/structureDescendingList.do";
|
|
document.form1.submit();
|
|
}
|
|
}
|
|
|
|
function fn_excelExport(pGridObj,pFileName){
|
|
var mya = pGridObj.getDataIDs();
|
|
var data = pGridObj.getRowData(mya[0]);
|
|
var colNames=new Array();
|
|
var ii=0;
|
|
for (var d in data){ colNames[ii++] = d; }
|
|
|
|
//컬럼 헤더 가져오기
|
|
var columnHeader = pGridObj.jqGrid('getGridParam','colNames') + '';
|
|
var arrHeader = columnHeader.split(',');
|
|
var html="<table border=1><tr>";
|
|
for ( var y = 0; y < arrHeader.length; y++ ) {
|
|
var hName = arrHeader[y];
|
|
if("PART_OBJID" == hName || "EO_OBJID" == hName){
|
|
continue;
|
|
}
|
|
|
|
html = html + "<td><b>" + arrHeader[y] + "</b></td>";
|
|
}
|
|
|
|
|
|
html = html + "</tr>";
|
|
|
|
//값 불러오기
|
|
for(var i=0;i< mya.length;i++) {
|
|
var datac= pGridObj.getRowData(mya[i]);
|
|
html = html +"<tr>";
|
|
for(var j=0; j< colNames.length;j++){
|
|
if("PART_OBJID" == colNames[j] || "EO_OBJID" == colNames[j]){
|
|
continue;
|
|
}
|
|
html=html + '<td>' + datac[colNames[j]]+"</td>";
|
|
}
|
|
html = html+"</tr>";
|
|
}
|
|
|
|
|
|
html=html+"</table>"; // end of line at the end
|
|
document.EXCEL_.csvBuffer.value = html;
|
|
document.EXCEL_.fileName.value = pFileName;
|
|
document.EXCEL_.target='_new';
|
|
document.EXCEL_.submit();
|
|
}
|
|
|
|
function openPartMngPopup(objId){
|
|
var hiddenForm = document.hiddenForm;
|
|
var url = "/partMng/partMngFormPopUp.do";
|
|
|
|
if("" != objId){
|
|
url = "/partMng/partMngDetailPopUp.do";
|
|
}
|
|
|
|
var target = "partMngPopUp";
|
|
|
|
window.open(url,target,"width=600, height=700, menubars=no, scrollbars=yes, resizable=yes");
|
|
|
|
hiddenForm.action = url;
|
|
hiddenForm.OBJID.value = objId;
|
|
hiddenForm.target = target;
|
|
hiddenForm.submit();
|
|
}
|
|
</script>
|
|
</head>
|
|
<body class="backcolor">
|
|
<form name="hiddenForm" id="hiddenForm" method="post">
|
|
<input type="hidden" name="OBJID" id="OBJID">
|
|
</form>
|
|
<form name="form1" id="form1" action="" method="post">
|
|
<input type="hidden" name="actionType" id="actionType" value="" />
|
|
<input type="hidden" name="OBJID" id="OBJID" value="${param.OBJID}">
|
|
<div class="min_part_enroll">
|
|
<div class="content-box">
|
|
<div class="content-box-s">
|
|
<div class="plm_menu_name">
|
|
<h2>
|
|
<span>BOM 역전개</span>
|
|
</h2>
|
|
</div>
|
|
<div id="plmSearchZon" style="display:none;">
|
|
<table>
|
|
<tbody>
|
|
<tr>
|
|
<td><label for="product_code">기종(모델)명</label></td>
|
|
<td>
|
|
<select name="product_code" id="product_code" style="" class="select2" autocomplete="off">
|
|
<option value="">선택</option>
|
|
${code_map.product_code}
|
|
</select>
|
|
</td>
|
|
|
|
<td><label for="product_mgmt_spec">규격</label></td>
|
|
<td>
|
|
<select name="product_mgmt_spec" id="product_mgmt_spec" style="" class="select2" autocomplete="off">
|
|
<option value="">선택</option>
|
|
</select>
|
|
</td>
|
|
<td><label for="">UPG_NO</label></td>
|
|
<td>
|
|
<select name="upg_no" id="upg_no" class="select2" style="width:250px;" autocomplete="off"></select>
|
|
</td>
|
|
<td class="align_r">
|
|
<label for="" class="">품번</label>
|
|
</td>
|
|
<td>
|
|
<input type="text" name="search_partNo" id="search_partNo" value="${param.search_partNo}" class="text_area" maxlength="15"/>
|
|
</td>
|
|
<td class="align_r">
|
|
<label for="" class="">품명</label>
|
|
</td>
|
|
<td>
|
|
<input type="text" name="search_partName" id="search_partName" value="${param.search_partName}" class="text_area" style="width:350px;" maxlength="20" placeholder="ex) HEX. BOLT"/>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="contents_page_basic_margin">
|
|
<div class="btn_wrap" style="display:none;">
|
|
<div class="plm_btn_wrap">
|
|
<!-- <input type="button" value="Excel Download" class="plm_btns" id="btnExcel"> -->
|
|
<input type="button" value="조회" class="plm_btns" id="btnSearch">
|
|
</div>
|
|
</div>
|
|
<div class="ascendig_text" style="display:none;">PartNo 혹은 Part Name을 통하여 조회 가능합니다.</div>
|
|
<div class="plm_table_wrap">
|
|
<div>
|
|
<div>
|
|
<table class="plm_table">
|
|
<colgroup>
|
|
<!-- <col width="2%" /> -->
|
|
<col width="2%" />
|
|
<col width="3%" />
|
|
<col width="9%" />
|
|
<col width="9%" />
|
|
<col width="9%" />
|
|
<col width="9%" />
|
|
<col width="9%" />
|
|
<col width="3%" />
|
|
<col width="8%" />
|
|
<col width="8%" />
|
|
<col width="8%" />
|
|
<col width="6%" />
|
|
<col width="5%" />
|
|
<col width="3%" />
|
|
</colgroup>
|
|
<thead>
|
|
<tr class="plm_thead">
|
|
<td></td>
|
|
<td>Level</td>
|
|
<td>Part No.</td>
|
|
<td>Part Name</td>
|
|
<td>형상</td>
|
|
<td>UNIT</td>
|
|
<td>Qty</td>
|
|
<td>EO No</td>
|
|
<td>EO Date</td>
|
|
<td>Revision</td>
|
|
<td>SPEC.</td>
|
|
<td>Material</td>
|
|
<td>Weight</td>
|
|
<td>Part Type</td>
|
|
<td>비고</td>
|
|
</tr>
|
|
</thead>
|
|
<c:choose>
|
|
<c:when test="${empty LIST}">
|
|
<tr>
|
|
<td colspan="15" align="center">조회된 정보가 없습니다.</td>
|
|
</tr>
|
|
</c:when>
|
|
<c:otherwise>
|
|
<c:forEach var="item" items="${LIST}" varStatus="status">
|
|
<tr class="dataTr" data-LEVEL="${item.LEV}" data-BOM_REPORT_OBJID="${item.BOM_REPORT_OBJID}" data-PATH="${item.PATH}">
|
|
<td>
|
|
<c:if test="${item.LEV eq '1' and item.LEAF eq '0'}">
|
|
<img src="/images/btnMinus.png" width="13px" height="13px" class="btnToggle" style="${item.LEV eq '1' and item.LEAF eq '0'?'cursor:pointer;':''}">
|
|
</c:if>
|
|
</td>
|
|
<td title="${item.LEV}">${item.LEV}</td>
|
|
<td title="${item.PART_NO}" class="align_l"><a href="#" onclick="openPartMngPopup('${item.OBJID}');">${item.PART_NO}</a></td>
|
|
<td style="text-align: left !important;" title="${item.PART_NAME}">
|
|
<c:forEach var="i" begin="0" end="${item.LEV}"> </c:forEach> ${item.PART_NAME}
|
|
<%-- <a href="#" class="btnPartDetail" data-PART_OBJID="${item.PART_MGMT_OBJID}">${item.PART_NAME}</a> --%>
|
|
</td>
|
|
<td title="" class="align_c">
|
|
<c:if test="${!empty item.SAVED_FILE_NAME and !empty item.REAL_FILE_NAME and !empty item.FILE_PATH}">
|
|
<img src="#" height='85px' width='100%'
|
|
onclick="fnc_openImagePopUp(this.src)"
|
|
data-SRC="/common/viewImage.do?realFileName=${item.REAL_FILE_NAME}&savedFileName=${item.SAVED_FILE_NAME}&attDir=${item.FILE_PATH}" />
|
|
</c:if>
|
|
</td>
|
|
<td title="${item.UNIT_TITLE}" class="align_c">${item.UNIT_TITLE}</td>
|
|
<td title="${item.QTY}" class="align_c">${item.QTY}</td>
|
|
<td title="${item.EO_NO}" class="align_c">${item.EO_NO}</td>
|
|
<td title="${item.EO_DATE}" class="align_c">${item.EO_DATE}</td>
|
|
<td title="${item.REVISION}" class="align_c">${item.REVISION}</td>
|
|
<td title="${item.SPEC}" class="align_l">${item.SPEC}</td>
|
|
<td title="${item.MATERIAL}" class="align_c">${item.MATERIAL}</td>
|
|
<td title="${item.WEIGHT}" class="align_c">${item.WEIGHT}</td>
|
|
<td title="${item.PART_TYPE_TITLE}" class="align_l">${item.PART_TYPE_TITLE}</td>
|
|
<td title="${item.REMARK}" class="align_l">${item.REMARK}</td>
|
|
</tr>
|
|
</c:forEach>
|
|
</c:otherwise>
|
|
</c:choose>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</body>
|
|
<style>
|
|
.container::-webkit-scrollbar-thumb {background: linear-gradient(to bottom, #f5d78e, #f5d78e) !important;}
|
|
.container::-webkit-scrollbar-track {background-color: white !important;}
|
|
.container::-webkit-scrollbar-button { display: none !important;}
|
|
</style>
|
|
</html> |