ERP-node/WebContent/WEB-INF/view/salesmgmt/customerMgmt/customerMgmtFormPopup.jsp

257 lines
8.8 KiB
Plaintext

<%
/**
* 고객관리 상세 조회
* @since 2021.11.03
* @author min
* @version 1.0
*
* << 개정 이력 >>
*
* 수정일 수정자 수정내용
* ---------------- --------------------- --------------------------------------------------------
* 2021.11.03 민상익 최초작성
**/
%>
<%@ 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" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%=Constants.SYSTEM_NAME%></title>
</head>
<link rel="stylesheet" href="/css/ions-basic.css">
<script type="text/javascript" src="/js/ions-common.js" ></script>
<script type="text/javascript">
$(document).ready(function(){
$('.select2').select2();
fnc_makeDatepick();
// 저장
$("#btnSave").click(function(){
fn_save();
});
// 삭제
$("#btnDelete").click(function(){
fn_delete();
});
// 닫기
$("#btnClose").click(function(){
self.close(0);
});
});
// 고객관리 정보 등록
function fn_save(){
if(fnc_valitate("form1")){
if ($.trim($('#taxNo1').val()) === '' && $.trim($('#taxNo2').val()) === '') {
Swal.fire('사업자번호나 주민번호 둘 중 하나는 반드시 입력해야 합니다.');
$('#taxNo1').focus();
return false;
}
if(confirm("등록 하시겠습니까?")){
saveProcess();
}
}
}
// 등록
function saveProcess(){
$.ajax({
url:"/customerMgmt/saveCustomerMgmt.do",
type:"POST",
data:$("#form1").serialize(),
dataType:"json",
success:function(data){
Swal.fire(data.RESULT.msg);
if (data.RESULT.result) {
opener.fn_search();
self.close();
}
},
error: function(jqxhr, status, error){
}
});
}
// 고객관리 정보 삭제
function fn_delete() {
if(confirm("삭제 하시겠습니까?")){
deleteProcess();
}
}
// 삭제
function deleteProcess(){
$.ajax({
url:"/customerMgmt/deleteCustomerMgmt.do",
type:"POST",
data:$("#form1").serialize(),
dataType:"json",
success:function(data){
Swal.fire(data.RESULT.msg);
opener.fn_search();
self.close();
},
error: function(jqxhr, status, error){
}
});
}
//관리담당자 조회
function getEmpList(deptCd) {
var param = "deptCd=" + deptCd;
$.ajax({
url:"/common/salesMgmt/empList.do",
type:"GET",
data:param,
dataType:"json",
success:function(data){
var options = "<option value=''>선택</option>";
if (data.RESULT !="") {
options += data.RESULT;
}
$("#salesman").html(options);
},
error: function(jqxhr, status, error){
}
});
}
</script>
<body>
<form name="form1" id="form1" action="" method="post">
<input type="hidden" name="custCd" id="custCd" value="${param.custCd}" />
<section>
<div class="plm_menu_name">
<h2>
<span>고객 등록</span>
</h2>
</div>
<div id="businessPopupFormWrap" >
<table class="pmsPopupForm">
<colgroup>
<col width="10%"/>
<col width="15%"/>
<col width="25%"/>
<col width="25%"/>
<col width="25%"/>
</colgroup>
<tr><td colspan="5" style="height:15px;"></td></tr>
<tr>
<td rowspan="13" class="sub_title">고객정보</td>
<c:if test="${param.actionType ne 'regist'}">
<td class="input_title" style="font-size:13px;"><label for="">고객코드</label> </td>
<td colspan="3" class="input_sub_title">
<input type="text" name="displayCustCd" id="displayCustCd" value="${info.CUSTCD}" disabled maxlength="20" style="width:130px;" />
</td>
</c:if>
</tr>
<tr>
<td class="input_title" style="font-size:13px;"><label for="">* 고객명</label></td>
<td colspan="3" class="input_sub_title"><input type="text" name="custNm" id="custNm" value="${info.CUSTNM}" required reqTitle="고객명" maxlength="20" style="width:130px;" /></td>
</tr>
<tr>
<td class="input_title" style="font-size:13px;"><label for="">* 고객지역</label></td>
<td colspan="3" class="input_sub_title">
<select name="custArea" id="custArea" required reqTitle="고객지역" type="select" style="width: 120px;" class="select2">
<option value="">선택</option>
<c:forEach var="areaList" items="${codeMap.areaList}">
${areaList}
</c:forEach>
</select>
</td>
</tr>
<tr>
<td class="input_title" style="font-size:13px;"><label for="">대표자</label></td>
<td width="21%" class="input_sub_title"><input type="text" name="custBoss" id="custBoss" value="${info.CUSTBOSS}" maxlength="20" style="width:130px;" /></td>
<td width="13%" class="input_title" style="font-size:13px;"><label for="">실사용자</label></td>
<td width="48%" class="input_sub_title"><input type="text" name="custUse" id="custUse" value="${info.CUSTUSE}" maxlength="20" style="width:130px;" /></td>
</tr>
<tr><td class="input_title" style="font-size:13px;"><label for="">* 사업자번호</label></td>
<td class="input_sub_title"><input type="text" name="taxNo1" id="taxNo1" value="${info.TAXNO1}" maxlength="20" style="width:130px;" /></td>
<td class="input_title" style="font-size:13px;"><label for="">* 법인/주민번호</label></td>
<td class="input_sub_title"><input type="text" name="taxNo2" id="taxNo2" value="${info.TAXNO2}" maxlength="20" style="width:130px;" /></td>
</tr>
<tr>
<td class="input_title" style="font-size:13px;"><label for="">업태</label></td>
<td class="input_sub_title"><input type="text" name="custType" id="custType" value="${info.CUSTTYPE}" maxlength="20" style="width:130px;" /></td>
<td class="input_title" style="font-size:13px;"><label for="">품목</label></td>
<td class="input_sub_title"><input type="text" name="custKind" id="custKind" value="${info.CUSTKIND}" maxlength="20" style="width:130px;" /></td>
</tr>
<tr>
<td class="input_title"><label for="">주소</label></td>
<td colspan="3" class="input_sub_title"><input type="text" name="postNo" id="postNo" value="${info.POSTNO}" maxlength="20" style="width:10%;" />
<input type="text" name="adrs" id="adrs" value="${info.ADRS}" maxlength="20" style="width:76%;" />
</td>
</tr>
<tr>
<td class="input_title"><label for="">휴대폰번호</label></td>
<td colspan="3" class="input_sub_title"><input type="text" name="handPhone" id="handPhone" value="${info.HANDPHONE}" maxlength="20" style="width:130px;" /></td>
</tr>
<tr>
<td class="input_title"><label for="">전화번호</label></td>
<td colspan="3" class="input_sub_title"><input type="text" name="tel" id="tel" value="${info.TEL}" maxlength="20" style="width:130px;" /></td>
</tr>
<tr>
<td class="input_title"><label for="">팩스번호</label></td>
<td colspan="3" class="input_sub_title"><input type="text" name="fax" id="fax" value="${info.FAX}" maxlength="20" style="width:130px;" /></td>
</tr>
<tr>
<td class="input_title"><label for="">영업부서</label></td>
<td colspan="3" class="input_sub_title">
<select name="deptCd" id="deptCd" onchange='getEmpList($(this).val())' type="select" style="width: 120px;" class="select2">
<option value="">선택</option>
<c:forEach var="deptList" items="${codeMap.deptList}">
${deptList}
</c:forEach>
</select>
</td>
</tr>
<tr>
<td class="input_title"><label for="">영업담당자</label></td>
<td colspan="3" class="input_sub_title">
<select name="salesman" id="salesman" type="select" style="width: 120px;" class="select2">
<option value="">선택</option>
<c:forEach var="salesmanList" items="${codeMap.salesmanList}">
${salesmanList}
</c:forEach>
</select>
</tr>
<tr><td colspan="5" style="height:15px;"></td></tr>
</table>
<br />
<br />
</div>
<div class="btn_wrap">
<div class="plm_btn_wrap_center">
<c:if test="${(param.actionType ne 'view' and info.REG_USER_ID eq connectUserId) or 'regist' eq param.actionType or 'plm_admin' eq connectUserId}">
<input type="button" value="저장" id="btnSave" class="plm_btns">
</c:if>
<c:if test="${(param.actionType eq 'modify' and info.REG_USER_ID eq connectUserId) or 'plm_admin' eq connectUserId}">
<input type="button" value="삭제" id="btnDelete" class="plm_btns">
</c:if>
<input type="button" value="닫기" id="btnClose" class="plm_btns">
</div>
</div>
</section>
</form>
</body>
</html>