367 lines
11 KiB
Plaintext
367 lines
11 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();
|
|
|
|
fnc_datepick();
|
|
$("input[type=text]").keyup(function(e){
|
|
if(e.keyCode == 13) search();
|
|
});
|
|
|
|
//첨부파일 팝업
|
|
$(".File").click(function(){
|
|
var popup_width = 800;
|
|
var popup_height = 240;
|
|
|
|
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);
|
|
});
|
|
|
|
//제원 등록 팝업
|
|
$(".Spec").click(function(){
|
|
var objId = $(this).attr("data-OBJID");
|
|
var params = "?targetObjId="+objId;
|
|
window.open("/productmgmt/openSpecificationFormPopup.do"+params, "", "width=1270, height=920");
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
//체크박스 전체선택/전체해제
|
|
$("#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();
|
|
});
|
|
|
|
$("#btnDelete").click(function(){
|
|
fn_delete();
|
|
});
|
|
|
|
//영업활동 등록 팝업
|
|
$("#btnReg").click(function(){
|
|
var popup_width = 850;
|
|
var popup_height = 480;
|
|
var url = "/productmgmt/productmgmtUpdateFormPopup.do?actionType=regist";
|
|
|
|
fn_centerPopup(popup_width, popup_height, url);
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
function openProductFormPopup(objId){
|
|
var popup_width = 850;
|
|
var popup_height = 480;
|
|
|
|
var hiddenForm = document.hiddenForm;
|
|
var url = "/productmgmt/productmgmtUpdateFormPopup.do";
|
|
var target = "productmgmtUpdateFormPopup";
|
|
|
|
fn_centerPopup(popup_width, popup_height, url, target);
|
|
hiddenForm.action = url;
|
|
hiddenForm.objId.value = objId;
|
|
hiddenForm.target = target;
|
|
hiddenForm.submit();
|
|
}
|
|
|
|
function releproduct(){
|
|
var partLength = $("input[name=partCheckBox]:checked").length;
|
|
if(0 < partLength){
|
|
if(confirm("해당제품을 배포하시겠습니까?")){
|
|
var param = $("#form1").serialize();
|
|
$.ajax({
|
|
type : "POST",
|
|
url : "/productmgmt/changeMultiproductStatus.do",
|
|
data: param,
|
|
dataType:"json",
|
|
async:false,
|
|
error: function(jqxhr, status, error){
|
|
Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
|
|
Swal.fire(jqxhr.status);
|
|
Swal.fire(jqxhr.responseText);
|
|
},
|
|
success: function(result){
|
|
if(result=="SUCCESS"){
|
|
Swal.fire('배포되었습니다.');
|
|
fn_search();
|
|
}
|
|
}
|
|
});
|
|
}
|
|
}else{
|
|
Swal.fire("선택된 제품이 없습니다.");
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
function fn_delete(){
|
|
var partLength = $("input[name=partCheckBox]:checked").length;
|
|
//초기화
|
|
$("#productobjid").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(" ",""));
|
|
checkArr.push(objId);
|
|
statusFlag = true;
|
|
});
|
|
|
|
$("#productobjid").val(checkArr);
|
|
|
|
if(statusFlag){
|
|
|
|
//if(confirm("기등록된 제품사양&BOM&PART도 함께 삭제 됩니다. 삭제 하시겠습니까?")){
|
|
|
|
var param = $("#hiddenForm").serialize();
|
|
$.ajax({
|
|
type : "POST",
|
|
url : "/productmgmt/productDelete.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("선택한 항목이 없습니다.");
|
|
}
|
|
|
|
|
|
}
|
|
|
|
//검색
|
|
function fn_search(){
|
|
document.form1.action = "/productmgmt/productmgmtList.do";
|
|
document.form1.submit();
|
|
}
|
|
|
|
|
|
//옵션 상세
|
|
function fn_History(objId){
|
|
window.open("/productmgmt/productPriceHistory.do?objId="+objId, "", "width=650, height=600","menubars=no, scrollbars=yes, resizable=yes");
|
|
}
|
|
|
|
|
|
|
|
</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="productobjid" id="productobjid">
|
|
</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 class="align_r"><label for="" class="">년도</label></td>
|
|
<td>
|
|
<select name="Year" id="Year" style="width:80px;" class="select2" autocomplete="off">
|
|
<option value="">선택</option>
|
|
<c:forEach begin="${sysYear-4}" end="${sysYear}" var="req_year">
|
|
<option value="${req_year}"${param.Year eq req_year ? 'selected':'' }>${req_year}</option>
|
|
</c:forEach>
|
|
</select>
|
|
</td>
|
|
|
|
<td class="align_r"><label for="" class="">사업부</label></td>
|
|
<td>
|
|
<select name="product_category" id="product_category" style="width: 150px;" class="select2" autocomplete="off">
|
|
<option value="">전체</option>
|
|
${code_map.product_category}
|
|
</select>
|
|
</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 Upload" class="plm_btns" onclick="saveexcelpop()"> -->
|
|
|
|
<!-- <input type="button" value="import" class="plm_btns" onclick="fn_import();"> -->
|
|
|
|
<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">
|
|
</div>
|
|
</div>
|
|
<div class="plm_table_wrap">
|
|
<div>
|
|
<table class="plm_table">
|
|
<colgroup>
|
|
<col width="2%" />
|
|
<col width="8%" />
|
|
<col width="5%" />
|
|
<col width="8%" />
|
|
<col width="8%" />
|
|
|
|
<col width="5%" />
|
|
<col width="5%" />
|
|
<col width="5%" />
|
|
<col width="5%" />
|
|
</colgroup>
|
|
<thead>
|
|
<tr class="plm_thead">
|
|
<td><input type="checkbox" id="allCheck" class="checkBox" style="width:15px;height:15px"></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="20">조회된 데이터가 없습니다.</td>
|
|
</tr>
|
|
</c:when>
|
|
<c:otherwise>
|
|
<c:forEach var="item" items="${LIST}" varStatus="varStatus">
|
|
<tr>
|
|
<td><input style="width:15px;height:15px" type="checkbox" value="${item.OBJID}" name="partCheckBox" id="partCheckBox" data-objId="${item.OBJID}"></td>
|
|
<td><a href="#" onclick="openProductFormPopup('${item.OBJID}')">${item.PRODUCT_CATEGORY_NAME}</a></td>
|
|
<td style="text-align:left; padding-left: 10px;">${item.PRODUCT_TYPE_NAME}</td>
|
|
<td style="text-align:left; padding-left: 10px;">${item.PRODUCT_NAME}</td><!-- 제품명 -->
|
|
<td style="text-align:left; padding-left: 10px;">${item.PRODUCT_CODE}</td><!-- 제품코드 -->
|
|
|
|
<td>${item.WRITER_NAME}</td>
|
|
<td>${item.REGDATE}</td>
|
|
<td>${item.PRODUCTION_FLAG_NAME}</td>
|
|
<td><a href="#" class="File file_${item.FILE_CNT eq 0?'empty_':''}icon" data-OBJID="${item.OBJID}" data-docType="PRODUCT_FILE" data-docTypeName="PRODUCT_FILE"></a></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> </td>
|
|
</c:when>
|
|
<c:otherwise>
|
|
<td class="no_more_page">prev</td>
|
|
<td> </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> </td>
|
|
</c:when>
|
|
<c:otherwise>
|
|
<td><a href="javascript:fnc_goPage('${status.index}');">${status.index}</a></td>
|
|
<td> </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> |