|
|
|
|
@ -1,5 +1,8 @@
|
|
|
|
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
|
|
|
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
|
|
|
|
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
|
|
|
|
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
|
|
|
|
<%@ taglib prefix="dateUtil" uri="http://egovframework.go.kr/functions/date-util" %>
|
|
|
|
|
|
|
|
|
|
<div class="popup_wrap">
|
|
|
|
|
<div class="popup_inner">
|
|
|
|
|
@ -15,43 +18,77 @@
|
|
|
|
|
<tr>
|
|
|
|
|
<th class="th"><span class="required">*</span> 연도</th>
|
|
|
|
|
<td>
|
|
|
|
|
<input type="text" id="yr" name="yr" class="input calender"
|
|
|
|
|
value="${data.yr}" maxlength="4"
|
|
|
|
|
validation-check="required"
|
|
|
|
|
style="width: 100px;"
|
|
|
|
|
placeholder="YYYY" readonly />
|
|
|
|
|
<div class="hint-message">※ 4자리 연도를 선택하세요. (클릭하여 연도 선택)</div>
|
|
|
|
|
<c:choose>
|
|
|
|
|
<c:when test="${param.mode eq 'V'}">
|
|
|
|
|
<span class="view-text">${data.yr}</span>
|
|
|
|
|
<input type="hidden" id="yr" name="yr" value="${data.yr}" />
|
|
|
|
|
</c:when>
|
|
|
|
|
<c:otherwise>
|
|
|
|
|
<input type="text" id="yr" name="yr" class="input calender"
|
|
|
|
|
value="${data.yr}" maxlength="4"
|
|
|
|
|
validation-check="required"
|
|
|
|
|
style="width: 100px;"
|
|
|
|
|
placeholder="YYYY" readonly />
|
|
|
|
|
<div class="hint-message">※ 4자리 연도를 선택하세요. (클릭하여 연도 선택)</div>
|
|
|
|
|
</c:otherwise>
|
|
|
|
|
</c:choose>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<th class="th"><span class="required">*</span> 번호</th>
|
|
|
|
|
<td>
|
|
|
|
|
<input type="text" id="no" name="no" class="input"
|
|
|
|
|
value="${data.no}" maxlength="1"
|
|
|
|
|
validation-check="required"
|
|
|
|
|
style="width: 80px;"
|
|
|
|
|
placeholder="1" />
|
|
|
|
|
<div class="hint-message">※ 1~9 사이의 한 자리 번호를 입력하세요.</div>
|
|
|
|
|
<c:choose>
|
|
|
|
|
<c:when test="${param.mode eq 'V'}">
|
|
|
|
|
<span class="view-text">${data.no}</span>
|
|
|
|
|
<input type="hidden" id="no" name="no" value="${data.no}" />
|
|
|
|
|
</c:when>
|
|
|
|
|
<c:otherwise>
|
|
|
|
|
<input type="text" id="no" name="no" class="input"
|
|
|
|
|
value="${data.no}" maxlength="1"
|
|
|
|
|
validation-check="required"
|
|
|
|
|
style="width: 80px;"
|
|
|
|
|
placeholder="1" />
|
|
|
|
|
<div class="hint-message">※ 1~9 사이의 한 자리 번호를 입력하세요.</div>
|
|
|
|
|
</c:otherwise>
|
|
|
|
|
</c:choose>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<th class="th"><span class="required">*</span> 건축물 용도</th>
|
|
|
|
|
<td>
|
|
|
|
|
<input type="text" id="bdstUsg" name="bdstUsg" class="input"
|
|
|
|
|
value="${data.bdstUsg}" maxlength="60"
|
|
|
|
|
validation-check="required"
|
|
|
|
|
style="width: 400px;"
|
|
|
|
|
placeholder="건축물 용도를 입력하세요" />
|
|
|
|
|
<c:choose>
|
|
|
|
|
<c:when test="${param.mode eq 'V'}">
|
|
|
|
|
<span class="view-text">${data.bdstUsg}</span>
|
|
|
|
|
<input type="hidden" id="bdstUsg" name="bdstUsg" value="${data.bdstUsg}" />
|
|
|
|
|
</c:when>
|
|
|
|
|
<c:otherwise>
|
|
|
|
|
<input type="text" id="bdstUsg" name="bdstUsg" class="input"
|
|
|
|
|
value="${data.bdstUsg}" maxlength="60"
|
|
|
|
|
validation-check="required"
|
|
|
|
|
style="width: 400px;"
|
|
|
|
|
placeholder="건축물 용도를 입력하세요" />
|
|
|
|
|
</c:otherwise>
|
|
|
|
|
</c:choose>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<th class="th"><span class="required">*</span> 기준액(원/㎡)</th>
|
|
|
|
|
<td>
|
|
|
|
|
<input type="text" id="bldgNewPrcCrtrAmt" name="bldgNewPrcCrtrAmt" class="input"
|
|
|
|
|
value="${data.bldgNewPrcCrtrAmt}"
|
|
|
|
|
validation-check="required"
|
|
|
|
|
style="width: 200px; text-align: right;" />
|
|
|
|
|
<div class="hint-message">※ 숫자만 입력하세요. (천단위 콤마는 자동으로 처리됩니다.)</div>
|
|
|
|
|
<c:choose>
|
|
|
|
|
<c:when test="${param.mode eq 'V'}">
|
|
|
|
|
<span class="view-text" style="text-align: right;">
|
|
|
|
|
<fmt:formatNumber value="${data.bldgNewPrcCrtrAmt}" pattern="#,##0" />
|
|
|
|
|
</span>
|
|
|
|
|
<input type="hidden" id="bldgNewPrcCrtrAmt" name="bldgNewPrcCrtrAmt" value="${data.bldgNewPrcCrtrAmt}" />
|
|
|
|
|
</c:when>
|
|
|
|
|
<c:otherwise>
|
|
|
|
|
<input type="text" id="bldgNewPrcCrtrAmt" name="bldgNewPrcCrtrAmt" class="input"
|
|
|
|
|
value="${data.bldgNewPrcCrtrAmt}"
|
|
|
|
|
validation-check="required"
|
|
|
|
|
style="width: 200px; text-align: right;" />
|
|
|
|
|
<div class="hint-message">※ 숫자만 입력하세요. (천단위 콤마는 자동으로 처리됩니다.)</div>
|
|
|
|
|
</c:otherwise>
|
|
|
|
|
</c:choose>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
@ -60,9 +97,9 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div class="popup_foot">
|
|
|
|
|
<c:choose>
|
|
|
|
|
<c:when test="${param.mode eq 'D'}">
|
|
|
|
|
<!-- 삭제 모드 -->
|
|
|
|
|
<a href="#" id="btnDelete" class="newbtns bg3">삭제</a>
|
|
|
|
|
<c:when test="${param.mode eq 'V'}">
|
|
|
|
|
<!-- 삭제/보기 모드: 삭제 버튼만 노출 -->
|
|
|
|
|
<a href="#" id="btnDelete" class="newbtns bg2">삭제</a>
|
|
|
|
|
</c:when>
|
|
|
|
|
<c:when test="${not empty data.yr and not empty data.no}">
|
|
|
|
|
<!-- 수정 모드 -->
|
|
|
|
|
@ -73,7 +110,7 @@
|
|
|
|
|
<a href="#" id="btnSave" class="newbtns bg4">저장</a>
|
|
|
|
|
</c:otherwise>
|
|
|
|
|
</c:choose>
|
|
|
|
|
<a href="#" class="newbtns bg1 modalclose">취소</a>
|
|
|
|
|
<a href="#" class="newbtns bg1 modalclose">닫기</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@ -93,7 +130,7 @@
|
|
|
|
|
var BldgNewPrcCrtrAmtForm = {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 현재 모드 ('', 'D')
|
|
|
|
|
* 현재 모드 ('', 'V')
|
|
|
|
|
*/
|
|
|
|
|
mode: '${param.mode}',
|
|
|
|
|
|
|
|
|
|
@ -206,24 +243,20 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var formData = this.getFormData();
|
|
|
|
|
var isEdit = (this.mode !== 'D' && formData.yr && formData.no && '${data.yr}' && '${data.no}');
|
|
|
|
|
var url = isEdit ?
|
|
|
|
|
'<c:url value="/baseData/bldgNewPrcCrtrAmt/update.ajax"/>' :
|
|
|
|
|
'<c:url value="/baseData/bldgNewPrcCrtrAmt/register.ajax"/>';
|
|
|
|
|
|
|
|
|
|
var url = '<c:url value="/baseData/bldgNewPrcCrtrAmt/register.ajax"/>';
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: url,
|
|
|
|
|
type: 'POST',
|
|
|
|
|
data: formData,
|
|
|
|
|
success: function(response) {
|
|
|
|
|
if (response.success) {
|
|
|
|
|
alert(isEdit ? '수정되었습니다.' : '저장되었습니다.');
|
|
|
|
|
alert('저장되었습니다.');
|
|
|
|
|
if (window.opener && window.opener.refreshList) {
|
|
|
|
|
window.opener.refreshList();
|
|
|
|
|
}
|
|
|
|
|
window.close();
|
|
|
|
|
} else {
|
|
|
|
|
alert(response.message || (isEdit ? '수정에 실패했습니다.' : '저장에 실패했습니다.'));
|
|
|
|
|
alert(response.message || '저장에 실패했습니다.');
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
error: function(xhr, status, error) {
|
|
|
|
|
@ -272,9 +305,7 @@
|
|
|
|
|
* 닫기 처리
|
|
|
|
|
*/
|
|
|
|
|
cancel: function() {
|
|
|
|
|
if (confirm('입력한 내용이 저장되지 않습니다. 창을 닫으시겠습니까?')) {
|
|
|
|
|
window.close();
|
|
|
|
|
}
|
|
|
|
|
window.close();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -347,7 +378,7 @@
|
|
|
|
|
$('#bldgNewPrcCrtrAmtForm').on('keypress', function(e) {
|
|
|
|
|
if (e.which === 13) { // 엔터키
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
if (self.mode === 'D') {
|
|
|
|
|
if (self.mode === 'V') {
|
|
|
|
|
self.delete();
|
|
|
|
|
} else {
|
|
|
|
|
self.save();
|
|
|
|
|
@ -356,31 +387,12 @@
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 삭제 모드 처리
|
|
|
|
|
*/
|
|
|
|
|
initDeleteMode: function() {
|
|
|
|
|
if (this.mode === 'D') {
|
|
|
|
|
// 입력 필드 비활성화
|
|
|
|
|
$('#bldgNewPrcCrtrAmtForm input[type="text"]').prop('disabled', true);
|
|
|
|
|
$('#bldgNewPrcCrtrAmtForm input[type="text"]').addClass('disabled');
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 모듈 초기화
|
|
|
|
|
*/
|
|
|
|
|
init: function() {
|
|
|
|
|
// 삭제 모드 처리
|
|
|
|
|
this.initDeleteMode();
|
|
|
|
|
|
|
|
|
|
// 이벤트 핸들러 설정
|
|
|
|
|
this.eventBindEvents();
|
|
|
|
|
|
|
|
|
|
// 첫 번째 입력 필드에 포커스 (연도 필드는 자동 포커스 제외하여 datepicker 자동 오픈 방지)
|
|
|
|
|
if (this.mode !== 'D') {
|
|
|
|
|
//$('#no').focus();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|