|
|
|
|
@ -157,20 +157,6 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<%-- 소유자 TUI GRID --%>
|
|
|
|
|
<div class="box_column" style="margin-top: 20px;">
|
|
|
|
|
<ul class="box_title">
|
|
|
|
|
<li class="tit">소유자 정보</li>
|
|
|
|
|
<li class="rig">
|
|
|
|
|
<button type="button" id="ownrSelectBtn" class="newbtn bg2-1">소유자 선택</button>
|
|
|
|
|
<button type="button" id="ownrRemoveBtn" class="newbtn bg2" style="margin-left: 5px;">제거</button>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
<div class="containers">
|
|
|
|
|
<div id="ownrInfoGrid"></div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@ -322,71 +308,8 @@
|
|
|
|
|
$("#lotnoWholAddr").val(lotnoWholAddr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 중요로직: 소유자 정보 그리드 관리 객체
|
|
|
|
|
var ownrGrid = {
|
|
|
|
|
instance: null,
|
|
|
|
|
|
|
|
|
|
// 그리드 초기화
|
|
|
|
|
init: function() {
|
|
|
|
|
var gridConfig = new XitTuiGridConfig();
|
|
|
|
|
|
|
|
|
|
// 기본 설정
|
|
|
|
|
gridConfig.setOptGridId('ownrInfoGrid');
|
|
|
|
|
gridConfig.setOptGridHeight(200);
|
|
|
|
|
gridConfig.setOptRowHeight(30);
|
|
|
|
|
gridConfig.setOptRowHeaderType('checkbox');
|
|
|
|
|
gridConfig.setOptUseClientSort(true);
|
|
|
|
|
|
|
|
|
|
// 컬럼 설정
|
|
|
|
|
gridConfig.setOptColumns([
|
|
|
|
|
{ header: '소유자ID', name: 'ownrId', align: 'center', width: 100, hidden: true },
|
|
|
|
|
{ header: '성명', name: 'flnm', align: 'center', width: 120 },
|
|
|
|
|
{ header: '주민등록번호', name: 'rrno', align: 'center', width: 150 },
|
|
|
|
|
{ header: '소유자구분', name: 'ownrSeCd', align: 'center', width: 100 },
|
|
|
|
|
{ header: '전화번호', name: 'telno', align: 'center', width: 120 },
|
|
|
|
|
{ header: '이메일', name: 'eml', align: 'left', width: 180 },
|
|
|
|
|
{ header: '지번전체주소', name: 'lotnoWholAddr', align: 'left', width: 300 },
|
|
|
|
|
{ header: '도로명전체주소', name: 'roadNmWholAddr', align: 'left', width: 300 }
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
this.instance = gridConfig.instance(tui.Grid);
|
|
|
|
|
tui.Grid.applyTheme('striped');
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 데이터 추가
|
|
|
|
|
addData: function(data) {
|
|
|
|
|
if (this.instance && data) {
|
|
|
|
|
this.instance.appendRow(data);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 선택된 행 삭제
|
|
|
|
|
removeSelectedRows: function() {
|
|
|
|
|
if (this.instance) {
|
|
|
|
|
var checkedRows = this.instance.getCheckedRows();
|
|
|
|
|
if (checkedRows.length === 0) {
|
|
|
|
|
alert('삭제할 소유자를 선택해주세요.');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (confirm('선택된 ' + checkedRows.length + '건의 소유자 정보를 제거하시겠습니까?')) {
|
|
|
|
|
checkedRows.forEach(function(row) {
|
|
|
|
|
this.instance.removeRow(row.rowKey);
|
|
|
|
|
}, this);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 모든 데이터 가져오기
|
|
|
|
|
getAllData: function() {
|
|
|
|
|
return this.instance ? this.instance.getData() : [];
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
|
// 중요로직: 소유자 그리드 초기화
|
|
|
|
|
ownrGrid.init();
|
|
|
|
|
|
|
|
|
|
$('#saveBtn').on('click', savePstnInfo);
|
|
|
|
|
$('#closeBtn, #btnCloseTop').on('click', function(e){ e.preventDefault(); window.close(); });
|
|
|
|
|
|
|
|
|
|
@ -394,35 +317,7 @@
|
|
|
|
|
$('#dtlAddr').on('input keyup blur', function() {
|
|
|
|
|
updateWholeAddress();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 중요로직: 소유자 선택 버튼 클릭 이벤트
|
|
|
|
|
$('#ownrSelectBtn').on('click', function() {
|
|
|
|
|
var crdnYr = '${crdnYr}';
|
|
|
|
|
var crdnNo = '${crdnNo}';
|
|
|
|
|
var url = '<c:url value="/crdn/crndRegistAndView/ownrSelect/popup.do"/>' +
|
|
|
|
|
'?crdnYr=' + encodeURIComponent(crdnYr) +
|
|
|
|
|
'&crdnNo=' + encodeURIComponent(crdnNo);
|
|
|
|
|
var w = 1000, h = 600;
|
|
|
|
|
var left = Math.max(0, (screen.width - w) / 2);
|
|
|
|
|
var top = Math.max(0, (screen.height - h) / 2);
|
|
|
|
|
window.open(url, 'ownrSelectPopup', 'width=' + w + ',height=' + h + ',left=' + left + ',top=' + top + ',resizable=yes,scrollbars=yes');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 중요로직: 소유자 제거 버튼 클릭 이벤트
|
|
|
|
|
$('#ownrRemoveBtn').on('click', function() {
|
|
|
|
|
ownrGrid.removeSelectedRows();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 중요로직: 소유자 선택 팝업에서 호출할 콜백 함수
|
|
|
|
|
window.onOwnrSelected = function(selectedOwnrs) {
|
|
|
|
|
if (selectedOwnrs && selectedOwnrs.length > 0) {
|
|
|
|
|
selectedOwnrs.forEach(function(ownr) {
|
|
|
|
|
ownrGrid.addData(ownr);
|
|
|
|
|
});
|
|
|
|
|
alert(selectedOwnrs.length + '건의 소유자 정보가 추가되었습니다.');
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 전역 함수로 노출하여 onclick에서 호출 가능하게 처리
|
|
|
|
|
|