ERP-node/WebContent/WEB-INF/view/salesmgmt/requestMgmt/additionalFeePopup.jsp

267 lines
6.5 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();
// 저장
$("#btnSave").click(function(){
fn_save();
});
// 삭제
$("#btnDelete").click(function(){
fn_delete();
});
// 닫기
$("#btnClose").click(function(){
self.close(0);
});
});
// 매출관리 정보 등록
function fn_save(){
//if(fnc_valitate("form1")){
var isChk = false;
var arrChk = document.getElementsByName("addChk");
for(var i = 0; i < arrChk.length; i++){
if(arrChk[i].checked == true){
isChk = true;
break;
}
}
if(!isChk){
Swal.fire("등록 할 부대비용을 한개 이상 선택해주세요.");
return false;
}
if(confirm("등록 하시겠습니까?")){
saveProcess();
}
//}
}
// 출고의뢰등록
function saveProcess(){
$.ajax({
url:"/requestMgmt/saveAdditionalFdd.do",
type:"POST",
data:$("#form1").serialize(),
dataType:"json",
success:function(data){
Swal.fire(data.RESULT.msg);
if (data.RESULT.result) {
location.reload();
}
},
error: function(jqxhr, status, error){
}
});
}
// 출고의뢰 정보 삭제
function fn_delete() {
var isChk = false;
var arrChk = document.getElementsByName("delChk");
for(var i = 0; i < arrChk.length; i++){
if(arrChk[i].checked == true){
isChk = true;
break;
}
}
if(!isChk){
Swal.fire("삭제 할 부대비용을 한개 이상 선택해주세요.");
return false;
}
if(confirm("삭제 하시겠습니까?")){
deleteProcess();
}
}
// 삭제
function deleteProcess(){
$.ajax({
url:"/requestMgmt/deleteAdditionalFdd.do",
type:"POST",
data:$("#form1").serialize(),
dataType:"json",
success:function(data){
Swal.fire(data.RESULT.msg);
if (data.RESULT.result) {
location.reload();
}
},
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="orderNo" id="orderNo" value="${param.orderNo}" /> <!-- 계약번호 -->
<input type="hidden" name="acntUnit" id="acntUnit" value="${param.acntUnit}" /> <!-- 사업부 -->
<input type="hidden" name="orderYm" id="orderYm" value="${param.orderYm}" /> <!-- 계약년월 -->
<input type="hidden" name="orderSer" id="orderSer" value="${param.orderSer}" /> <!-- 일련번호 -->
<section>
<div class="plm_menu_name_ieg" style="display:flex;">
<h2>
<span>부대비용등록</span>
</h2>
</div>
<div id="businessPopupFormWrap">
<h3 class="sub_title_left">부대비용정보</h3>
<p>&nbsp;</p>
<div style="height:300px;overflow-y:scroll;">
<table class="plm_table3">
<colgroup>
<col width="5%" />
<col width="20%" />
<col width="*" />
</colgroup>
<thead>
<tr class="plm_thead">
<td>선택</td>
<td>순번</td>
<td>명칭</td>
</tr>
</thead>
<c:choose>
<c:when test="${empty codeList}">
<tr style="text-align:center;">
<td align="center" colspan="3">조회된 데이터가 없습니다.</td>
</tr>
</c:when>
<c:otherwise>
<c:forEach var="item" items="${codeList}" varStatus="varStatus" begin="1">
<tr>
<td><input type="checkbox" name="addChk" id="addChk" value="${varStatus.index}|${item.EOPT_CD}"/></td>
<td>${item.EOPT_CD}</td>
<td>${item.EOPT_NM}</td>
</tr>
</c:forEach>
</c:otherwise>
</c:choose>
</table>
</div>
<br><br>
<div class="col_arrow">
<a href="javascript:;" onclick="fn_delete();"><button type="button" class="bt_order"><i class="ico_comm ico_up">삭제</i></button></a>
<a href="javascript:;" onclick="fn_save();"><button type="button" class="bt_order"><i class="ico_comm ico_down">추가</i></button></a>
</div>
<br><br>
<div style="height:300px;overflow-y:scroll;">
<table class="plm_table3">
<colgroup>
<col width="5%" />
<col width="10%" />
<col width="20%" />
<col width="20%" />
<col width="*" />
</colgroup>
<thead>
<tr class="plm_thead">
<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="5">조회된 데이터가 없습니다.</td>
</tr>
</c:when>
<c:otherwise>
<c:forEach var="item" items="${LIST}" varStatus="varStatus">
<tr>
<td><input type="checkbox" name="delChk" id="delChk" value="${item.EOPT_CD}"/></td>
<td>${item.EOPT_CD}</td>
<td>${item.EOPT_NM}</td>
<td>${item.TOT_AMT}</td>
<td>${item.REM_NM}</td>
</tr>
</c:forEach>
</c:otherwise>
</c:choose>
</table>
</div>
<p>&nbsp;</p>
</div>
<div class="btn_wrap">
<div class="plm_btn_wrap_center">
<input type="button" value="닫기" id="btnClose" class="plm_btns">
</div>
</div>
</section>
</form>
</body>
</html>