226 lines
7.1 KiB
Plaintext
226 lines
7.1 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" %>
|
|
<%
|
|
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>
|
|
$(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();
|
|
});
|
|
|
|
//삭제
|
|
$("#btnDelete").click(function(){
|
|
fn_delete();
|
|
});
|
|
|
|
fn_search();
|
|
});
|
|
</script>
|
|
<script type="text/javascript">
|
|
var columns = [
|
|
{title:'OBJID', field:'OBJID' ,visible:false },
|
|
{headerHozAlign : 'center', hozAlign : 'center', width : '50', title : 'NO', field : 'RNUM' },
|
|
{headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '구분', field : 'SUPPLY_CODE_NAME' },
|
|
{headerHozAlign : 'center', hozAlign : 'left', width : '190', title : '고객명', field : 'SUPPLY_NAME',
|
|
formatter : fnc_createGridAnchorTag,
|
|
cellClick : function(e, cell) {
|
|
var objid = fnc_checkNull(cell.getData().OBJID);
|
|
openOEMPopUp(objid);
|
|
}
|
|
},
|
|
{headerHozAlign : 'center', hozAlign : 'left', width : '110', title : '지역', field : 'AREA_CD_NAME' },
|
|
{headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '대표자명', field : 'CHARGE_USER_NAME' },
|
|
{headerHozAlign : 'center', hozAlign : 'left', width : '280', title : '업종', field : 'SUPPLY_STOCKNAME' },
|
|
{headerHozAlign : 'center', hozAlign : 'left', width : '180', title : '업태', field : 'SUPPLY_BUSNAME' },
|
|
{headerHozAlign : 'center', hozAlign : 'left', /* width : '300', */ title : '주소', field : 'SUPPLY_ADDRESS' },
|
|
{headerHozAlign : 'center', hozAlign : 'center', width : '150', title : '핸드폰', field : 'SUPPLY_TEL_NO' },
|
|
{headerHozAlign : 'center', hozAlign : 'center', width : '110', title : '등록일', field : 'REGDATE' }
|
|
];
|
|
|
|
//var grid;
|
|
function fn_search(){
|
|
_tabulGrid = fnc_tabul_search(_tabul_layout_fitColumns, _tabulGrid, "/admin/supplyMngPagingGridList.do", columns, true);
|
|
}
|
|
|
|
function fn_delete(){
|
|
var checkedObj = _tabulGrid.getSelectedData();
|
|
|
|
if(0 < checkedObj.length){
|
|
var objId = fnc_checkNull(checkedObj[0].OBJID);
|
|
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 버튼을 눌렀다면
|
|
$.ajax({
|
|
type : "POST",
|
|
url : "/admin/deletesupplyMngInfo.do",
|
|
data: {
|
|
"objId":objId
|
|
},
|
|
dataType:"json",
|
|
success:function(data){
|
|
if(data.result == 'true'){
|
|
Swal.fire("삭제되었습니다.");
|
|
fn_search();
|
|
};
|
|
}
|
|
,error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}else{
|
|
Swal.fire("선택한 항목이 없습니다.");
|
|
}
|
|
}
|
|
|
|
|
|
function openOEMPopUp(objid){
|
|
var popup_width = 1300;
|
|
var popup_height = 510;
|
|
var target = "openOEMPopUp";
|
|
var url = "/admin/supplyRegistPopUp.do";
|
|
|
|
fn_centerPopup(popup_width, popup_height, url, target);
|
|
|
|
var hiddenForm = document.hiddenForm;
|
|
hiddenForm.objid.value = objid;
|
|
hiddenForm.target = "openOEMPopUp";
|
|
hiddenForm.action = "/admin/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 multiChangeOEMStatus(status){
|
|
if("" == status){
|
|
Swal.fire("잘못된 접근입니다.");
|
|
return false;
|
|
}else if("" != status){
|
|
var choice = [];
|
|
$("input[name='oemCheck']:checked").each(function(i){
|
|
choice.push($(this).val());
|
|
});
|
|
if(choice == ''){
|
|
Swal.fire("고객사를 선택하세요.")
|
|
}
|
|
else if(confirm("변경하시겠습니까?")){
|
|
document.form1.status.value = status;
|
|
document.form1.action = "/admin/multiChangeOEMStatus.do";
|
|
document.form1.submit();
|
|
}
|
|
}
|
|
}
|
|
|
|
function fn_openHistory(objid){
|
|
if(null != objid){
|
|
window.open("/admin/supMgmtInfoHistoryList.do?objid="+objid, "", "width=1200, height=500");
|
|
}else{
|
|
Swal.fire("잘못된 접근입니다.");
|
|
}
|
|
}
|
|
|
|
</script>
|
|
</head>
|
|
<body style="overflow-y: hidden;">
|
|
<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">
|
|
<div class="content-box">
|
|
<div class="content-box-s">
|
|
<div class="plm_menu_name_gdnsi">
|
|
<h2>
|
|
<span>구매관리_공급업체관리</span>
|
|
</h2>
|
|
<div class="btnArea">
|
|
<input type="button" value="조회" class="plm_btns" id="btnSearch">
|
|
<input type="button" value="공급업체 등록" class="plm_btns" onclick="javascript:openOEMPopUp('');">
|
|
<input type="button" value="삭제" class="plm_btns" id="btnDelete">
|
|
</div>
|
|
</div>
|
|
<div id="plmSearchZon">
|
|
<table>
|
|
<tbody>
|
|
<tr>
|
|
<td class="label"><label for="">고객명</label></td>
|
|
<td><input type="text" name="supply_name" id="supply_name" value="<%=supply_name%>"></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<%@include file= "/WEB-INF/view/common/common_gridArea.jsp" %>
|
|
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</body>
|
|
</html> |