ERP-node/WebContent/WEB-INF/view/materMgmt/materDetailList2.jsp

463 lines
15 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 %>" />
<script type="text/javascript">
$(function(){
$(document).ready(function(){
$('.select2').select2();
/* $('#projectno').select2();
$('#spec_cd').select2();
$('#process_cd').select2();
$('#sort_cd').select2();
$('#supply_cd').select2(); */
fnc_datepick();
$("input[type=text]").keyup(function(e){
if(e.keyCode == 13) search();
});
//image src encoding
$("img").each(function(i){
var imgSrc = $(this).attr("data-SRC");
$(this).attr("src", encodeURI(imgSrc));
});
$(".btnRevision").click(function(){
var partNo = $(this).attr("data-PART_NO");
fn_openPartListPop(partNo);
});
//체크박스 전체선택/전체해제
$("#allCheck").click(function(){
if($("#allCheck").prop("checked")) {
$("input[type=checkbox]").prop("checked",true);
} else {
$("input[type=checkbox]").prop("checked",false);
}
});
$("#btnSearch").click(function(){
$("#page").val("1");
document.form1.actionType.value = "";
fn_search();
});
$("#btnExcel").click(function(){
document.form1.actionType.value = "excel";
fn_search();
});
$(".btnApprovalDetail").click(function(){
var approvalObjId = $(this).attr("data-APPROVAL_OBJID");
var routeObjId = $(this).attr("data-ROUTE_OBJID");
//Swal.fire("approvalObjId : "+approvalObjId+", routeObjId : "+routeObjId);
var params = "?approvalObjId="+approvalObjId;
params += "&routeObjId="+routeObjId;
//Swal.fire("params : "+params);
window.open("/approval/approvalDetail.do"+params,"approvalDetailPopup","width=650 height=760 menubar=no status=no");
});
});
});
function savepop(){
var url = "/partmgmt/partmgmtsaveFormPopup.do";
var target = "partmgmtsaveFormPopup";
window.open(url,target,"width=1300, height=550, menubars=no, scrollbars=yes, resizable=yes");
}
function excelExport(){
var form = document.form1;
form.target = "_self";
form.actionType.value = "excel"
form.action = "/partmgmt/partmgmtList.do";
form1.submit();
}
function openEOPopup(objId,actionType){
var hiddenForm = document.hiddenForm;
var target = "tempEoListPopup";
var url = "/eo/eoDetailViewPopup.do";
window.open("",target,"width=1500,height=700");
hiddenForm.objId.value = objId;
hiddenForm.actionType.value = actionType;
hiddenForm.action = url;
hiddenForm.target = target;
hiddenForm.submit();
}
function openImagePopUp(url){
var img=new Image();
img.src=url;
var img_width=img.width;
var img_height=img.height;
var win_width=img.width+25;
var height=img.height+30;
window.open(url,"partListShapeImgPopUp","width="+img_width+",height="+height+", menubars=no, scrollbars=yes, resizable=yes'");
}
//Revision 클릭 시 해당 파트의 모든 Revision을 보여준다.
function fn_openPartListPop(partNo){
window.open("/part/openRevisionPartPopUp.do?partNo="+partNo,"openPartListPop","width=1500 height=560 menubar=no status=no");
}
//수주활동 검색 기능
function fn_search(){
document.form1.action = "/materMgmt/materDetailList2.do";
document.form1.submit();
}
function fn_downmater(){
var partLength = $("input[name=partCheckBox]:checked").length;
if(0 < partLength){
var checkArr = new Array();
var statusFlag = false;
$("input[name=partCheckBox]:checked").each(function(){
var objId = fnc_checkNull($(this).attr("data-objId").replace(" ",""));
var ststus_cd = fnc_checkNull($(this).attr("data-STATUS_CD").replace(" ",""));
if(ststus_cd=="PURSTCD00600" || ststus_cd=="PURSTCD00700"){
checkArr.push(objId);
statusFlag = true;
}
});
if(1 < checkArr.length){
Swal.fire('1건씩만 발주서 다운로드가 가능합니다.');
return;
}
if(statusFlag){
document.form1.action = "/materMgmt/materOrderDown.do?objId="+checkArr[0];
document.form1.submit();
}else{
Swal.fire("발주다운 가능한 항목이 없습니다.");
}
}else{
Swal.fire("선택한 항목이 없습니다.");
}
}
function fn_relemater(){
var partLength = $("input[name=partCheckBox]:checked").length;
//초기화
$("#materOrdObjId").val("");
if(0 < partLength){
var checkArr = new Array();
var statusFlag = false;
$("input[name=partCheckBox]:checked").each(function(){
var objId = fnc_checkNull($(this).attr("data-objId").replace(" ",""));
var ststus_cd = fnc_checkNull($(this).attr("data-STATUS_CD").replace(" ",""));
if(ststus_cd=="PURSTCD00600"){
checkArr.push(objId);
statusFlag = true;
}
});
$("#materOrdObjId").val(checkArr);
if(statusFlag){
if(confirm("선택한 항목을 발주 하시겠습니까?")){
var param = $("#hiddenForm").serialize();
$.ajax({
type : "POST",
url : "/materMgmt/changeMaterOrdStatus.do",
data: param,
dataType:"json",
success:function(data){
if(data=="SUCCESS"){
Swal.fire("발주되었습니다.");
fn_search();
};
}
,error: function(jqxhr, status, error){
}
});
}
}else{
Swal.fire("발주가능한 항목이 없습니다.");
}
}else{
Swal.fire("발주가능한 항목이 없습니다.");
}
}
</script>
</head>
<body class="backcolor">
<form name="hiddenForm" id="hiddenForm" method="post">
<input type="hidden" name="actionType" id="actionType">
<input type="hidden" name="objId" id="objId">
<input type="hidden" name="objid" id="objid">
<input type="hidden" name="materRegObjId" id="materRegObjId">
<input type="hidden" name="materOrdObjId" id="materOrdObjId">
</form>
<form name="form1" id="form1" method="post">
<input type="hidden" name="actionType">
<input type="hidden" name="gubun" id="gubun" value="${param.gubun}">
<div class="content-box">
<div class="content-box-s">
<div class="plm_menu_name">
<h2>
<span>자재관리_입고현황</span>
</h2>
</div>
<div id="plmSearchZon">
<table>
<tbody>
<tr>
<td class="align_r">
<label for="" class="">Project No.</label>
</td>
<td>
<select name="projectno" id="projectno" style="width:200px;" class="select2" autocomplete="off">
<option value="">전체</option>
${code_map.projectno}
</select>
</td>
<td class="align_r">
<label for="" class="">부품구분</label>
</td>
<td>
<select name="sort_cd" id="sort_cd" style="width:140px;" class="select2" autocomplete="off">
<option value="">전체</option>
${code_map.sort_cd}
</select>
</td>
<td class="align_r">
<label for="" class="">공급업체</label>
</td>
<td>
<select name="supply_cd" id="supply_cd" style="width:230px;" class="select2" autocomplete="off">
<option value="">전체</option>
${code_map.supply_cd}
</select>
</td>
<td class="align_r">
<label for="" class="">발주자</label>
</td>
<td>
<select name="recv_userid" id="recv_userid" style="width:230px;" class="select2" autocomplete="off">
<option value="">전체</option>
${code_map.recv_userid}
</select>
</td>
<td class="align_r">
<label for="" class="">입고일</label>
</td>
<td class="input_sub_title">
<input type="text" id="search_fromDate" name="search_fromDate" autocomplete="off" class="date_icon" value="${param.search_fromDate}" style="!important;width:85px;">
~
<input type="text" id="search_toDate" name="search_toDate" autocomplete="off" class="date_icon" value="${param.search_toDate}" style="!important;width:85px;">
</td>
</tr>
</tbody>
</table>
</div>
<section class="contents_page_basic_margin">
<div class="btn_wrap">
<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"><font size="3px" color="red">※ 입고금액 합계 :&nbsp;<fmt:formatNumber value="${qtysum.SUM_SUP_PRICE}" pattern="#,###"/>&nbsp;원</font></div>
<div class="plm_table_wrap">
<!-- <table class="plm_table" style="width:2200px;overflow-x:scroll;"> -->
<table class="plm_table">
<colgroup>
<col width="13%" />
<col width="9%" />
<col width="15%" />
<col width="15%" />
<col width="15%" />
<col width="10%" />
<col width="5%" /> <!-- 수량 -->
<col width="10%" />
<col width="10%" />
<col width="10%" />
<col width="5%" /><!-- REV -->
<col width="8%" /><!-- -- -->
<col width="10%" />
<col width="10%" />
<col width="8%" /><!-- -- -->
<col width="10%" />
<col width="10%" />
<col width="7%" />
<col width="8%" />
<col width="10%" />
<col width="7%" />
<!-- <col width="8%" />
<col width="13%" /> -->
</colgroup>
<thead>
<tr class="plm_thead">
<td>발주번호</td>
<td>Project No.</td>
<td>품명</td>
<td>품번</td>
<td>규격(재질)</td>
<td>제조사</td>
<td>수량</td>
<td>후처리</td>
<td>부품구분</td>
<td>공급업체</td>
<td>Rev</td>
<td>단가</td>
<td>공급금액</td>
<td>입고요청일</td>
<td>발주자</td>
<td>발주일</td>
<td>입고일</td>
<td>입고수량</td>
<td>인수자</td>
<td>인수일</td>
<td>인수수량</td>
<!-- <td>입고단가</td>
<td>공급가</td> -->
</tr>
</thead>
<c:choose>
<c:when test="${empty LIST}">
<tr style="text-align:center;">
<td align="center" colspan="21">조회된 데이터가 없습니다.</td>
</tr>
</c:when>
<c:otherwise>
<c:forEach var="item" items="${LIST}" varStatus="varStatus">
<tr>
<td title="${item.ORDER_NO}">${item.ORDER_NO}</td>
<td title="${item.PROJECT_NO}">${item.PROJECT_NO}</td>
<td title="${item.PART_NAME}" style="text-align:left;">${item.PART_NAME}</td>
<td title="${item.PART_NO}" style="text-align:left;">${item.PART_NO}</td>
<td title="${item.SPEC_CD}" style="text-align:left;">${item.SPEC_CD}</td>
<td title="${item.MFA_CD}" style="text-align:left;">${item.MFA_CD}</td>
<td title="${item.QTY}"><fmt:formatNumber value="${item.QTY}" pattern="#,###"/></td>
<td title="${item.PROCESS_NAME}">${item.PROCESS_NAME}</td>
<td title="${item.SORT_NAME}">${item.SORT_NAME}</td>
<td title="${item.SUP_NAME}" style="text-align:left;">${item.SUP_NAME}</td>
<td title="${item.REV}">${item.REV}</td>
<td align="right" title="${item.UNIT_PRICE1}"><fmt:formatNumber value="${item.UNIT_PRICE1}" pattern="#,###"/>${empty item.UNIT_PRICE1 ? '0':''}</td>
<td align="right" title="${item.PRICE1}"><fmt:formatNumber value="${item.PRICE1}" pattern="#,###"/>${empty item.PRICE1 ? '0':''}</td>
<td title="${item.RECV_DATE}">${item.RECV_DATE}</td>
<td title="${item.REG_USER_NAME}">${item.REG_USER_NAME}</td>
<td title="${item.ORDER_DATE}">${item.ORDER_DATE}</td>
<td title="${item.REC_DATE}">${item.REC_DATE}</td>
<td title="${item.RECEIVE_QTY}"><fmt:formatNumber value="${item.RECEIVE_QTY}" pattern="#,###"/></td>
<td title="${item.ACQ_USER_NAME}">${item.ACQ_USER_NAME}</td>
<td title="${item.ACQ_DATE}">${item.ACQ_DATE}</td>
<td title="${item.ACQ_QTY}">${item.ACQ_QTY}</td>
<%-- <td align="right" title="${item.RECV_PRICE}"><fmt:formatNumber value="${item.RECV_PRICE}" pattern="#,###"/>${empty item.RECV_PRICE ? '0':''}</td>
<td align="right" title="${item.SUP_PRICE}"><fmt:formatNumber value="${item.SUP_PRICE}" pattern="#,###"/>${empty item.SUP_PRICE ? '0':''}</td> --%>
</tr>
</c:forEach>
</c:otherwise>
</c:choose>
</table>
</div>
<div class="pdm_page">
<input type="hidden" name="page" id="page" value="${nPage}">
<c:if test="${!empty LIST}">
<div class="page_pro">
<table align="center">
<tr>
<c:choose>
<c:when test="${nPage > 1}">
<td><a href="javascript:fnc_goPrev('${prevPage}');">prev</a></td>
<td>&nbsp;&nbsp;&nbsp;</td>
</c:when>
<c:otherwise>
<td class="no_more_page">prev</td>
<td>&nbsp;&nbsp;&nbsp;</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>
<td>&nbsp;&nbsp;&nbsp;</td>
</c:when>
<c:otherwise>
<td><a href="javascript:fnc_goPage('${status.index}');">${status.index}</a></td>
<td>&nbsp;&nbsp;&nbsp;</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>
</section>
</div>
</div>
</form>
</body>
</html>