ERP-node/WebContent/WEB-INF/view/ions/itemmgmt/purchaseRequest/purchaseRequestFormPopup.jsp

417 lines
14 KiB
Plaintext

<%
/**
* 구매의뢰 등록
* @since 2021.11.16
* @author kim
* @version 1.0
*
* << 개정 이력 >>
*
* 수정일 수정자 수정내용
* ---------------- --------------------- --------------------------------------------------------
* 2021.11.16 김효일 최초작성
**/
%>
<%@ 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();
// 로트번호(기종코드) 검색
$("#btnLotNoSearch").click(function(){
window.open("/common/itemMgmt/searchLotNo.do", "searchLotNo", "width=1024, height=710", "menubars=no, scrollbars=yes, resizable=yes");
});
// 저장
$("#btnSave").click(function(){
fn_save();
});
// 삭제
$("#btnDelete").click(function(){
fn_delete();
});
// 닫기
$("#btnClose").click(function(){
self.close(0);
});
// 기종별 공정 조회
$("#btnSearch").click(function(){
fn_productPartSearch();
});
// 기종별 공정 정보 전체선택 or 해제
$("#allCheck").click(function(o) {
if (this.checked) {
// 전체선택
$("input[name=upgCodes]").prop("checked", true);
} else {
// 전체해제
$("input[name=upgCodes]").prop("checked", false);
}
});
});
// 구매의뢰 정보 등록
function fn_save(){
if(fnc_valitate("form1")){
if(confirm("등록 하시겠습니까?")){
saveProcess();
}
}
}
// 등록
function saveProcess(){
$.ajax({
url:"/imItem/savePurchaseRequest.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:"/imItem/deletePurchaseRequest.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 lotNoSelected(selectedItem) {
form1.puLotNo.value = selectedItem.puLotNo;
}
// 기종별 공정 조회
function fn_productPartSearch() {
var puLotNo = $("#puLotNo").val();
if (puLotNo === "") {
Swal.fire("기종별 공정은 로트번호 선택 후 조회 가능합니다.");
return;
}
var html = "";
html += '<tr style="text-align:center;">';
html += ' <td align="center" colspan="4">조회된 데이터가 없습니다.</td>';
html += '</tr>';
$("#productPart").html(html);
$.ajax({
url:"/imItem/purchaseRequestProductPartList.do",
type:"GET",
data:$("#form1").serialize(),
dataType:"json",
success:function(data){
var result = data.RESULT;
if (result === "" || result === undefined) {
return;
}
html = "";
var len = result.length;
for (var idx = 0; idx < len; idx++) {
var itemRegCount = result[idx].ITEMREGCOUNT;
var checked = itemRegCount > 0 ? "checked" : "";
html += '<tr>';
html += ' <td>';
html += result[idx].UPG_CODE;
html += ' </td>';
html += ' <td>';
html += result[idx].UPG_NAME;
html += ' </td>';
html += ' <td>';
html += result[idx].ITEMCOUNT;
html += ' </td>';
html += ' <td>';
html += ' <input type="checkbox" name="upgCodes" id="upgCodes" value="'+result[idx].UPG_CODE+'" />';
html += ' </td>';
html += '</tr>';
}
$("#productPart").html(html);
},
error: function(jqxhr, status, error){
}
});
}
</script>
<body>
<form name="form1" id="form1" action="" method="post">
<input type="hidden" name="puReqstNo" id="puReqstNo" value="${param.puReqstNo}" />
<section>
<div class="plm_menu_name">
<h2>
<span>구매의뢰 등록</span>
</h2>
</div>
<div id="businessPopupFormWrap" >
<table class="pmsPopupForm">
<colgroup>
<col width="10%"/>
<col width="10%"/>
<col width="20%"/>
<col width="10%"/>
<col width="20%"/>
</colgroup>
<tr><td colspan="11" style="height:15px;"></td></tr>
<tr>
<td rowspan="8" class="sub_title">구매의뢰등록</td>
</tr>
<tr>
<td class="input_title"><label for="">* 사업부</label></td>
<td>
<select name="acntUnit" id="acntUnit" required reqTitle="사업부" type="select" style="width:150px;" class="select2">
<option value="">선택</option>
<option value="41" ${info.ACNTUNIT eq '41' ? 'selected':'' }>크레인사업부</option>
<option value="42" ${info.ACNTUNIT eq '42' ? 'selected':'' }>실린더생산팀</option>
<option value="43" ${info.ACNTUNIT eq '43' ? 'selected':'' }>출고</option>
<option value="44" ${info.ACNTUNIT eq '44' ? 'selected':'' }>전장제작반</option>
<option value="50" ${info.ACNTUNIT eq '50' ? 'selected':'' }>특장사업부</option>
<option value="F0" ${info.ACNTUNIT eq 'F0' ? 'selected':'' }>정비사업부</option>
</select>
</td>
<td class="input_title"><label for="">* 용도</label></td>
<td colspan="7">
<select name="puUsageCd" id="puUsageCd" required reqTitle="용도" type="select" style="width:150px;" class="select2">
<option value="">선택</option>
<c:forEach var="puUsageList" items="${codeMap.puUsageList}">
${puUsageList}
</c:forEach>
</select>
</td>
</tr>
<tr>
<td class="input_title"><label for="">* 의뢰구분</label></td>
<td>
<select name="puReqTp" id="puReqTp" required reqTitle="의뢰구분" type="select" style="width:150px;" class="select2">
<option value="">선택</option>
<option value="1" ${info.PUREQTP eq '1' ? 'selected' : ''}>정상</option>
<option value="2" ${info.PUREQTP eq '2' ? 'selected' : ''}>긴급</option>
</select>
</td>
<td class="input_title"><label for="">* 내/외자</label></td>
<td colspan="7">
<select name="puNation" id="puNation" required reqTitle="내/외자" type="select" style="width:150px;" class="select2">
<option value="">선택</option>
<c:forEach var="puNationList" items="${codeMap.puNationList}">
${puNationList}
</c:forEach>
</select>
</td>
</tr>
<tr>
<td class="input_title"><label for="">* 로트번호</label></td>
<td>
<input type="text" name="puLotNo" id="puLotNo" required reqTitle="로트번호" value="${info.PULOTNO}" readonly maxlength="9" style="width:160px;float:left;" />
<input type="button" value="?" class="gray_btns" id="btnLotNoSearch">
</td>
<td class="input_title"><label for="">* 의뢰자</label></td>
<td colspan="7">
<select name="puRequestor" id="puRequestor" required reqTitle="의뢰자" type="select" style="width:150px;" class="select2">
<option value="">선택</option>
<c:forEach var="puRequestorList" items="${codeMap.puRequestorList}">
${puRequestorList}
</c:forEach>
</select>
</td>
</tr>
<tr>
<td class="input_title"><label for="">* 의뢰부서</label></td>
<td>
<select name="puReqstDept" id="puReqstDept" required reqTitle="의뢰부서" type="select" style="width:150px;" class="select2">
<option value="">선택</option>
<c:forEach var="puReqstDeptList" items="${codeMap.puReqstDeptList}">
${puReqstDeptList}
</c:forEach>
</select>
</td>
<td class="input_title">&nbsp;</td>
<td colspan="7">&nbsp;</td>
</tr>
<tr>
<td class="input_title"><label for="">* 의뢰일자</label></td>
<td>
<input type="text" name="puReqstDt" id="puReqstDt" required reqTitle="의뢰일자" value="${info.PUREQSTDT}" class="date_icon" style="width: 100px !important;background-color:#fff;" autocomplete="off" />
</td>
<td class="input_title">&nbsp;</td>
<td colspan="7">&nbsp;</td>
</tr>
<tr>
<td class="input_title"><label for="">* 납기일자</label></td>
<td>
<input type="text" id="piTargetDt" name="piTargetDt" required reqTitle="납기일자" value="${info.PITARGETDT}" class="date_icon" style="width: 100px !important;background-color:#fff;" autocomplete="off" />
</td>
<td class="input_title"><label for="">* 대수</label></td>
<td colspan="7">
<input type="text" name="piReqstQty" id="piReqstQty" required reqTitle="대수" value="${info.PIREQSTQTY}" maxlength="9" style="width:50px;" />
</td>
</tr>
<tr>
<td class="input_title"><label for="">특이사항</label></td>
<td colspan="9">
<textarea name="puRemark" id="puRemark" style="width:50%;">${info.PUREMARK}</textarea>
</td>
</tr>
<tr><td colspan="11" style="height:15px;"></td></tr>
</table>
<br/>
<!--// 조회조건 -->
<table class="pmsPopupForm">
<colgroup>
<col width="10%"/>
<col width="20%"/>
<col width="70%"/>
</colgroup>
<tr><td colspan="3" style="height:15px;"></td></tr>
<tr>
<td rowspan="4" class="sub_title">조회조건</td>
<td class="input_title"><label for="label">조달구분</label></td>
<td colspan="3" class="">
<input type="checkbox" name="condImSourcingTp_I" id="condImSourcingTp_I" value="I" ${condImSourcingTp_I eq 'I' ? 'checked': ''} /><label for="condImSourcingTp_I" class="mar20">도입</label>
<input type="checkbox" name="condImSourcingTp_M" id="condImSourcingTp_M" value="M" ${condImSourcingTp_M eq 'M' ? 'checked': ''} /><label for="condImSourcingTp_M" class=" mar20">자체제작</label>
<input type="checkbox" name="condImSourcingTp_O" id="condImSourcingTp_O" value="O" ${condImSourcingTp_O eq 'O' ? 'checked': ''} /><label for="condImSourcingTp_O" class="mar20 ">외주</label>
<input type="checkbox" name="condImSourcingTp_P" id="condImSourcingTp_P" value="P" ${condImSourcingTp_P eq 'P' ? 'checked': ''} /><label for="condImSourcingTp_P" class="mar20">일반구매</label>
</td>
</tr>
<tr>
<td class="input_title"><label for="label">자재구분</label></td>
<td colspan="3">
<input type="checkbox" name="condImABC_A" id="condImABC_A" value="A" ${condImABC_A eq 'A' ? 'checked': ''} /><label for="condImABC_A" class="mar20">A급</label>
<input type="checkbox" name="condImABC_B" id="condImABC_B" value="B" ${condImABC_B eq 'B' ? 'checked': ''} /><label for="condImABC_B" class="mar20">B급</label>
<input type="checkbox" name="condImABC_C" id="condImABC_C" value="C" ${condImABC_C eq 'C' ? 'checked': ''} /><label for="condImABC_C" class="mar20">C급</label>
</td>
</tr>
<tr>
<td class="input_title"><label for="label">사급여부</label></td>
<td colspan="3">
<input type="checkbox" name="condImSagupTp_S" id="condImSagupTp_S" value="S" ${condImSagupTp_S eq 'S' ? 'checked': ''} /><label for="condImSagupTp_S" class="mar20">사급</label>
<input type="checkbox" name="condImSagupTp_K" id="condImSagupTp_K" value="K" ${condImSagupTp_K eq 'K' ? 'checked': ''} /><label for="condImSagupTp_K" class="mar20">사내조립</label>
<input type="checkbox" name="condImSagupTp_M" id="condImSagupTp_M" value="M" ${condImSagupTp_M eq 'M' ? 'checked': ''} /><label for="condImSagupTp_M" class="mar20">사내제작</label>
<input type="checkbox" name="condImSagupTp_V" id="condImSagupTp_V" value="V" ${condImSagupTp_V eq 'V' ? 'checked': ''} /><label for="condImSagupTp_V" class="mar20">Vendor</label>
</td>
</tr>
<tr><td colspan="5" style="height:15px;"></td></tr>
</table>
<!--// 조회조건 -->
<!--// 기종별 공정 정보 -->
<p>&nbsp;</p>
<div id="plmSearchZon">
<table style="width:100%">
<colgroup>
<col width="95%" />
<col width="*" />
</colgroup>
<tbody>
<tr>
<td class="align_l"><h3 class="tit">기종별 공정 정보</h3></td>
<td>
<input type="button" value="조회" class="plm_btns" id="btnSearch">
</td>
</tr>
</tbody>
</table>
</div>
<table class="plm_table">
<colgroup>
<col width="30%" />
<col width="40%" />
<col width="15%" />
<col width="15%" />
</colgroup>
<thead>
<tr class="plm_thead">
<td>공정코드</td>
<td>공정명</td>
<td>품번수</td>
<td><input type="checkbox" name="alLCheck" id="allCheck" value="1" /><label for="allCheck">선택</label></td>
</tr>
</thead>
</table>
<div style="height:350px;overflow-y:scroll;margin-right:-10px;">
<table class="plm_table">
<colgroup>
<col width="30%" />
<col width="40%" />
<col width="15%" />
<col width="15%" />
</colgroup>
<tbody id="productPart">
<tr style="text-align:center;">
<td align="center" colspan="4">조회된 데이터가 없습니다.</td>
</tr>
</tbody>
</table>
</div>
<!--// 기종별 공정 정보 -->
</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>