ERP-node/WebContent/WEB-INF/view/salesmgmt/goodsInOut/goodsInOutFormPopup.jsp

218 lines
6.5 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();
// 제품코드 검색
$("#btnGoodsSearch").click(function(){
window.open("/common/salesMgmt/searchGoods.do", "", "width=1024, height=300", "menubars=no, scrollbars=yes, resizable=yes");
});
// 저장
$("#btnSave").click(function(){
fn_save();
});
// 삭제
$("#btnDelete").click(function(){
fn_delete();
});
// 닫기
$("#btnClose").click(function(){
self.close(0);
});
});
// 제품입고 정보 등록
function fn_save(){
if(fnc_valitate("form1")){
var cClass = $("#cClass").val(); // 제품그룹
var acntUnit = cClass.substring(0, 1); // 사업부
var inPlace = ""; // 입고처코드
console.log(cClass);
console.log(acntUnit);
if (acntUnit === "1") {
// 크레인
inPlace = "J99901";
} else if (acntUnit === "2") {
// 출장
inPlace = "J99902";
} else {
Swal.fire("제품그룹을 확인하세요.");
return;
}
$("#acntUnit").val(acntUnit); // 사업부
$("#inPlace").val(inPlace); // 입고처코드
if(confirm("등록 하시겠습니까?")){
saveProcess();
}
}
}
// 등록
function saveProcess(){
$.ajax({
url:"/goodsInOut/saveGoodsInOut.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 fn_delete() {
if(confirm("삭제 하시겠습니까?")){
deleteProcess();
}
}
// 삭제
function deleteProcess(){
$.ajax({
url:"/goodsInOut/deleteGoodsInOut.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 goodsSelected(selectedItem) {
form1.goodsCd.value = selectedItem.goodsCd;
form1.goodsNm.value = selectedItem.goodsNm;
form1.cClass.value = selectedItem.cClass;
}
</script>
<body>
<form name="form1" id="form1" action="" method="post">
<input type="hidden" name="inOutNo" id="inOutNo" value="${param.inOutNo}" /> <!-- 입고번호 -->
<input type="hidden" name="deliveryType" id="deliveryType" value="01" /> <!-- 입고구분 -->
<input type="hidden" name="acntUnit" id="acntUnit" /> <!-- 사업부 -->
<input type="hidden" name="inPlace" id="inPlace" /> <!-- 입고처코드 -->
<section>
<div class="plm_menu_name">
<h2>
<span>제품입고 등록</span>
</h2>
</div>
<div id="businessPopupFormWrap" >
<table class="pmsPopupForm">
<colgroup>
<col width="15%"/>
<col width="10%"/>
<col width="15%"/>
<col width="10%"/>
<col width="15%"/>
</colgroup>
<tr><td colspan="10" 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="8" class="input_sub_title">
<input type="text" name="displayInOutNo" id="displayInOutNo" value="${info.INOUTNO}" disabled style="width:130px;" />
</td>
</c:if>
</tr>
<tr>
<td class="input_title" style="font-size:13px;">
<label for="">* 입고일자</label>
</td>
<td colspan="8" class="input_sub_title">
<input type="text" id="inOutDate" name="inOutDate" required reqTitle="입고일자" value="${info.INOUTDATE}" 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">
<input type="text" name="qty" id="qty" required reqTitle="입고수량" value="${info.QTY}" maxlength="9" style="width:100px;" />
</td>
<td class="input_title" style="font-size:13px;">
<label for="">* 제품</label>
</td>
<td colspan="6" class="input_sub_title">
<input type="text" name="goodsCd" id="goodsCd" required reqTitle="제품" value="${info.GOODSCD}" readonly style="width:180px;float:left;background-color:#efefef;" />
<span><input type="button" value="?" class="gray_btns" id="btnGoodsSearch"></span>
<input type="text" name="goodsNm" id="goodsNm" value="${info.GOODSNM}" disabled style="width:180px;float:left" />
<input type="hidden" name="cClass" id="cClass" value="${info.C_CLASS}" />
</td>
</tr>
<tr>
<td class="input_title">
<label for="">비고</label>
</td>
<td colspan="8" class="input_sub_title">
<textarea name="remark" id="remark" style="width:90%;height:50px;">${info.REMARK}</textarea>
</td>
</tr>
<tr><td colspan="9" 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>