Files
wace_plm/WebContent/WEB-INF/view/contractMgmt/supplyMngList_back.jsp
2025-11-10 12:17:16 +09:00

420 lines
14 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}" />
<script src="/js/rMateChartH5/rMateChartH5License.js"></script>
<script src="/js/rMateChartH5/JS/rMateChartH5.js"></script>
<link rel="stylesheet" href="/js/rMateChartH5/Assets/Css/rMateChartH5.css"/>
<script>
$(document).ready(function(){
fnc_datepick();
//엔터키로 조회
$("input").keyup(function(e){
if(e.keyCode == 13){
$("#page").val("1");
fn_search();
}
});
// 전체 선택
$("#firstCheck").click(function(){
if($("#firstCheck").prop("checked")){
$("input[name=oemCheck]").prop("checked",true);
}else{
$("input[name=oemCheck]").prop("checked",false);
}
})
// 부분체크해제
$("input[name=oemCheck]").click(function(){
if($("#firstCheck").is(":checked")){
$("#firstCheck").prop("checked",false);
}
})
$("#btnSearch").click(function(){
$("#page").val("1");
fn_search();
});
//체크박스 전체선택/전체해제
$("#allCheck").click(function(){
if($("#allCheck").prop("checked")) {
$("input[type=checkbox]").prop("checked",true);
} else {
$("input[type=checkbox]").prop("checked",false);
}
});
//삭제
$("#btnDelete").click(function(){
fn_delete();
});
});
</script>
<script type="text/javascript">
function fn_delete(){
if(0 < $("input[name=oemCheck]:checked").length){
Swal.fire({
title: '선택한 고객정보를 삭제하시겠습니까?',
text: '',
icon: 'warning',
showCancelButton: true, // cancel버튼 보이기. 기본은 원래 없음
confirmButtonColor: '#3085d6', // confrim 버튼 색깔 지정
cancelButtonColor: '#d33', // cancel 버튼 색깔 지정
confirmButtonText: '확인', // confirm 버튼 텍스트 지정
cancelButtonText: '취소', // cancel 버튼 텍스트 지정
reverseButtons: false, // 버튼 순서 거꾸로
}).then(result => {
// 만약 Promise리턴을 받으면,
if (result.isConfirmed) { // 만약 모달창에서 confirm 버튼을 눌렀다면
var param = $("#form1").serialize();
$.ajax({
type : "POST",
url : "/contractMgmt/deletesupplyMngInfo.do",
data: param,
dataType:"json",
success:function(data){
if(data.result == 'true'){
alert("삭제되었습니다.");
fn_search();
};
}
,error: function(jqxhr, status, error){
}
});
}
});
}else{
Swal.fire("선택한 항목이 없습니다.");
}
}
function openOEMPopUp(objid){
var popup_width = 900;
var popup_height = 700;
var target = "openOEMPopUp";
fn_centerPopup(popup_width, popup_height, url, target);
var hiddenForm = document.hiddenForm;
var url = "/contractMgmt/supplyRegistPopUp.do";
hiddenForm.objid.value = objid;
hiddenForm.target = "openOEMPopUp";
hiddenForm.action = "/contractMgmt/supplyRegistPopUp.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 viewBusRegCert(supplyObjId){
// 파일 목록 가져오기
$.ajax({
url: "/common/getFileList.do",
type: "POST",
data: {
targetObjId: supplyObjId,
docType: "BUS_REG_CERT"
},
dataType: "json",
success: function(data){
if(data && data.length > 0){
// 파일이 1개면 바로 새 탭에서 열기
if(data.length === 1){
window.open("/common/downloadFile.do?objId="+data[0].OBJID, "_blank");
} else {
// 파일이 여러 개면 선택 팝업 표시
showFileSelectPopup(data);
}
} else {
Swal.fire("등록된 사업자등록증이 없습니다.");
}
},
error: function(){
Swal.fire("파일 목록을 불러오는데 실패했습니다.");
}
});
}
// 여러 파일 선택 팝업
function showFileSelectPopup(files){
var fileListHtml = "<div style='max-height:400px; overflow-y:auto;'>";
fileListHtml += "<table style='width:100%; border-collapse:collapse;'>";
fileListHtml += "<thead><tr style='background-color:#f8f9fa;'>";
fileListHtml += "<th style='padding:10px; border:1px solid #dee2e6;'>파일명</th>";
fileListHtml += "<th style='padding:10px; border:1px solid #dee2e6; width:100px;'>등록일</th>";
fileListHtml += "<th style='padding:10px; border:1px solid #dee2e6; width:80px;'>보기</th>";
fileListHtml += "</tr></thead><tbody>";
$.each(files, function(i, file){
fileListHtml += "<tr>";
fileListHtml += "<td style='padding:8px; border:1px solid #dee2e6;'>"+file.REAL_FILE_NAME+"</td>";
fileListHtml += "<td style='padding:8px; border:1px solid #dee2e6; text-align:center;'>"+file.REGDATE+"</td>";
fileListHtml += "<td style='padding:8px; border:1px solid #dee2e6; text-align:center;'>";
fileListHtml += "<button onclick='window.open(\"/common/downloadFile.do?objId="+file.OBJID+"\", \"_blank\"); return false;' style='padding:5px 10px; cursor:pointer;'>보기</button>";
fileListHtml += "</td>";
fileListHtml += "</tr>";
});
fileListHtml += "</tbody></table></div>";
Swal.fire({
title: '사업자등록증 ('+files.length+'개)',
html: fileListHtml,
width: '700px',
showCloseButton: true,
showConfirmButton: false
});
}
function fn_search(){
var form = document.form1;
form.action="/contractMgmt/supplyMngPagingList.do";
form.submit();
}
</script>
</head>
<body>
<form name="hiddenForm" id="hiddenForm">
<input type="hidden" name="objid">
</form>
<form name="form1" id="form1" method="post">
<input type="hidden" name="status" id="status">
<section id="commonSection" class="admin1">
<div class="content-box" style="height:98.8%;">
<div class="content-box-s">
<div class="plm_menu_name">
<h2>
<span>영업관리_고객관리</span>
</h2>
</div>
<div id="plmSearchZon">
<table>
<tr>
<td class="label"><label for="">고객사명</label></td>
<td><input type="text" name="supply_name" id="supply_name" value="<%=supply_name%>"></td>
<!-- <td class="label"><label for="">고객구분</label></td> -->
<!-- <td> -->
<!-- <select name="supply_code" id="supply_code" type="select" class="select2" autocomplete="off"> -->
<!-- <option value="">선택</option> -->
<%-- ${code_map.supply_code} --%>
<!-- </select> -->
<!-- </td> -->
<!-- <td class="label"><label for="">지역</label></td> -->
<!-- <td> -->
<!-- <select name="area_cd" id="area_cd" type="select" class="select2" autocomplete="off"> -->
<!-- <option value="">선택</option> -->
<%-- ${code_map.area_cd} --%>
<!-- </select> -->
<!-- </td> -->
</tr>
</table>
</div>
<section class="contents_page_basic_margin">
<div class="btn_wrap">
<div class="plm_btn_wrap">
<input type="button" value="삭제" class="plm_btns delete" id="btnDelete">
<input type="button" value="조회" class="plm_btns" id="btnSearch">
<input type="button" value="고객등록" class="plm_btns" onclick="javascript:openOEMPopUp('');">
</div>
</div>
<div class="plm_table_wrap" style="height:620px">
<div>
<table class="plm_table">
<colgroup>
<col width="3%" />
<col width="6%" />
<col width="5%" />
<col width="6%" />
<col width="10%" />
<col width="7%" />
<col width="8%" />
<col width="*" />
<col width="8%" />
<col width="12%" />
<col width="7%" />
</colgroup>
<thead>
<tr class="plm_thead">
<td><input type="checkbox" id="allCheck"></td>
<td>고객번호</td>
<!-- <td>고객구분</td> -->
<!-- <td>지역</td> -->
<td>고객사</td>
<td>대표자명</td>
<td>담당자</td>
<!-- <td>담당자 이메일</td> -->
<td>사업자등록번호</td>
<td>주소</td>
<td>연락처</td>
<td>E-MAIL</td>
<td>등록일</td>
<td>사업자등록증</td>
</tr>
</thead>
<tbody>
<c:choose>
<c:when test="${0 < supplyInfoList.size()}">
<c:forEach var="oemInfo" items="${supplyInfoList}">
<tr>
<td><input type="checkbox" name="oemCheck" value="${oemInfo.OBJID}"></td>
<td><a href="#" onclick="javascript:openOEMPopUp('${oemInfo.OBJID}')">${oemInfo.CUS_NO}</a></td>
<%-- <td>${oemInfo.SUPPLY_CODE_NAME}</td> --%>
<%-- <td style="text-align:left; padding-left: 10px;">${oemInfo.AREA_CD_NAME}</td> --%>
<td style="text-align:left; padding-left: 10px;">${oemInfo.SUPPLY_NAME}</td>
<td style="text-align:left; padding-left: 10px;">${oemInfo.CHARGE_USER_NAME}</td>
<td style="text-align:left; padding-left: 10px;">${oemInfo.MANAGER1_NAME}</td>
<%-- <td style="text-align:left; padding-left: 10px;">${oemInfo.MANAGER1_EMAIL}</td> --%>
<td>${oemInfo.BUS_REG_NO}</td>
<td style="text-align:left; padding-left: 10px;">${oemInfo.SUPPLY_ADDRESS}</td>
<td>${oemInfo.SUPPLY_TEL_NO}</td>
<td style="text-align:left; padding-left: 10px;">${oemInfo.EMAIL}</td>
<td>${oemInfo.REGDATE}</td>
<td>
<c:choose>
<c:when test="${not empty oemInfo.BUS_REG_FILE_CNT and oemInfo.BUS_REG_FILE_CNT > 0}">
<a href="javascript:viewBusRegCert('${oemInfo.OBJID}')">
<img src="/images/folder_blue.png" height="25px" width="25px" style="cursor:pointer;" title="사업자등록증 보기 (${oemInfo.BUS_REG_FILE_CNT}개)">
</a>
</c:when>
<c:otherwise>
<a href="javascript:viewBusRegCert('${oemInfo.OBJID}')">
<img src="/images/file_empty.png" height="25px" width="25px" style="cursor:pointer;" title="등록된 파일 없음">
</a>
</c:otherwise>
</c:choose>
</td>
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<tr>
<td colspan="11">조회된 정보가 없습니다.</td>
</tr>
</c:otherwise>
</c:choose>
</tbody>
</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>
</div>
</div>
<%-- <div id="chart1Holder" style="width:600px; height:400px; border: 1px solid;">
${chart1SC}
</div>
<div id="chart2Holder" style="width:600px; height:400px; border: 1px solid;">
${chart2SC}
</div> --%>
</form>
</body>
</html>