임차인계약서 관리 상세 정보 수정.

main
jjh 2 months ago
parent 1df696e9b0
commit 587d9b3964

@ -1,7 +1,7 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%> <%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<c:set var="prefixName" scope="request">임대차계약 등록</c:set> <c:set var="prefixName" scope="request">임대차계약 등록</c:set>
<!-- inner page html --> <!-- inner page html -->
<div class="content-wrapper" data-doctx="${pageName}"> <div class="content-wrapper" data-doctx="${pageName}">
@ -268,7 +268,6 @@
let params = { let params = {
callPurpose: "view" callPurpose: "view"
, crdnId: $P.ctrl.getValue("CRDN_ID") , crdnId: $P.ctrl.getValue("CRDN_ID")
, lsctId: $P.ctrl.getValue("LSCT_ID")
}; };
$P.ctrl.getInfo(params); $P.ctrl.getInfo(params);

@ -7,122 +7,127 @@
<div class="content-pop" data-doctx="${pageName}"> <div class="content-pop" data-doctx="${pageName}">
<!-- Content --> <!-- Content -->
<div class="container flex-grow-1 px-0"> <div class="container flex-grow-1 px-0">
<!-- 입력 영역 -->
<form name="frmEdit">
<!-- hidden -->
<input type="hidden" name="crdnId" data-map="CRDN_ID" />
<!-- 단속 정보 -->
<div class="card"> <div class="card">
<!-- 상단 버튼 --> <!-- 업무 버튼 -->
<div class="container-page-btn"> <div class="container-page-btn">
<button type="button" class="btn btn-outline-dark w-px-120" name="btnReset" title="초기화"> <label class="col-form-label bg-label-danger pe-2 w-px-120 text-sm-center">단속 정보</label>
초기화 </div> <!-- <div class="container-page-btn"> -->
</button>
<span class="container-window-btn-right"> <div class="row g-1">
<button type="button" class="btn btn-search w-px-120" name="btnSearch" title="검색"> <!-- 단속 일시 -->
검색 <div class="col-md-6">
</button> <label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="crdnDt">단속일시</label>
<button type="button" class="btn btn-success w-px-120" name="btnOK" title="임차인 선택 확인"> <input is="id-input" type="text" class="form-control w-30" name="crdnDt" data-map="CRDN_DT" data-fmt-type="dt" readonly />
선택 확인 </div>
</button> <!-- 차량번호 -->
</span> <div class="col-md-6">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="vhrno">차량번호</label>
<input is="id-input" type="text" class="form-control w-30" name="vhrno" data-map="VHRNO" readonly />
</div>
<!-- 위반 내용 -->
<div class="col-md-6">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="vltnArtcl">위반내용</label>
<input is="id-input" type="text" class="form-control w-30" name="vltnArtcl" data-map="VLTN_ARTCL" readonly />
</div>
<!-- 과태료 단속원금 -->
<div class="col-md-6">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="ffnlgCrdnAmt">과태료단속원금</label>
<input is="id-input" type="text" class="form-control w-30 text-sm-end" name="ffnlgCrdnAmt" data-map="FFNLG_CRDN_AMT" data-fmt-type="number" readonly />
</div>
<!-- 법정동 -->
<div class="col-md-6">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="crdnStdgNm">법정동</label>
<input is="id-input" type="text" class="form-control w-30" name="crdnStdgNm" data-map="CRDN_STDG_NM" readonly />
</div>
<!-- 단속 장소 -->
<div class="col-md-6">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="crdnPlc">단속장소</label>
<input is="id-input" type="text" class="form-control w-50" name="crdnPlc" data-map="CRDN_PLC" readonly />
</div>
</div>
</div> </div>
<!-- 상단 버튼 -->
<!-- 검색 조건 영역 --> <p></p>
<form name="frmSearch">
<!-- hidden --> <!-- 임대차계약 정보 -->
<input type="hidden" name="userId" /> <div class="card">
<!-- 업무 버튼 -->
<div class="container-page-btn">
<label class="col-form-label bg-label-danger pe-2 w-px-120 text-sm-center">임대차계약 정보</label>
</div> <!-- <div class="container-page-btn"> -->
<!-- 메인 조건 -->
<div class="container-search">
<div class="row g-1"> <div class="row g-1">
<!-- 기업 번호 --> <!-- 계약 시작 일시 -->
<div class="col-6"> <div class="col-md-6">
<label is="name-label" class="form-label fw-bold form-search-title w-px-120 text-end" for="schEntNo">단속일자</label> <label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="ctrtBgngYmd">계약시작일시</label>
<input is="id-input" type="text" class="form-control w-px-160" name="CRDN_YMD" autocomplete="off" /> <input is="id-input" type="text" class="form-control w-30" name="ctrtBgngYmd" data-map="CTRT_BGNG_DT" data-fmt-type="dt" readonly />
</div> </div>
<!-- 기업 명 --> <!-- 계약 종료 일시 -->
<div class="col-6"> <div class="col-md-6">
<label is="name-label" class="form-label fw-bold form-search-title w-px-120 text-end" for="schEntNm">차량번호</label> <label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="ctrtEndYmd">계약종료일시</label>
<input is="id-input" type="text" class="form-control w-px-200" name="schVhrno" autocomplete="off" /> <input is="id-input" type="text" class="form-control w-30" name="ctrtEndYmd" data-map="CTRT_END_DT" data-fmt-type="dt" readonly />
</div> </div>
<!-- 자동차등록번호 -->
<div class="col-md-6">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="vhrno">자동차등록번호</label>
<input is="id-input" type="text" class="form-control w-30" name="vhrno" data-map="VHRNO" readonly />
</div> </div>
</div> <!-- 메인 조건 --> <!-- 임차인 구분 코드 -->
</form> <div class="col-md-6">
<!-- 검색 조건 영역 --> <label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="vhrno">임차인구분</label>
<input is="id-input" type="text" class="form-control w-20" name="hirerSeNm" data-map="HIRER_SE_NM" readonly />
<!-- 업무 버튼 및 건수 표시 -->
<div>
<div class="container-page-btn" name="gridButtonArea">
<!-- 건수, 페이지 표시 -->
<div class="d-flex flex-row justify-content-between">
<span is="paging-info" class="dataTables_info" name="dataPagingInfo" role="status" aria-live="polite"></span>
<ul class="pagination pagination-primary" name="dataPaging">
</ul>
</div> </div>
<!-- 업무 버튼 --> <!-- 임차인 등록 번호 -->
<span class="container-window-btn-right"> <div class="col-md-6">
<button type="button" class="btn btn-primary w-px-120" name="btnCreate" title="임차인 등록"> <label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="hirerRegNo">임차인등록번호</label>
임차인 등록 <input is="id-input" type="text" class="form-control w-30" name="hirerRegNo" data-map="HIRER_REG_NO" readonly />
</button> </div>
<button type="button" class="btn btn-primary w-px-120" name="btnUpdate" title="임차인 수정"> <!-- 임차인 명 -->
임차인 수정 <div class="col-md-6">
</button> <label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="hirerNm">임차인명</label>
<button type="button" class="btn btn-primary w-px-120" name="btnRemove" title="임차인 삭제"> <input is="id-input" type="text" class="form-control w-30" name="hirerNm" data-map="HIRER_NM" readonly />
임차인 삭제 </div>
</button> <!-- 등록 일시 / 등록자 -->
</span> <div class="col-md-6">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="regDt">등록일시</label>
<input is="id-input" type="text" class="form-control w-30" name="regDt" data-map="REG_DT" data-fmt-type="dt" readonly />
<input is="id-input" type="text" class="form-control w-25" name="rgtrNm" data-map="RGTR_NM" readonly />
</div> </div>
<!-- 수정 일시 / 수정자 -->
<div class="col-md-6">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="mdfcnDt">수정일시</label>
<input is="id-input" type="text" class="form-control w-30" name="mdfcnDt" data-map="MDFCN_DT" data-fmt-type="dt" readonly />
<input is="id-input" type="text" class="form-control w-25" name="mdfrNm" data-map="MDFR_NM" readonly />
</div> </div>
<!-- 업무 버튼 및 건수 표시 --> </div>
</div>
</form>
<!-- 입력 영역 -->
<!-- DataTables(그리드) --> <!-- 첨부 파일 -->
<div class="card-datatable text-nowrap"> <div class="card">
<div class="dataTables_wrapper dt-bootstrap5 no-footer"> <!-- 첨부 파일 테이블 -->
<div class="table-responsive ox-scroll oy-scroll h-px-300" name="tableRspns"> <div class="table-responsive">
<table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer" aria-describedby="DataTables_Table_0_info"> <table class="table table-bordered table-hover table-striped" name="fileList">
<thead class="sticky-thead"> <thead>
<tr name="theadTr" data-search-target="[data-doctx='${pageName}']"> <th class="text-center" style="width: 24px">No.</th>
</tr> <th class="text-center" style="width: 200px">파일번호</th>
<th class="text-center">파일이름</th>
<th class="text-center" style="width: 200px">파일크기</th>
<th class="text-center" style="width: 120px">다운로드</th>
</thead> </thead>
<template name="tmpltCols"> <tbody name="tbodyFileList">
<th class="cmn" style="width: 72px;">No.</th>
<th class="cmn" style="width: 56px;"><input type="checkbox" class="form-check-input" name="gridAllCheckbox" onchange="pageObject['${pageName}'].dataTableCheckbox(this, this.checked);" /></th>
<th class="cmn" style="width: 200px;">기업명</th>
<th class="cmn" style="width: 160px;">법인(사업자)번호</th>
<th class="cmn" style="width: 120px;">대표자명</th>
<th class="cmn" style="width: 160px;">전화번호</th>
<th class="cmn" style="width: 160px;">팩스번호</th>
<th class="cmn" style="width: 100px;">우편번호</th>
<th class="cmn" style="width: 280px;">주소</th>
<th class="cmn" style="width: 180px;">등록일시</th>
<th class="cmn dummy-th"></th>
</template>
<tbody name="tbodyList">
</tbody> </tbody>
<template is="curly-brackets" name="tmpltRows">
<tr data-index="{data-index}">
<td class="cmn text-center" onclick ondblclick>{ROW_NUM}</td>
<td class="cmn text-center"><input type="checkbox" class="form-check-input" name="gridCheckbox" value="{data-index}" onchange="pageObject['${pageName}'].dataTableCheckbox(this, this.checked);" /></td>
<td class="cmn text-start" onclick ondblclick>{ENT_NM}</td>
<td class="cmn text-center" onclick ondblclick>{ENT_NO}</td>
<td class="cmn text-center" onclick ondblclick>{RPRSV_NM}</td>
<td class="cmn text-center" onclick ondblclick>{ENT_TELNO}</td>
<td class="cmn text-center" onclick ondblclick>{ENT_FXNO}</td>
<td class="cmn text-center" onclick ondblclick>{ENT_ZIP}</td>
<td class="cmn text-start" onclick ondblclick>{ENT_ADDR}</td>
<td class="cmn text-center" onclick ondblclick>{REG_DT}</td>
<td class="cmn dummy-td"></td>
</tr>
</template>
<template name="tmpltNotFound">
<tr class="cmn">
<td valign="top" colspan="11" class="dataTables_empty text-center">${prefixName} 정보를 찾지 못했습니다.</td>
</tr>
</template>
</table> </table>
</div> </div> <!-- 첨부 파일 테이블 <div class="table-responsive"> -->
</div>
</div>
<!-- DataTables(그리드) -->
</div> <!-- <div class="card"> --> </div> <!-- <div class="card"> -->
<!-- 첨부 파일 -->
</div> <!-- <div class="container flex-grow-1 px-0"> --> </div> <!-- <div class="container flex-grow-1 px-0"> -->
<!-- Content --> <!-- Content -->
</div> </div>
@ -143,195 +148,79 @@
// pageObject // pageObject
let $P = pageObject["${pageName}"]; let $P = pageObject["${pageName}"];
// formFields
$P.formFields = new FimsFormFields($P.selectorn("frmSearch"));
// datasetControl // datasetControl
$P.ctrl = newRent02020Control("${pageName}", "[data-doctx=${pageName}]"); $P.ctrl = newRent02020Control("${pageName}", "[data-doctx=${pageName}]");
// paging // 파일 리스트
$P.pagingSupport = new FimsPagingSupport({ $P.fileListArr = new Array();
ctrl: $P.ctrl // DatasetControl
, ignoreCtrlPrefix: true // ctrl.prefix 가 있더라도 무시
, linkContainer: "[name='dataPaging']" // <ul class="pagination pagination-primary" name="dataPaging">
});
/**************************************************************************
* DataTable 이벤트
**************************************************************************/
// dataTable 체크박스 클릭 이벤트
$P.dataTableCheckbox = (element, bool) => {
GRID.checkbox.sync(element, bool);
let atLeastOne = GRID.checkbox.countChecked(element) > 0;
$P.$findn("btnOK").prop("disabled", !atLeastOne);
$P.$findn("btnRemove").prop("disabled", !atLeastOne);
Apply.toDataset.selection($P.ctrl.dataset, element, bool);
}
// dataTable 클릭 이벤트
$P.dataTableClick = (dataIndex) => {
if (dataIndex == "") return;
$P.$findn("tbodyList").setCurrentRow(dataIndex);
Apply.toDataset.current($P.ctrl.dataset, dataIndex);
}
// dataTable 더블 클릭 이벤트
$P.dataTableDblClick = (dataIndex, dataKey) => {
let params = {
entId: $P.ctrl.getValue("ENT_ID")
};
$P.ctrl.getInfo(params);
}
// DataTable에 스크롤이 맨 밑으로 이동했을 때 이벤트
$P.scrollDataList = () => {
$P.ctrl.load($P.ctrl.query.pageNum + 1);
}
/************************************************************************** /**************************************************************************
* 사용자 함수(function) * 사용자 함수(function)
**************************************************************************/ **************************************************************************/
// URL 설정 // URL 설정
$P.setUrl = (prefixUrl) => { $P.setUrl = (prefixUrl) => {
$P.ctrl.urls.load = wctx.url(prefixUrl + "/020/list.do"); // 검색 $P.ctrl.urls.load = wctx.url(prefixUrl + "/020/list.do") // 검색
$P.ctrl.urls.create = wctx.url(prefixUrl + "/020/createMpng.do") // 등록
$P.ctrl.urls.remove = wctx.url(prefixUrl + "/020/removeEnt.do") // 삭제
$P.ctrl.urls.getInfo = wctx.url(prefixUrl + "/030/info.do"); // 상세 정보
} }
/************************************************************************** // 첨부파일 조회
* 버튼 clickEvent $P.fnSearchFileList = (hirerId) => {
**************************************************************************/ let tableFileList = $P.findn("fileList"); // table element 찾기
// 업무 구분 변경 이벤트 let fileLength = tableFileList.rows.length;
$P.fnReset = (initSearchYN) => {
// 화면 초기화
$P.findn("frmSearch").reset();
// dataset 초기화
$P.ctrl.dataset.clear();
// URL 설정
$P.setUrl("${prefixUrl}");
// 기본 데이터 설정
$P.$findn("userId").val("${userId}"); // 사용자 ID
$P.$findn("schEntNo").val("${schEntNo}"); // 기업 번호
// 그리드 th // 기존 table에 자료가 존재하면 tableRow 삭제
let colContent = $P.findn("tmpltCols").content; for (let iLoop = 1; iLoop < fileLength; iLoop++) {
let cols = $(colContent).find(".cmn"); tableFileList.deleteRow(1); // table 행(Row) 삭제
let colsOuterHTML = "";
cols.each(function() {
colsOuterHTML += this.outerHTML;
});
$P.findn("tableRspns").changeColumn(colsOuterHTML);
if (initSearchYN && $P.$findn("schEntNo").val() != "") {
$P.fnSearchList();
}
} }
// 검색 버튼 클릭 이벤트 // 임차인 등록일 경우에는 첨부파일을 조회하지 안는다..
$P.fnSearchList = () => { if (!hirerId) return;
// 검색조건
$P.ctrl.query = $P.formFields.get(); // 검색 조건
$P.ctrl.query.fetchSize = DEFAULT_FETCH_SIZE; // 한번에 조회되는 자료 건수
$P.ctrl.query.delYn = "N"; // 삭제 여부
$P.ctrl.load(1); // 첨부파일 리스트
ajax.get({
url: "file/list.do"
, data: {
infoType: "120"
, infoKeys: hirerId
, fetchSize: 0
} }
, success: (resp) => {
let fileNo = 0;
let fileList = resp.fileList;
// 엑셀 버튼 이벤트 fileList.forEach(function (item, index, array) {
$P.fnExcel = () => { fileNo = index + 1;
if ($P.ctrl.dataset.empty) {
dialog.alert({
content: "검색된 자료가 없습니다."
, onOK: () => { }
});
return;
}
// DataTable(그리드) let innerHtml = "";
$P.ctrl.query.cellDefs = innerHtml += "<tr>";
AppSupport.getCellDefs($P.$findn("theadTr").find("th").not(".dummy-th").not(":eq(0)") innerHtml += "<td class='text-center'>" + fileNo + "</td>";
, $($P.findn("tmpltRows").content).find("td").not(".dummy-td").not(":eq(0)")); innerHtml += "<td class='text-center'>" + item.FILE_ID + "</td>";
innerHtml += "<td class='text-center'>" + item.FILE_NM + "</td>";
innerHtml += "<td class='text-center'>" + item.FILE_SIZE + " byte</td>";
innerHtml += "<td class='text-center'>" + "<button type='button' class='btn' onclick=";
innerHtml += "pageObject['${pageName}'].fnFileDownload(" + item.FILE_ID + ");" + "><i class='bx bx-download me-1'></i></button>" + "</td>";
innerHtml += "</tr>";
$P.ctrl.download(); $P.$findn("tbodyFileList").append(innerHtml);
}
// 확인
$P.fnOK = () => {
let selected = $P.ctrl.getDataset("selected");
if (selected.length < 1) {
dialog.alert({
content: "선택하신 " + $P.ctrl.prefixName + " 정보가 없습니다."
, onOK: () => { }
}); });
return;
}
dialog.alert({
content: "현재 " + $P.ctrl.prefixName + " 정보를 저장하시겠습니까?"
, onOK: () => {
let params = {
callPurpose: "create"
, userId: $P.$findn("userId").val()
, entIds: selected.map(info => info.ENT_ID).join(",")
}
$P.ctrl.save(params);
} }
}); });
} }
// 임대기업 등록 버튼 클릭 이벤트 // 첨부파일 다운로드 아이콘 클릭 이벤트
$P.fnCreate = () => { $P.fnFileDownload = (fileID) => {
let params = { top.location.href = "/file/download.do?fileID=" + fileID;
entId: null
};
$P.ctrl.getInfo(params);
} }
// 임대기업 수정 버튼 클릭 이벤트 /**************************************************************************
$P.fnUpdate = () => { * 버튼 clickEvent
// 임대기업 ID **************************************************************************/
let entId = $P.ctrl.getValue("ENT_ID"); // 업무 구분 변경 이벤트
// 임대기업 ID 가 없다면.. return $P.fnReset = () => {
if (typeof entId == "undefined" || entId == null || entId == "") return; // 화면 초기화
$P.findn("frmEdit").reset();
let params = {
entId: entId
};
$P.ctrl.getInfo(params);
}
// 임대기업 삭제 버튼 클릭 이벤트
$P.fnRemove = () => {
let selected = $P.ctrl.getDataset("selected"); // 선택 자료
if (selected.length < 1) {
dialog.alert({
content: "선택하신 " + $P.ctrl.prefixName + " 정보가 없습니다."
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => { }
});
return;
}
let params = { // URL 설정
entIds: selected.map(info => info.ENT_ID).join(",") $P.setUrl("${prefixUrl}");
};
dialog.alert({
content: "선택한 " + selected.length + "건의 " + $P.ctrl.prefixName + " 정보를 삭제하시겠습니까?"
, onOK: () => { $P.ctrl.remove(params); }
});
} }
/************************************************************************** /**************************************************************************
@ -339,25 +228,7 @@
**************************************************************************/ **************************************************************************/
// 이벤트 // 이벤트
$P.setEvent = () => { $P.setEvent = () => {
// 기본 버튼 이벤트 //
$P.$findn("btnReset").on("click", () => { $P.fnReset(); }); // 초기화
$P.$findn("btnSearch").on("click", () => { $P.fnSearchList(); }); // 검색
$P.$findn("btnOK").on("click", () => { $P.fnOK(); }); // 선택 확인
// input에서 엔터(Enter) 키를 누르면 검색한다.
$P.$findn("schEntNo").onEnterPress($P.fnSearchList); // 법인(사업자)번호
$P.$findn("schEntNm").onEnterPress($P.fnSearchList); // 기업명
// 업무 버튼 이벤트
$P.$findn("btnCreate").on("click", () => { $P.fnCreate(); }); // 등록
$P.$findn("btnUpdate").on("click", () => { $P.fnUpdate(); }); // 수정
$P.$findn("btnRemove").on("click", () => { $P.fnRemove(); }); // 삭제
// DataTable width 변경 조정
Componentization.fnMakeResizableTable($P.findn("tableRspns"));
// DataTable 스크롤 이벤트 생성
Componentization.fnMakeScrollableTable($P.findn("tableRspns"), $P.scrollDataList);
} }
/************************************************************************** /**************************************************************************
@ -367,10 +238,10 @@
$P.setEvent(); $P.setEvent();
// 2. 초기 설정 // 2. 초기 설정
$P.fnReset(true); $P.fnReset();
// 3. 보안모드 // 3. dataset 설정
fn_securityModeToggle($("#securityMode--top").is(":checked")); $P.ctrl.setData([${Info}]);
}); });
</script> </script>

@ -69,7 +69,7 @@
<!-- 임차인 이메일 주소 --> <!-- 임차인 이메일 주소 -->
<div class="col-md-12"> <div class="col-md-12">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="hirerEmlAddr">이메일</label> <label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="hirerEmlAddr">이메일</label>
<input is="id-input" type="text" class="form-control w-30" name="hirerEmlAddr" data-map="HIRER_EML_ADDR" /> <input is="id-input" type="text" class="form-control w-30" name="hirerEmlAddr" data-map="HIRER_EML_ADDR" autocomplete="off" />
</div> </div>
<!-- 주소 --><!-- 우편번호 --> <!-- 주소 --><!-- 우편번호 -->
<div class="col-md-12"> <div class="col-md-12">
@ -117,6 +117,7 @@
</div> <!-- <div class="card"> --> </div> <!-- <div class="card"> -->
<!-- 첨부 파일 --> <!-- 첨부 파일 -->
<p></p>
<!-- 업무 버튼 및 건수 표시 --> <!-- 업무 버튼 및 건수 표시 -->
<div> <div>

@ -1,7 +1,7 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%> <%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<c:set var="prefixName" scope="request">임대차계약 관리</c:set> <c:set var="prefixName" scope="request">임대차계약 관리</c:set>
<!-- inner page html --> <!-- inner page html -->
<div class="content-wrapper" data-doctx="${pageName}"> <div class="content-wrapper" data-doctx="${pageName}">
@ -116,14 +116,14 @@
</li> </li>
<li class="nav-item"> <li class="nav-item">
<button type="button" class="nav-link w-px-160 h-100" role="tab" data-bs-toggle="tab" name="tabItem1" <button type="button" class="nav-link w-px-160 h-100" role="tab" data-bs-toggle="tab" name="tabItem1"
onClick="pageObject['${pageName}'].fnSearchList('대상');"> onClick="pageObject['${pageName}'].fnSearchList('대상');">
대상 대상
</button> </button>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<button type="button" class="nav-link w-px-160 h-100" role="tab" data-bs-toggle="tab" name="tabItem2" <button type="button" class="nav-link w-px-160 h-100" role="tab" data-bs-toggle="tab" name="tabItem2"
onClick="pageObject['${pageName}'].fnSearchList('대상');"> onClick="pageObject['${pageName}'].fnSearchList('대상');">
대상 대상
</button> </button>
</li> </li>
<li class="nav-item"> <li class="nav-item">
@ -309,9 +309,9 @@
// URL 설정 // URL 설정
$P.setUrl = (prefixUrl) => { $P.setUrl = (prefixUrl) => {
$P.ctrl.urls.load = wctx.url(prefixUrl + "/050/list.do"); // 검색 $P.ctrl.urls.load = wctx.url(prefixUrl + "/050/list.do"); // 검색
$P.ctrl.urls.getInfo = wctx.url(prefixUrl + "/020/info.do"); // 상세 정보
$P.ctrl.urls.create = wctx.url(prefixUrl + "/050/createAprv.do") // 승인 요청 $P.ctrl.urls.create = wctx.url(prefixUrl + "/050/createAprv.do") // 승인 요청
$P.ctrl.urls.remove = wctx.url(prefixUrl + "/050/removeAprv.do") // 승인 요청 취소 $P.ctrl.urls.remove = wctx.url(prefixUrl + "/050/removeAprv.do") // 승인 요청 취소
$P.ctrl.urls.getInfo = wctx.url(prefixUrl + "/060/info.do"); // 상세 정보
} }
// 버튼 설정 // 버튼 설정

@ -0,0 +1,264 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<c:set var="prefixName" scope="request">임대차계약 정보</c:set>
<!-- inner page html -->
<div class="content-pop" data-doctx="${pageName}">
<!-- Content -->
<div class="container flex-grow-1 px-0">
<!-- 입력 영역 -->
<form name="frmEdit">
<!-- hidden -->
<input type="hidden" name="lsctId" data-map="LSCT_ID" />
<!-- 단속 정보 -->
<div class="card">
<!-- 업무 버튼 -->
<div class="container-page-btn">
<label class="col-form-label bg-label-danger pe-2 w-px-120 text-sm-center">단속 정보</label>
</div> <!-- <div class="container-page-btn"> -->
<div class="row g-1">
<!-- 단속 일시 -->
<div class="col-md-6">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="crdnDt">단속일시</label>
<input is="id-input" type="text" class="form-control w-30" name="crdnDt" data-map="CRDN_DT" data-fmt-type="dt" readonly />
</div>
<!-- 차량번호 -->
<div class="col-md-6">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="vhrno">차량번호</label>
<input is="id-input" type="text" class="form-control w-30" name="vhrno" data-map="VHRNO" readonly />
</div>
<!-- 위반 내용 -->
<div class="col-md-6">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="vltnArtcl">위반내용</label>
<input is="id-input" type="text" class="form-control w-30" name="vltnArtcl" data-map="VLTN_ARTCL" readonly />
</div>
<!-- 단속 장소 -->
<div class="col-md-6">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="crdnPlc">단속장소</label>
<input is="id-input" type="text" class="form-control w-30" name="crdnStdgNm" data-map="CRDN_STDG_NM" readonly />
<input is="id-input" type="text" class="form-control w-40" name="crdnPlc" data-map="CRDN_PLC" readonly />
</div>
</div>
</div>
<p></p>
<!-- 임대차계약 정보 -->
<div class="card">
<!-- 업무 버튼 -->
<div class="container-page-btn">
<label class="col-form-label bg-label-danger pe-2 w-px-120 text-sm-center">임대차계약 정보</label>
</div> <!-- <div class="container-page-btn"> -->
<div class="row g-1">
<!-- 계약 시작 일시 -->
<div class="col-md-6">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="ctrtBgngYmd">계약시작일시</label>
<input is="id-input" type="text" class="form-control w-30" name="ctrtBgngYmd" data-map="CTRT_BGNG_DT" data-fmt-type="dt" readonly />
</div>
<!-- 계약 종료 일시 -->
<div class="col-md-6">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="ctrtEndYmd">계약종료일시</label>
<input is="id-input" type="text" class="form-control w-30" name="ctrtEndYmd" data-map="CTRT_END_DT" data-fmt-type="dt" readonly />
</div>
<!-- 자동차등록번호 -->
<div class="col-md-6">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="vhrno">자동차등록번호</label>
<input is="id-input" type="text" class="form-control w-30" name="vhrno" data-map="VHRNO" readonly />
</div>
<!-- 임차인 구분 코드 -->
<div class="col-md-6">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="vhrno">임차인구분</label>
<input is="id-input" type="text" class="form-control w-20" name="hirerSeNm" data-map="HIRER_SE_NM" readonly />
</div>
<!-- 임차인 등록 번호 -->
<div class="col-md-6">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="hirerRegNo">임차인등록번호</label>
<input is="id-input" type="text" class="form-control w-30" name="hirerRegNo" data-map="HIRER_REG_NO" readonly />
</div>
<!-- 임차인 명 -->
<div class="col-md-6">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="hirerNm">임차인명</label>
<input is="id-input" type="text" class="form-control w-30" name="hirerNm" data-map="HIRER_NM" readonly />
</div>
<!-- 임차인 전화번호 -->
<div class="col-md-6">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="hirerTelno">전화번호</label>
<input is="id-input" type="text" class="form-control w-30" name="hirerTelno" data-map="HIRER_TELNO" readonly />
</div>
<!-- 임차인 휴대 전화번호 -->
<div class="col-md-6">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="hirerMblTelno">휴대전화번호</label>
<input is="id-input" type="text" class="form-control w-30" name="hirerMblTelno" data-map="HIRER_MBL_TELNO" readonly />
</div>
<!-- 임차인 이메일 주소 -->
<div class="col-md-12">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="hirerEmlAddr">이메일</label>
<input is="id-input" type="text" class="form-control w-30" name="hirerEmlAddr" data-map="HIRER_EML_ADDR" readonly />
</div>
<!-- 주소 --><!-- 우편번호 -->
<div class="col-md-12">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="hirerAddr">주소</label>
<input is="id-input" type="text" class="form-control w-70" name="hirerAddr" data-map="HIRER_ADDR" readonly />
<input is="id-input" type="text" class="form-control w-px-80" name="hirerZip" data-map="HIRER_ZIP" readonly />
</div>
<!-- 상세주소 -->
<div class="col-md-12">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="hirerDtlAddr">상세주소</label>
<input is="id-input" type="text" class="form-control w-78" name="hirerDtlAddr" data-map="HIRER_DTL_ADDR" readonly />
</div>
<!-- 등록 일시 / 등록자 -->
<div class="col-md-6">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="regDt">등록일시</label>
<input is="id-input" type="text" class="form-control w-30" name="regDt" data-map="REG_DT" data-fmt-type="dt" readonly />
<input is="id-input" type="text" class="form-control w-25" name="rgtrNm" data-map="RGTR_NM" readonly />
</div>
<!-- 수정 일시 / 수정자 -->
<div class="col-md-6">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="mdfcnDt">수정일시</label>
<input is="id-input" type="text" class="form-control w-30" name="mdfcnDt" data-map="MDFCN_DT" data-fmt-type="dt" readonly />
<input is="id-input" type="text" class="form-control w-25" name="mdfrNm" data-map="MDFR_NM" readonly />
</div>
</div>
</div>
</form>
<!-- 입력 영역 -->
<!-- 첨부 파일 -->
<div class="card">
<!-- 첨부 파일 테이블 -->
<div class="table-responsive">
<table class="table table-bordered table-hover table-striped" name="fileList">
<thead>
<th class="text-center" style="width: 24px">No.</th>
<th class="text-center" style="width: 200px">파일번호</th>
<th class="text-center">파일이름</th>
<th class="text-center" style="width: 200px">파일크기</th>
<th class="text-center" style="width: 120px">다운로드</th>
</thead>
<tbody name="tbodyFileList">
</tbody>
</table>
</div> <!-- 첨부 파일 테이블 <div class="table-responsive"> -->
</div> <!-- <div class="card"> -->
<!-- 첨부 파일 -->
</div> <!-- <div class="container flex-grow-1 px-0"> -->
<!-- Content -->
</div>
<!-- / inner page html <div class="content-pop"> -->
<script>
LoadScript("rent02020Script", wctx.url("/webjars/js/fims/rent/rent02020.js?ver=${ver}"));
/**************************************************************************
* Global Variable
**************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
/**************************************************************************
* script 진입
**************************************************************************/
$(document).ready(function() {
// pageObject
let $P = pageObject["${pageName}"];
// datasetControl
$P.ctrl = newRent02020Control("${pageName}", "[data-doctx=${pageName}]");
// 파일 리스트
$P.fileListArr = new Array();
/**************************************************************************
* 사용자 함수(function)
**************************************************************************/
// URL 설정
$P.setUrl = (prefixUrl) => {
$P.ctrl.urls.load = wctx.url(prefixUrl + "/020/list.do") // 검색
}
// 첨부파일 조회
$P.fnSearchFileList = (hirerId) => {
let tableFileList = $P.findn("fileList"); // table element 찾기
let fileLength = tableFileList.rows.length;
// 기존 table에 자료가 존재하면 tableRow 삭제
for (let iLoop = 1; iLoop < fileLength; iLoop++) {
tableFileList.deleteRow(1); // table 행(Row) 삭제
}
// 임차인 등록일 경우에는 첨부파일을 조회하지 안는다..
if (!hirerId) return;
// 첨부파일 리스트
ajax.get({
url: "file/list.do"
, data: {
infoType: "120"
, infoKeys: hirerId
, fetchSize: 0
}
, success: (resp) => {
let fileNo = 0;
let fileList = resp.fileList;
fileList.forEach(function (item, index, array) {
fileNo = index + 1;
let innerHtml = "";
innerHtml += "<tr>";
innerHtml += "<td class='text-center'>" + fileNo + "</td>";
innerHtml += "<td class='text-center'>" + item.FILE_ID + "</td>";
innerHtml += "<td class='text-center'>" + item.FILE_NM + "</td>";
innerHtml += "<td class='text-center'>" + item.FILE_SIZE + " byte</td>";
innerHtml += "<td class='text-center'>" + "<button type='button' class='btn' onclick=";
innerHtml += "pageObject['${pageName}'].fnFileDownload(" + item.FILE_ID + ");" + "><i class='bx bx-download me-1'></i></button>" + "</td>";
innerHtml += "</tr>";
$P.$findn("tbodyFileList").append(innerHtml);
});
}
});
}
// 첨부파일 다운로드 아이콘 클릭 이벤트
$P.fnFileDownload = (fileID) => {
top.location.href = "/file/download.do?fileID=" + fileID;
}
/**************************************************************************
* 버튼 clickEvent
**************************************************************************/
// 업무 구분 변경 이벤트
$P.fnReset = () => {
// 화면 초기화
$P.findn("frmEdit").reset();
// URL 설정
$P.setUrl("${prefixUrl}");
}
/**************************************************************************
* 초기 설정
**************************************************************************/
// 이벤트
$P.setEvent = () => {
//
}
/**************************************************************************
* 최초 실행 함수
**************************************************************************/
// 1. 이벤트 설정
$P.setEvent();
// 2. 초기 설정
$P.fnReset();
// 3. dataset 설정
$P.ctrl.setData([${Info}]);
});
</script>

