421 lines
17 KiB
Plaintext
421 lines
17 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" %>
|
|
<%
|
|
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
|
|
String connector = person.getUserId();
|
|
|
|
%>
|
|
<!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>
|
|
|
|
<c:set var="connector" value="<%=connector %>" />
|
|
|
|
<script type="text/javascript">
|
|
$(function(){
|
|
$(document).ready(function(){
|
|
fnc_datepick();
|
|
|
|
$("#btnClose").click(function(){
|
|
self.close(0);
|
|
});
|
|
|
|
$("input[type=text]").keyup(function(e){
|
|
if(e.keyCode == 13) search();
|
|
});
|
|
|
|
$("#btnReg").click(function(){
|
|
openCustomerMngPopup("");
|
|
});
|
|
|
|
$("#btnDelete").click(function(){
|
|
fn_deleteCustomerMng();
|
|
});
|
|
|
|
$("#btnApproval").click(function(){
|
|
var checkedCustomerMng = $("input[name=customerMngObjId]:checked");
|
|
var title = "";
|
|
if(1 < checkedCustomerMng){
|
|
Swal.fire("한번에 한개의 결재만 가능합니다.");
|
|
return false;
|
|
}else{
|
|
var targetStatus = $("input[name=customerMngObjId]:checked").attr("data-STATUS");
|
|
var objId = checkedCustomerMng.val();
|
|
|
|
if(targetStatus == "등록중" || targetStatus == "조치중" || targetStatus == "조치완료" || targetStatus == "반려"){
|
|
window.open("/approval/registApproval.do?targetType=CUSTOMER_MNG&targetObjId="+objId+"&approvalTitle="+title+"&callbackFnc=fn_search","registApproval","width=700,height=700");
|
|
}else{
|
|
Swal.fire("이미 결재완료 또는 결재중 상태입니다.");
|
|
return false;
|
|
}
|
|
}
|
|
});
|
|
|
|
$(".btnApprovalDetail").click(function(){
|
|
var approvalObjId = $(this).attr("data-APPROVAL_OBJID");
|
|
var routeObjId = $(this).attr("data-ROUTE_OBJID");
|
|
var params = "?approvalObjId="+approvalObjId;
|
|
params += "&routeObjId="+routeObjId;
|
|
//Swal.fire("params : "+params);
|
|
window.open("/approval/approvalDetail.do"+params,"approvalDetailPopup","width=650 height=400 menubar=no status=no");
|
|
});
|
|
|
|
//체크박스 전체선택/전체해제
|
|
$("#allCheck").click(function(){
|
|
if($("#allCheck").prop("checked")) {
|
|
$("input[type=checkbox]").prop("checked",true);
|
|
} else {
|
|
$("input[type=checkbox]").prop("checked",false);
|
|
}
|
|
});
|
|
|
|
$("#btnSearch").click(function(){
|
|
$("#page").val("1");
|
|
fn_search();
|
|
});
|
|
|
|
fnc_getCodeListAppend("<%=Constants.MNG_TYPE_CD%>","search_mng_type","${param.search_mng_type}");
|
|
fnc_getCodeListAppend("<%=Constants.PRODUCT_DIVISION_CD%>","search_product_division","${param.search_product_division}");
|
|
fn_getProjectNoList("search_project_objid","${param.search_project_objid}");
|
|
fnc_getCodeListAppend("<%=Constants.PERFORMER_CD%>","search_performer","${param.search_performer}");
|
|
fnc_getCodeListAppend("<%=Constants.MEASURE_TYPE_CD%>","search_measure_type","${param.search_measure_type}");
|
|
fnc_getCodeListAppend("<%=Constants.CUSTOMER_MNG_STATUS_CD%>","search_status","${param.search_status}");
|
|
});
|
|
});
|
|
|
|
function fn_getProjectNoList(selectboxId,selectedVal){
|
|
$.ajax({
|
|
url:"/common/getProjectNoList.do",
|
|
type:"POST",
|
|
data:{},
|
|
dataType:"json",
|
|
async:false,
|
|
success:function(data){
|
|
|
|
var resultList = data;
|
|
|
|
if(0 < resultList.length){
|
|
$("#"+selectboxId).empty();
|
|
|
|
$("#"+selectboxId).append("<option value=''>선택</option>");
|
|
|
|
for (var i = 0; i < resultList.length; i++) {
|
|
var projectNoObjId = resultList[i].ORDER_MGMT_OBJID;
|
|
var projectNo = resultList[i].PROJECT_NO;
|
|
$("#"+selectboxId).append("<option value='"+projectNoObjId+"'>"+projectNo+"</option>");
|
|
}
|
|
$("#"+selectboxId).val(selectedVal);
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
|
|
function fn_deleteCustomerMng(){
|
|
var checkedCustomerMng = $("input[name=customerMngObjId]:checked");
|
|
|
|
if(0 == checkedCustomerMng.length){
|
|
Swal.fire("선택된 대상이 없습니다.");
|
|
}else{
|
|
var checkArr = new Array();
|
|
var ngCnt = 0;
|
|
$("input[name=customerMngObjId]:checked").each(function(){
|
|
var objId = fnc_checkNull($(this).val().replace(" ",""));
|
|
var currentStatus = $(this).attr("data-STATUS");
|
|
|
|
if("결재중" == currentStatus || "결재완료" == currentStatus){
|
|
ngCnt++;
|
|
}
|
|
checkArr.push(objId);
|
|
});
|
|
|
|
if(0 < ngCnt){
|
|
Swal.fire("결재중/결재완료인 내용은 삭제가 불가합니다.");
|
|
return false;
|
|
}else{
|
|
if(confirm("삭제하시겠습니까?")){
|
|
$.ajax({
|
|
type : "POST",
|
|
url : "/customerMng/deleteCustomerMng.do",
|
|
data: {"checkArr":checkArr.join()},
|
|
dataType:"json",
|
|
success:function(data){
|
|
Swal.fire(data.msg);
|
|
if(data.result =="true"){
|
|
fn_search();
|
|
}
|
|
}
|
|
,error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function openCustomerMngPopup(objId){
|
|
var hiddenForm = document.hiddenForm;
|
|
var url = "/customerMng/customerMngFormPopUp.do";
|
|
|
|
if("" != objId){
|
|
url = "/customerMng/customerMngDetailPopUp.do";
|
|
}
|
|
|
|
var target = "customerMngPopUp";
|
|
|
|
window.open(url,target,"width=1000, height=800, menubars=no, scrollbars=yes, resizable=yes");
|
|
|
|
hiddenForm.action = url;
|
|
hiddenForm.OBJID.value = objId;
|
|
hiddenForm.target = target;
|
|
hiddenForm.submit();
|
|
}
|
|
|
|
function fn_search(){
|
|
document.form1.action = "/customerMng/customerMngListPopUp.do";
|
|
document.form1.submit();
|
|
}
|
|
|
|
</script>
|
|
</head>
|
|
<body class="backcolor">
|
|
<form name="hiddenForm" id="hiddenForm" method="post">
|
|
<input type="hidden" name="OBJID" id="OBJID">
|
|
<input type="hidden" name="DOC_TYPE" id="DOC_TYPE">
|
|
<input type="hidden" name="TITLE" id="TITLE">
|
|
<input type="hidden" name="actionType" id="actionType">
|
|
<input type="hidden" name="division" id="division">
|
|
<input type="hidden" name="status" id="status">
|
|
</form>
|
|
<form name="form1" id="form1" method="post">
|
|
<input type="hidden" name="actionType">
|
|
<div class="content-box">
|
|
<div class="content-box-s">
|
|
<div class="plm_menu_name">
|
|
<h2>
|
|
<span>고객관리 조회</span>
|
|
</h2>
|
|
</div>
|
|
<div id="plmSearchZon">
|
|
<table>
|
|
<tbody>
|
|
<tr>
|
|
<td><label for="Year">연도</label></td>
|
|
<td>
|
|
<select name="search_year" id="search_year" style="width:200px;" autocomplete="off">
|
|
<option value="">선택</option>
|
|
<c:forEach begin="${sysYear-4}" end="${sysYear}" var="req_year">
|
|
<option value="${req_year}"${param.search_year eq req_year ? 'selected':'' }>${req_year}</option>
|
|
</c:forEach>
|
|
</select>
|
|
</td>
|
|
<td><label for="">유형</label></td>
|
|
<td>
|
|
<select name="search_mng_type" id="search_mng_type" style="width:200px;" autocomplete="off"></select>
|
|
</td>
|
|
<td><label for="">제품구분</label></td>
|
|
<td>
|
|
<select name="search_product_division" id="search_product_division" style="width:200px;" autocomplete="off"></select>
|
|
</td>
|
|
<td><label for="">Project No.</label></td>
|
|
<td>
|
|
<select name="search_project_objid" id="search_project_objid" style="width:200px;" autocomplete="off"></select>
|
|
</td>
|
|
<td><label for="">고객사명</label></td>
|
|
<td>
|
|
<input type="text" name="search_customer_name" id="search_customer_name" style="width:200px;" value="${param.search_customer_name}">
|
|
</td>
|
|
<td><label for="">접수일</label></td>
|
|
<td>
|
|
<input type="text" name="search_start_reception_date" id="search_start_reception_date" style="width:80px;" value="${param.search_start_reception_date}">~
|
|
<input type="text" name="search_end_reception_date" id="search_end_reception_date" style="width:80px;" value="${param.search_end_reception_date}">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><label for="">발생장소</label></td>
|
|
<td>
|
|
<input type="text" name="search_event_location" id="search_event_location" style="width:200px;" value="${param.search_event_location}">
|
|
</td>
|
|
<td><label for="">수행사</label></td>
|
|
<td>
|
|
<select name="search_performer" id="search_performer" style="width:200px;" autocomplete="off"></select>
|
|
</td>
|
|
<td><label for="">조치일</label></td>
|
|
<td>
|
|
<input type="text" name="search_start_action_date" id="search_start_action_date" style="width:93px;" value="${param.search_start_action_date}">~
|
|
<input type="text" name="search_end_action_date" id="search_end_action_date" style="width:93px;" value="${param.search_end_action_date}">
|
|
</td>
|
|
<td><label for="">비용구분</label></td>
|
|
<td>
|
|
<select name="search_measure_type" id="search_measure_type" style="width:200px;" autocomplete="off"></select>
|
|
</td>
|
|
<td><label for="">상태</label></td>
|
|
<td>
|
|
<select name="search_status" id="search_status" style="width:200px;" autocomplete="off"></select>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<section class="contents_page_basic_margin">
|
|
<div class="btn_wrap">
|
|
<div class="plm_btn_wrap">
|
|
<input type="button" value="결재상신" class="plm_btns" id="btnApproval">
|
|
<input type="button" value="등록" class="plm_btns" id="btnReg">
|
|
<input type="button" value="삭제" class="plm_btns" id="btnDelete">
|
|
<input type="button" value="조회" class="plm_btns" id="btnSearch">
|
|
</div>
|
|
</div>
|
|
<div class="plm_table_wrap">
|
|
<div>
|
|
<p style="color:red;">※ 조치비용 총 금액(원) : <fmt:formatNumber value="${SUM_MEASURE_AMOUNT}"/></p>
|
|
<table class="plm_table">
|
|
<colgroup>
|
|
<col width="2.5%" />
|
|
<col width="6%" /> <!-- No. -->
|
|
<col width="6%" /> <!-- 유형 -->
|
|
<col width="6%" /> <!-- 제품구분 -->
|
|
<col width="9%" /> <!-- Project No. -->
|
|
<col width="8%" /> <!-- 고객사명 -->
|
|
<col width="6%" /> <!-- 접수일 -->
|
|
<col width="6%" /> <!-- 발생장소 -->
|
|
<col width="*" /> <!-- 제목 -->
|
|
<col width="8%" /> <!-- 작성자 -->
|
|
<col width="4%" /> <!-- 수행사 -->
|
|
<col width="6%" /> <!-- 조치일 -->
|
|
<col width="5%" /> <!-- 비용구분 -->
|
|
<col width="8%" /> <!-- 조치비용 -->
|
|
<col width="5%" /> <!-- 상태 -->
|
|
</colgroup>
|
|
<thead>
|
|
<tr class="plm_thead">
|
|
<td><input type="checkbox" name="allCheck"></td>
|
|
<td>No.</td> <!-- No. -->
|
|
<td>유형</td> <!-- 유형 -->
|
|
<td>제품구분</td> <!-- 제품구분 -->
|
|
<td>Project No.</td><!-- Project No. -->
|
|
<td>고객사명</td> <!-- 고객사명 -->
|
|
<td>접수일</td> <!-- 접수일 -->
|
|
<td>발생장소</td> <!-- 발생장소 -->
|
|
<td>제목</td> <!-- 제목 -->
|
|
<td>작성자</td> <!-- 작성자 -->
|
|
<td>수행사</td> <!-- 수행사 -->
|
|
<td>조치일</td> <!-- 조치일 -->
|
|
<td>비용구분</td> <!-- 비용구분 -->
|
|
<td>조치비용</td> <!-- 조치비용 -->
|
|
<td>상태</td> <!-- 상태 -->
|
|
</tr>
|
|
</thead>
|
|
|
|
<c:choose>
|
|
<c:when test="${empty LIST}">
|
|
<tr style="text-align:center;">
|
|
<td align="center" colspan="15">조회된 데이터가 없습니다.</td>
|
|
</tr>
|
|
</c:when>
|
|
<c:otherwise>
|
|
<c:forEach var="item" items="${LIST}" varStatus="varStatus">
|
|
<tr>
|
|
<td><input type="checkbox" name="customerMngObjId" value="${item.OBJID}" data-STATUS="${item.STATUS_TITLE}" data-WRITER="${item.WRITER}"></td>
|
|
<td title="${item.MNG_NUMBER}"><a href="#" onclick="openCustomerMngPopup('${item.OBJID}');">${item.MNG_NUMBER}</a></td><!-- Date -->
|
|
<td title="${item.MNG_TYPE_TITLE}">${item.MNG_TYPE_TITLE}</td><!-- Date -->
|
|
<td title="${item.PRODUCT_DIVISION_TITLE}">${item.PRODUCT_DIVISION_TITLE}</td><!-- Date -->
|
|
<td title="${item.PROJECT_NO}">${item.PROJECT_NO}</td><!-- Date -->
|
|
<td title="${item.CUSTOMER_NAME}">${item.CUSTOMER_NAME}</td><!-- Date -->
|
|
<td title="${item.RECEPTION_DATE_TITLE}">${item.RECEPTION_DATE_TITLE}</td><!-- Date -->
|
|
<td title="${item.EVENT_LOCATION}">${item.EVENT_LOCATION}</td><!-- Date -->
|
|
<td title="${item.TITLE}">${item.TITLE}</td><!-- Date -->
|
|
<td title="${item.WRITER_TITLE}">${item.WRITER_TITLE}</td><!-- 등록자 -->
|
|
<td title="${item.PERFORMER_TITLE}">${item.PERFORMER_TITLE}</td><!-- Date -->
|
|
<td title="${item.ACTION_DATE_TITLE}">${item.ACTION_DATE_TITLE}</td><!-- Date -->
|
|
<td title="${item.MEASURE_TYPE_TITLE}">${item.MEASURE_TYPE_TITLE}</td><!-- Date -->
|
|
<td title="${item.MEASURE_AMOUNT}"><fmt:formatNumber value="${item.MEASURE_AMOUNT}"/></td><!-- Date -->
|
|
<td title="${item.STATUS_TITLE}">
|
|
<c:choose>
|
|
<c:when test="${item.STATUS_TITLE ne '작성중'}">
|
|
<a href="#" class="btnApprovalDetail" data-APPROVAL_OBJID="${item.APPROVAL_OBJID}" data-ROUTE_OBJID="${item.ROUTE_OBJID}">${item.STATUS_TITLE}</a>
|
|
</c:when>
|
|
<c:otherwise>
|
|
${item.STATUS_TITLE}
|
|
</c:otherwise>
|
|
</c:choose>
|
|
</td><!-- 상태 -->
|
|
</tr>
|
|
</c:forEach>
|
|
</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">
|
|
<table align="center">
|
|
<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>
|
|
<c:if test="${!empty LIST}">
|
|
<p id="adminPageCount">총 ${totalCount}건</p>
|
|
</c:if>
|
|
</div>
|
|
</c:if>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
<div class="btn_wrap">
|
|
<div class="plm_btn_wrap_center">
|
|
<input type="button" value="닫기" id="btnClose" class="plm_btns">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</body>
|
|
</html> |