187 lines
4.5 KiB
Plaintext
187 lines
4.5 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>
|
|
$(document).ready(function(){
|
|
// 닫기 버튼
|
|
$("#btn_close").click(function(){
|
|
self.close();
|
|
});
|
|
|
|
// 저장 버튼
|
|
$("#btn_save").click(function(){
|
|
fn_save();
|
|
});
|
|
});
|
|
|
|
// 저장
|
|
function fn_save(){
|
|
// 필수값 체크
|
|
var materialName = $("#material_name").val();
|
|
if(materialName == null || materialName == ''){
|
|
Swal.fire({
|
|
title: '알림',
|
|
text: '소재명을 입력해주세요.',
|
|
icon: 'warning'
|
|
});
|
|
$("#material_name").focus();
|
|
return;
|
|
}
|
|
|
|
Swal.fire({
|
|
title: '확인',
|
|
text: '저장하시겠습니까?',
|
|
icon: 'question',
|
|
showCancelButton: true,
|
|
confirmButtonText: '확인',
|
|
cancelButtonText: '취소'
|
|
}).then((result) => {
|
|
if (result.isConfirmed) {
|
|
$.ajax({
|
|
url: "/admin/saveMaterialMngInfo.do",
|
|
type: "POST",
|
|
data: $("#materialForm").serialize(),
|
|
dataType: "json",
|
|
success: function(data){
|
|
if(data.result == 'true'){
|
|
Swal.fire({
|
|
title: '성공',
|
|
text: data.message,
|
|
icon: 'success'
|
|
}).then(() => {
|
|
if(opener && opener.fn_search){
|
|
opener.fn_search();
|
|
}
|
|
self.close();
|
|
});
|
|
} else {
|
|
Swal.fire({
|
|
title: '실패',
|
|
text: data.message || '저장에 실패했습니다.',
|
|
icon: 'error'
|
|
});
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
Swal.fire({
|
|
title: '오류',
|
|
text: '저장 중 오류가 발생했습니다.',
|
|
icon: 'error'
|
|
});
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
<style>
|
|
.form-table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
}
|
|
.form-table th, .form-table td {
|
|
border: 1px solid #ddd;
|
|
padding: 8px 10px;
|
|
text-align: left;
|
|
}
|
|
.form-table th {
|
|
background-color: #f5f5f5;
|
|
width: 120px;
|
|
font-weight: bold;
|
|
}
|
|
.form-table input[type="text"], .form-table textarea, .form-table select {
|
|
width: 100%;
|
|
box-sizing: border-box;
|
|
padding: 5px;
|
|
border: 1px solid #ccc;
|
|
}
|
|
.form-table textarea {
|
|
height: 80px;
|
|
resize: vertical;
|
|
}
|
|
.btn-area {
|
|
text-align: center;
|
|
padding: 15px;
|
|
}
|
|
.required:after {
|
|
content: " *";
|
|
color: red;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<form name="materialForm" id="materialForm" method="post">
|
|
<input type="hidden" name="objid" id="objid" value="${resultMap.OBJID}">
|
|
|
|
<div class="plm_menu_name_myungjin">
|
|
<h2>
|
|
<span>소재 등록/수정</span>
|
|
</h2>
|
|
</div>
|
|
|
|
<div style="padding: 15px;">
|
|
<table class="form-table">
|
|
<colgroup>
|
|
<col width="120px">
|
|
<col width="*">
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<th><label for="material_code" class="required">소재코드</label></th>
|
|
<td>
|
|
<input type="text" name="material_code" id="material_code" value="${resultMap.MATERIAL_CODE}" maxlength="50" placeholder="예: MAT-001">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th><label for="material_name">소재명</label></th>
|
|
<td>
|
|
<input type="text" name="material_name" id="material_name" value="${resultMap.MATERIAL_NAME}" maxlength="256" placeholder="소재명을 입력하세요">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th><label for="size_spec" class="required">사이즈</label></th>
|
|
<td>
|
|
<input type="text" name="size_spec" id="size_spec" value="${resultMap.SIZE_SPEC}" maxlength="100" placeholder="예: 100x50x10mm">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th><label for="material_part_no" class="required">소재품번</label></th>
|
|
<td>
|
|
<input type="text" name="material_part_no" id="material_part_no" value="${resultMap.MATERIAL_PART_NO}" maxlength="100" placeholder="소재품번을 입력하세요">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th><label for="status">상태</label></th>
|
|
<td>
|
|
<select name="status" id="status">
|
|
<option value="ACTIVE" ${resultMap.STATUS == 'ACTIVE' || empty resultMap.STATUS ? 'selected' : ''}>활성</option>
|
|
<option value="INACTIVE" ${resultMap.STATUS == 'INACTIVE' ? 'selected' : ''}>비활성</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th><label for="remark">비고</label></th>
|
|
<td>
|
|
<textarea name="remark" id="remark" placeholder="비고를 입력하세요">${resultMap.REMARK}</textarea>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="btn-area">
|
|
<input type="button" value="저장" class="plm_btns" id="btn_save">
|
|
<input type="button" value="닫기" class="plm_btns" id="btn_close">
|
|
</div>
|
|
|
|
</form>
|
|
</body>
|
|
</html>
|
|
|