최초커밋
This commit is contained in:
@@ -0,0 +1,140 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.pms.common.utils.*"%>
|
||||
<%@ page import="java.util.*"%>
|
||||
<%@include file="/init.jsp"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link rel="stylesheet" href="css/basic.css">
|
||||
<title><%=Constants.SYSTEM_NAME%></title>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
$(document).ready(function(){
|
||||
var actionType = "${actionType}";
|
||||
if(actionType == 'modify'){
|
||||
$('#overlapCheckId').remove();
|
||||
$('#overlapStatus').remove();
|
||||
}
|
||||
});
|
||||
|
||||
//엔터키로 조회
|
||||
$("input").keyup(function(e){
|
||||
if(e.keyCode == 13){
|
||||
fnc_materialSubmit();
|
||||
}
|
||||
});
|
||||
});
|
||||
//공백 및 중복확인
|
||||
function fnc_overlapCheck(){
|
||||
var result;
|
||||
var materialName = $('#materialName').val();
|
||||
if(!fnc_valitate('form1')){
|
||||
$('#overlapStatus').empty();
|
||||
$('#materialName').focus();
|
||||
}else{
|
||||
$.ajax({
|
||||
url:"/admin/materialOverlapCheck.do",
|
||||
type:"POST",
|
||||
data:{"search_materialName":materialName},
|
||||
dataType:"json",
|
||||
async:false,
|
||||
success:function(overlap){
|
||||
if(overlap.MATERIAL_NAME == materialName){
|
||||
$('#overlapStatus').text("등록된 정보입니다.");
|
||||
$('#materialName').focus();
|
||||
}else{
|
||||
$('#overlapStatus').text("등록 가능한 정보입니다.");
|
||||
$('#materialName').focus();
|
||||
}
|
||||
result = overlap;
|
||||
},
|
||||
error: function(jqxhr, status, error){
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
//저장
|
||||
function fnc_materialSubmit(){
|
||||
|
||||
var materialName = $('#materialName').val();
|
||||
var materialObjid = $('#materialObjid').val();
|
||||
var status = $('#status').val();
|
||||
var actionType = "${param.actionType}";
|
||||
|
||||
var overlap = fnc_overlapCheck();
|
||||
if(overlap.MATERIAL_NAME == materialName && actionType == 'regist'){
|
||||
Swal.fire("등록된 정보입니다.");
|
||||
$('#materialName').focus();
|
||||
}else if(overlap.OBJID == materialObjid || overlap.MATERIAL_NAME == undefined){
|
||||
if(confirm("저장하시겠습니까?")){
|
||||
$.ajax({
|
||||
url:"/admin/mergeMaterial.do",
|
||||
type:"POST",
|
||||
data:{"materialName":materialName, "materialObjid":materialObjid, "status":status, "actionType":actionType},
|
||||
dataType:"text",
|
||||
async:false,
|
||||
success:function(data){
|
||||
opener.fn_search();
|
||||
self.close(0);
|
||||
},
|
||||
error: function(jqxhr, status, error){
|
||||
}
|
||||
});
|
||||
}
|
||||
}else{
|
||||
Swal.fire("등록된 정보입니다.");
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<section id="commonSection">
|
||||
<div class=admin_title>
|
||||
<h2>재질관리</h2>
|
||||
</div>
|
||||
<div id="adminPopupFormWrap">
|
||||
<form id="form1" name="form1" method="post">
|
||||
<input type="hidden" id="materialObjid" name="materialObjid" value="${materialInfo.OBJID}">
|
||||
<table id="adminPopupForm">
|
||||
<colgroup>
|
||||
<col width="37%" />
|
||||
<col width="63%" />
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><label>재질명</label></td>
|
||||
<td><input type="text" title="재질" id="materialName" value="${materialInfo.MATERIAL_NAME}" maxlength="20" required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label>활성화 여부</label></td>
|
||||
<td>
|
||||
<select name="status" id="status">
|
||||
<option value="active" ${materialInfo.STATUS eq 'active'?'selected':''}>활성화</option>
|
||||
<option value="inActive" ${materialInfo.STATUS eq 'inActive'?'selected':''}>비활성화</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div id="adminPopupBtnWrap">
|
||||
<span id="overlapStatus"></span>
|
||||
<input type="button" value="저장" class="btns" onclick="javascript:fnc_materialSubmit()" >
|
||||
<input type="button" value="중복확인" class="btns" id="overlapCheckId" onclick="javascript:fnc_overlapCheck()">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="btnCenterWrap">
|
||||
<center class="center_btns_wrap">
|
||||
<input type="button" value="닫기" name="" id="btn_close" class="btns" onclick="javascript:self.close();">
|
||||
</center>
|
||||
</div>
|
||||
</secsion>
|
||||
</body>
|
||||
</html>
|
||||
256
WebContent/WEB-INF/view/admin/material/adminMaterialMngList.jsp
Normal file
256
WebContent/WEB-INF/view/admin/material/adminMaterialMngList.jsp
Normal file
@@ -0,0 +1,256 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.pms.common.utils.*"%>
|
||||
<%@ page import="java.util.*" %>
|
||||
<%@include file= "/init.jsp" %>
|
||||
<!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}" />
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function(){
|
||||
|
||||
$("#btnSearch").click(function(){
|
||||
$("#page").val("1");
|
||||
fn_search();
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
fnc_datepick();
|
||||
});
|
||||
|
||||
//체크된 재질 목록의 상태 활성화 및 비활성화 변경
|
||||
$(".btnActive").click(function(){
|
||||
var buttonType = $(this).attr("buttonType");
|
||||
|
||||
var choice = [];
|
||||
$("input[name='choice']:checked").each(function(i){
|
||||
choice.push($(this).val());
|
||||
});
|
||||
if(choice == ''){
|
||||
Swal.fire("재질을 선택하세요.");
|
||||
}
|
||||
else if(confirm("상태를 변경하시겠습니까?")){
|
||||
$.ajax({
|
||||
url:"/admin/updateCheckMaterialStatus.do",
|
||||
type:"POST",
|
||||
data:{"actionType":buttonType, "choice":choice},
|
||||
dataType:"text",
|
||||
success:function(data){
|
||||
fn_search();
|
||||
},
|
||||
error: function(jqxhr, status, error){
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
//엑셀 다운로드
|
||||
$("#btnExcel").click(function(){
|
||||
document.form1.action = "/admin/getMaterialMngList.do?actionType=excel";
|
||||
document.form1.submit();
|
||||
});
|
||||
|
||||
//체크박스 전체선택/전체해제
|
||||
$("#allCheck").click(function(){
|
||||
if($("#allCheck").prop("checked")) {
|
||||
$("input[type=checkbox]").prop("checked",true);
|
||||
} else {
|
||||
$("input[type=checkbox]").prop("checked",false);
|
||||
}
|
||||
});
|
||||
|
||||
// 부분체크해제
|
||||
$("input[name=choice]").click(function(){
|
||||
if($("#allCheck").is(":checked")){
|
||||
$("#allCheck").prop("checked",false);
|
||||
}
|
||||
});
|
||||
|
||||
//재질수정
|
||||
$(".btnModify").click(function(){
|
||||
var objId = $(this).attr("data-OBJID");
|
||||
var actionType = $(this).attr("data-actionType");
|
||||
|
||||
fnc_adminMaterialFormPopup(objId, actionType);
|
||||
});
|
||||
|
||||
//엔터키로 조회
|
||||
$("input").keyup(function(e){
|
||||
if(e.keyCode == 13){
|
||||
$("#page").val("1");
|
||||
fn_search();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//재질 생성
|
||||
function fnc_adminMaterialFormPopup(materialObjid, actionType){
|
||||
var params = "";
|
||||
params += "?search_materialObjid="+materialObjid;
|
||||
params += "&actionType="+actionType;
|
||||
window.open("/admin/adminMaterialFormPopup.do"+params,"adminMaterialFormPopup","width=500,height=204");
|
||||
}
|
||||
|
||||
//재질 목록 리스트에서 상태만 변경
|
||||
function fnc_updateMaterialStatus(materialObjid, materialStatus){
|
||||
var modifyMaterialStatus = confirm("재질의 상태를 전환하시겠습니까?");
|
||||
if(modifyMaterialStatus) {
|
||||
$.ajax({
|
||||
url:"/admin/updateMaterialStatus.do",
|
||||
type:"POST",
|
||||
data:{"materialObjid":materialObjid, "materialStatus":materialStatus},
|
||||
dataType:"text",
|
||||
success:function(data){
|
||||
fn_search();
|
||||
},
|
||||
error: function(jqxhr, status, error){
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
//검색조건에 따라 재질 목록 리스트 출력
|
||||
function fn_search(){
|
||||
if(fnc_dateFormChk($("#search_fromDate").val(),$("#search_toDate").val())){
|
||||
document.form1.action="/admin/getMaterialMngList.do";
|
||||
document.form1.submit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form name="form1" method="POST">
|
||||
<section id="commonSection" class="admin1">
|
||||
<div class="admin_title">
|
||||
<h2>재질관리</h2>
|
||||
</div>
|
||||
<div id="adminFormWrap">
|
||||
<table id="adminForm">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="label"><label>재질명</label></td>
|
||||
<td><input type="text" id="search_materialName" name="search_materialName" value="${param.search_materialName}" maxlength="16"></td>
|
||||
<td class="label"><label>등록자</label></td>
|
||||
<td><input type="text" id="search_writer" name="search_writer" value="${param.search_writer}" maxlength="8"></td>
|
||||
<td class="label"><label>상태</label></td>
|
||||
<td><select id="search_status" name="search_status">
|
||||
<option value="">전체선택</option>
|
||||
<option value="active" ${param.search_status eq 'active'?'selected':''}>활성화</option>
|
||||
<option value="inActive" ${param.search_status eq 'inActive'?'selected':''}>비활성화</option>
|
||||
</select></td>
|
||||
<td class="label"><label>등록일</label></td>
|
||||
<td colspan="3"><input type="text" id="search_fromDate" name="search_fromDate" class="date_margin" value="${param.search_fromDate}" readonly>
|
||||
~ <input type="text" id="search_toDate" name="search_toDate" value="${param.search_toDate}" readonly>
|
||||
<input type="button" class="date_delete" value="x" onclick="javascript:fnc_date_empty()"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="adminBtnWrap">
|
||||
<input type="button" value="조회" class="btns" id="btnSearch" >
|
||||
<input type="button" value="재질등록" class="btns" onclick="javascript:fnc_adminMaterialFormPopup('', 'regist')">
|
||||
<input type="button" value="활성화" class="btns btnActive" buttonType="active">
|
||||
<input type="button" value="비활성화" class="btns btnActive" buttonType="inActive">
|
||||
<input type="button" value="Excel Download" class="btns" id="btnExcel">
|
||||
</div>
|
||||
<div id="adminTableWrap">
|
||||
<div id="tableWrap">
|
||||
<table id="adminTable">
|
||||
<colgroup>
|
||||
<col width="3%" />
|
||||
<col width="4%" />
|
||||
<col width="*%" />
|
||||
<col width="20%" />
|
||||
<col width="20%" />
|
||||
<col width="20%" />
|
||||
</colgroup>
|
||||
<tr id="thead">
|
||||
<td><input type="checkbox" id="allCheck" class="checkBox"></td>
|
||||
<td>No</td>
|
||||
<td>재질명</td>
|
||||
<td>등록자</td>
|
||||
<td>등록일</td>
|
||||
<td>상태</td>
|
||||
</tr>
|
||||
<c:choose>
|
||||
<c:when test="${!empty materialMngList}">
|
||||
<c:forEach var="material" items="${materialMngList}">
|
||||
<tr>
|
||||
<td><input type="checkbox" name="choice" value="${material.OBJID}"></td>
|
||||
<td>${material.RNUM}</td>
|
||||
<td><a href="#" style="cursor:pointer;" class="btnModify" data-OBJID="${material.OBJID}" data-actionType="modify">${material.MATERIAL_NAME}</a></td>
|
||||
<td>${material.DEPT_NAME} ${material.USER_NAME}</td>
|
||||
<td>${material.REGDATE}</td>
|
||||
<td>
|
||||
<select onchange="javascript:fnc_updateMaterialStatus('${material.OBJID}', '${material.STATUS}')">
|
||||
<option value="active" ${material.STATUS eq 'active'?'selected':''}>활성화</option>
|
||||
<option value="inActive" ${material.STATUS eq 'inActive'?'selected':''}>비활성화</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<td align="center" colspan="6">조회된 정보가 없습니다.</td>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pdm_page">
|
||||
<input type="hidden" name="page" id="page" value="${nPage}">
|
||||
<c:if test="${!empty materialMngList}">
|
||||
<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>
|
||||
<p id="adminPageCount">총 ${totalCount}건</p>
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,79 @@
|
||||
<%@ page import="com.pms.common.utils.*"%>
|
||||
<%@ page import="java.util.*" %>
|
||||
|
||||
<%@ page isThreadSafe = "true" %>
|
||||
<%@ page buffer="256kb" %>
|
||||
<%@ page autoFlush = "true" %>
|
||||
<%@ page contentType="application/vnd.ms-excel;charset=UTF-8" %>
|
||||
|
||||
<%
|
||||
java.text.SimpleDateFormat frm= new java.text.SimpleDateFormat ("yyyy_MM_dd_HH_mm");
|
||||
Calendar cal = Calendar.getInstance();
|
||||
String todayKor = frm.format(cal.getTime());
|
||||
|
||||
String excelName = "재질목록";
|
||||
String encodeName = excelName+todayKor+".xls";
|
||||
String fileName = java.net.URLEncoder.encode(encodeName,"UTF-8");
|
||||
|
||||
response.setHeader("Content-Disposition", "attachment;filename="+fileName+"");
|
||||
response.setHeader("Content-Description", "JSP Generated Data");
|
||||
|
||||
ArrayList materialMngList = (ArrayList)request.getAttribute("materialMngList");
|
||||
|
||||
%>
|
||||
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">
|
||||
<head>
|
||||
<meta http-equiv=Content-Type content="text/html; charset=UTF-8">
|
||||
<meta name=ProgId content=Excel.Sheet>
|
||||
<meta name=Generator content="Microsoft Excel 11">
|
||||
|
||||
<style type="text/css">
|
||||
.plm_menu_name {width:100%; background: #e7eaee; border-bottom: 1px solid #d4d4d4;}
|
||||
.plm_menu_name h2 {width:97.5%; margin: 0 auto; height:35px; color:000; font-size: 13px; line-height: 35px;}
|
||||
.plm_menu_name h2 span {height: 35px; padding-left: 23px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form name="materialListForm" method="POST">
|
||||
<h2>재질관리</h2><br>
|
||||
<table border="1">
|
||||
<tr align="center" bgColor="yellow" style="font-weight:bold;">
|
||||
<td>No</td>
|
||||
<td>재질명</td>
|
||||
<td>등록자</td>
|
||||
<td>등록일</td>
|
||||
<td>상태</td>
|
||||
</tr>
|
||||
<%
|
||||
if(materialMngList != null && materialMngList.size() > 0){
|
||||
for(int i = 0 ; i < materialMngList.size() ; i++){
|
||||
HashMap map = (HashMap)materialMngList.get(i);
|
||||
|
||||
String materialName = CommonUtils.checkNull(map.get("MATERIAL_NAME"));
|
||||
String regDate = CommonUtils.checkNull(map.get("REGDATE"));
|
||||
String deptName = CommonUtils.checkNull(map.get("DEPT_NAME"));
|
||||
String userName = CommonUtils.checkNull(map.get("USER_NAME"));
|
||||
String statusStr = CommonUtils.checkNull(map.get("STATUS_STR"));
|
||||
%>
|
||||
<tr align="center">
|
||||
<td><%=i+1%></td>
|
||||
<td><%=materialName%></td>
|
||||
<td><%=deptName%> <%=userName%></td>
|
||||
<td><%=regDate%></td>
|
||||
<td><%=statusStr%></td>
|
||||
</tr>
|
||||
<%
|
||||
}
|
||||
}else{
|
||||
%>
|
||||
<tr>
|
||||
<td align="center" colspan="5">조회된 정보가 없습니다.</td>
|
||||
</tr>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,53 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.pms.common.utils.*"%>
|
||||
<%@ page import="java.util.*" %>
|
||||
<%@include file= "/init.jsp" %>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title><%=Constants.SYSTEM_NAME%></title>
|
||||
</head>
|
||||
<body>
|
||||
<form name="form1" action="" method="post">
|
||||
<section id="commonSection" class="admin_option_min">
|
||||
<div class="admin_title">
|
||||
<h2>재질관리</h2>
|
||||
</div>
|
||||
<div id="adminPopupFormWrap">
|
||||
<table id="adminPopupForm">
|
||||
<colgroup>
|
||||
<col width="37%" />
|
||||
<col width="63%" />
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><label>재질명</label></td>
|
||||
<td><p></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label>활성화 여부</label></td>
|
||||
<td class="no_bottom_border">
|
||||
<select name="status" id="status">
|
||||
<option>활성화</option>
|
||||
<option>비활성화</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div id="adminPopupBtnWrap">
|
||||
<span id="overlapStatus"></span>
|
||||
<input type="button" value="저장" class="btns" >
|
||||
<input type="button" value="중복확인" class="btns">
|
||||
</div>
|
||||
</div>
|
||||
<div class="btnCenterWrap">
|
||||
<center class="center_btns_wrap">
|
||||
<input type="button" value="닫기" name="" id="btn_close" class="btns" onclick="javascript:self.close();">
|
||||
</center>
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
140
WebContent/WEB-INF/view/admin/material/adminMtTypeFormPopup.jsp
Normal file
140
WebContent/WEB-INF/view/admin/material/adminMtTypeFormPopup.jsp
Normal file
@@ -0,0 +1,140 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.pms.common.utils.*"%>
|
||||
<%@ page import="java.util.*"%>
|
||||
<%@include file="/init.jsp"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title><%=Constants.SYSTEM_NAME%></title>
|
||||
<script>
|
||||
$(function(){
|
||||
$(document).ready(function(){
|
||||
var actionType = "${actionType}";
|
||||
if(actionType == 'modify'){
|
||||
$('#overlapCheckId').remove();
|
||||
$('#overlapStatus').focus();
|
||||
}
|
||||
});
|
||||
|
||||
//엔터키로 조회
|
||||
$("input").keyup(function(e){
|
||||
if(e.keyCode == 13){
|
||||
fnc_materialTypeSubmit();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//중복확인
|
||||
function fnc_overlapCheck(){
|
||||
var result;
|
||||
var materialTypeName = $('#materialTypeName').val();
|
||||
if(!fnc_valitate('form1')){
|
||||
$('#overlapStatus').empty();
|
||||
$('#materialTypeName').focus();
|
||||
}else{
|
||||
$.ajax({
|
||||
url:"/admin/materialTypeOverlapCheck.do",
|
||||
type:"POST",
|
||||
data:{"search_materialTypeName":materialTypeName},
|
||||
dataType:"json",
|
||||
async:false,
|
||||
success:function(overlap){
|
||||
if(overlap.MATERIAL_TYPE_NAME == materialTypeName){
|
||||
$('#overlapStatus').text("등록된 정보입니다.");
|
||||
$('#materialTypeName').focus();
|
||||
}else{
|
||||
$('#overlapStatus').text("등록 가능한 정보입니다.");
|
||||
$('#materialTypeName').focus();
|
||||
}
|
||||
|
||||
result = overlap;
|
||||
},
|
||||
error: function(jqxhr, status, error){
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
//저장
|
||||
function fnc_materialTypeSubmit(){
|
||||
|
||||
var materialTypeName = $('#materialTypeName').val();
|
||||
var materialTypeObjid = $('#materialTypeObjid').val();
|
||||
var status = $('#status').val();
|
||||
var actionType = "${param.actionType}";
|
||||
|
||||
var overlap = fnc_overlapCheck();
|
||||
if(overlap.MATERIAL_TYPE_NAME == materialTypeName && actionType == 'regist'){
|
||||
Swal.fire("등록된 정보입니다.");
|
||||
$('#materialTypeName').focus();
|
||||
}else if(overlap.OBJID == materialTypeObjid || overlap.MATERIAL_TYPE_NAME == undefined){
|
||||
if(confirm("저장하시겠습니까?")){
|
||||
|
||||
$.ajax({
|
||||
url:"/admin/mergeMaterialType.do",
|
||||
type:"POST",
|
||||
data:{"materialTypeName":materialTypeName, "materialTypeObjid":materialTypeObjid, "status":status, "actionType":actionType},
|
||||
dataType:"text",
|
||||
async:false,
|
||||
success:function(data){
|
||||
opener.fn_search();
|
||||
self.close(0);
|
||||
},
|
||||
error: function(jqxhr, status, error){
|
||||
}
|
||||
});
|
||||
}
|
||||
}else{
|
||||
Swal.fire("등록된 정보입니다.");
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" name="form1" method="post">
|
||||
<input type="hidden" id="materialTypeObjid" name="materialTypeObjid" value="${materialTypeInfo.OBJID}">
|
||||
<section id="commonSection" class="mtTypePopup">
|
||||
<div class="admin_title">
|
||||
<h2>자재유형 관리</h2>
|
||||
</div>
|
||||
<div id="adminPopupFormWrap">
|
||||
<table id="adminPopupForm">
|
||||
<colgroup>
|
||||
<col width="37%" />
|
||||
<col width="63%" />
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><label>자재유형</label></td>
|
||||
<td><input type="text" title="자재유형" id="materialTypeName" value="${materialTypeInfo.MATERIAL_TYPE_NAME}" maxlength="16" required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label>활성화 여부</label></td>
|
||||
<td class="no_bottom_border">
|
||||
<select name="status" id="status">
|
||||
<option value="active" ${materialTypeInfo.STATUS eq 'active'?'selected':''}>활성화</option>
|
||||
<option value="inActive" ${materialTypeInfo.STATUS eq 'inActive'?'selected':''}>비활성화</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div id="adminPopupBtnWrap">
|
||||
<span id="overlapStatus"></span>
|
||||
<input type="button" value="저장" class="btns" onclick="javascript:fnc_materialTypeSubmit()">
|
||||
<input type="button" value="중복확인" class="btns" id="overlapCheckId" onclick="javascript:fnc_overlapCheck()">
|
||||
</div>
|
||||
</div>
|
||||
<div class="btnCenterWrap">
|
||||
<center class="center_btns_wrap">
|
||||
<input type="button" value="닫기" name="" id="btn_close" class="btns" onclick="javascript:self.close();">
|
||||
</center>
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
257
WebContent/WEB-INF/view/admin/material/adminMtTypeList.jsp
Normal file
257
WebContent/WEB-INF/view/admin/material/adminMtTypeList.jsp
Normal file
@@ -0,0 +1,257 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.pms.common.utils.*"%>
|
||||
<%@ page import="java.util.*"%>
|
||||
<%@include file="/init.jsp"%>
|
||||
<!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}" />
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function(){
|
||||
|
||||
$(document).ready(function(){
|
||||
fnc_datepick();
|
||||
});
|
||||
|
||||
//체크된 자재유형 목록의 상태 활성화 및 비활성화 변경
|
||||
$(".btnActive").click(function(){
|
||||
var buttonType = $(this).attr("buttonType");
|
||||
|
||||
var choice = [];
|
||||
$("input[name='choice']:checked").each(function(i){
|
||||
choice.push($(this).val());
|
||||
});
|
||||
if(choice == ''){
|
||||
Swal.fire("자재유형을 선택하세요.")
|
||||
}
|
||||
else if(confirm("상태를 변경하시겠습니까?")){
|
||||
$("#actionType").val(buttonType);
|
||||
$.ajax({
|
||||
url:"/admin/updateCheckMaterialTypeStatus.do",
|
||||
type:"POST",
|
||||
data:{"actionType":buttonType, "choice":choice},
|
||||
dataType:"text",
|
||||
success:function(data){
|
||||
fn_search();
|
||||
},
|
||||
error: function(jqxhr, status, error){
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
//엑셀 다운로드
|
||||
$("#btnExcel").click(function(){
|
||||
document.form1.action = "/admin/getMaterialTypeMngList.do?actionType=excel";
|
||||
document.form1.submit();
|
||||
});
|
||||
|
||||
//체크박스 전체선택/전체해제
|
||||
$("#allCheck").click(function(){
|
||||
if($("#allCheck").prop("checked")) {
|
||||
$("input[type=checkbox]").prop("checked",true);
|
||||
} else {
|
||||
$("input[type=checkbox]").prop("checked",false);
|
||||
}
|
||||
});
|
||||
|
||||
// 부분체크해제
|
||||
$("input[name=choice]").click(function(){
|
||||
if($("#allCheck").is(":checked")){
|
||||
$("#allCheck").prop("checked",false);
|
||||
}
|
||||
});
|
||||
|
||||
//자재유형 수정
|
||||
$(".btnModify").click(function(){
|
||||
var objId = $(this).attr("data-OBJID");
|
||||
var actionType = $(this).attr("data-actionType");
|
||||
|
||||
fnc_adminMaterialTypeFormPopup(objId, actionType);
|
||||
});
|
||||
|
||||
//엔터키로 조회
|
||||
$("input").keyup(function(e){
|
||||
if(e.keyCode == 13){
|
||||
$("#page").val("1");
|
||||
fn_search();
|
||||
}
|
||||
});
|
||||
|
||||
$("#btnSearch").click(function(){
|
||||
$("#page").val("1");
|
||||
fn_search();
|
||||
});
|
||||
});
|
||||
|
||||
//자재유형 생성
|
||||
function fnc_adminMaterialTypeFormPopup(materialTypeObjid, actionType){
|
||||
var params = "";
|
||||
params += "?search_materialTypeObjid="+materialTypeObjid;
|
||||
params += "&actionType="+actionType;
|
||||
window.open("/admin/adminMtTypeFormPopup.do"+params,"adminMtTypeFormPopup","width=500,height=204");
|
||||
}
|
||||
|
||||
//자재유형 목록 리스트에서 상태만 변경
|
||||
function fnc_updateMaterialTypeStatus(materialTypeObjid, materialTypeStatus){
|
||||
var modifyMaterialTypeStatus = confirm("자재 유형의 상태를 전환하시겠습니까?");
|
||||
if(modifyMaterialTypeStatus) {
|
||||
$.ajax({
|
||||
url:"/admin/updateMaterialTypeStatus.do",
|
||||
type:"POST",
|
||||
data:{"materialTypeObjid":materialTypeObjid, "materialTypeStatus":materialTypeStatus},
|
||||
dataType:"text",
|
||||
success:function(data){
|
||||
fn_search();
|
||||
},
|
||||
error: function(jqxhr, status, error){
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
//검색조건에 따라 자재유형 목록 리스트 출력
|
||||
function fn_search(){
|
||||
if(fnc_dateFormChk($("#search_fromDate").val(),$("#search_toDate").val())){
|
||||
document.form1.action="/admin/getMaterialTypeMngList.do";
|
||||
document.form1.submit();
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form name="form1" method="post">
|
||||
<section id="commonSection" class="admin1">
|
||||
<div class="admin_title">
|
||||
<h2>자재유형 관리</h2>
|
||||
</div>
|
||||
<div id="adminFormWrap">
|
||||
<table id="adminForm">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="label"><label>자재유형</label></td>
|
||||
<td><input type="text" id="search_materialTypeName" name="search_materialTypeName" value="${param.search_materialTypeName}" maxlength="16"></td>
|
||||
<td class="label"><label>등록자</label></td>
|
||||
<td><input type="text" id="search_writer" name="search_writer" value="${param.search_writer}" maxlength="8"></td>
|
||||
<td class="label"><label>상태</label></td>
|
||||
<td><select id="search_status" name="search_status">
|
||||
<option value="">전체선택</option>
|
||||
<option value="active" ${param.search_status eq 'active'?'selected':''}>활성화</option>
|
||||
<option value="inActive" ${param.search_status eq 'inActive'?'selected':''}>비활성화</option>
|
||||
</select></td>
|
||||
<td class="label"><label>등록일</label></td>
|
||||
<td colspan="3"><input type="text" id="search_fromDate" name="search_fromDate" class="date_margin" value="${param.search_fromDate}" readonly>
|
||||
~ <input type="text" id="search_toDate" name="search_toDate" value="${param.search_toDate}" readonly>
|
||||
<input type="button" class="date_delete" value="x" onclick="javascript:fnc_date_empty()"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="adminBtnWrap">
|
||||
<input type="button" value="조회" class="btns" id="btnSearch">
|
||||
<input type="button" value="자재유형 등록" class="btns" onclick="javascript:fnc_adminMaterialTypeFormPopup('', 'regist')">
|
||||
<input type="button" value="활성화" class="btns btnActive" buttonType="active">
|
||||
<input type="button" value="비활성화" class="btns btnActive" buttonType="inActive">
|
||||
<input type="button" value="Excel Download" class="btns" id="btnExcel">
|
||||
</div>
|
||||
<div id="adminTableWrap">
|
||||
<div id="tableWrap">
|
||||
<table id="adminTable">
|
||||
<colgroup>
|
||||
<col width="3%" />
|
||||
<col width="4%" />
|
||||
<col width="*%" />
|
||||
<col width="20%" />
|
||||
<col width="20%" />
|
||||
<col width="20%" />
|
||||
</colgroup>
|
||||
<tr id="thead">
|
||||
<td><input type="checkbox" id="allCheck" class="checkBox"></td>
|
||||
<td>No</td>
|
||||
<td>자재유형</td>
|
||||
<td>등록자</td>
|
||||
<td>등록일</td>
|
||||
<td>상태</td>
|
||||
</tr>
|
||||
<c:choose>
|
||||
<c:when test="${!empty materialTypeMngList}">
|
||||
<c:forEach var="materialType" items="${materialTypeMngList}">
|
||||
<tr>
|
||||
<td><input type="checkbox" name="choice" value="${materialType.OBJID}"></td>
|
||||
<td>${materialType.RNUM}</td>
|
||||
<td><a href="#" style="cursor:pointer;" class="btnModify" data-OBJID="${materialType.OBJID}" data-actionType="modify">${materialType.MATERIAL_TYPE_NAME}</a></td>
|
||||
<td>${materialType.DEPT_NAME} ${materialType.USER_NAME}</td>
|
||||
<td>${materialType.REGDATE}</td>
|
||||
<td>
|
||||
<select onchange="javascript:fnc_updateMaterialTypeStatus('${materialType.OBJID}', '${materialType.STATUS}')">
|
||||
<option value="active" ${materialType.STATUS eq 'active'?'selected':''}>활성화</option>
|
||||
<option value="inActive" ${materialType.STATUS eq 'inActive'?'selected':''}>비활성화</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<td align="center" colspan="6">조회된 정보가 없습니다.</td>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pdm_page">
|
||||
<input type="hidden" name="page" id="page" value="${nPage}">
|
||||
<c:if test="${!empty materialTypeMngList}">
|
||||
<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>
|
||||
<p id="adminPageCount">총 ${totalCount}건</p>
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,78 @@
|
||||
<%@ page import="com.pms.common.utils.*"%>
|
||||
<%@ page import="java.util.*" %>
|
||||
|
||||
<%@ page isThreadSafe = "true" %>
|
||||
<%@ page buffer="256kb" %>
|
||||
<%@ page autoFlush = "true" %>
|
||||
<%@ page contentType="application/vnd.ms-excel;charset=UTF-8" %>
|
||||
|
||||
<%
|
||||
java.text.SimpleDateFormat frm= new java.text.SimpleDateFormat ("yyyy_MM_dd_HH_mm");
|
||||
Calendar cal = Calendar.getInstance();
|
||||
String todayKor = frm.format(cal.getTime());
|
||||
|
||||
String excelName = "자재유형 목록";
|
||||
String encodeName = excelName+todayKor+".xls";
|
||||
String fileName = java.net.URLEncoder.encode(encodeName,"UTF-8");
|
||||
|
||||
response.setHeader("Content-Disposition", "attachment;filename="+fileName+"");
|
||||
response.setHeader("Content-Description", "JSP Generated Data");
|
||||
|
||||
ArrayList materialTypeMngList = (ArrayList)request.getAttribute("materialTypeMngList");
|
||||
|
||||
%>
|
||||
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">
|
||||
<head>
|
||||
<meta http-equiv=Content-Type content="text/html; charset=UTF-8">
|
||||
<meta name=ProgId content=Excel.Sheet>
|
||||
<meta name=Generator content="Microsoft Excel 11">
|
||||
<style type="text/css">
|
||||
.plm_menu_name {width:100%; background: #e7eaee; border-bottom: 1px solid #d4d4d4;}
|
||||
.plm_menu_name h2 {width:97.5%; margin: 0 auto; height:35px; color:000; font-size: 13px; line-height: 35px;}
|
||||
.plm_menu_name h2 span {height: 35px; padding-left: 23px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form name="materialTypeListForm" method="POST">
|
||||
<h2>자재유형 관리</h2><br>
|
||||
<table border="1">
|
||||
<tr align="center" bgColor="yellow" style="font-weight:bold;">
|
||||
<td>No</td>
|
||||
<td>자재유형</td>
|
||||
<td>등록자</td>
|
||||
<td>등록일</td>
|
||||
<td>상태</td>
|
||||
</tr>
|
||||
<%
|
||||
if(materialTypeMngList != null && materialTypeMngList.size() > 0){
|
||||
for(int i = 0 ; i < materialTypeMngList.size() ; i++){
|
||||
HashMap map = (HashMap)materialTypeMngList.get(i);
|
||||
|
||||
String materialTypeName = CommonUtils.checkNull(map.get("MATERIAL_TYPE_NAME"));
|
||||
String regDate = CommonUtils.checkNull(map.get("REGDATE"));
|
||||
String deptName = CommonUtils.checkNull(map.get("DEPT_NAME"));
|
||||
String userName = CommonUtils.checkNull(map.get("USER_NAME"));
|
||||
String statusStr = CommonUtils.checkNull(map.get("STATUS_STR"));
|
||||
%>
|
||||
<tr align="center">
|
||||
<td><%=i+1%></td>
|
||||
<td><%=materialTypeName%></td>
|
||||
<td><%=deptName%> <%=userName%></td>
|
||||
<td><%=regDate%></td>
|
||||
<td><%=statusStr%></td>
|
||||
</tr>
|
||||
<%
|
||||
}
|
||||
}else{
|
||||
%>
|
||||
<tr>
|
||||
<td align="center" colspan="5">조회된 정보가 없습니다.</td>
|
||||
</tr>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,53 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.pms.common.utils.*"%>
|
||||
<%@ page import="java.util.*" %>
|
||||
<%@include file= "/init.jsp" %>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title><%=Constants.SYSTEM_NAME%></title>
|
||||
</head>
|
||||
<body>
|
||||
<form name="form1" action="" method="post">
|
||||
<section id="commonSection" class="admin_option_min">
|
||||
<div class="admin_title">
|
||||
<h2>자재유형 관리</h2>
|
||||
</div>
|
||||
<div id="adminPopupFormWrap">
|
||||
<table id="adminPopupForm">
|
||||
<colgroup>
|
||||
<col width="37%" />
|
||||
<col width="63%" />
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><label>자재유형</label></td>
|
||||
<td><p></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label>활성화 여부</label></td>
|
||||
<td class="no_bottom_border">
|
||||
<select name="status" id="status">
|
||||
<option>활성화</option>
|
||||
<option>비활성화</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div id="adminPopupBtnWrap">
|
||||
<span id="overlapStatus"></span>
|
||||
<input type="button" value="저장" class="btns" >
|
||||
<input type="button" value="중복확인" class="btns">
|
||||
</div>
|
||||
</div>
|
||||
<div class="btnCenterWrap">
|
||||
<center class="center_btns_wrap">
|
||||
<input type="button" value="닫기" name="" id="btn_close" class="btns" onclick="javascript:self.close();">
|
||||
</center>
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user