282 lines
8.1 KiB
Plaintext
282 lines
8.1 KiB
Plaintext
<%@ 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" %>
|
|
<%
|
|
ArrayList list = (ArrayList)request.getAttribute("LIST");
|
|
System.out.println("list : "+list);
|
|
%>
|
|
<!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();
|
|
});
|
|
|
|
//재질수정
|
|
$(".btnModify").click(function(){
|
|
var objId = $(this).attr("data-OBJID");
|
|
var actionType = $(this).attr("data-actionType");
|
|
|
|
fnc_registFormPopup(objId, actionType);
|
|
});
|
|
|
|
//엔터키로 조회
|
|
$("input").keyup(function(e){
|
|
if(e.keyCode == 13){
|
|
document.form1.page.value = "1";
|
|
fn_search();
|
|
}
|
|
});
|
|
|
|
//Form Popup
|
|
$("#btnRegist").click(function(){
|
|
fn_registFormPopup();
|
|
});
|
|
|
|
//Detail Popup
|
|
$(".btnDetail").click(function(){
|
|
var objId = $(this).attr("data-OBJID");
|
|
fn_registDetailPopup(objId);
|
|
});
|
|
|
|
//change status
|
|
$(".comboStatus").change(function(){
|
|
var objId = $(this).attr("data-OBJID");
|
|
var status = $(this).val();
|
|
|
|
fn_changeStatus(dept_code, status);
|
|
});
|
|
|
|
//search
|
|
$("#btnSearch").click(function(){
|
|
document.form1.page.value = "1";
|
|
fn_search();
|
|
});
|
|
});
|
|
//조회 기능
|
|
function fn_search(){
|
|
document.form1.action = "/admin/deptMngList.do";
|
|
document.form1.submit();
|
|
}
|
|
|
|
//검사명 등록 Form Popup
|
|
function fn_registFormPopup(){
|
|
var params = "";
|
|
window.open("/admin/deptFormPopup.do"+params,"deptFormPopup","width=500,height=254");
|
|
}
|
|
|
|
//검사명 상세 Detail Popup
|
|
function fn_registDetailPopup(deptCode){
|
|
var params = "?deptCode="+deptCode;
|
|
window.open("/admin/deptDetailPopup.do"+params,"deptDetailPopup","width=500,height=254");
|
|
}
|
|
|
|
/* //기존에 있던 상태값 수정 함수 2019-03-27
|
|
function fn_changeStatus(objId, status){
|
|
$.ajax({
|
|
url:"/admin/changeTestTypeStatus.do",
|
|
type:"POST",
|
|
data:{"objId":objId, "status":status},
|
|
dataType:"text",
|
|
success:function(data){
|
|
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
} */
|
|
|
|
//새로 추가한 상태값 수정 함수 2019-03-27
|
|
function fn_changeStatus(dept_code, Status){
|
|
var updateStatus = confirm("부서의 상태를 전환하시겠습니까?");
|
|
|
|
if(updateStatus) {
|
|
$.ajax({
|
|
url:"/admin/changeDeptStatus.do",
|
|
type:"POST",
|
|
data:{"dept_code":dept_code, "status":Status},
|
|
dataType:"text",
|
|
success:function(data){
|
|
fn_search();
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
//프로젝트에 해당하는 WBS Task 목록 PopUp을 호출한다.
|
|
function fn_openUserHistory(dept_code){
|
|
if(null != dept_code){
|
|
window.open("/admin/deptHistoryList.do?dept_code="+dept_code, "", "width=950, height=500");
|
|
}else{
|
|
Swal.fire("잘못된 접근입니다.");
|
|
}
|
|
}
|
|
|
|
function fn_deleteGroup(DEPT_CODE){
|
|
if("" != DEPT_CODE){
|
|
if(confirm("삭제하시겠습니까?")){
|
|
$.ajax({
|
|
url:"/admin/deleteGroup.do",
|
|
type:"POST",
|
|
data:{"DEPT_CODE":DEPT_CODE},
|
|
dataType:"json",
|
|
async:false,
|
|
success:function(data){
|
|
Swal.fire(data.msg);
|
|
if(data.result){
|
|
fn_search();
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<form name="form1" method="POST">
|
|
<input type="hidden" name="actionType" id="actionType" value="" />
|
|
<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_locationName" name="search_locationName" value="${param.search_locationName}" maxlength="16"></td> --%>
|
|
<td class="label"><label>부서명</label></td>
|
|
<td><input type="text" id="search_deptName" name="search_deptName" value="${param.search_deptName}" maxlength="16"></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div id="adminBtnWrap">
|
|
<input type="button" value="조회" class="btns" id="btnSearch">
|
|
<input type="button" value="부서 등록" class="btns" id="btnRegist">
|
|
</div>
|
|
<div id="adminTableWrap">
|
|
<div id="tableWrap">
|
|
<table id="adminTable">
|
|
<colgroup>
|
|
<col width="4%" />
|
|
<col width="*%" />
|
|
<col width="*%" />
|
|
<col width="*%" />
|
|
<col width="*%" />
|
|
<col width="*%" />
|
|
<col width="40px" />
|
|
<col width="40px" />
|
|
</colgroup>
|
|
<tr id="thead">
|
|
<td>No</td>
|
|
<!-- <td>업체구분</td> -->
|
|
<td>부서코드</td>
|
|
<td>회사명</td>
|
|
<td>부서명</td>
|
|
<td>등록일</td>
|
|
<td>상태</td>
|
|
<td colspan="2">기능</td>
|
|
</tr>
|
|
<c:choose>
|
|
<c:when test="${!empty LIST}">
|
|
<c:forEach var="info" items="${LIST}" varStatus="status">
|
|
<tr>
|
|
<td>${info.RNUM}</td>
|
|
<%-- <td>${info.LOCATION_NAME}</td> --%>
|
|
<td>${info.DEPT_CODE}</td>
|
|
<td>${info.COMPANY_NAME}</td>
|
|
<td><a href="#" class="btnDetail" data-OBJID="${info.DEPT_CODE}">${info.DEPT_NAME}</a></td>
|
|
<td>${info.REGDATE}</td>
|
|
<td>
|
|
<select onchange="javascript:fn_changeStatus('${info.DEPT_CODE}', this.value)">
|
|
<option value="">선택</option>
|
|
<option value="active" ${info.STATUS eq 'active' ? 'selected' : ''}>활성화</option>
|
|
<option value="inActive" ${info.STATUS eq 'inActive' ? 'selected' : ''}>비활성화</option>
|
|
</select>
|
|
</td>
|
|
<td><input type="button" class="blue_btn" value="삭제" onclick="fn_deleteGroup('${info.DEPT_CODE}');" style="float:none;"></td>
|
|
<td><input type="button" class="blue_btn" value="이력" onclick="fn_openUserHistory('${info.DEPT_CODE}');" style="float:none;"></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 LIST}">
|
|
<div class="page_pro">
|
|
<center>
|
|
<table>
|
|
<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>
|
|
<p id="adminPageCount">총 ${totalCount}건</p>
|
|
</center>
|
|
</div>
|
|
</c:if>
|
|
</div>
|
|
</section>
|
|
</form>
|
|
</body>
|
|
</html> |