ERP-node/WebContent/WEB-INF/view/admin/ratecal/ratecalMngList.jsp

237 lines
7.3 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" %>
<%
String supply_name = CommonUtils.checkNull(request.getParameter("supply_name"));
String searchStatus = CommonUtils.checkNull(request.getParameter("searchStatus"));
%>
<!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>
<script>
<c:if test="${'KGY4287' ne connectUserId and 'plm_admin' ne connectUserId}">
history.go(-1);
</c:if>
$(document).ready(function(){
fnc_datepick();
//엔터키로 조회
$("input").keyup(function(e){
if(e.keyCode == 13){
$("#page").val("1");
fn_search();
}
});
$("#btnSearch").click(function(){
$("#page").val("1");
fn_search();
});
});
function openOEMPopUp(objid){
window.open("","openOEMPopUp","width=550 height=300 menubar=no status=no");
var hiddenForm = document.hiddenForm;
hiddenForm.objid.value = objid;
hiddenForm.target = "openOEMPopUp";
hiddenForm.action = "/admin/ratecalRegistPopUp.do";
hiddenForm.submit();
}
//고객사의 상태를 변경한다.
function changeOEMStatus(objid,status){
if("" == objid || "" == status){
Swal.fire("잘못된 접근입니다.");
return false;
}else if("" != objid && "" != status){
if(confirm("상태를 변경하시겠습니까?")){
var hiddenForm = document.hiddenForm;
hiddenForm.objid.value = objid;
hiddenForm.status.value = status;
var param = $("#hiddenForm").serialize();
$.ajax({
type : "POST",
url : "/admin/changeSupStatus.do",
data : param,
dataType:"json",
complete:function(xhr){
Swal.fire("변경하였습니다.");
fn_search();
}
});
}
}
}
function fn_search(){
var form = document.form1;
form.action="/admin/ratecalMngPagingList.do";
form.submit();
}
//임율마스터 history
function fn_openratecalHistory(objid){
if(null != objid){
window.open("/admin/ratecalMngHistoryList.do?objId="+objid, "", "width=400, height=500");
}else{
Swal.fire("잘못된 접근입니다.");
}
}
</script>
</head>
<body>
<form name="hiddenForm" id="hiddenForm">
<input type="hidden" name="objid">
<input type="hidden" name="status">
</form>
<form name="form1" id="form1" method="post">
<input type="hidden" name="status" id="status">
<section id="commonSection" class="admin1">
<div class="admin_title">
<h2>임율마스터관리</h2>
</div>
<div id="adminFormWrap">
<table id="adminForm">
<tbody>
<tr>
<td>
<select name="yyyy" id="yyyy">
<option value="">선택</option>
<c:forEach begin="${sysYear-4}" end="${sysYear}" var="req_year">
<option value="${req_year}"${param.yyyy eq req_year ? 'selected':'' }>${req_year}</option>
</c:forEach>
</select>
</td>
</tr>
</tbody>
</table>
</div>
<div id="adminBtnWrap">
<input type="button" value="조회" class="btns" id="btnSearch">
<input type="button" value="임율마스터등록" class="btns" onclick="javascript:openOEMPopUp('');">
</div>
<div id="adminTableWrap">
<div id="tableWrap">
<table id="adminTable">
<colgroup>
<col width="4%" />
<col width="13%" />
<col width="13%" />
<col width="13%" />
<col width="13%" />
<col width="13%" />
<col width="13%" />
<col width="13%" />
<col width="40px" />
</colgroup>
<tr id="thead">
<td>No</td>
<td>적용년도</td>
<td>명칭</td>
<td>단가</td>
<td>일단가</td>
<td>등록자</td>
<td>등록일</td>
<td>상태</td>
<td>이력</td>
</tr>
<c:choose>
<c:when test="${0 < supplyInfoList.size()}">
<c:forEach var="oemInfo" items="${supplyInfoList}">
<tr>
<td>${oemInfo.RNUM}</td>
<td>${oemInfo.YYYY}</td>
<td><a href="#" onclick="javascript:openOEMPopUp('${oemInfo.RATECAL_MGMT_OBJID}')">${oemInfo.USER_ID}</a></td>
<td>${oemInfo.ORDINARY_HOURLY_WAGE}</td>
<td>${oemInfo.DAILY_WAGE}</td>
<td>${oemInfo.WRITER_DEPT} ${oemInfo.WRITER_NAME}</td>
<td>${oemInfo.REGDATE}</td>
<td>
<select name="" id="" onchange="javascript:changeOEMStatus('${oemInfo.OBJID}',this.value);">
<option value="active" ${oemInfo.STATUS eq 'active' ? 'selected' : ''}>활성화</option>
<option value="inActive" ${oemInfo.STATUS eq 'inActive' ? 'selected' : ''}>비활성화</option>
</select>
</td>
<td><input type="button" class="blue_btn" value="이력" onclick="fn_openratecalHistory('${oemInfo.RATECAL_MGMT_OBJID}');" style="float:none;"></td>
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<tr>
<td colspan="10">조회된 정보가 없습니다.</td>
</tr>
</c:otherwise>
</c:choose>
</table>
</div>
</div>
<div class="pdm_page">
<input type="hidden" name="page" id="page" value="${nPage}">
<c:if test="${!empty supplyInfoList}">
<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>