ERP-node/WebContent/WEB-INF/view/resourceMasterMng/resourceMasterMngList.jsp

375 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 %>" />
<script type="text/javascript">
$(function(){
$(document).ready(function(){
fnc_datepick();
$("input[type=text]").keyup(function(e){
if(e.keyCode == 13) search();
});
$("#btnReg").click(function(){
openResourceMasterMngPopUp("");
});
$("#btnDelete").click(function(){
fn_deleteCustomerMng();
});
//체크박스 전체선택/전체해제
$("#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");
fn_search();
});
$("#search_resource_title").change(function(){
$("#search_product_title").empty();
if("" != this.value){
fnc_getCodeListAppend(this.value,"search_product_title","");
}else{
$("#search_product_title").append("<option value=''>선택</option>");
}
});
//명칭기준정보 목록을 가져온다.
fnc_getCodeListAppend("<%=Constants.RESOURCE_TITLE_CD%>","search_resource_title","${param.search_resource_title}");
if("" != "${param.search_resource_title}"){
fnc_getCodeListAppend("${param.search_resource_title}","search_product_title","${param.search_product_title}");
}
//첨부팝업
$(".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_deleteCustomerMng(){
var objIdArr = $("input[name=resourceMasterObjId]:checked");
if(0 == objIdArr.length){
Swal.fire("선택된 대상이 없습니다.");
}else{
var checkArr = new Array();
var ngCnt = 0;
$("input[name=resourceMasterObjId]:checked").each(function(){
var objId = fnc_checkNull($(this).val().replace(" ",""));
checkArr.push(objId);
});
if(confirm("삭제하시겠습니까?")){
$.ajax({
type : "POST",
url : "/resourceMasterMng/deleteResourceMasterMng.do",
data: {"checkArr":checkArr.join()},
dataType:"json",
success:function(data){
Swal.fire(data.msg);
if(data.result =="true"){
fn_search();
}
}
,error: function(jqxhr, status, error){
}
});
}
}
}
function openResourceMasterMngPopUp(objId){
var popup_width = 1200;
var popup_height = 650;
var hiddenForm = document.hiddenForm;
var url = "/resourceMasterMng/resourceMasterMngFormPopUp.do";
if("" != objId){
url = "/resourceMasterMng/resourceMasterMngDetailPopUp.do";
}
var target = "resourceMasterMngPopUp";
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 = "/resourceMasterMng/resourceMasterMngList.do";
document.form1.submit();
}
function openFilePopup(objId,title,docType){
var popup_width = 600;
var popup_height = 250;
var hiddenForm = document.hiddenForm;
var url = "/resourceMasterMng/resourceMasterFilePopUp.do";
var target = "resourceMasterMng";
fn_centerPopup(popup_width, popup_height, url, target);
hiddenForm.action = url;
hiddenForm.DOC_TYPE.value = docType;
hiddenForm.TITLE.value = title;
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">
<input type="hidden" name="DOC_TYPE" id="DOC_TYPE">
<input type="hidden" name="TITLE" id="TITLE">
<input type="hidden" name="actionType" id="actionType">
<input type="hidden" name="division" id="division">
<input type="hidden" name="status" id="status">
</form>
<form name="form1" id="form1" method="post">
<input type="hidden" name="actionType">
<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><label for="Year">연도</label></td>
<td>
<select name="search_year" id="search_year" style="width:200px;" autocomplete="off">
<option value="">선택</option>
<c:forEach begin="${sysYear-4}" end="${sysYear}" var="req_year">
<option value="${req_year}"${param.search_year eq req_year ? 'selected':'' }>${req_year}</option>
</c:forEach>
</select>
</td>
<td><label for="">품번</label></td>
<td>
<input type="text" name="part_no" id="part_no" style="width:200px;" value="${param.part_no}">
</td>
<td><label for="">품명</label></td>
<td>
<input type="text" name="part_name" id="part_name" style="width:200px;" value="${param.part_name}">
</td>
<%-- <td><label for="">규격</label></td>
<td>
<input type="text" name="search_standard" id="search_standard" style="width:200px;" value="${param.search_standard}">
</td> --%>
</tr>
</tbody>
</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="btnReg">
<input type="button" value="조회" class="plm_btns" id="btnSearch">
<input type="button" value="삭제" class="plm_btns" id="btnDelete">
</div>
</div>
<div class="plm_table_wrap">
<div>
<table class="plm_table">
<colgroup>
<col width="2.5%" />
<col width="7%" /> <!-- 명칭 자재명 -->
<col width="7%" /> <!-- 품명 구분 -->
<col width="7%" /> <!-- 규격 -->
<col width="4%" /> <!-- 단위 -->
<col width="4%" /> <!-- Unit 길이(m) -->
<col width="4%" />
<col width="4%" />
<col width="4%" />
<col width="4%" />
<col width="4%" />
<col width="4%" />
<col width="8%" />
<col width="8%" /> <!-- Date -->
<col width="8%" /> <!-- 공급단가 -->
<col width="7%" /> <!-- 첨부파일 -->
<col width="5%" /> <!-- 비고 -->
<col width="*" /> <!-- 원단가 -->
</colgroup>
<thead>
<tr class="plm_thead">
<td rowspan="2"><input type="checkbox" name="allCheck"></td>
<td colspan="11">자재정보</td>
<td colspan="4">단가관리(원)</td>
<td rowspan="2">첨부파일</td> <!-- 첨부파일 -->
<td rowspan="2">비고</td> <!-- 비고 -->
</tr>
<tr class="plm_thead">
<td>품목</td> <!-- 명칭 -->
<td>품명</td> <!-- 품명 -->
<td>규격</td> <!-- 규격 -->
<td>재질</td> <!-- 단위 -->
<td>단위</td> <!-- Unit -->
<td>두께</td>
<td>가로</td>
<td>세로</td>
<td>외경</td>
<td>내경</td>
<td>길이</td>
<td>적용일</td> <!-- Date -->
<td>원단가</td> <!-- 원단가 -->
<td>판가(개인)</td> <!-- 원단가 -->
<td>판가(대리점)</td> <!-- 원단가 -->
</tr>
</thead>
<c:choose>
<c:when test="${empty LIST}">
<tr style="text-align:center;">
<td align="center" colspan="16">조회된 데이터가 없습니다.</td>
</tr>
</c:when>
<c:otherwise>
<c:forEach var="item" items="${LIST}" varStatus="varStatus">
<tr>
<td><input type="checkbox" name="resourceMasterObjId" value="${item.OBJID}"></td>
<td title="${item.PART_NO}">${item.PART_NO}</td>
<td title="${item.PART_NAME}">${item.PART_NAME}</td>
<td title="${item.SPEC}">${item.SPEC}</td>
<td title="${item.MATERIAL}">${item.MATERIAL}</td>
<td title="${item.UNIT}">${item.UNIT}</td>
<td title="${item.THICKNESS}">${item.THICKNESS}</td>
<td title="${item.WIDTH}">${item.WIDTH}</td>
<td title="${item.HEIGHT}">${item.HEIGHT}</td>
<td title="${item.OUT_DIAMETER}">${item.OUT_DIAMETER}</td>
<td title="${item.IN_DIAMETER}">${item.IN_DIAMETER}</td>
<td title="${item.LENGTH}">${item.LENGTH}</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.PART_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.PART_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.PART_OBJID}" data-docType="2D_PDF_CAD" data-docTypeName="2D(PDF) CAD 첨부파일"></a></td> --%>
<td title="${item.PRICE_REGDATE_TITLE}">${item.PRICE_REGDATE_TITLE}</td>
<td title="<fmt:formatNumber value="${item.UNIT_PRICE}"/>" style="text-align:right; padding-right: 5px;"><a href="#" onclick="openResourceMasterMngPopUp('${item.OBJID}');"><fmt:formatNumber value="${item.UNIT_PRICE}"/></a></td><!-- 등록자 -->
<td title="<fmt:formatNumber value="${item.PERSON_PRICE}"/>" style="text-align:right; padding-right: 5px;"><a href="#" onclick="openResourceMasterMngPopUp('${item.OBJID}');"><fmt:formatNumber value="${item.PERSON_PRICE}"/></a></td><!-- 등록자 -->
<td title="<fmt:formatNumber value="${item.AGENCY_PRICE}"/>" style="text-align:right; padding-right: 5px;"><a href="#" onclick="openResourceMasterMngPopUp('${item.OBJID}');"><fmt:formatNumber value="${item.AGENCY_PRICE}"/></a></td><!-- 등록자 -->
<td title=""><a href="#" onclick="openFilePopup('${item.OBJID}','첨부파일','RESOURCE_MASTER_MNG_FILE');">${0 < item.FILE_CNT ? '■':'□'}</a></td><!-- 수리내역 -->
<td title="${item.REMARK}" class='align_l'>${item.REMARK}</td>
</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 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>