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

259 lines
8.6 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();
// 고객 검색
$("#btnCustomerSearch").click(function(){
window.open("/common/salesMgmt/searchCustomer.do", "searchCustomer", "width=1024, height=530", "menubars=no, scrollbars=yes, resizable=yes");
});
// 저장
$("#btnSave").click(function(){
fn_save();
});
// 삭제
$("#btnDelete").click(function(){
fn_delete();
});
// 닫기
$("#btnClose").click(function(){
self.close(0);
});
// 매출수량 입력
$("#supplyQty").keyup(function() {
// 공급가, 부가세 계산
calcAmt();
});
// 매출단가 입력
$("#supplyPrice").keyup(function() {
// 공급가, 부가세 계산
calcAmt();
});
});
// 매출관리 정보 등록
function fn_save(){
if(fnc_valitate("form1")){
if(confirm("등록 하시겠습니까?")){
saveProcess();
}
}
}
// 매출등록
function saveProcess(){
$.ajax({
url:"/salesNcollectMgmt/saveSalesMgmt.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:"/salesNcollectMgmt/deleteSalesMgmt.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 customerSelected(selectedItem) {
form1.custCd.value = selectedItem.custCd;
form1.custNm.value = selectedItem.custNm;
}
// 매출수량, 매출단가 계산
function calcAmt() {
var supplyQty = $("#supplyQty").val(); // 매출수량 입력
var supplyPrice = $("#supplyPrice").val(); // 매출단가 입력
var supplyAmt = Math.floor(supplyQty * supplyPrice); // 공급가
var supplyVat = Math.floor(supplyAmt * 0.1); // 부가세
$("#supplyAmt").val(supplyAmt);
$("#supplyVat").val(supplyVat);
}
</script>
<body>
<form name="form1" id="form1" action="" method="post">
<input type="hidden" name="saleNo" id="saleNo" value="${info.SALENO}" /> <!-- 매출번호 -->
<input type="hidden" name="orderNo" id="orderNo" value="${param.orderNo}" /> <!-- 계약번호 -->
<input type="hidden" name="pubSer" id="pubSer" value="${info.PUBSER}" /> <!-- 일련번호 -->
<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="11" 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="displaySaleNo" id="displaySaleNo" value="${info.SALENO}" disabled 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" id="wrtYmd" name="wrtYmd" required reqTitle="매출일자" value="${info.WRTYMD}" class="date_icon" style="width: 120px !important;background-color:#fff;" autocomplete="off" />
</td>
</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="custCd" id="custCd" value="${info.CUSTCD}" required reqTitle="고객" readonly style="width:130px;float:left;background-color:#efefef;" />
<span><input type="button" value="?" class="gray_btns" id="btnCustomerSearch"></span>
<input type="text" name="custNm" id="custNm" value="${info.CUSTNM}" required reqTitle="고객" disabled style="width:130px;" />
</td>
<td width="13%" class="input_sub_title"></td>
<td width="48%" class="input_sub_title">&nbsp;</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="supplyQty" id="supplyQty" required reqTitle="매출수량" value="${info.SUPPLYQTY}" maxlength="9" style="width:50px;" />
</td>
<td colspan="2" class="input_title" style="font-size:13px;">&nbsp;</td>
</tr>
<tr>
<td class="input_title" style="font-size:13px;"><label for="">* 매출단가</label></td>
<td class="input_sub_title">
<input type="text" name="supplyPrice" id="supplyPrice" required reqTitle="매출단가" value="${info.SUPPLYPRICE}" maxlength="9" style="width:130px;" />
</td>
<td class="input_title" style="font-size:13px;">&nbsp;</td>
<td class="input_sub_title">&nbsp;</td>
</tr>
<tr>
<td class="input_title" style="font-size:13px;"><label for="">* 공급가</label></td>
<td class="input_sub_title">
<input type="text" name="supplyAmt" id="supplyAmt" required reqTitle="공급가" value="${info.SUPPLYAMT}" maxlength="9" style="width:130px;" />
</td>
<td colspan="2" class="input_title" style="font-size:13px;">&nbsp;</td>
</tr>
<tr>
<td class="input_title" style="font-size:13px;"><label for="">* 부가세</label></td>
<td class="input_sub_title">
<input type="text" name="supplyVat" id="supplyVat" required reqTitle="부가세" value="${info.SUPPLYVAT}" maxlength="9" style="width:130px;" />
</td>
<td colspan="2" class="input_title" style="font-size:13px;">&nbsp;</td>
</tr>
<tr>
<td class="input_title"><label for="">자동결의서</label></td>
<td colspan="3" class="input_sub_title">
<input type="text" name="reSolutionNo" id="reSolutionNo" value="${info.RESOLUTIONNO}" maxlength="9" style="width:130px;" />
</td>
</tr>
<tr>
<td class="input_title"> <label for="">과세유형</label></td>
<td colspan="3" class="input_sub_title">
<select name="taxType" id="taxType" type="select" style="width: 160px;" class="select2">
<option value="">선택</option>
<c:forEach var="taxTypeList" items="${codeMap.taxTypeList}">
${taxTypeList}
</c:forEach>
</select>
</td>
</tr>
<tr>
<td class="input_title"><label for="">비고</label></td>
<td colspan="3" class="input_sub_title">
<input type="text" name="remark" id="remark" value="${info.REMARK}" maxlength="20" style="width:160px;" />
</td>
</tr>
<tr><td colspan="5" style="height:15px;"></td></tr>
</table>
</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>