150 lines
3.6 KiB
Plaintext
150 lines
3.6 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>
|
|
|
|
<script>
|
|
$(function(){
|
|
$(document).ready(function(){
|
|
$("#factoryName").focus();
|
|
});
|
|
|
|
//엔터키로 조회
|
|
$("input").keyup(function(e){
|
|
if(e.keyCode == 13){
|
|
fn_save();
|
|
}
|
|
});
|
|
|
|
//save
|
|
$("#btnSave").click(function(){
|
|
fn_save();
|
|
});
|
|
});
|
|
</script>
|
|
<script>
|
|
//정합성체크
|
|
function fn_validate(){
|
|
if($("#factoryName").val() == null || $("#factoryName").val() == ""){
|
|
Swal.fire("검사명을 입력해 주시기 바랍니다.");
|
|
$("#factoryName").focus();
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
//생산공장명 저장
|
|
function fn_save(){
|
|
if(fn_validate()){
|
|
if(confirm("저장하시겠습니까?")){
|
|
if(fn_duplicateNameCheck()){
|
|
$.ajax({
|
|
url:"/admin/saveFactoryInfo.do",
|
|
type:"POST",
|
|
data:$("#form1").serialize(),
|
|
dataType:"json",
|
|
async:false,
|
|
success:function(data){
|
|
Swal.fire(data.msg);
|
|
if(data.result == "true" || data.result == true || data.result){
|
|
opener.fn_search();
|
|
self.close(0);
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
//생산공장명 중복체크
|
|
function fn_duplicateNameCheck(){
|
|
var result = false;
|
|
var factoryName = $("#factoryName").val();
|
|
|
|
$.ajax({
|
|
url:"/admin/checkDuplicateFactoryName.do",
|
|
type:"POST",
|
|
data:{"factoryName":factoryName},
|
|
dataType:"json",
|
|
async:false,
|
|
success:function(data){
|
|
if(data.result == "false" || data.result == false || !data.result){
|
|
Swal.fire(data.msg);
|
|
}else{
|
|
result = true;
|
|
}
|
|
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
|
|
return result;
|
|
}
|
|
|
|
//정합성체크
|
|
function fn_validate(){
|
|
if($("#factoryName").val() == null || $("#factoryName").val() == ""){
|
|
Swal.fire("생산공장을 입력해 주시기 바랍니다.");
|
|
$("#factoryName").focus();
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<section id="commonSection">
|
|
<div class=admin_title>
|
|
<h2>생산공장명 관리</h2>
|
|
</div>
|
|
<div id="adminPopupFormWrap">
|
|
<form id="form1" name="form1" method="post">
|
|
<input type="hidden" id="objId" name="objId" value="${info.OBJID}">
|
|
<table id="adminPopupForm">
|
|
<colgroup>
|
|
<col width="37%" />
|
|
<col width="63%" />
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<td><label>생산공장명</label></td>
|
|
<td>
|
|
<input type="text" title="생산공장명" name="factoryName" id="factoryName" value="${info.FACTORY_NAME}" maxlength="20" required>
|
|
<input type="text" name="donottouch" id="donottouch" value="" style="display:none;"/>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><label>활성화 여부</label></td>
|
|
<td>
|
|
<select name="status" id="status">
|
|
<option value="active" ${info.STATUS eq 'active'?'selected':''}>활성화</option>
|
|
<option value="inActive" ${info.STATUS eq 'inActive'?'selected':''}>비활성화</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<div id="adminPopupBtnWrap">
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="btnCenterWrap">
|
|
<div class="center_btns_wrap">
|
|
<input type="button" value="저장" class="btns" id="btnSave">
|
|
<input type="button" value="닫기" name="" id="btn_close" class="btns" onclick="javascript:self.close();">
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</body>
|
|
</html> |