178 lines
5.4 KiB
Plaintext
178 lines
5.4 KiB
Plaintext
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
|
<%@ page import="com.pms.common.utils.*"%>
|
|
<%@ 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>
|
|
<link rel="stylesheet" href="css/basic.css">
|
|
<script>
|
|
$(document).ready(function(){
|
|
var actionType = "${actionType}";
|
|
if(actionType == 'modify'){
|
|
$('#overlapCheckId').remove();
|
|
$('#overlapStatus').remove();
|
|
}
|
|
|
|
//엔터키로 조회
|
|
$("input").keyup(function(e){
|
|
if(e.keyCode == 13){
|
|
fnc_productGroupSubmit();
|
|
}
|
|
});
|
|
});
|
|
|
|
//공백 및 중복확인
|
|
function fnc_overlapCheck(){
|
|
var result;
|
|
var productGroupName = $('#productGroupName').val();
|
|
if(!fnc_valitate('form1')){
|
|
$('#overlapStatus').empty();
|
|
$('#productGroupName').focus();
|
|
}else{
|
|
$.ajax({
|
|
url:"/admin/productGroupOverlapCheck.do",
|
|
type:"POST",
|
|
data:{"search_productGroupName":productGroupName},
|
|
dataType:"json",
|
|
async:false,
|
|
success:function(overlap){
|
|
if(overlap.PRODUCT_GROUP_NAME == productGroupName){
|
|
$('#overlapStatus').text("등록된 정보입니다.");
|
|
$('#productGroupName').focus();
|
|
}else{
|
|
$('#overlapStatus').text("등록 가능한 정보입니다.");
|
|
$('#productGroupName').focus();
|
|
}
|
|
result = overlap;
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
return result;
|
|
}
|
|
}
|
|
|
|
//저장
|
|
function fnc_productGroupSubmit(){
|
|
|
|
var productGroupName = $('#productGroupName').val();
|
|
var productGroupObjid = $('#productGroupObjid').val();
|
|
var productGroupDescription = $('#productGroupDescription').val();
|
|
var status = $('#productGroupStatus').val();
|
|
var actionType = "${param.actionType}";
|
|
|
|
var overlap = fnc_overlapCheck();
|
|
if(overlap.PRODUCT_GROUP_NAME == productGroupName && actionType == 'regist'){
|
|
Swal.fire("등록된 정보입니다.");
|
|
$('#productGroupName').focus();
|
|
}else if(overlap.OBJID == productGroupObjid || overlap.PRODUCT_GROUP_NAME == undefined){
|
|
if(confirm("저장하시겠습니까?")){
|
|
$.ajax({
|
|
url:"/admin/mergeProductGroup.do",
|
|
type:"POST",
|
|
data:{"productGroupName":productGroupName, "productGroupObjid":productGroupObjid, "status":status,
|
|
"actionType":actionType, "productGroupDescription":productGroupDescription},
|
|
dataType:"text",
|
|
async:false,
|
|
success:function(data){
|
|
opener.fn_search();
|
|
self.close(0);
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
}else{
|
|
Swal.fire("등록된 정보입니다.");
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<form id="form1" name="form1" method="post">
|
|
<input type="hidden" id="productGroupObjid" value="${productGroupInfo.OBJID}">
|
|
<section id="commonSection" class="admin_min">
|
|
<div class="admin_title">
|
|
<h2>제품군 관리</h2>
|
|
</div>
|
|
<div id="adminPopupFormWrap">
|
|
<table id="adminPopupForm">
|
|
<colgroup>
|
|
<col width="30%">
|
|
<col width="*">
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<td><label>제품군 명</label></td>
|
|
<td><input type="text" title="제품군" id="productGroupName" name="productGroupName" value="${productGroupInfo.PRODUCT_GROUP_NAME}" maxlength="16" required></td>
|
|
</tr>
|
|
<tr>
|
|
<td><label>제품군 설명</label></td>
|
|
<td><input type="text" id="productGroupDescription" name="productGroupDescription" value="${productGroupInfo.DESCRIPTION}" maxlength="20"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><label>활성화 여부</label></td>
|
|
<td>
|
|
<select id="productGroupStatus" name="productGroupStatus">
|
|
<option value="active" ${productGroupInfo.STATUS eq 'active' ? 'selected' : ''}>활성화</option>
|
|
<option value="inActive" ${productGroupInfo.STATUS eq 'inActive' ? 'selected' : ''}>비활성화</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="oem_pso_wrap">
|
|
<div id="adminPopTableW">
|
|
<table id="adminPopTable">
|
|
<colgroup>
|
|
<col width="8%" />
|
|
<col width="30%" />
|
|
<col width="*%" />
|
|
<col width="18%" />
|
|
</colgroup>
|
|
<tr id="thead">
|
|
<td>코드</td>
|
|
<td>제품</td>
|
|
<td>설명</td>
|
|
<td>활성화 여부</td>
|
|
</tr>
|
|
<c:choose>
|
|
<c:when test="${0 < productList.size()}">
|
|
<c:forEach var="product" items="${productList}">
|
|
<tr>
|
|
<td>${product.PRODUCT_CODE}</td>
|
|
<td>${product.PRODUCT_NAME}</td>
|
|
<td>${product.PRODUCT_DESC}</td>
|
|
<td>${product.STATUS eq 'active' ? '활성화':'비활성화'}</td>
|
|
</tr>
|
|
</c:forEach>
|
|
</c:when>
|
|
<c:otherwise>
|
|
<tr rowType="default">
|
|
<td colspan="4">해당하는 데이터가 없습니다.</td>
|
|
</tr>
|
|
</c:otherwise>
|
|
</c:choose>
|
|
</table>
|
|
</div>
|
|
<div id="adminPopupBtnWrap">
|
|
<span id="overlapStatus"></span>
|
|
<input type="button" value="저장" class="btns" onclick="javascript:fnc_productGroupSubmit()">
|
|
<input type="button" value="중복확인" class="btns" id="overlapCheckId" onclick="javascript:fnc_overlapCheck()">
|
|
</div>
|
|
</div>
|
|
<div class="btnCenterWrap">
|
|
<div class="center_btns_wrap">
|
|
<input type="button" value="닫기" name="" id="btn_close" class="btns" onclick="javascript:self.close();">
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</form>
|
|
</body>
|
|
</html> |