ERP-node/WebContent/WEB-INF/view/salesmgmt/contractMgmt/accountFormPopup.jsp

318 lines
10 KiB
Plaintext

<%
/**
* 결제예정 등록
* @since 2021.10.01
* @author kim
* @version 1.0
*
* << 개정 이력 >>
*
* 수정일 수정자 수정내용
* ---------------- --------------------- --------------------------------------------------------
* 2021.10.01 김효일 최초작성
**/
%>
<%@ 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.serial.value = "";
document.hiddenForm.typeNo.value = "";
document.hiddenForm.action = "/contractMgmt/accountFormPopup.do";
document.hiddenForm.submit();
}
// 결제예정 정보 등록
function fn_save(){
if(fnc_valitate("form1")){
if(confirm("등록 하시겠습니까?")){
saveProcess();
}
}
}
// 등록
function saveProcess(){
$.ajax({
url:"/contractMgmt/saveAccount.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:"/contractMgmt/deleteAccount.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 searchAccount(orderNo, serial, typeNo) {
document.form1.orderNo.value = orderNo;
document.form1.serial.value = serial;
document.form1.typeNo.value = typeNo;
document.hiddenForm.actionType.value = "modify";
document.hiddenForm.orderNo.value = orderNo;
document.hiddenForm.serial.value = serial;
document.hiddenForm.typeNo.value = typeNo;
document.hiddenForm.action = "/contractMgmt/accountFormPopup.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="serial" id="serial" />
<input type="hidden" name="typeNo" id="typeNo" />
</form>
<form name="form1" id="form1" action="" method="post">
<input type="hidden" name="orderNo" id="orderNo" value="${param.orderNo}">
<input type="hidden" name="serial" id="serial" value="${param.serial}">
<section>
<div class="plm_menu_name">
<h2>
<span>결제예정 등록</span>
</h2>
</div>
<div id="businessPopupFormWrap">
<!--// pmsPopupForm -->
<table class="pmsPopupForm">
<colgroup>
<col width="13%"/>
<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="6" 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="4" class="input_sub_title">
<input type="text" name="displaySerial" id="displaySerial" value="${info.SERIAL}" disabled style="width:130px;/">
</td>
</c:if>
</tr>
<tr>
<td class="input_title" style="font-size:13px;"><label for="">* 구분</label></td>
<td class="input_sub_title">
<c:if test="${param.actionType eq 'regist'}">
<select name="typeNo" id="typeNo" required reqTitle="구분" type="select" style="width: 150px;" class="select2">
<option value="">선택</option>
<option value="0" ${info.TYPENO eq '0' ? 'selected':''}>계약</option>
<option value="1" ${info.TYPENO eq '1' ? 'selected':''}>수금</option>
</select>
</c:if>
<c:if test="${param.actionType ne 'regist'}">
<input type="hidden" name="typeNo" id="typeNo" value="${param.typeNo}">
<select name="displayTypeNo" id="displayTypeNo" style="width: 150px;" class="select2" disabled>
<option value="">선택</option>
<option value="0" ${info.TYPENO eq '0' ? 'selected':''}>계약</option>
<option value="1" ${info.TYPENO eq '1' ? 'selected':''}>수금</option>
</select>
</c:if>
</td>
<td class="input_title" style="font-size:13px;"><label for="">* 지불예정일</label></td>
<td class="input_sub_title">
<input type="text" id="accountDueDate" name="accountDueDate" required reqTitle="지불예정일" value="${info.ACCOUNTDUEDATE}" class="date_icon" style="width: 100px !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;" class="select2">
<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="contactAmt" id="contactAmt" required reqTitle="결제금액" value="${info.CONTACTAMT}" 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;" class="select2">
<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;" class="select2">
<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="4" class="input_sub_title">
<textarea id="remark" name="remark" style="width:95%;height:50px;"><c:out value="${info.REMARK}" escapeXml="false" /></textarea>
</td>
</tr>
<tr><td colspan="5" style="height:15px;"></td></tr>
</table>
<!--// pmsPopupForm -->
<!--// plm_table -->
<table class="plm_table">
<colgroup>
<col width="5%" />
<col width="10%" />
<col width="10%" />
<col width="10%" />
<col width="10%" />
<col width="10%" />
<col width="10%" />
<col width="10%" />
<col width="15%" />
</colgroup>
<thead>
<tr class="plm_thead">
<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="9">조회된 데이터가 없습니다.</td>
</tr>
</c:when>
<c:otherwise>
<c:forEach var="item" items="${LIST}" varStatus="varStatus">
<tr>
<td><a href="javascript:;" onclick="searchAccount('${item.ORDERNO}', '${item.SERIAL}', '${item.TYPENO}')">${item.SERIAL}</a></td>
<td>${item.TYPENONM}</td>
<td>${item.ACCOUNTTYPENM}</td>
<td>
<fmt:formatNumber value="${item.CONTACTAMT}" type="number" maxFractionDigits="3" />
</td>
<td>
<fmt:parseDate var="accountDueDate" value="${item.ACCOUNTDUEDATE}" pattern="yyyyMMdd"/>
<fmt:formatDate value="${accountDueDate}" pattern="yyyy-MM-dd" />
</td>
<td>
<fmt:parseDate var="contactDate" value="${item.CONTACTDATE}" pattern="yyyyMMdd"/>
<fmt:formatDate value="${contactDate}" pattern="yyyy-MM-dd" />
</td>
<td>${item.FUNDSTYPENM}</td>
<td>${item.AOTYPENM}</td>
<td>${item.REMARK}</td>
</tr>
</c:forEach>
</c:otherwise>
</c:choose>
</table>
<!--// plm_table -->
</div>
<!--// btn_wrap -->
<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>
<!--// btn_wrap -->
</section>
</form>
</body>
</html>