347 lines
11 KiB
Plaintext
347 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">
|
|
|
|
$(function(){
|
|
$(document).ready(function(){
|
|
//고객사 목록 조회
|
|
fn_setOEMList();
|
|
//차종 Grade 목록 조회
|
|
fn_setCarGradeList();
|
|
//달력
|
|
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/updateCheckCarStatus.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/getCarMngList.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_adminCarFormPopup(objId, actionType);
|
|
});
|
|
|
|
//엔터키로 조회
|
|
$("input").keyup(function(e){
|
|
if(e.keyCode == 13){
|
|
$("#page").val("1");
|
|
fn_search();
|
|
}
|
|
});
|
|
|
|
$("#btnSearch").click(function(){
|
|
$("#page").val("1");
|
|
fn_search();
|
|
});
|
|
|
|
|
|
});
|
|
|
|
//oem 목록 조회
|
|
function fn_setOEMList(){
|
|
$.ajax({
|
|
url:"/common/getOEMList.do",
|
|
type:"POST",
|
|
data:{"isJson":true},
|
|
dataType:"json",
|
|
success:function(data){
|
|
var appendCode = "";
|
|
|
|
$.each(data, function(i){
|
|
appendCode += "<option value='"+data[i].OBJID+"'>"+data[i].OEM_NAME+"("+data[i].OEM_CODE+")</option>";
|
|
});
|
|
|
|
$("#search_oemObjid").append(appendCode);
|
|
|
|
var paramValue = "${param.search_oemObjid}";
|
|
if(paramValue != ""){
|
|
$("#search_oemObjid > option[value=${param.search_oemObjid}]").attr("selected", "true");
|
|
$("#search_oemObjid").trigger("change");
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
|
|
//차종 Grade 목록 조회
|
|
function fn_setCarGradeList(){
|
|
$.ajax({
|
|
url:"/common/getCarGradeList.do",
|
|
type:"POST",
|
|
data:{"isJson":true},
|
|
dataType:"json",
|
|
success:function(data){
|
|
var appendCode = "";
|
|
|
|
$.each(data, function(i){
|
|
appendCode += "<option value='"+data[i].OBJID+"'>"+data[i].GRADE_NAME+"</option>";
|
|
});
|
|
|
|
$("#search_carGradeObjid").append(appendCode);
|
|
|
|
var paramValue = "${param.search_carGradeObjid}";
|
|
if(paramValue != ""){
|
|
$("#search_carGradeObjid > option[value=${param.search_carGradeObjid}]").attr("selected", "true");
|
|
$("#search_carGradeObjid").trigger("change");
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
|
|
//차종 생성
|
|
function fnc_adminCarFormPopup(carObjid, actionType){
|
|
var params = "";
|
|
params += "?search_carObjid="+carObjid;
|
|
params += "&actionType="+actionType;
|
|
window.open("/admin/adminCarFormPopup.do"+params,"adminCarFormPopup","width=500,height=762");
|
|
}
|
|
|
|
//차종 목록 리스트에서 상태만 변경
|
|
function fnc_updateCarStatus(carObjid, carStatus){
|
|
var updateCarStatus = confirm("차종의 상태를 전환하시겠습니까?");
|
|
if(updateCarStatus) {
|
|
$.ajax({
|
|
url:"/admin/updateCarStatus.do",
|
|
type:"POST",
|
|
data:{"carObjid":carObjid, "carStatus":carStatus},
|
|
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/getCarMngList.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><label for="">고객사</label></td>
|
|
<td>
|
|
<select name="search_oemObjid" id="search_oemObjid">
|
|
<option value="">선택</option>
|
|
</select>
|
|
</td>
|
|
<td class="label"><label>차명</label></td>
|
|
<td><input type="text" id="search_carName" name="search_carName" value="${param.search_carName}"></td>
|
|
<td class="label"><label>차종 code</label></td>
|
|
<td><input type="text" id="search_carCode" name="search_carCode" value="${param.search_carCode}"></td>
|
|
<td class="label"><label>Grade</label></td>
|
|
<td>
|
|
<select name="search_carGradeObjid" id="search_carGradeObjid">
|
|
<option value="">선택</option>
|
|
</select>
|
|
</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>
|
|
</tr>
|
|
<tr>
|
|
<td class="label"><label>등록자</label></td>
|
|
<td><input type="text" id="search_writer" name="search_writer" value="${param.search_writer}"></td>
|
|
<td class="label"><label>등록일</label></td>
|
|
<td colspan="3" class="date_n">
|
|
<input type="text" name="search_fromDate" id="search_fromDate" value="${param.search_fromDate}" class="date_margin date_width" readonly>
|
|
~ <input type="text" name="search_toDate" id="search_toDate" value="${param.search_toDate}" class="date_margin" 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_adminCarFormPopup('', '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="10%" />
|
|
<col width="*" />
|
|
<col width="*" />
|
|
<col width="*" />
|
|
<col width="8%" />
|
|
<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>차종 code</td>
|
|
<td>모델코드</td>
|
|
<td>Grade</td>
|
|
<td>등록자</td>
|
|
<td>등록일</td>
|
|
<td>상태</td>
|
|
</tr>
|
|
<c:choose>
|
|
<c:when test="${!empty carMngList}">
|
|
<c:forEach var="car" items="${carMngList}">
|
|
<tr>
|
|
<td><input type="checkbox" name="choice" value="${car.OBJID}"></td>
|
|
<td>${car.RNUM}</td>
|
|
<td>${car.OEM_NAME}</td>
|
|
<td><a href="#" style="cursor:pointer;" class="btnModify" data-OBJID="${car.OBJID}" data-actionType="modify">${car.CAR_NAME}</a></td>
|
|
<td><a href="#" style="cursor:pointer;" class="btnModify" data-OBJID="${car.OBJID}" data-actionType="modify">${car.CAR_CODE}</a></td>
|
|
<td><a href="#" style="cursor:pointer;" class="btnModify" data-OBJID="${car.OBJID}" data-actionType="modify">${car.MODEL_CODE}</a></td>
|
|
<td>${car.GRADE_NAME}</td>
|
|
<td>${car.DEPT_NAME} ${car.USER_NAME}</td>
|
|
<td>${car.REGDATE}</td>
|
|
<td>
|
|
<select onchange="javascript:fnc_updateCarStatus('${car.OBJID}', '${car.STATUS}')">
|
|
<option value="active" ${car.STATUS eq 'active'?'selected':''}>활성화</option>
|
|
<option value="inActive" ${car.STATUS eq 'inActive'?'selected':''}>비활성화</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
</c:forEach>
|
|
</c:when>
|
|
<c:otherwise>
|
|
<td align="center" colspan="10">조회된 정보가 없습니다.</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 carMngList}">
|
|
<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> |