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

380 lines
14 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() {
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));
});
$("#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);
});
fn_search();
});
});
var columns = [
{title:'OBJID', field:'OBJID' ,visible:false },
//{headerHozAlign : 'center', hozAlign : 'center', width : '30', title : '순', field : 'NUM' , headersorting:false},
//{headerHozAlign : 'center', hozAlign : 'left ', width : '100', title : '프로젝트번호', field : 'PROJECT_NO' },
//{headerHozAlign : 'center', hozAlign : 'left', /* width : '200', */title : '유닛명', field : 'UNIT_NAME' },
/*
{headerHozAlign : 'center', hozAlign : 'left', width : '140', title : '고객사', field : 'CUSTOMER_NAME' },
{headerHozAlign : 'center', hozAlign : 'left', width : '200', title : '고객사프로젝트명', field : 'CUSTOMER_PROJECT_NAME' },
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : 'E-BOM', field : 'BOM_CNT',
formatter: fnc_subInfoValueFormatter,
cellClick:function(e, cell){
var objId = fnc_checkNull(cell.getData().OBJID);
//var bomReportObjId = fnc_checkNull(cell.getData().BOM_REPORMECHANICAL_TYPET_OBJID);
fn_openSetStructure(objId);
}
},
*/
//{headerHozAlign : 'center', hozAlign : 'left', width : '125', title : '모품번', field : 'PARENT_PART_INFO' },
{headerHozAlign : 'center', hozAlign : 'left', width : '125', title : '품번', field : 'PART_NO',
formatter:fnc_createGridAnchorTag,
cellClick:function(e, cell){
var objid = fnc_checkNull(cell.getData().OBJID);
openPartMngPopup(objid);
}
},
{headerHozAlign : 'center', hozAlign : 'left', /* width : '270', */ title : '품명', field : 'PART_NAME' },
{headerHozAlign : 'center', hozAlign : 'center', width : '50', title : '수량', field : 'BOM_QTY' }, //Q_QTY QTY QTY_P
{headerHozAlign : 'center', hozAlign : 'center', width : '45', title : '3D', field : 'CU01_CNT',
formatter:fnc_subInfoValueFormatter,
cellClick:function(e, cell){
var objid = fnc_checkNull(cell.getData().OBJID);
var docType = '3D_CAD';
var docTypeName = '3D CAD 첨부파일';
fnc_fileDetailPopup(objid, docType, docTypeName);
}
},
{headerHozAlign : 'center', hozAlign : 'center', width : '45', title : '2D', field : 'CU02_CNT',
formatter:fnc_subInfoValueFormatter,
cellClick:function(e, cell){
var objid = fnc_checkNull(cell.getData().OBJID);
var docType = '2D_DRAWING_CAD';
var docTypeName = '2D(Drawing) CAD 첨부파일';
fnc_fileDetailPopup(objid, docType, docTypeName);
}
},
{headerHozAlign : 'center', hozAlign : 'center', width : '55', title : 'PDF', field : 'CU03_CNT',
formatter:fnc_subInfoValueFormatter,
cellClick:function(e, cell){
var objid = fnc_checkNull(cell.getData().OBJID);
var docType = '2D_PDF_CAD';
var docTypeName = '2D(PDF) CAD 첨부파일';
fnc_fileDetailPopup(objid, docType, docTypeName);
}
},
{headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '재질', field : 'MATERIAL' },
{headerHozAlign : 'center', hozAlign : 'left', width : '90', title : '사양(규격)', field : 'SPEC' },
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '후처리', field : 'POST_PROCESSING' },
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : 'MAKER', field : 'MAKER' },
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '대분류', field : 'MAJOR_CATEGORY' },
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '중분류', field : 'SUB_CATEGORY' },
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : 'Revision', field : 'REVISION' },
{headerHozAlign : 'center', hozAlign : 'center', width : '90', title : 'EO No', field : 'EO_NO' },
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : 'EO Date', field : 'EO_DATE' },
{headerHozAlign : 'center', hozAlign : 'center', width : '88', title : 'PART구분', field : 'PART_TYPE_TITLE' },
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '비고', field : 'REMARK' }
];
//var grid;
function fn_search(){
_tabulGrid = fnc_tabul_search(_tabul_layout_fitColumns, _tabulGrid, "/partMng/partMngGridList.do", columns, true, null, null, null, true);
}
function fn_deletePartMng() {
var selectedPart = _tabulGrid.getSelectedData();
var targetObjIdList = [];
if(0 < selectedPart.length){
for(var i = 0; i < selectedPart.length;i++){
var OBJID = fnc_checkNull(selectedPart[i].OBJID);
targetObjIdList.push(OBJID);
}
//if(confirm("선택된 Part를 삭제하시겠습니까?")){
Swal.fire({
title: '선택된 Part를 삭제하시겠습니까?',
text: '',
icon: 'warning',
showCancelButton: true, // cancel버튼 보이기. 기본은 원래 없음
confirmButtonColor: '#3085d6', // confrim 버튼 색깔 지정
cancelButtonColor: '#d33', // cancel 버튼 색깔 지정
confirmButtonText: '확인', // confirm 버튼 텍스트 지정
cancelButtonText: '취소', // cancel 버튼 텍스트 지정
reverseButtons: false, // 버튼 순서 거꾸로
}).then(result => {
// 만약 Promise리턴을 받으면,
if (result.isConfirmed) { // 만약 모달창에서 confirm 버튼을 눌렀다면
$.ajax({
url:"/partMng/partMngDelete.do",
type:"POST",
data:{
"checkArr":targetObjIdList.join()
},
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_excel() {
document.form1.actionType.value = "excel";
document.form1.action = "/partMng/partMngList.do";
document.form1.submit();
}
// function fn_excel() {
// document.form1.actionType.value = "excel";
// fn_search();
// }
function fn_FileRegist(objId, docType, docTypeName){
var popup_width = 800;
var popup_height = 335;
var objId = objId;
var docType = docType;
var docTypeName = docTypeName;
var params = "?targetObjId="+objId+"&docType="+docType+"&docTypeName="+docTypeName;
var url = "/projectConcept/FileRegistPopup.do"+params;
fn_centerPopup(popup_width, popup_height, url);
}
</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_gdnsi">
<h2>
<span>제품관리_PART 조회</span>
</h2>
<div class="btnArea">
<!-- <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 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>
<%@include file= "/WEB-INF/view/common/common_gridArea.jsp" %>
</div>
</div>
</form>
</body>
</html>