ERP-node/WebContent/WEB-INF/view/partMng/structureList_back.jsp

761 lines
24 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>
<!-- //JSTL 변수선언 -->
<c:set var="totalCount" value="${empty TOTAL_COUNT?0:TOTAL_COUNT}" />
<c:set var="maxPage" value="${empty MAX_PAGE_SIZE?1:MAX_PAGE_SIZE}" />
<c:set var="nPage" value="${empty param.page?1:param.page}" />
<c:set var="pageIndex" value="${(nPage-1)/10}" />
<c:set var="nextPage" value="${empty NEXT_PAGE?1:NEXT_PAGE}" />
<c:set var="prevPage" value="${empty PREV_PAGE?1:PREV_PAGE}" />
<script>
$(document).ready(function(){
//체크박스 전체선택/전체해제
$("#allCheck").click(function() {
if ($("#allCheck").prop("checked")) {
$("input[type=checkbox]").prop("checked", true);
} else {
$("input[type=checkbox]").prop("checked", false);
}
});
//구조 등록
$("#btnSetStructure").click(function(){
if($("#product_code").val()==""){
Swal.fire('기종명을 선택해 주세요');
return;
}
if($("#product_mgmt_spec").val()==""){
Swal.fire('사양을 선택해 주세요');
return;
}
if($("#upg_no").val()==""){
Swal.fire('upg_no를 선택해 주세요');
return;
}
fn_openSetStandardInfo($("#product_code").val(),$("#product_mgmt_spec").val(),$("#upg_no").val());
});
//end of 구조 등록
//구조 등록
$("#btnBomCopy").click(function(){
if($("#product_code").val()==""){
Swal.fire('기종명을 선택해 주세요');
return;
}
fn_openSetBomCopy($("#product_code").val());
});
//상세 팝업
$(".btnDetail").click(function(){
var objId = $(this).attr("data-OBJID");
fn_openSetStructure(objId);
});
//상세 팝업
$("#btnDelete").click(function(){
fn_delete();
});
//end of 상세 팝업
//조회
$("#btnSearch").click(function(){
document.form1.action = "/partMng/searchStructureList.do";
document.form1.submit();
});
$("#btnDeploy").click(function(){
fn_deploy();
});
$("#SEARCH_PRODUCT_MGMT_OBJID").change(function(){
//fn_productUPGList(this.value, "SEARCH_PRODUCT_MGMT_UPG", "");
//fn_productVCList("","SEARCH_PRODUCT_MGMT_VC", "");
});
$("#SEARCH_PRODUCT_MGMT_UPG").change(function(){
fn_productVCList(this.value,"SEARCH_PRODUCT_MGMT_VC", "");
});
fnc_datepick("SEARCH_DEPLOY_DATE_FROM", "SEARCH_DEPLOY_DATE_TO");
//fnc_getProductMgmtList("SEARCH_PRODUCT_MGMT_OBJID", "${param.SEARCH_PRODUCT_MGMT_OBJID}");
fn_productSpecList("${param.product_code}", "product_mgmt_spec", "${param.product_mgmt_spec}");
fnc_getUserList2("SEARCH_WRITER", "${param.SEARCH_WRITER}");
/* $("#product_code").change(function(){
//fnc_productUPGNEWList(this.value,"","upg_no", "");
fn_productSpecList(this.value, "product_mgmt_spec", "${param.product_mgmt_spec}");
}); */
$("#customer_cd").change(function(){
//fnc_productUPGNEWList(this.value,"","upg_no", "");
fn_projectNameList(this.value, "project_name", "");
});
$("#project_name").change(function(){
//fnc_productUPGNEWList(this.value,"","upg_no", "");
fn_UnitCodeList(this.value, "unit_code", "");
});
if("${param.customer_cd}"!=""){
fn_projectNameList("${param.customer_cd}", "project_name","");
$("#project_name").val("${param.project_name}");
}
if("${param.project_name}"!=""){
fn_UnitCodeList("${param.project_name}", "unit_code","${param.unit_code}");
//$("#unit_code").val("${param.unit_code}");
}
$("#product_mgmt_spec").change(function(){
//fnc_productUPGNEWList(this.value,"","upg_no", "");
//fn_productSpecList(this.value, "product_mgmt_spec", "${param.product_mgmt_spec}");
fnc_productUPGNEWList("",this.value,"upg_no", "${param.upg_no}");
});
if("${param.product_code}"!=""){
fnc_productUPGNEWList("${param.product_code}","","upg_no", "");
$("#upg_no").val("${param.upg_no}");
}
$('.select2').select2();
});
//양산제품에 해당하는 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_productVCList(productUPGObjId,selectboxId,selectedVal){
$("#"+selectboxId).empty();
$("#"+selectboxId).append("<option value=''>선택</option>");
if("" != productUPGObjId){
$.ajax({
url:"/common/getProductUPGList.do",
type:"POST",
data:{"isJson":true,"PRODUCT_MGMT_UPG":productUPGObjId},
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].VC;
$("#"+selectboxId).append("<option value='"+commonCodeId+"'>"+commonCodeName+"</option>");
}
$("#"+selectboxId).val(selectedVal);
}
},
error: function(jqxhr, status, error){
}
});
}
}
function fn_deploy() {
var selectedStructure = $("input[name=OBJID]:checked");
var objIdSubTask = selectedStructure.attr("data-OBJID_SUB_TASK");
if(selectedStructure.length == 0){
Swal.fire("선택된 내용이 없습니다.");
return false;
}else if(1 < selectedStructure.length){
Swal.fire("한번에 한개의 배포만 가능합니다.");
return false;
}else{
var checkArr = selectedStructure.val();
if(confirm("선택된 내용을 배포하시겠습니까?")){
Swal.fire("배포사유를 입력해주세요");
fn_openChangeDesignNote(objIdSubTask);
/* $.ajax({
url:"/partMng/deployStructure.do",
type:"POST",
data:{"checkArr":chkArray.join(",")},
dataType:"json",
success:function(data){
Swal.fire(data.msg);
fn_search();
},
error: function(jqxhr, status, error){
}
}); */
}
}
}
function fn_delete() {
var selectedStructure = $("input[name=OBJID]:checked");
if(0 < selectedStructure.length){
var chkArray = [];
$("input[name=OBJID]:checked").each(function() {
chkArray.push(this.value);
});
if(confirm("선택된 내용을 삭제하시겠습니까?")){
$.ajax({
url:"/partMng/deleteStructure.do",
type:"POST",
data:{"checkArr":chkArray.join(",")},
dataType:"json",
success:function(data){
Swal.fire(data.msg);
fn_search();
},
error: function(jqxhr, status, error){
}
});
}
}else{
Swal.fire("선택된 내용이 없습니다.");
return false;
}
}
/**
* 구조 기준정보 팝업
*/
function fn_openSetStandardInfo(product_code,product_mgmt_spec,upg_no){
var hiddenForm = document.hiddenForm;
var url = "/partMng/setStructureStandardFormPopup.do";
var target = "setStructureStandardFormPopup";
window.open(url,target,"width=500, height=260, menubars=no, scrollbars=yes, resizable=yes");
hiddenForm.action = url;
hiddenForm.param_product_code.value = product_code;
hiddenForm.param_product_mgmt_spec.value = product_mgmt_spec;
hiddenForm.param_upg_no.value = upg_no;
hiddenForm.target = target;
hiddenForm.submit();
}
/**
* bom copy 팝업
*/
function fn_openSetBomCopy(product_code){
var hiddenForm = document.hiddenForm;
var url = "/partMng/setBomCopyFormPopup.do";
var target = "setBomCopyFormPopup";
window.open(url,target,"width=1100, height=360, menubars=no, scrollbars=yes, resizable=yes");
hiddenForm.action = url;
hiddenForm.param_product_code.value = product_code;
hiddenForm.target = target;
hiddenForm.submit();
}
/**
* 구조등록 팝업
*/
function fn_openSetStructure(objId){
window.open("/partMng/setStructurePopupMainFS.do?objId="+objId, "", "width=1600, height=850, resizable=no");
}
/**
* 배포사유 입력 팝업
*/
function fn_openChangeDesignNote(objId){
window.open("/partMng/changeDesignNotePopUp.do?objId="+objId, "", "width=1000, height=200, resizable=no");
}
function fn_search(){
document.form1.action = "/partMng/searchStructureList.do";
document.form1.submit();
}
function saveexcelpop() {
if($("#customer_cd").val()==""){
Swal.fire('고객사를 선택해 주세요');
return;
}
if($("#project_name").val()==""){
Swal.fire('프로젝트를 선택해 주세요');
return;
}
if($("#unit_code").val()==""){
Swal.fire('유닛명을 선택해 주세요');
return;
}
var url = "/partMng/openBomReportExcelImportPopUp.do?customer_cd="+$("#customer_cd").val()+"&project_name="+$("#project_name").val()+"&unit_code="+$("#unit_code").val();
var target = "openBomReportExcelImportPopUp";
window.open(url, target,"width=1650, height=600, menubars=no, scrollbars=yes, resizable=yes");
}
</script>
</head>
<body class="backcolor">
<form name="hiddenForm" id="hiddenForm" method="post">
<input type="hidden" name="param_product_code" id="param_product_code">
<input type="hidden" name="param_product_mgmt_spec" id="param_product_mgmt_spec">
<input type="hidden" name="param_upg_no" id="param_upg_no">
</form>
<form name="form1" action="" method="post">
<div class="content-box">
<div class="content-box-s">
<div class="plm_menu_name">
<h2>
<span>제품관리_PART 및 구조등록</span>
</h2>
</div>
<%-- <div id="plmSearchZon">
<table>
<tr>
<td><label for="customer_cd">고객사</label></td>
<td>
<select name="customer_cd" id="customer_cd" style="width:170px" class="select2" autocomplete="off">
<option value="">선택</option>
${code_map.customer_cd}
</select>
</td>
<td><label for="project_name">당사프로젝트번호</label></td>
<td>
<select name="project_name" id="project_name" style="width:230px" class="select2" autocomplete="off">
</select>
</td>
<td><label for="unit_code">유닛명</label></td>
<td>
<select name="unit_code" id="unit_code" style="width:350px" class="select2" autocomplete="off">
</select>
</td>
<td class="align_r">
<label>등록자</label>
</td>
<td>
<select name="SEARCH_WRITER" id="SEARCH_WRITER" style="width:190px;" autocomplete="off" class="select2"></select>
</td>
</tr>
<tr>
<td class="align_r">
<label>배포일</label>
</td>
<td>
<input type="text" name="SEARCH_DEPLOY_DATE_FROM" id="SEARCH_DEPLOY_DATE_FROM" style="width:90px;" autocomplete="off" value="${param.SEARCH_DEPLOY_DATE_FROM}">~
<input type="text" name="SEARCH_DEPLOY_DATE_TO" id="SEARCH_DEPLOY_DATE_TO" style="width:90px;" autocomplete="off" value="${param.SEARCH_DEPLOY_DATE_TO}">
</td>
<td><label for="status">상태</label></td>
<td>
<select id="status" name="status" class="select2" style="width:170px;">
<option value="">선택</option>
<option value="create" ${param.status eq 'create'?'selected':''}>등록중</option>
<option value="deploy" ${param.status eq 'deploy'?'selected':''}>배포완료</option>
</select>
</td>
</tr>
</table>
</div>
<div class="contents_page_basic_margin">
<div class="btn_wrap">
<div class="plm_btn_wrap">
<!-- <input type="button" value="Bom Copy" class="plm_btns" id="btnBomCopy"> -->
<!-- <input type="button" value="구조 등록" class="plm_btns" id="btnSetStructure"> -->
<input type="button" value="배포" class="plm_btns" id="btnDeploy">
<input type="button" value="삭제" class="plm_btns" id="btnDelete">
<input type="button" value="구조등록" class="plm_btns" onclick="saveexcelpop();">
<input type="button" value="조회" class="plm_btns" id="btnSearch">
</div>
</div>
<div class="ascendig_text">
<font size="2px">총 ${fn:length(LIST)}건</font>
</div>
<div class="in_table_scroll_wrap _table1" style="height:625px;width:99.4%;">
<div>
<table class="plm_table">
<colgroup>
<col width="30px" />
<col width="50px" />
<col width="150px" />
<col width="180px" />
<col width="160px" />
<col width="240px" />
<col width="60px" />
<col width="150px" />
<col width="100px" />
<col width="100px" />
<col width="100px" />
<col width="100px" />
<col width="100px" />
<col width="*%" />
</colgroup>
<tr class="plm_thead">
<td><input type="checkbox" id="allCheck" class="checkBox"></td>
<td>순</td>
<td>고객사</td>
<td>고객사프로젝트명</td>
<td>당사프로젝트번호</td>
<td>유닛명</td>
<td>BOM</td>
<td>등록자</td>
<td>등록일</td>
<td>배포일</td>
<td>Revision</td>
<td>Eo No</td>
<td>Eo Date</td>
<td>상태</td>
</tr>
</table>
<div class="in_table_scroll_wrap _table2" style="width:100%; height:600px;">
<table class="plm_table">
<colgroup>
<col width="30px" />
<col width="50px" />
<col width="150px" />
<col width="180px" />
<col width="160px" />
<col width="240px" />
<col width="60px" />
<col width="150px" />
<col width="100px" />
<col width="100px" />
<col width="100px" />
<col width="100px" />
<col width="100px" />
<col width="*%" />
</colgroup>
<c:choose>
<c:when test="${!empty LIST}">
<c:forEach var="item" items="${LIST}" varStatus="status">
<tr>
<td><input type="checkbox" name="OBJID" value="${item.OBJID}" data-WRITER="${item.WRITER}"></td>
<td>${item.RNUM}</td>
<td style="text-align:left; padding-left: 10px;">${item.CUSTOMER_NAME}</td>
<td style="text-align:left; padding-left: 10px;">${item.CUSTOMER_PROJECT_NAME}</td>
<td style="text-align:left; padding-left: 10px;">${item.PROJECT_NO}</td>
<td style="text-align:left; padding-left: 10px;">${item.UNIT_NAME}</td>
<td><a href="#" class="btnDetail file_${info.BOM_CNT eq 0?'empty_':''}icon" data-OBJID="${item.OBJID}"></a></td>
<td style="text-align:left; padding-left: 10px;">${item.DEPT_NAME}/${item.USER_NAME}</td>
<td>${item.REG_DATE}</td>
<td>${item.DEPLOY_DATE}</td>
<td>${item.REVISION}</td>
<td>${item.EO_NO}</td>
<td>${item.EO_DATE}</td>
<td>${item.STATUS_TITLE}</td>
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<tr>
<td colspan="14" align="center">조회된 정보가 없습니다.</td>
</tr>
</c:otherwise>
</c:choose>
</table>
</div>
</div>
</div>
</div>
</div>
</div> --%>
<div id="plmSearchZon">
<table>
<tr>
<td><label for="customer_cd">고객사</label></td>
<td>
<select name="customer_cd" id="customer_cd" style="width:170px" class="select2" autocomplete="off">
<option value="">선택</option>
${code_map.customer_cd}
</select>
</td>
<td><label for="project_name">당사프로젝트번호</label></td>
<td>
<select name="project_name" id="project_name" style="width:230px" class="select2" autocomplete="off">
</select>
</td>
<td><label for="unit_code">유닛명</label></td>
<td>
<select name="unit_code" id="unit_code" style="width:350px" class="select2" autocomplete="off">
</select>
</td>
<td class="align_r">
<label>등록자</label>
</td>
<td>
<select name="SEARCH_WRITER" id="SEARCH_WRITER" style="width:190px;" autocomplete="off" class="select2"></select>
</td>
</tr>
<tr>
<td class="align_r">
<label>배포일</label>
</td>
<td>
<input type="text" name="SEARCH_DEPLOY_DATE_FROM" id="SEARCH_DEPLOY_DATE_FROM" style="width:90px;" autocomplete="off" value="${param.SEARCH_DEPLOY_DATE_FROM}">~
<input type="text" name="SEARCH_DEPLOY_DATE_TO" id="SEARCH_DEPLOY_DATE_TO" style="width:90px;" autocomplete="off" value="${param.SEARCH_DEPLOY_DATE_TO}">
</td>
<td><label for="status">상태</label></td>
<td>
<select id="status" name="status" class="select2" style="width:170px;">
<option value="">선택</option>
<option value="create" ${param.status eq 'create'?'selected':''}>등록중</option>
<option value="deploy" ${param.status eq 'deploy'?'selected':''}>배포완료</option>
</select>
</td>
</tr>
</table>
</div>
<section class="contents_page_basic_margin">
<div class="btn_wrap">
<div class="plm_btn_wrap">
<input type="button" value="배포" class="plm_btns" id="btnDeploy">
<input type="button" value="삭제" class="plm_btns" id="btnDelete">
<input type="button" value="구조등록" class="plm_btns" onclick="saveexcelpop();">
<input type="button" value="조회" class="plm_btns" id="btnSearch">
</div>
</div>
<div class="plm_table_wrap" style="height:600px">
<div>
<table class="plm_table">
<colgroup>
<col width="30px" />
<col width="50px" />
<col width="150px" />
<col width="180px" />
<col width="160px" />
<col width="240px" />
<col width="60px" />
<col width="150px" />
<col width="100px" />
<col width="100px" />
<col width="100px" />
<!-- <col width="100px" /> -->
<col width="*%" />
<col width="100px" />
</colgroup>
<thead>
<tr class="plm_thead">
<td><input type="checkbox" id="allCheck" class="checkBox"></td>
<td>순</td>
<td>고객사</td>
<td>고객사프로젝트명</td>
<td>당사프로젝트번호</td>
<td>유닛명</td>
<td>BOM</td>
<td>등록자</td>
<td>등록일</td>
<td>배포일</td>
<td>Version</td>
<!-- <td>Eo No</td>
<td>Eo Date</td> -->
<td>배포사유</td>
<td>상태</td>
</tr>
</thead>
<tbody>
<c:choose>
<c:when test="${0 < LIST.size()}">
<c:forEach var="item" items="${LIST}">
<tr>
<td><input type="checkbox" name="OBJID" value="${item.OBJID}" data-WRITER="${item.WRITER}" data-OBJID_SUB_TASK="${item.OBJID}"></td>
<td>${item.RNUM}</td>
<td style="text-align:left; padding-left: 10px;">${item.CUSTOMER_NAME}</td>
<td style="text-align:left; padding-left: 10px;">${item.CUSTOMER_PROJECT_NAME}</td>
<td style="text-align:left; padding-left: 10px;">${item.PROJECT_NO}</td>
<td style="text-align:left; padding-left: 10px;">${item.UNIT_NAME}</td>
<td><a href="#" class="btnDetail file_${info.BOM_CNT eq 0?'empty_':''}icon" data-OBJID="${item.OBJID}"></a></td>
<td style="text-align:left; padding-left: 10px;">${item.DEPT_NAME}/${item.USER_NAME}</td>
<td>${item.REG_DATE}</td>
<td>${item.DEPLOY_DATE}</td>
<%-- <td>${item.REVISION}</td> --%>
<c:choose>
<c:when test="${empty item.REVISION and empty item.REVISION }">
<td class="align_l"></td>
</c:when>
<c:when test="${item.REVISION == 'RE'}">
<td>${item.REVISION}</td>
</c:when>
<c:otherwise>
<td>${item.REVISION}차</td>
</c:otherwise>
</c:choose>
<%-- <td>${item.EO_NO}</td>
<td>${item.EO_DATE}</td> --%>
<td>${item.NOTE}</td>
<td>${item.STATUS_TITLE}</td>
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<tr>
<td colspan="13">조회된 정보가 없습니다.</td>
</tr>
</c:otherwise>
</c:choose>
</tbody>
</table>
</div>
</div>
<div class="pdm_page">
<input type="hidden" name="page" id="page" value="${nPage}">
<c:if test="${!empty LIST}">
<div class="page_pro">
<table>
<tr>
<c:choose>
<c:when test="${nPage > 1}">
<td><a href="javascript:fnc_goPrev('${prevPage}');">prev</a></td>
</c:when>
<c:otherwise>
<td class="no_more_page">prev</td>
</c:otherwise>
</c:choose>
<c:forEach var="v" begin="${nPage>5?nPage-5:1}" end="${nPage>5?nPage+4:10}" step="1" varStatus="status">
<c:if test="${status.index -1 < maxPage}">
<c:choose>
<c:when test="${status.index eq nPage}">
<td><a href="#" class="now_page">${nPage}</a></td>
</c:when>
<c:otherwise>
<td><a href="javascript:fnc_goPage('${status.index}');">${status.index}</a></td>
</c:otherwise>
</c:choose>
</c:if>
</c:forEach>
<c:choose>
<c:when test="${nPage < maxPage}">
<td><a href="javascript:fnc_goNext('${nextPage}');">next</a></td>
</c:when>
<c:otherwise>
<td class="no_more_page">next</td>
</c:otherwise>
</c:choose>
</tr>
</table>
<p id="adminPageCount">총 ${totalCount}건</p>
</div>
</c:if>
</div>
</section>
</div>
</div>
</form>
</body>
</html>