368 lines
11 KiB
Plaintext
368 lines
11 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" %>
|
|
<!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">
|
|
|
|
<%-- [주석 처리] Amaranth API AJAX 방식 결재 목록 조회 - 일반 결재로 변경
|
|
// 현재 페이지 및 페이징 상태
|
|
var currentPage = 1;
|
|
var maxPage = 1;
|
|
var totalCount = 0;
|
|
--%>
|
|
|
|
$(function(){
|
|
$(document).ready(function(){
|
|
fnc_datepick();
|
|
});
|
|
|
|
$(".searchInput").keyup(function(e){
|
|
var keyCode = e.keyCode;
|
|
if(keyCode == 13){
|
|
fn_search();
|
|
}
|
|
});
|
|
|
|
$("#btnSearch").click(function(){
|
|
fn_search();
|
|
});
|
|
|
|
$(".btnApprovalDetail").click(function(){
|
|
var approvalObjId = $(this).attr("data-APPROVAL_OBJID");
|
|
var routeObjId = $(this).attr("data-ROUTE_OBJID");
|
|
var params = "?approvalObjId="+approvalObjId;
|
|
params += "&routeObjId="+routeObjId;
|
|
window.open("/approval/approvalDetail.do"+params,"approvalDetailPopup","width=650 height=620 menubar=no status=no");
|
|
});
|
|
|
|
$("X.targetTypeA").each( function() {
|
|
var code = $(this).text();
|
|
var codeName = fnc_getApprovalTargetName(code);
|
|
$(this).text(codeName);
|
|
} );
|
|
});
|
|
|
|
function fn_search(){
|
|
document.form1.action = "/approval/approvalList.do";
|
|
document.form1.submit();
|
|
}
|
|
|
|
function openApprovalPop(){
|
|
window.open("/approval/approvalDetail.do","specDataPopUp","width=650 height=730 menubar=no status=no");
|
|
}
|
|
|
|
<%-- [주석 처리] Amaranth API AJAX 방식 함수들 - 필요 시 주석 해제하여 사용
|
|
|
|
// Amaranth API 결재 문서 목록 조회
|
|
function fn_loadApprovalList(page){
|
|
currentPage = page;
|
|
|
|
var keyWord = $("#search_approvalTitle").val() || "";
|
|
var fromDt = $("#search_fromDate").val() || "";
|
|
var toDt = $("#search_toDate").val() || "";
|
|
|
|
$.ajax({
|
|
url: "/approval/getAmaranthApprovalDocList.do",
|
|
type: "POST",
|
|
data: {
|
|
"page": page,
|
|
"search_approvalTitle": keyWord,
|
|
"search_fromDate": fromDt,
|
|
"search_toDate": toDt
|
|
},
|
|
dataType: "json",
|
|
beforeSend: function(){
|
|
$("#approvalListBody").html('<tr style="text-align:center;"><td colspan="7">조회중...</td></tr>');
|
|
},
|
|
success: function(data){
|
|
totalCount = data.totalCount || 0;
|
|
maxPage = data.maxPage || 1;
|
|
var list = data.list || [];
|
|
|
|
fn_renderList(list);
|
|
fn_renderPaging(currentPage, maxPage, totalCount);
|
|
},
|
|
error: function(xhr, status, error){
|
|
console.error("결재 목록 조회 오류:", error);
|
|
$("#approvalListBody").html('<tr style="text-align:center;"><td colspan="7">조회 중 오류가 발생했습니다.</td></tr>');
|
|
fn_renderPaging(1, 1, 0);
|
|
}
|
|
});
|
|
}
|
|
|
|
// 검색
|
|
function fn_searchAmaranth(){
|
|
fn_loadApprovalList(1);
|
|
}
|
|
|
|
// 테이블 목록 렌더링
|
|
function fn_renderList(list){
|
|
var html = "";
|
|
|
|
if(list.length == 0){
|
|
html = '<tr style="text-align:center;"><td colspan="7">조회된 정보가 없습니다.</td></tr>';
|
|
} else {
|
|
for(var i = 0; i < list.length; i++){
|
|
var item = list[i];
|
|
html += '<tr style="text-align:center;">';
|
|
html += '<td>' + (item.RNUM || '') + '</td>';
|
|
html += '<td><a href="javascript:fn_openApprovalDetail(\'' + (item.DOC_ID || '') + '\',\'' + (item.DEPT_SEQ || '') + '\');" style="color:#0066cc;text-decoration:underline;">' + (item.DOC_ID || '') + '</a></td>';
|
|
html += '<td>' + (item.FORM_NAME || '') + '</td>';
|
|
html += '<td class="align_l4"><a href="javascript:fn_openApprovalDetail(\'' + (item.DOC_ID || '') + '\',\'' + (item.DEPT_SEQ || '') + '\');">' + (item.DOC_TITLE || '') + '</a></td>';
|
|
html += '<td>' + (item.REP_DT || '') + '</td>';
|
|
html += '<td>' + (item.DEPT_NAME || '') + ' ' + (item.EMP_NAME || '') + '</td>';
|
|
html += '<td>' + (item.DOC_STS_NAME || '') + '</td>';
|
|
html += '</tr>';
|
|
}
|
|
}
|
|
|
|
$("#approvalListBody").html(html);
|
|
}
|
|
|
|
// Amaranth 결재 문서 상세 팝업 열기
|
|
function fn_openApprovalDetail(docId, deptSeq){
|
|
if(!docId) return;
|
|
var params = "?docId=" + docId + "&deptSeq=" + (deptSeq || "");
|
|
window.open("/approval/amaranthApprovalDetail.do" + params, "amaranthApprovalDetail", "width=1000,height=800,menubar=no,status=no,scrollbars=yes,resizable=yes");
|
|
}
|
|
|
|
// 페이징 렌더링
|
|
function fn_renderPaging(nPage, maxPage, totalCount){
|
|
var html = "";
|
|
|
|
if(totalCount > 0){
|
|
html += '<table><tr>';
|
|
|
|
// prev
|
|
if(nPage > 1){
|
|
html += '<td><a href="javascript:fn_loadApprovalList(' + (nPage - 1) + ');">prev</a></td>';
|
|
} else {
|
|
html += '<td class="no_more_page">prev</td>';
|
|
}
|
|
|
|
// 페이지 번호
|
|
var startPage = nPage > 5 ? nPage - 5 : 1;
|
|
var endPage = nPage > 5 ? nPage + 4 : 10;
|
|
if(endPage > maxPage) endPage = maxPage;
|
|
|
|
for(var i = startPage; i <= endPage; i++){
|
|
if(i == nPage){
|
|
html += '<td><a href="#" class="now_page">' + i + '</a></td>';
|
|
} else {
|
|
html += '<td><a href="javascript:fn_loadApprovalList(' + i + ');">' + i + '</a></td>';
|
|
}
|
|
}
|
|
|
|
// next
|
|
if(nPage < maxPage){
|
|
html += '<td><a href="javascript:fn_loadApprovalList(' + (nPage + 1) + ');">next</a></td>';
|
|
} else {
|
|
html += '<td class="no_more_page">next</td>';
|
|
}
|
|
|
|
html += '</tr></table>';
|
|
html += '<p id="adminPageCount">총 ' + totalCount + '건</p>';
|
|
}
|
|
|
|
$("#pagingArea").html(html);
|
|
}
|
|
--%>
|
|
|
|
</script>
|
|
|
|
</head>
|
|
<body class="backcolor">
|
|
<form name="form1" action="" method="post">
|
|
<div class="min_approval_list">
|
|
|
|
<div class="content-box">
|
|
<div class="content-box-s">
|
|
<div class="plm_menu_name_gdnsi">
|
|
<h2>
|
|
<span>결재</span>
|
|
</h2>
|
|
|
|
<div class="btnArea">
|
|
<input type="button" value="조회" class="plm_btns" id="btnSearch">
|
|
</div>
|
|
|
|
</div>
|
|
<div id="plmSearchZon">
|
|
<table>
|
|
<tr>
|
|
<td class="">
|
|
<label for="" class="">제목</label>
|
|
</td>
|
|
<td>
|
|
<input type="text" name="search_approvalTitle" id="search_approvalTitle" class="searchInput" value="${param.search_approvalTitle}" style="width:250px;"/>
|
|
</td>
|
|
<td class="">
|
|
<label for="" class="">상신일</label>
|
|
</td>
|
|
<td>
|
|
<input type="text" name="search_fromDate" id="search_fromDate" value="${param.search_fromDate}" class="input_date_solo searchInput"> ~ <input type="text" name="search_toDate" id="search_toDate" value="${param.search_toDate}" class="input_date_solo searchInput">
|
|
</td>
|
|
<td class="">
|
|
<label for="" class="">상신자</label>
|
|
</td>
|
|
<td>
|
|
<input type="text" name="search_writerUserName" id="search_writerUserName" value="${param.search_writerUserName}" class="searchInput">
|
|
</td>
|
|
<%-- <td class="">
|
|
<label for="" class="">상태</label>
|
|
</td>
|
|
<td>
|
|
<select name="search_approvalStatus" id="search_approvalStatus">
|
|
<option value="">전체</option>
|
|
<option value="inProcess" ${param.search_approvalStatus eq 'inProcess'?'selected':''}>결재중</option>
|
|
<option value="complete" ${param.search_approvalStatus eq 'complete'?'selected':''}>결재완료</option>
|
|
</select>
|
|
</td> --%>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="contents_page_basic_margin">
|
|
<div class="in_table_scroll_wrap _table1" style="height:26px;width:99.4%;">
|
|
<table class="plm_table">
|
|
<colgroup>
|
|
<col width="5%">
|
|
<col width="10%">
|
|
<col width="10%">
|
|
<col width="*">
|
|
<col width="10%">
|
|
<col width="20%">
|
|
<col width="10%">
|
|
</colgroup>
|
|
<thead>
|
|
<tr class="plm_thead">
|
|
<td>No</td>
|
|
<td>결재번호</td>
|
|
<td>대상구분</td>
|
|
<td>제목</td>
|
|
<td>상신일</td>
|
|
<td>상신자</td>
|
|
<td>상태</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="in_table_scroll_wrap _table2" style="height:auto;width:100%;">
|
|
<table class="plm_table">
|
|
<colgroup>
|
|
<col width="5%">
|
|
<col width="10%">
|
|
<col width="10%">
|
|
<col width="*">
|
|
<col width="10%">
|
|
<col width="20%">
|
|
<col width="10%">
|
|
</colgroup>
|
|
<c:choose>
|
|
<c:when test="${!empty LIST}">
|
|
<c:forEach var="item" items="${LIST}" varStatus="status">
|
|
<tr style="text-align:center;">
|
|
<td>${item.RNUM}</td>
|
|
<td>${item.ROUTE_NO}</td>
|
|
<td class="targetType">${item.TARGET_NAME}</td>
|
|
<td class="align_l4"><a href="#" class="btnApprovalDetail" data-APPROVAL_OBJID="${item.APPROVAL_OBJID}" data-ROUTE_OBJID="${item.ROUTE_OBJID}">${item.APPROVAL_TITLE}</a></td>
|
|
<td>${item.ROUTE_REGDATE}</td>
|
|
<td>${item.WRITER_DEPT_NAME} ${item.WRITER_USER_NAME}</td>
|
|
<td>
|
|
<c:choose>
|
|
<c:when test="${item.STATUS eq 'inProcess'}">
|
|
결재중
|
|
</c:when>
|
|
<c:when test="${item.STATUS eq 'reject'}">
|
|
반려
|
|
</c:when>
|
|
<c:when test="${item.STATUS eq 'complete'}">
|
|
결재완료
|
|
</c:when>
|
|
<c:when test="${item.STATUS eq 'cancel'}">
|
|
결재취소
|
|
</c:when>
|
|
<c:otherwise>
|
|
${item.STATUS}
|
|
</c:otherwise>
|
|
</c:choose>
|
|
</td>
|
|
</tr>
|
|
</c:forEach>
|
|
</c:when>
|
|
<c:otherwise>
|
|
<tr style="text-align:center;">
|
|
<td colspan="7">조회된 정보가 없습니다.</td>
|
|
</tr>
|
|
</c:otherwise>
|
|
</c:choose>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="pdm_page">
|
|
|
|
<%--
|
|
nPage ${nPage}
|
|
prevPage ${prevPage}
|
|
maxPage ${maxPage}
|
|
nextPage ${nextPage}
|
|
totalCount ${totalCount}
|
|
--%>
|
|
|
|
<input type="hidden" name="page" id="page" value="${nPage}">
|
|
<c:if test="${!empty LIST}">
|
|
<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>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</body>
|
|
</html> |