ERP-node/WebContent/WEB-INF/view/ions/itemmgmt/imItem/imItemFormPopup.jsp

540 lines
20 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();
// 품목 검색
$("#btnPartSearch").click(function(){
window.open("/common/itemMgmt/searchPart.do", "searchProduct", "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);
});
});
// 품목 정보 등록
function fn_save(){
if(fnc_valitate("form1")){
if(confirm("등록 하시겠습니까?")){
saveProcess();
}
}
}
// 등록
function saveProcess(){
$.ajax({
url:"/imItem/saveImItem.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("삭제 하시겠습니까?\n ※주의 : 자재관리 및 발주특성 항목도 삭제됩니다.")){
deleteProcess();
}
}
// 삭제
function deleteProcess(){
$.ajax({
url:"/imItem/deleteImItem.do",
type:"POST",
data:$("#form1").serialize(),
dataType:"json",
success:function(data){
Swal.fire(data.RESULT.msg);
if (data.RESULT.result) {
opener.form1.imItemId.value = '';
opener.fn_search();
self.close();
}
},
error: function(jqxhr, status, error){
}
});
}
// 품번분류2 조회
function getImClass2(imClass1) {
var param = "majorCd=" + imClass1;
$.ajax({
url:"/common/itemMgmt/codeList.do",
type:"GET",
data:param,
dataType:"json",
success:function(data){
var options = "<option value=''>선택</option>";
if (data.RESULT !="") {
options += data.RESULT;
}
$("#imClass2").html(options);
},
error: function(jqxhr, status, error){
}
});
}
// 품목 선택
function partSelected(selectedItem) {
form1.imItemId.value = selectedItem.objId;
form1.imItemNo.value = selectedItem.partNo;
form1.displayImItemId.value = selectedItem.partNo;
form1.imItemNm.value = selectedItem.partName;
}
</script>
<body>
<form name="form1" id="form1" action="" method="post">
<input type="hidden" name="imItemId" id="imItemId" value="${param.imItemId}" />
<input type="hidden" name="imItemNo" id="imItemNo" value="${info.IMITEMNO}" />
<section>
<div class="plm_menu_name">
<h2>
<span>품목 등록</span>
</h2>
</div>
<div id="businessPopupFormWrap" >
<table class="pmsPopupForm">
<colgroup>
<col width="9%"/>
<col width="10%"/>
<col width="9%"/>
<col width="9%"/>
<col width="9%"/>
<col width="9%"/>
<col width="9%"/>
<col width="9%"/>
<col width="9%"/>
<col width="9%"/>
<col width="9%"/>
</colgroup>
<tr><td colspan="11" style="height:15px;"></td></tr>
<tr>
<td rowspan="5" class="sub_title">형상정보</td>
</tr>
<tr>
<td class="input_title"><label for="">* 품목번호</label></td>
<td>
<input type="text" name="displayImItemId" id="displayImItemId" required reqTitle="품목번호" value="${info.IMITEMNO}" disabled style="width:82px;" />
<c:if test="${param.actionType eq 'regist'}">
<span><input type="button" value="?" class="gray_btns" id="btnPartSearch"></span>
</c:if>
</td>
<td class="input_title"><label for="">* 품명</label></td>
<td colspan="3">
<input type="text" name="imItemNm" id="imItemNm" required reqTitle="품명" value="${info.IMITEMNM}" maxlength="10" style="width:90%;" />
</td>
<td class="input_title"><label for="">* 규격</label></td>
<td colspan="4">
<input type="text" name="imItemSpec" id="imItemSpec" required reqTitle="규격" value="${info.IMITEMSPEC}" maxlength="10" style="width:90%;/">
</td>
</tr>
<tr>
<td class="input_title"><label for="">* 재질</label></td>
<td>
<input type="text" name="imMaterial" id="imMaterial" required reqTitle="재질" value="${info.IMMATERIAL}" maxlength="10" style="width:130px;" />
</td>
<td class="input_title"><label for="">* 형상</label></td>
<td>
<select name="imShapeCd" id="imShapeCd" required reqTitle="형상" type="select" style="width:130px;" class="select2">
<option value="">선택</option>
<c:forEach var="imShapeList" items="${codeMap.imShapeList}">
${imShapeList}
</c:forEach>
</select>
</td>
<td class="input_title"><label for="">* 색상</label></td>
<td>
<select name="imColor" id="imColor" required reqTitle="색상" type="select" style="width:130px;" class="select2">
<option value="">선택</option>
<c:forEach var="imColorList" items="${codeMap.imColorList}">
${imColorList}
</c:forEach>
</select>
</td>
<td class="input_title"><label for="">* 단위</label></td>
<td>
<input type="text" name="imUnit" id="imUnit" required reqTitle="단위" value="${info.IMUNIT}" maxlength="10" style="width:50px;" />
</td>
<td class="input_title"><label for="">* 단중</label></td>
<td colspan="2">
<input type="text" name="imWeight" id="imWeight" required reqTitle="단중" value="${info.IMWEIGHT}" maxlength="10" style="width:50px;" />kg
</td>
</tr>
<tr>
<td class="input_title"><label for="">* Assay</label></td>
<td>
<select name="imAssy" id="imAssy" required reqTitle="Assay" type="select" style="width:130px;" class="select2">
<option value="">선택</option>
<option value="Y" ${info.IMASSY eq 'Y' ? 'selected' : ''}>Assay</option>
<option value="N" ${info.IMASSY eq 'N' ? 'selected' : ''}>단품</option>
</select>
</td>
<td class="input_title"><label for="">* 품목구분</label></td>
<td colspan="3" >
<select name="imItemTp" id="imItemTp" required reqTitle="품목구분" type="select" style="width:130px;" class="select2">
<option value="">선택</option>
<option value="P" ${info.IMITEMTP eq 'P' ? 'selected' : ''}>제품</option>
<option value="A" ${info.IMITEMTP eq 'A' ? 'selected' : ''}>반제품</option>
<option value="E" ${info.IMITEMTP eq 'E' ? 'selected' : ''}>단품</option>
</select>
</td>
<td class="input_title"></td>
<td colspan="5" ></td>
</tr>
<tr>
<td class="input_title"><label for="">* 대체재질</label></td>
<td>
<input type="text" name="imChngMaterial" id="imChngMaterial" required reqTitle="대체재질" value="${info.IMCHNGMATERIAL}" maxlength="10" style="width:130px;" />
</td>
<td class="input_title"><label for="">* 사용구분</label></td>
<td colspan="3">
<select name="imItemFlag" id="imItemFlag" required reqTitle="사용구분" type="select" style="width:130px;" class="select2">
<option value="">선택</option>
<option value="1" ${info.IMITEMFLAG eq '1' ? 'selected' : ''}>기술설계</option>
<option value="2" ${info.IMITEMFLAG eq '2' ? 'selected' : ''}>구매</option>
<option value="3" ${info.IMITEMFLAG eq '3' ? 'selected' : ''}>A/S</option>
<option value="4" ${info.IMITEMFLAG eq '4' ? 'selected' : ''}>사용불가</option>
</select>
</td>
<td class="input_title"><label for="">* 기종코드</label></td>
<td colspan="5">
<select name="imProdNo" id="imProdNo" required reqTitle="기종코드" type="select" style="width:130px;" class="select2">
<option value="">선택</option>
<c:forEach var="imProdNoList" items="${codeMap.imProdNoList}">
${imProdNoList}
</c:forEach>
</select>
</td>
</tr>
<tr><td colspan="11" style="height:15px;"></td></tr>
</table>
<br />
<table class="pmsPopupForm">
<colgroup>
<col width="8%"/>
<col width="13%"/>
<col width="13%"/>
<col width="13%"/>
<col width="13%"/>
<col width="13%"/>
<col width="13%"/>
</colgroup>
<tr>
<td colspan="7" style="height:15px;"></td>
</tr>
<tr><td rowspan="4" class="sub_title">발주정보</td></tr>
<tr>
<td class="input_title"><label for="label">* 내자/외자</label></td>
<td>
<select name="imNation" id="imNation" required reqTitle="내자/외자" type="select" style="width:130px;" class="select2">
<option value="">선택</option>
<option value="D" ${info.IMNATION eq 'D' ? 'selected' : ''}>내자</option>
<option value="E" ${info.IMNATION eq 'E' ? 'selected' : ''}>외자</option>
</select>
</td>
<td class="input_title"><label for="label">* 구매담당자</label></td>
<td colspan="3">
<select name="imCardex" id="imCardex" required reqTitle="구매담당자" type="select" style="width:130px;" class="select2">
<option value="">선택</option>
<c:forEach var="imCardexList" items="${codeMap.imCardexList}">
${imCardexList}
</c:forEach>
</select>
</td>
</tr>
<tr>
<td class="input_title"><label for="label">* 최소발주량</label></td>
<td>
<input type="text" name="imMinOrderQty" id="imMinOrderQty" required reqTitle="최소발주량" value="${info.IMMINORDERQTY}" maxlength="10" style="width:130px;" />
</td>
<td class="input_title"><label for="label">* 포장규격</label></td>
<td>
<input type="text" name="imPackSize" id="imPackSize" required reqTitle="포장규격" value="${info.IMPACKSIZE}" maxlength="10" style="width:130px;" />
</td>
<td class="input_title"><label for="label">* 포장당수량</label></td>
<td>
<input type="text" name="imPackQty" id="imPackQty" required reqTitle="포장당수량" value="${info.IMPACKQTY}" maxlength="10" style="width:50px;" />
</td>
</tr>
<tr>
<td class="input_title"><label for="label">* 품번분류</label></td>
<td>
<select name="imClass1" id="imClass1" onchange="getImClass2(this.value);" required reqTitle="품번분류" type="select" style="float:left;" class="select2">
<option value="">선택</option>
<c:forEach var="imClass1List" items="${codeMap.imClass1List}">
${imClass1List}
</c:forEach>
</select>
</td>
<td colspan="2" class="input_title">
<select name="imClass2" id="imClass2" required reqTitle="품번분류" type="select" class="select2">
<option value="">선택</option>
<c:forEach var="imClass2List" items="${codeMap.imClass2List}">
${imClass2List}
</c:forEach>
</select>
</td>
<td class="input_title"><label for="label">* 조달소요일</label></td>
<td>
<input type="text" name="imDelivery" id="imDelivery" required reqTitle="조달소요일" value="${info.IMDELIVERY}" maxlength="10" style="width:50px;" /> 일
</td>
</tr>
<tr>
<td colspan="7" style="height:15px;"></td>
</tr>
</table>
<br />
<table class="pmsPopupForm">
<colgroup>
<col width="10%"/>
<col width="9%"/>
<col width="14%"/>
<col width="9%"/>
<col width="14%"/>
<col width="8%"/>
<col width="13%"/>
<col width="8%"/>
<col width="15%"/>
</colgroup>
<tr><td colspan="9" style="height:15px;"></td></tr>
<tr><td rowspan="4" class="sub_title">자재정보</td></tr>
<tr>
<td class="input_title"><label for="label">* 조달형태</label></td>
<td>
<select name="imSourcingTp" id="imSourcingTp" required reqTitle="조달형태" type="select" style="width:130px;" class="select2">
<option value="">선택</option>
<option value="I" ${info.IMSOURCINGTP eq 'I' ? 'selected' : ''}>도입</option>
<option value="M" ${info.IMSOURCINGTP eq 'M' ? 'selected' : ''}>자체제작</option>
<option value="O" ${info.IMSOURCINGTP eq 'O' ? 'selected' : ''}>외주</option>
<option value="P" ${info.IMSOURCINGTP eq 'P' ? 'selected' : ''}>일반구매</option>
</select>
</td>
<td class="input_title"><label for="label">* 사급여부</label></td>
<td>
<select name="imSagupTp" id="imSagupTp" required reqTitle="사급여부" type="select" style="width:130px;" class="select2">
<option value="">선택</option>
<option value="S" ${info.IMSAGUPTP eq 'S' ? 'selected' : ''}>사급</option>
<option value="K" ${info.IMSAGUPTP eq 'K' ? 'selected' : ''}>사내조립</option>
<option value="M" ${info.IMSAGUPTP eq 'M' ? 'selected' : ''}>사내제작</option>
<option value="V" ${info.IMSAGUPTP eq 'V' ? 'selected' : ''}>Vendor</option>
</select>
</td>
<td class="input_title"><label for="label">* 사용구분</label></td>
<td>
<select name="imItemFlag" id="imItemFlag" required reqTitle="사용구분" type="select" style="width:130px;" class="select2">
<option value="">선택</option>
<option value="1" ${info.IMITEMFLAG eq '1' ? 'selected' : ''}>기술설계</option>
<option value="2" ${info.IMITEMFLAG eq '2' ? 'selected' : ''}>구매</option>
<option value="3" ${info.IMITEMFLAG eq '3' ? 'selected' : ''}>A/S</option>
<option value="4" ${info.IMITEMFLAG eq '4' ? 'selected' : ''}>사용불가</option>
</select>
</td>
<td class="input_title"><label for="label">* 조달 후 처리</label></td>
<td>
<select name="imRepairTp" id="imRepairTp" required reqTitle="조달 후 처리" type="select" style="width:130px;" class="select2">
<option value="">선택</option>
<option value="1" ${info.IMREPAIRTP eq '1' ? 'selected' : ''}>단순임</option>
<option value="2" ${info.IMREPAIRTP eq '2' ? 'selected' : ''}>사급임</option>
</select>
</td>
</tr>
<tr>
<td class="input_title"><label for="label">* 자재관리등급</label></td>
<td>
<select name="imABC" id="imABC" required reqTitle="자재관리등급" type="select" style="width:130px;" class="select2">
<option value="">선택</option>
<option value="A" ${info.IMABC eq 'A' ? 'selected' : ''}>A급</option>
<option value="B" ${info.IMABC eq 'B' ? 'selected' : ''}>B급</option>
<option value="C" ${info.IMABC eq 'C' ? 'selected' : ''}>C급</option>
</select>
</td>
<td class="input_title"><label for="label">* 원,부자재</label></td>
<td>
<select name="imMaterialTp" id="imMaterialTp" required reqTitle="원,부자재" type="select" style="width:130px;" class="select2">
<option value="">선택</option>
<option value="1" ${info.IMMATERIALTP eq '1' ? 'selected' : ''}>원자재</option>
<option value="2" ${info.IMMATERIALTP eq '2' ? 'selected' : ''}>부자재</option>
<option value="3" ${info.IMMATERIALTP eq '3' ? 'selected' : ''}>소모품</option>
<option value="4" ${info.IMMATERIALTP eq '4' ? 'selected' : ''}>공구</option>
</select>
</td>
<td></td>
<td></td>
<td class="input_title"><label for="label">* 특성구분</label></td>
<td>
<select name="imItemSpFlag" id="imItemSpFlag" required reqTitle="특성구분" type="select" style="width:130px;" class="select2">
<option value="">선택</option>
<option value="1" ${info.IMITEMSPFLAG eq '1' ? 'selected' : ''}>정상사용</option>
<option value="2" ${info.IMITEMSPFLAG eq '2' ? 'selected' : ''}>장기재고</option>
<option value="3" ${info.IMITEMSPFLAG eq '3' ? 'selected' : ''}>불용</option>
<option value="4" ${info.IMITEMSPFLAG eq '4' ? 'selected' : ''}>검토필요</option>
</select>
</td>
</tr>
<tr>
<td class="input_title"><label for="label">* 생산안전재고</label></td>
<td>
<input type="text" name="imSafetyQty" id="imSafetyQty" required reqTitle="생산안전재고" value="${info.IMSAFETYQTY}" maxlength="10" style="width:130px;" />
</td>
<td class="input_title"><label for="label">* 부품판매안전재고</label></td>
<td colspan="3" >
<input type="text" name="imSaleSafetyQty" id="imSaleSafetyQty" required reqTitle="부품판매안전재고" value="${info.IMSALESAFETYQTY}" maxlength="10" style="width:130px;" />
</td>
<td class="input_title"><label for="label">* 검수여부</label></td>
<td>
<select name="imInspection" id="imInspection" required reqTitle="검수여부" type="select" style="width:130px;" class="select2">
<option value="">선택</option>
<option value="Y" ${info.IMINSPECTION eq 'Y' ? 'selected' : ''}>검수</option>
</select>
</td>
</tr>
<tr><td colspan="9" style="height:15px;"></td></tr>
</table>
<br />
</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>
<br/>
<!--// 미등록 부품 정보 -->
<div id="plmSearchZon">
<h3 class="tit">미등록 부품 정보</h3>
</div>
<table class="plm_table">
<colgroup>
<col width="8%" />
<col width="*" />
<col width="8%" />
<col width="8%" />
<col width="8%" />
<col width="8%" />
<col width="8%" />
</colgroup>
<thead>
<tr class="plm_thead">
<td>품번</td>
<td>품명</td>
<td>단위</td>
<td>수량</td>
<td>형번(규격)</td>
<td>재질</td>
<td>중량</td>
</tr>
</thead>
</table>
<div style="height:300px;overflow-y:scroll;margin-right:-10px;">
<table class="plm_table">
<colgroup>
<col width="8%" />
<col width="*" />
<col width="8%" />
<col width="8%" />
<col width="8%" />
<col width="8%" />
<col width="8%" />
</colgroup>
<tbody>
<c:choose>
<c:when test="${empty partList}">
<tr style="text-align:center;">
<td align="center" colspan="7">조회된 데이터가 없습니다.</td>
</tr>
</c:when>
<c:otherwise>
<c:forEach var="item" items="${partList}" varStatus="varStatus">
<tr>
<td>${item.PART_NO}</td>
<td>${item.PART_NAME}</td>
<td>${item.UNIT_NM}</td>
<td>${item.QTY}</td>
<td>${item.SPEC}</td>
<td>${item.MATERIAL}</td>
<td>${item.WEIGHT}</td>
</tr>
</c:forEach>
</c:otherwise>
</c:choose>
</tbody>
</table>
</div>
<!--// 미등록 부품 정보 -->
</section>
</form>
</body>
</html>