ERP-node/WebContent/WEB-INF/view/salesmgmt/salesNcollectMgmt/collectFormPopup.jsp

281 lines
8.8 KiB
Plaintext

<%
/**
* 수금관리 상세 조회
* @since 2021.11.05
* @author min
* @version 1.0
*
* << 개정 이력 >>
*
* 수정일 수정자 수정내용
* ---------------- --------------------- --------------------------------------------------------
* 2021.11.05 민상익 최초작성
**/
%>
<%@ 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();
// 신규등록
$("#btnReg").click(function(){
fn_init();
});
// 저장
$("#btnSave").click(function(){
fn_save();
});
// 삭제
$("#btnDelete").click(function(){
fn_delete();
});
// 닫기
$("#btnClose").click(function(){
opener.fn_search();
self.close(0);
});
});
// 폼 초기화
function fn_init() {
document.hiddenForm.actionType.value = "regist";
document.hiddenForm.rcptNo.value = "";
document.hiddenForm.action = "/salesNcollectMgmt/collectMgmtFormPopup.do";
document.hiddenForm.submit();
}
// 수금관리 정보 등록
function fn_save(){
if(fnc_valitate("form1")){
if(confirm("등록 하시겠습니까?")){
saveProcess();
}
}
}
// 수금등록
function saveProcess(){
$.ajax({
url:"/salesNcollectMgmt/saveCollectMgmt.do",
type:"POST",
data:$("#form1").serialize(),
dataType:"json",
success:function(data){
Swal.fire(data.RESULT.msg);
if (data.RESULT.result) {
fn_init();
}
},
error: function(jqxhr, status, error){
}
});
}
// 수금 정보 삭제
function fn_delete() {
if(confirm("삭제 하시겠습니까?")){
deleteProcess();
}
}
// 삭제
function deleteProcess(){
$.ajax({
url:"/salesNcollectMgmt/deleteCollectMgmt.do",
type:"POST",
data:$("#form1").serialize(),
dataType:"json",
success:function(data){
Swal.fire(data.RESULT.msg);
if (data.RESULT.result) {
fn_init();
}
},
error: function(jqxhr, status, error){
}
});
}
//하단 그리드 선택 했을때
function selectCollectbyRcpNo(rcptNo, orderNo){
document.form1.rcptNo.value = rcptNo;
document.hiddenForm.actionType.value = "modify";
document.hiddenForm.orderNo.value = orderNo;
document.hiddenForm.rcptNo.value = rcptNo;
document.hiddenForm.action = "/salesNcollectMgmt/collectMgmtFormPopup.do";
document.hiddenForm.submit();
}
</script>
<body>
<form name="hiddenForm" id="hiddenForm" method="get" onsubmit="return false;">
<input type="hidden" name="actionType" id="actionType" value="${param.actionType}" />
<input type="hidden" name="orderNo" id="orderNo" value="${param.orderNo}" /> <!-- 계약번호 -->
<input type="hidden" name="rcptNo" id="rcptNo" /> <!-- 수금번호 -->
</form>
<form name="form1" id="form1" action="" method="post">
<input type="hidden" name="orderNo" id="orderNo" value="${param.orderNo}" /> <!-- 계약번호 -->
<input type="hidden" name="rcptNo" id="rcptNo" value="${info.RCPTNO}" /> <!-- 수금번호 -->
<input type="hidden" name="custCd" id="custCd" value="${info.CUSTCD}" /> <!-- 고객코드 -->
<input type="hidden" name="ser" id="ser" value="${info.SER}" /> <!-- 일련번호 -->
<section>
<div class="plm_menu_name">
<h2>
<span>수금등록</span>
</h2>
</div>
<div id="businessPopupFormWrap">
<table class="pmsPopupForm">
<colgroup>
<col width="10%"/>
<col width="20%"/>
<col width="25%"/>
<col width="20%"/>
<col width="25%"/>
</colgroup>
<tr><td colspan="5" style="height:15px;"></td></tr>
<tr>
<td rowspan="5" 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="5" class="input_sub_title">
<input type="text" name="displayRcptNo" id="displayRcptNo" value="${info.RCPTNO}" disabled style="width:130px;" />
</td>
</c:if>
</tr>
<tr>
<td class="input_title" style="font-size:13px;"><label for="">* 수금일자</label></td>
<td colspan="5" class="input_sub_title">
<input type="text" name="rcptYmd" id="rcptYmd" required reqTitle="수금일자" value="${info.RCPTYMD}" class="date_icon" style="width: 130px !important;background-color:#fff;" autocomplete="off">
</td>
</tr>
<tr>
<td class="input_title" style="font-size:13px;"><label for="">* 계정과목</label></td>
<td class="input_sub_title">
<select name="accountType" id="accountType" required reqTitle="계정과목" type="select" style="width:150px;">
<option value="">선택</option>
<c:forEach var="accountTypeList" items="${codeMap.accountTypeList}">
${accountTypeList}
</c:forEach>
</select>
</td>
<td class="input_title" style="font-size:13px;"><label for="">* 수금금액</label></td>
<td class="input_sub_title">
<input type="text" name="rcptAmt" id="rcptAmt" required reqTitle="수금금액" value="${info.RCPTAMT}" maxlength="9" style="width:150px;" />
</td>
</tr>
<tr>
<td class="input_title" style="font-size:13px;"><label for="">* 자금구분</label></td>
<td class="input_sub_title">
<select name="fundsType" id="fundsType" required reqTitle="자금구분" type="select" style="width:150px;">
<option value="">선택</option>
<c:forEach var="fundsTypeList" items="${codeMap.fundsTypeList}">
${fundsTypeList}
</c:forEach>
</select>
</td>
<td class="input_title" style="font-size:13px;"><label for="">* 자금유형</label></td>
<td class="input_sub_title">
<select name="aoType" id="aoType" required reqTitle="자금유형" type="select" style="width:150px;">
<option value="">선택</option>
<c:forEach var="aoTypeList" items="${codeMap.aoTypeList}">
${aoTypeList}
</c:forEach>
</select>
</td>
</tr>
<tr>
<td class="input_title"><label for="">비고</label></td>
<td colspan="3" class="input_sub_title">
<textarea name="remark" id="remark" style="width:85%;height:30px;">${info.REMARK}</textarea>
</td>
</tr>
<tr><td colspan="5" style="height:15px;"></td></tr>
</table>
<table class="plm_table">
<colgroup>
<col width="10%" />
<col width="10%" />
<col width="10%" />
<col width="10%" />
<col width="10%" />
<col width="10%" />
<col width="30%" />
</colgroup>
<thead>
<tr class="plm_thead">
<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="7">조회된 데이터가 없습니다.</td>
</tr>
</c:when>
<c:otherwise>
<c:forEach var="item" items="${LIST}" varStatus="varStatus">
<tr>
<td><a href="javascript:;" onclick="selectCollectbyRcpNo('${item.RCPTNO}', '${item.ORDERNO}');">${item.RCPTNO}</a></td>
<td>
<fmt:parseDate var="rcpYmd" value="${item.RCPTYMD}" pattern="yyyyMMdd"/>
<fmt:formatDate value="${rcpYmd}" pattern="yyyy-MM-dd" />
</td>
<td>${item.ACCOUNTTYPENM}</td>
<td><fmt:formatNumber value="${item.RCPTAMT}" type="number" maxFractionDigits="3" /></td>
<td>${item.FUNDSTYPENM}</td>
<td>${item.AOTYPENM}</td>
<td>${item.REMARK}</td>
</tr>
</c:forEach>
</c:otherwise>
</c:choose>
</table>
</div>
<div class="btn_wrap">
<div class="plm_btn_wrap_center">
<input type="button" value="신규등록" id="btnReg" class="plm_btns">
<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>