@ -1,8 +1,8 @@
function newRent02010Control(pageName, doctx="[data-doctx='rent02010']") { function newRent02010Control(pageName, doctx="[data-doctx='rent02010']") {
let ctrl = new DatasetControl({ let ctrl = new DatasetControl({
doctx: doctx doctx: doctx
, prefix: "lsct" , prefix: "crdnLsct"
, prefixName: "임대차계약" , prefixName: "임대차계약 등록"
, dataGetter: obj => obj["List"] , dataGetter: obj => obj["List"]
, keys: ["CRDN_ID"] , keys: ["CRDN_ID"]
, appendData: true , appendData: true
@ -107,7 +107,7 @@ function newRent02010Control(pageName, doctx="[data-doctx='rent02010']") {
AppSupport.setDialogZindex(); AppSupport.setDialogZindex();
} }
, onClose: () => { ctrl.reload({ all: true }); } , onClose: () => { }
}); });
} }
}); });

@ -1,163 +1,31 @@
function newRent02020Control(pageName, doctx="[data-doctx='rent02020']") { function newRent02020Control(pageName, doctx="[data-doctx='rent02020']") {
let ctrl = new DatasetControl({ let ctrl = new DatasetControl({
doctx: doctx doctx: doctx
, prefix: "rentEnt" , prefix: "crdnLsct"
, prefixName: "임대기업" , prefixName: "임대차계약 등록"
, dataGetter: obj => obj["List"] , dataGetter: obj => obj["Info"]
, keys: ["ENT_ID"] , keys: ["CRDN_ID"]
, appendData: true
, infoSize: "lg"
, urls: { , urls: {
load: "/list.do" load: "/list.do"
, getInfo: "/info.do"
, create: "/create.do"
, update: "/update.do"
, remove: "/remove.do"
}
, formats: {
REG_DT: datetimeFormat
} }
}); });
// 검색 조건
ctrl.query = { pageNum: 1, fetchSize: DEFAULT_FETCH_SIZE }; // 1 페이지당 자료 건수 index.jsp에서 확인
/************************************************************************** /**************************************************************************
* DatasetControl Events * DatasetControl Events
**************************************************************************/ **************************************************************************/
// Dataset 변경 이벤트
ctrl.onDatasetChange = (obj, option) => {
// 데이터 셋
let dataList = ctrl.dataset;
let empty = dataList.empty;
// 업무별 dataTables(그리드) tr, td
let foundContent = ctrl.find("[name='tmpltRows']").content;
let foundTr = $(foundContent).find("tr")[0].cloneNode(false);
let foundTds = $(foundContent).find(".cmn");
foundTds.each(function() {
foundTr.appendChild(this.cloneNode(true));
});
let replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['" + pageName + "'].dataTableClick('{data-index}');")
.replace(/{ondblclick}/gi, "pageObject['" + pageName + "'].dataTableDblClick('{data-index}');");
let trs = empty ?
[ctrl.find("[name='tmpltNotFound']").content.querySelector(".cmn").outerHTML]
: dataList.inStrings(foundTr.outerHTML, replacer);
let noMore = (dataList.length >= obj["Total"]); // 전체 건수
let initScroll = (ctrl.query.pageNum < 2);
if (option != null && option.reloaded) {
initScroll = false;
}
// dataTables(그리드)에 자료 표시 td
ctrl.find("[name='tableRspns']").changeContent(trs.join(), initScroll, noMore);
// checkbox 체크 해제
$(ctrl.find("[name='gridAllCheckbox']")).prop("checked", false);
// dataTables(그리드)에 페이지 표시 pagingInfo
pageObject[pageName].pagingSupport.setPagingInfo(obj);
};
// 현재 선택 자료 변경 이벤트 // 현재 선택 자료 변경 이벤트
ctrl.onCurrentChange = (item) => { ctrl.onCurrentChange = (item) => {
Apply.fromDataset.currentRow(ctrl.dataset, item, ctrl.find("[name='tbodyList']")); if (!item) return;
};
// 선택(체크) 변경 이벤트 // 화면에 Dataset 셋팅
ctrl.onSelectionChange = (selectedArr) => { let formFields = new FimsFormFields(ctrl.selector("[name='frmEdit']"));
// gridCheckbox formFields.set(ctrl, item);
Apply.fromDataset.gridCheckbox(ctrl.dataset, ctrl.find("[name='tbodyList']"), 1, selectedArr);
// gridButton
Apply.fromDataset.gridButton(ctrl.dataset, ctrl.find("[name='btnOK']"), selectedArr); // 선택 확인 버튼
Apply.fromDataset.gridButton(ctrl.dataset, ctrl.find("[name='btnRemove']"), selectedArr); // 삭제 버튼
};
// 상세 정보 dialog let key = item.data.HIRER_ID;
ctrl.getInfo = (params) => { if (key != null) {
if (!params) return; pageObject[pageName].fnSearchFileList(key);
ajax.get({
url: ctrl.urls.getInfo
, data: params || {}
, success: (resp) => {
let dialogName = ctrl.prefixed("Dialog");
let dialogId = dialogName + "-" + uuid();
dialog.open({
id: dialogId
, title: ctrl.prefixName + " 정보"
, size: ctrl.infoSize
, content: resp
, init: () => {
$("#" + dialogId).attr("name", dialogName);
$("#" + dialogId).attr("data-ref-doctx", pageName);
AppSupport.setDialogZindex();
}
, onClose: () => { } // ctrl.reload();
});
}
});
}
// 저장 callback
ctrl.onSave = (params, resp) => {
let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, ctrl.prefixName);
// 메시지 출력
dialog.alert({
content: showMessage
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => { }
, onClose: () => {
if (resp.saved) { dialog.close($(document.querySelector(doctx)).parents(".modal")[0].id); }
}
});
}
// 저장
ctrl.save = (params) => {
if (!params) return;
ajax.post({
url: ctrl.urls.create
, data: params || {}
, success: (resp) => { ctrl.onSave(params, resp); }
});
}
// 삭제 callback
ctrl.onRemove = (params, resp) => {
let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, ctrl.prefixName);
// 메시지 출력
dialog.alert({
content: showMessage
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => { }
, onClose: () => {
if (resp.saved) { ctrl.reload({ all: true }); }
}
});
}
// 삭제
ctrl.remove = (params) => {
if (!params) return;
ajax.post({
url: ctrl.urls.remove
, data: params || {}
, success: (resp) => { ctrl.onRemove(params, resp); }
});
} }
};
return ctrl; return ctrl;
} }

@ -108,7 +108,7 @@ function newRent02050Control(pageName, doctx="[data-doctx='rent02050']") {
AppSupport.setDialogZindex(); AppSupport.setDialogZindex();
} }
, onClose: () => { ctrl.reload({ all: true }); } , onClose: () => { }
}); });
} }
}); });

@ -0,0 +1,31 @@
function newRent02020Control(pageName, doctx="[data-doctx='rent02020']") {
let ctrl = new DatasetControl({
doctx: doctx
, prefix: "lsct"
, prefixName: "임대차계약"
, dataGetter: obj => obj["Info"]
, keys: ["LSCT_ID"]
, urls: {
load: "/list.do"
}
});
/**************************************************************************
* DatasetControl Events
**************************************************************************/
// 현재 선택 자료 변경 이벤트
ctrl.onCurrentChange = (item) => {
if (!item) return;
// 화면에 Dataset 셋팅
let formFields = new FimsFormFields(ctrl.selector("[name='frmEdit']"));
formFields.set(ctrl, item);
let key = item.data.HIRER_ID;
if (key != null) {
pageObject[pageName].fnSearchFileList(key);
}
};
return ctrl;
}
Loading…
Cancel
Save