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

473 lines
19 KiB
Plaintext

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.pms.common.utils.*"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ page import="java.util.*" %>
<%@include file= "/init.jsp" %>
<%
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
String connector = person.getUserId();
%>
<!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}" />
<c:set var="now" value="<%=new java.util.Date() %>"/>
<c:set var="sysYear"><fmt:formatDate value="${now}" pattern="yyyy" /></c:set>
<c:set var="connector" value="<%=connector %>" />
<style type="text/css">
::-webkit-scrollbar-thumb {
background: linear-gradient(to bottom, #f5d78e, #f5d78e);
}
</style>
<script type="text/javascript">
$(function() {
$(document).ready(function() {
$("._table1").scroll(function () {
$("._table2").scrollLeft($("._table1").scrollLeft());
});
$("._table2").scroll(function () {
$("._table1").scrollLeft($("._table2").scrollLeft());
});
fnc_datepick();
$("input[type=text]").keyup(function(e) {
if (e.keyCode == 13)
fn_search();
});
$("#btnReg").click(function(){
openPartMngPopup("");
});
$("#btnDelete").click(function(){
fn_deletePartMng();
});
$("#btnDeploy").click(function(){
fn_partMngDeploy();
});
//image src encoding
$("img").each(function(i) {
var imgSrc = $(this).attr("data-SRC");
$(this).attr("src", encodeURI(imgSrc));
});
//체크박스 전체선택/전체해제
$("#allCheck").click(function() {
if ($("#allCheck").prop("checked")) {
$("input[type=checkbox]").prop("checked", true);
} else {
$("input[type=checkbox]").prop("checked", false);
}
});
$("#btnSearch").click(function() {
/* if($("#product_code").val()==""){
Swal.fire('기종을 선택해주세요');
return;
} */
fn_search();
});
$("#btnConnectFile").click(function() {
var form = document.form1;
form.action = "/partMng/partConnectDrawingFile.do";
form.submit();
});
$("#btnExcel").click(function() {
fn_excel();
});
$("#product_code").change(function(){
fnc_productUPGNEWList(this.value,"","upg_no", "");
});
if("${param.product_code}"!=""){
fnc_productUPGNEWList("${param.product_code}","","upg_no", "");
$("#upg_no").val("${param.upg_no}");
}
fnc_getCodeListAppend("<%=Constants.PART_TYPE_CODE%>","SEARCH_PART_TYPE","${param.SEARCH_PART_TYPE}");
$("#SEARCH_REVISION_RELEASE").val("${param.SEARCH_REVISION_RELEASE}");
if("${param.SEARCH_REVISION_RELEASE}"==""){
$("#SEARCH_REVISION_RELEASE").val("0");
}
$('.select2').select2();
//첨부팝업
$(".File").click(function(){
var popup_width = 800;
var popup_height = 335;
var objId = $(this).attr("data-OBJID");
var docType =$(this).attr("data-docType");
var docTypeName = $(this).attr("data-docTypeName");
var params = "?targetObjId="+objId+"&docType="+docType+"&docTypeName="+docTypeName;
var url = "/projectConcept/FileRegistPopup.do"+params;
fn_centerPopup(popup_width, popup_height, url);
});
});
});
function fn_deletePartMng() {
var selectedPart = $("input[name=OBJID]:checked");
if(0 < selectedPart.length){
if(confirm("선택된 Part를 삭제하시겠습니까?")){
$.ajax({
url:"/partMng/partMngDelete.do",
type:"POST",
data:$("#form1").serialize(),
dataType:"json",
success:function(data){
Swal.fire(data.msg);
fn_search();
},
error: function(jqxhr, status, error){
}
});
}
}else{
Swal.fire("선택된 Part가 없습니다.");
return false;
}
}
function openPartMngPopup(objId){
var popup_width = 600;
var popup_height = 500;
var hiddenForm = document.hiddenForm;
var url = "/partMng/partMngFormPopUp.do";
if("" != objId){
url = "/partMng/partMngDetailPopUp.do";
}
var target = "partMngPopUp";
fn_centerPopup(popup_width, popup_height, url, target);
hiddenForm.action = url;
hiddenForm.OBJID.value = objId;
hiddenForm.target = target;
hiddenForm.submit();
}
function fn_search() {
document.form1.action = "/partMng/partMngList.do";
document.form1.submit();
}
function fn_excel() {
document.form1.actionType.value = "excel";
fn_search();
}
// function fn_excel() {
// document.form1.actionType.value = "excel";
// fn_search();
// }
</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" method="post">
<input type="hidden" name="search" id="search" value="Y">
<input type="hidden" name="actionType" id="actionType">
<div>
<div class="content-box">
<div class="content-box-s">
<div class="plm_menu_name">
<h2>
<span>제품관리_PART 조회</span>
</h2>
</div>
<div id="plmSearchZon">
<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="">UPG_NO</label></td> -->
<!-- <td> -->
<!-- <select name="upg_no" id="upg_no" class="select2" style="width:250px;" autocomplete="off"></select> -->
<!-- </td> -->
<td><label for="">품번</label></td>
<td>
<input type="text" name="SEARCH_PART_NO" id="SEARCH_PART_NO" style="width:194px;" autocomplete="off" value="${param.SEARCH_PART_NO}">
</td>
<td><label for="">품명</label></td>
<td>
<input type="text" name="SEARCH_PART_NAME" id="SEARCH_PART_NAME" style="width:150px;" autocomplete="off" value="${param.SEARCH_PART_NAME}">
</td>
<td><label for="">Revision</label></td>
<td colspan="7">
<select name="SEARCH_REVISION_RELEASE" id="SEARCH_REVISION_RELEASE" style="width:150px;" autocomplete="off">
<option value="1">current</option>
<option value="0">all</option>
</select>
</td>
<td><label for="">재질</label></td>
<td>
<input type="text" name="SEARCH_MATERIAL" id="SEARCH_MATERIAL" style="width:150px;" autocomplete="off" value="${param.SEARCH_MATERIAL}">
</td>
<td><label for="">사양(규격)</label></td>
<td>
<input type="text" name="SEARCH_SPEC" id="SEARCH_SPEC" style="width:150px;" autocomplete="off" value="${param.SEARCH_SPEC}">
</td>
<!-- <td><label for="">EO No.</label></td> -->
<!-- <td> -->
<%-- <input type="text" name="SEARCH_EO" id="SEARCH_EO" style="width:150px;" autocomplete="off" value="${param.SEARCH_EO}"> --%>
<!-- </td> -->
<%-- <td><label for="">최초설계일</label></td>
<td>
<input type="text" name="SEARCH_DESIGN_DATE_FROM" id="SEARCH_DESIGN_DATE_FROM" style="width:90px;" autocomplete="off" value="${param.SEARCH_DESIGN_DATE_FROM}">~
<input type="text" name="SEARCH_DESIGN_DATE_TO" id="SEARCH_DESIGN_DATE_TO" style="width:90px;" autocomplete="off" value="${param.SEARCH_DESIGN_DATE_TO}">
</td> --%>
<td><label for="">부품 유형</label></td>
<td>
<select name="SEARCH_PART_TYPE" id="SEARCH_PART_TYPE" style="width:150px;" autocomplete="off"></select>
</td>
</tr>
</tbody>
</table>
</div>
<div class="contents_page_basic_margin">
<div class="btn_wrap">
<div class="plm_btn_wrap">
<!-- <input type="button" value="파일연결" class="plm_btns" id="btnConnectFile"> -->
<!--
<input type="button" value="등록" class="plm_btns" id="btnReg">
-->
<input type="button" value="삭제" class="plm_btns" id="btnDelete">
<input type="button" value="조회" class="plm_btns" id="btnSearch">
<input type="button" value="Excel Download" class="plm_btns" id="btnExcel">
</div>
</div>
<div class="plm_table_wrap" style="height:600px">
<table class="plm_table">
<colgroup>
<col width="30px" />
<col width="30px" /> <!-- 순 -->
<col width="140px" /> <!-- 품번 -->
<col width="100px" /> <!-- 품명 -->
<col width="30px" /> <!-- Qty -->
<col width="50px" /> <!-- 3D -->
<col width="50px" /> <!-- 2D -->
<col width="50px" /> <!-- 2D PDF -->
<col width="70px" /> <!-- Material -->
<col width="190px" /> <!-- SPEC. -->
<col width="90px" /> <!-- MAKER. -->
<col width="70px" /> <!-- Revision -->
<col width="75px" /> <!-- EO no -->
<col width="75px" /> <!-- EO Date -->
<col width="70px" /> <!-- 부품 유향 -->
</colgroup>
<thead>
<tr class="plm_thead">
<td><input type="checkbox" id="allCheck" class="checkBox"></td>
<td>순 </td>
<td>품명</td>
<td>품번 </td>
<td>수량</td>
<td>3D</td>
<td>2D</td>
<td>PDF</td>
<td>재질</td>
<td>사양(규격)</td>
<td>MAKER</td>
<td>Revision</td>
<td>EO No</td>
<td>EO Date</td>
<td>PART 구분</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-STATUS="${item.STATUS_TITLE}" data-WRITER="${item.WRITER}" data-PART_NO="${item.PART_NO}" data-REVISION="${item.REVISION}"></td>
<td>${item.RNUM}</td><!-- 순 -->
<td title="${item.PART_NAME}" class="align_l" style="text-align: left; padding-left: 10px;">${item.PART_NAME}</td><!-- 품명 -->
<td title="${item.PART_NO}" class="align_l" style="text-align: left; padding-left: 10px;"><a href="#" onclick="openPartMngPopup('${item.OBJID}');">${item.PART_NO}</a></td><!-- 품번 -->
<td title="${item.QTY}" class="align_c">${item.QTY}</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><a href="#" class="File file_${item.CU01_CNT eq 0?'empty_':''}icon" data-OBJID="${item.OBJID}" data-docType="3D_CAD" data-docTypeName="3D CAD 첨부파일"></a></td>
<td><a href="#" class="File file_${item.CU02_CNT eq 0?'empty_':''}icon" data-OBJID="${item.OBJID}" data-docType="2D_DRAWING_CAD" data-docTypeName="2D(Drawing) CAD 첨부파일"></a></td>
<td><a href="#" class="File file_${item.CU03_CNT eq 0?'empty_':''}icon" data-OBJID="${item.OBJID}" data-docType="2D_PDF_CAD" data-docTypeName="2D(PDF) CAD 첨부파일"></a></td>
<td title="${item.MATERIAL}" class="align_l" style="text-align: left; padding-left: 10px;">${item.MATERIAL}</td><!-- 재질 -->
<td title="${item.SPEC}" class="align_l" style="text-align: left; padding-left: 10px;">${item.SPEC}</td><!-- SPEC -->
<td title="${item.MAKER}" class="align_l" style="text-align: left; padding-left: 10px;">${item.MAKER}</td><!-- SPEC -->
<td title="${item.REVISION}" class="align_l" style="text-align: left; padding-left: 10px;">${item.REVISION}</td><!-- REVISION -->
<td title="${item.EO_NO}" class="align_c">${item.EO_NO}</td><!-- REVISION -->
<td title="${item.EO_DATE}" class="align_c">${item.EO_DATE}</td><!-- REVISION -->
<td title="${item.PART_TYPE_TITLE}" class="align_c">${item.PART_TYPE_TITLE}</td><!-- SIZE -->
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<tr>
<td colspan="15">조회된 정보가 없습니다.</td>
</tr>
</c:otherwise>
</c:choose>
</tbody>
</table>
<%-- <div class="in_table_scroll_wrap _table2" style="height:600px;width:100%;">
<table class="plm_table">
<colgroup>
<col width="30px" />
<col width="30px" /> <!-- 순 -->
<col width="140px" /> <!-- 품번 -->
<col width="100px" /> <!-- 품명 -->
<col width="30px" /> <!-- Qty -->
<col width="50px" /> <!-- 3D -->
<col width="50px" /> <!-- 2D -->
<col width="50px" /> <!-- 2D PDF -->
<col width="70px" /> <!-- Material -->
<col width="190px" /> <!-- SPEC. -->
<col width="90px" /> <!-- MAKER. -->
<col width="70px" /> <!-- Revision -->
<col width="75px" /> <!-- EO no -->
<col width="75px" /> <!-- EO Date -->
<col width="70px" /> <!-- 부품 유향 -->
</colgroup>
<c:choose>
<c:when test="${empty LIST}">
<tr style="text-align: center;">
<td align="center" colspan="19">조회된 데이터가 없습니다.</td>
</tr>
</c:when>
<c:otherwise>
<c:forEach var="item" items="${LIST}" varStatus="varStatus">
<tr>
<td><input type="checkbox" name="OBJID" value="${item.OBJID}" data-STATUS="${item.STATUS_TITLE}" data-WRITER="${item.WRITER}" data-PART_NO="${item.PART_NO}" data-REVISION="${item.REVISION}"></td>
<td>${item.RNUM}</td><!-- 순 -->
<td title="${item.PART_NAME}" class="align_l" style="text-align: left; padding-left: 10px;">${item.PART_NAME}</td><!-- 품명 -->
<td title="${item.PART_NO}" class="align_l" style="text-align: left; padding-left: 10px;"><a href="#" onclick="openPartMngPopup('${item.OBJID}');">${item.PART_NO}</a></td><!-- 품번 -->
<td title="${item.QTY}" class="align_c">${item.QTY}</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><a href="#" class="File file_${item.CU01_CNT eq 0?'empty_':''}icon" data-OBJID="${item.OBJID}" data-docType="3D_CAD" data-docTypeName="3D CAD 첨부파일"></a></td>
<td><a href="#" class="File file_${item.CU02_CNT eq 0?'empty_':''}icon" data-OBJID="${item.OBJID}" data-docType="2D_DRAWING_CAD" data-docTypeName="2D(Drawing) CAD 첨부파일"></a></td>
<td><a href="#" class="File file_${item.CU03_CNT eq 0?'empty_':''}icon" data-OBJID="${item.OBJID}" data-docType="2D_PDF_CAD" data-docTypeName="2D(PDF) CAD 첨부파일"></a></td>
<td title="${item.MATERIAL}" class="align_l" style="text-align: left; padding-left: 10px;">${item.MATERIAL}</td><!-- 재질 -->
<td title="${item.SPEC}" class="align_l" style="text-align: left; padding-left: 10px;">${item.SPEC}</td><!-- SPEC -->
<td title="${item.MAKER}" class="align_l" style="text-align: left; padding-left: 10px;">${item.MAKER}</td><!-- SPEC -->
<td title="${item.REVISION}" class="align_l" style="text-align: left; padding-left: 10px;">${item.REVISION}</td><!-- REVISION -->
<td title="${item.EO_NO}" class="align_c">${item.EO_NO}</td><!-- REVISION -->
<td title="${item.EO_DATE}" class="align_c">${item.EO_DATE}</td><!-- REVISION -->
<td title="${item.PART_TYPE_TITLE}" class="align_c">${item.PART_TYPE_TITLE}</td><!-- SIZE -->
</tr>
</c:forEach>
</c:otherwise>
</c:choose>
</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>
<c:if test="${!empty LIST}">
<p id="adminPageCount">총 ${totalCount}건</p>
</c:if>
</div>
</c:if>
</div>
</div>
</div>
</div>
</div>
</form>
</body>
</html>