261 lines
8.9 KiB
Plaintext
261 lines
8.9 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">
|
|
|
|
$(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/updateCheckCarOptionStatus.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/getCarOptionMngList.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_adminCarOptionFormPopup(objId, actionType);
|
|
});
|
|
|
|
$("#btnSearch").click(function(){
|
|
$("#page").val("1");
|
|
fn_search();
|
|
});
|
|
|
|
//엔터키로 조회
|
|
$("input").keyup(function(e){
|
|
if(e.keyCode == 13){
|
|
$("#page").val("1");
|
|
fn_search();
|
|
}
|
|
});
|
|
});
|
|
|
|
//차량옵션 생성
|
|
function fnc_adminCarOptionFormPopup(optionObjid, actionType){
|
|
var params = "";
|
|
params += "?search_optionObjid="+optionObjid;
|
|
params += "&actionType="+actionType;
|
|
window.open("/admin/adminCarOptionFormPopup.do"+params,"adminCarOptionFormPopup","width=500,height=238");
|
|
}
|
|
|
|
//차량옵션 목록 리스트에서 상태만 변경
|
|
function fnc_updateCarOptionStatus(carOptionObjid, carOptionStatus){
|
|
var modifyStatus = confirm("차량옵션의 상태를 전환하시겠습니까?");
|
|
if(modifyStatus) {
|
|
$.ajax({
|
|
url:"/admin/updateCarOptionStatus.do",
|
|
type:"POST",
|
|
data:{"optionObjid":carOptionObjid, "optionStatus":carOptionStatus},
|
|
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/getCarOptionMngList.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_optionName" name="search_optionName" value="${param.search_optionName}" 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_adminCarOptionFormPopup('', '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="22%" />
|
|
<col width="32%" />
|
|
<col width="13%" />
|
|
<col width="13%" />
|
|
<col width="13%" />
|
|
</colgroup>
|
|
<tr id="thead">
|
|
<td><input type="checkbox" id="allCheck" class="checkBox"></td>
|
|
<td>No</td>
|
|
<td>옵션명</td>
|
|
<td>설명</td>
|
|
<td>등록자</td>
|
|
<td>등록일</td>
|
|
<td>상태</td>
|
|
</tr>
|
|
<c:choose>
|
|
<c:when test="${!empty carOptionMngList}">
|
|
<c:forEach var="info" items="${carOptionMngList}">
|
|
<tr>
|
|
<td><input type="checkbox" name="choice" value="${info.OBJID}"></td>
|
|
<td>${info.RNUM}</td>
|
|
<td><a href="#" style="cursor:pointer;" class="btnModify" data-OBJID="${info.OBJID}" data-actionType="modify">${info.OPTION_NAME}</a></td>
|
|
<td>${info.DESCRIPTION}</td>
|
|
<td>${info.DEPT_NAME} ${info.USER_NAME}</td>
|
|
<td>${info.REGDATE}</td>
|
|
<td>
|
|
<select onchange="javascript:fnc_updateCarOptionStatus('${info.OBJID}', '${info.STATUS}')">
|
|
<option value="active" ${info.STATUS eq 'active'?'selected':''}>활성화</option>
|
|
<option value="inActive" ${info.STATUS eq 'inActive'?'selected':''}>비활성화</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
</c:forEach>
|
|
</c:when>
|
|
<c:otherwise>
|
|
<tr>
|
|
<td align="center" colspan="7">조회된 정보가 없습니다.</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 carOptionMngList}">
|
|
<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> |