임대차계약서 수정.

main
xitpc\xituser 2 months ago
parent 9a3682d381
commit e78576b167

@ -53,10 +53,10 @@
</div> </div>
<!-- 업무 버튼 --> <!-- 업무 버튼 -->
<span class="container-window-btn-right"> <span class="container-window-btn-right">
<button type="button" class="btn btn-primary w-px-120" name="btnCreate" title="임대기업 매핑 등록"> <button type="button" class="btn btn-primary w-px-160" name="btnCreate" title="임대기업 매핑 등록">
매핑 등록 매핑 등록
</button> </button>
<button type="button" class="btn btn-primary w-px-120" name="btnRemove" title="임대기업 매핑 삭제"> <button type="button" class="btn btn-primary w-px-160" name="btnRemove" title="임대기업 매핑 삭제">
매핑 삭제 매핑 삭제
</button> </button>
</span> </span>
@ -77,7 +77,7 @@
<th class="cmn" style="width: 72px;">No.</th> <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: 56px;"><input type="checkbox" class="form-check-input" name="gridAllCheckbox" onchange="pageObject['${pageName}'].dataTableCheckbox(this, this.checked);" /></th>
<th class="cmn" style="width: 160px;" onclick="FimsSupport.searchFromGridTitle('USER_ACNT', this.innerText, 'match', 'part');">사용자계정</th> <th class="cmn" style="width: 160px;" onclick="FimsSupport.searchFromGridTitle('USER_ACNT', this.innerText, 'match', 'part');">사용자계정</th>
<th class="cmn" style="width: 120px;" onclick="FimsSupport.searchFromGridTitle('USER_NM', this.innerText, 'match', 'part');">사용자명</th> <th class="cmn" style="width: 160px;" onclick="FimsSupport.searchFromGridTitle('USER_NM', this.innerText, 'match', 'part');">사용자명</th>
<th class="cmn" style="width: 120px;" onclick="FimsSupport.searchFromGridTitle('ENT_SE_CD', this.innerText, 'codeValue', 'FIM088');">기업구분</th> <th class="cmn" style="width: 120px;" onclick="FimsSupport.searchFromGridTitle('ENT_SE_CD', this.innerText, 'codeValue', 'FIM088');">기업구분</th>
<th class="cmn" style="width: 200px;" onclick="FimsSupport.searchFromGridTitle('ENT_NM', this.innerText, 'match', 'part');">기업명</th> <th class="cmn" style="width: 200px;" onclick="FimsSupport.searchFromGridTitle('ENT_NM', this.innerText, 'match', 'part');">기업명</th>
<th class="cmn" style="width: 160px;" onclick="FimsSupport.searchFromGridTitle('ENT_NO', this.innerText, 'match', 'part');">법인(사업자)번호</th> <th class="cmn" style="width: 160px;" onclick="FimsSupport.searchFromGridTitle('ENT_NO', this.innerText, 'match', 'part');">법인(사업자)번호</th>

@ -17,7 +17,7 @@
<button type="button" class="btn btn-search w-px-120" name="btnSearch" title="검색"> <button type="button" class="btn btn-search w-px-120" name="btnSearch" title="검색">
검색 검색
</button> </button>
<button type="button" class="btn btn-primary w-px-120" name="btnOK" title="임대기업 선택 확인"> <button type="button" class="btn btn-success w-px-120" name="btnOK" title="임대기업 선택 확인">
선택 확인 선택 확인
</button> </button>
</span> </span>

@ -77,7 +77,7 @@
<span class="container-page-btn"> <span class="container-page-btn">
<!-- 업무 버튼 --> <!-- 업무 버튼 -->
<span class="container-window-btn-right"> <span class="container-window-btn-right">
<button type="button" class="btn btn-primary w-px-80" name="btnSave" title="저장"> <button type="button" class="btn btn-success w-px-120" name="btnSave" title="저장">
저장 저장
</button> </button>
</span> </span>

@ -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}">
@ -76,10 +76,13 @@
</div> </div>
<!-- 업무 버튼 --> <!-- 업무 버튼 -->
<span class="container-window-btn-right"> <span class="container-window-btn-right">
<button type="button" class="btn btn-primary w-px-120" name="btnCreate" title="임대계약서 등록"> <button type="button" class="btn btn-primary w-px-160" name="btnCreate" title="임대차계약서 등록">
임대계약서 등록 임대계약서 등록
</button> </button>
<button type="button" class="btn btn-primary w-px-120" name="btnRemove" title="임대계약서 삭제"> <button type="button" class="btn btn-primary w-px-160" name="btnUpdate" title="임대차계약서 수정">
임대계약서 수정
</button>
<button type="button" class="btn btn-primary w-px-160" name="btnRemove" title="임대차계약서 삭제">
임대계약서 삭제 임대계약서 삭제
</button> </button>
</span> </span>
@ -98,14 +101,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" <button type="button" class="nav-link w-px-160 h-100" role="tab" data-bs-toggle="tab"
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" <button type="button" class="nav-link w-px-160 h-100" role="tab" data-bs-toggle="tab"
onClick="pageObject['${pageName}'].fnSearchList('세외수입');"> onClick="pageObject['${pageName}'].fnSearchList('등록');">
세외수입 등록
</button> </button>
</li> </li>
</ul> </ul>
@ -126,6 +129,7 @@
<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: 56px;"><input type="checkbox" class="form-check-input" name="gridAllCheckbox" onchange="pageObject['${pageName}'].dataTableCheckbox(this, this.checked);" /></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: 180px;" onclick="FimsSupport.searchFromGridTitle('CRDN_YMD', this.innerText, 'ymd', '');">단속일시</th> <th class="cmn" style="width: 180px;" onclick="FimsSupport.searchFromGridTitle('CRDN_YMD', this.innerText, 'ymd', '');">단속일시</th>
<th class="cmn" style="width: 160px;" onclick="FimsSupport.searchFromGridTitle('VHRNO', this.innerText, 'match', 'part');">차량번호</th> <th class="cmn" style="width: 160px;" onclick="FimsSupport.searchFromGridTitle('VHRNO', this.innerText, 'match', 'part');">차량번호</th>
<th class="cmn" style="width: 120px;" onclick="FimsSupport.searchFromGridTitle('RTPYR_SE_CD', this.innerText, 'codeValue', 'FIM011');">납부자구분</th> <th class="cmn" style="width: 120px;" onclick="FimsSupport.searchFromGridTitle('RTPYR_SE_CD', this.innerText, 'codeValue', 'FIM011');">납부자구분</th>
@ -150,6 +154,7 @@
<td class="cmn text-center" onclick ondblclick>{ROW_NUM}</td> <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-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-center" onclick ondblclick>{TASK_SE_NM}</td> <td class="cmn text-center" onclick ondblclick>{TASK_SE_NM}</td>
<td class="cmn text-center" onclick ondblclick>{TRGT_YN}</td>
<td class="cmn text-center" onclick ondblclick>{CRDN_YMD_TM}</td> <td class="cmn text-center" onclick ondblclick>{CRDN_YMD_TM}</td>
<td class="cmn text-start" onclick ondblclick>{VHRNO}</td> <td class="cmn text-start" onclick ondblclick>{VHRNO}</td>
<td class="cmn text-center" onclick ondblclick>{RTPYR_SE_NM}</td> <td class="cmn text-center" onclick ondblclick>{RTPYR_SE_NM}</td>
@ -207,95 +212,9 @@
// formFields // formFields
$P.formFields = new FimsFormFields($P.selectorn("frmSearch")); $P.formFields = new FimsFormFields($P.selectorn("frmSearch"));
// paging
$P.pagingSupport = new FimsPagingSupport({
doq: $P
, linkContainer: "[name='dataPaging']"
});
// datasetControl
$P.ctrl = newRent02010Control($P, "${pageName}", "[data-doctx=${pageName}]");
/**************************************************************************
* DataTable 이벤트
**************************************************************************/
// DataTable에 click, dbclick 이벤트
$P.renderList = (obj, option) => {
// 데이터 셋
let dataList = $P.ctrl.dataset;
let empty = dataList.empty;
// 업무별 DataTables(그리드) tr, td
let foundContent = $P.findn("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('{CRDN_ID}');");
let trs = empty ?
[$P.findn("tmpltNotFound").content.querySelector(".cmn").outerHTML]
: dataList.inStrings(foundTr.outerHTML, replacer);
let noMore = (dataList.length >= obj["Total"]);
let initScroll = ($P.ctrl.query.pageNum < 2);
if (option != null && option.reloaded) {
initScroll = false;
}
// pagingInfo
$P.pagingSupport.setPagingInfo(obj);
$P.findn("tableRspns").changeContent(trs.join(), initScroll, noMore);
// checkbox 체크 해제
$P.$findn("gridAllCheckbox").prop("checked", false);
// 보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked"));
}
// dataTable 체크박스 클릭 이벤트
$P.dataTableCheckbox = (element, bool) => {
GRID.checkbox.sync(element, bool);
let atLeastOne = GRID.checkbox.countChecked(element) > 0;
// 버튼 // datasetControl
$P.$findn("btnRemove").prop("disabled", !atLeastOne); $P.ctrl = newRent02010Control("${pageName}", "[data-doctx=${pageName}]");
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 = (dataKey) => {
let params = {
callPurpose: "update"
, crdnId: dataKey
, lsctId: $P.ctrl.getValue("LSCT_ID")
};
$P.ctrl.getInfo(params);
}
// DataTables에 스크롤이 맨 밑으로 이동했을 때 이벤트
$P.scrollDataList = () => {
$P.ctrl.load($P.ctrl.query.pageNum + 1);
}
/************************************************************************** /**************************************************************************
* 사용자 함수(function) * 사용자 함수(function)
@ -331,12 +250,17 @@
$P.$findn("schCrdnYmdTo").datepicker("setDate", TODAY()); // 단속 일자 종료 $P.$findn("schCrdnYmdTo").datepicker("setDate", TODAY()); // 단속 일자 종료
$P.$findn("schVhrno").val("167하9750"); // 차량번호 $P.$findn("schVhrno").val("167하9750"); // 차량번호
// URL 설정 //
$P.fnSetUrl("${prefixUrl}"); $P.$findn("btnCreate").prop("disabled", true);
$P.$findn("btnUpdate").prop("disabled", true);
$P.$findn("btnRemove").prop("disabled", true);
// dataset 초기화 // dataset 초기화
$P.ctrl.dataset.clear(); $P.ctrl.dataset.clear();
// URL 설정
$P.fnSetUrl("${prefixUrl}");
// 그리드 th // 그리드 th
let colContent = $P.findn("tmpltCols").content; let colContent = $P.findn("tmpltCols").content;
let cols = $(colContent).find(".cmn"); let cols = $(colContent).find(".cmn");
@ -356,12 +280,17 @@
$P.ctrl.query.delYn = "N"; // 삭제 여부 $P.ctrl.query.delYn = "N"; // 삭제 여부
// tab // tab
if (tabName == "단속") { if (tabName == "대상") {
$P.ctrl.query.nxrpCrdnLinkYn = "N"; $P.ctrl.query.regTrgtYn = "Y";
} else if (tabName == "세외수입") { $P.$findn("btnCreate").prop("disabled", false);
$P.ctrl.query.nxrpCrdnLinkYn = "Y"; } else if (tabName == "등록") {
$P.ctrl.query.regTrgtYn = "N";
$P.$findn("btnUpdate").prop("disabled", false);
$P.$findn("btnRemove").prop("disabled", false);
} else { } else {
$P.ctrl.query.nxrpCrdnLinkYn = "N"; $P.$findn("btnCreate").prop("disabled", true);
$P.$findn("btnUpdate").prop("disabled", true);
$P.$findn("btnRemove").prop("disabled", true);
} }
// 임대기업번호가 전체라면.. // 임대기업번호가 전체라면..

@ -0,0 +1,500 @@
<%@ 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">
<div class="card">
<!-- 상단 버튼 -->
<div class="container-page-btn">
<button type="button" class="btn btn-outline-dark w-px-120" name="btnReset" title="초기화">
초기화
</button>
<span class="container-window-btn-right">
<button type="button" class="btn btn-search w-px-120" name="btnSearch" title="검색">
검색
</button>
<button type="button" class="btn btn-success w-px-120" name="btnOK" title="임대기업 선택 확인">
선택 확인
</button>
</span>
</div>
<!-- 상단 버튼 -->
<!-- 검색 조건 영역 -->
<form name="frmSearch">
<!-- hidden -->
<input type="hidden" name="userId" />
<!-- 메인 조건 -->
<div class="container-search">
<div class="row g-1">
<!-- 차량번호 -->
<div class="col-md-6">
<label is="name-label" class="form-label fw-bold form-search-title w-px-120 text-end required" for="vhrno">차량번호</label>
<input is="id-input" type="text" class="form-control w-px-120" name="vhrno" autocomplete="off" />
</div>
<!-- 계약 일자 -->
<div class="col-md-6">
<label is="name-label" class="form-label fw-bold form-search-title w-px-120 text-end required" for="ctrtYmd">계약일자</label>
<input is="id-input" type="text" class="form-control form-date" name="ctrtYmd"
data-fmt-type="day" autocomplete="off" title="날짜 선택" maxlength="10" required />
<button type="button" class="bx bx-lg bx-calendar bg-white" name="btnCtrtYmd"></button>
</div>
</div>
</div> <!-- 메인 조건 -->
</form>
<!-- 검색 조건 영역 -->
<!-- 업무 버튼 및 건수 표시 -->
<div>
<span class="container-page-btn">
<!-- 건수, 페이지 표시 -->
<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>
<!-- 업무 버튼 -->
<span class="container-window-btn-right">
<button type="button" class="btn btn-primary w-px-120" name="btnCreate" title="임차인 등록">
임차인 등록
</button>
<button type="button" class="btn btn-primary w-px-120" name="btnUpdate" title="임차인 수정">
임차인 수정
</button>
<button type="button" class="btn btn-primary w-px-120" name="btnRemove" title="임차인 삭제">
임차인 삭제
</button>
</span>
</span>
</div>
<!-- 업무 버튼 및 건수 표시 -->
<!-- DataTables(그리드) -->
<div class="card-datatable text-nowrap">
<div class="dataTables_wrapper dt-bootstrap5 no-footer">
<div class="table-responsive ox-scroll oy-scroll h-px-300" name="tableRspns">
<table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer" aria-describedby="DataTables_Table_0_info">
<thead class="sticky-thead">
<tr name="theadTr" data-search-target="[data-doctx='${pageName}']">
<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>
</tr>
</thead>
<tbody name="tbodyList">
</tbody>
<template is="curly-brackets" name="tmpltRows">
<tr data-key="ENT_ID">
<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="ENT_ID" 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="odd">
<td valign="top" colspan="11" class="dataTables_empty text-center">${prefixName} 정보를 찾지 못했습니다.</td>
</tr>
</template>
</table>
</div>
</div>
</div>
<!-- DataTables(그리드) -->
</div> <!-- <div class="card"> -->
</div> <!-- <div class="container flex-grow-1 px-0"> -->
<!-- Content -->
</div>
<!-- / inner page html <div class="content-pop"> -->
<script>
/**************************************************************************
* Global Variable
**************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
/**************************************************************************
* script 진입
**************************************************************************/
$(document).ready(function() {
// pageObject
let $P = pageObject["${pageName}"];
// FormFields
$P.formFields = new FimsFormFields($P.selectorn("frmSearch"));
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.ctrl = new DatasetControl({
prefix: "rentEnt"
, prefixName: "임대 기업"
, keymapper: info => info ? info.ENT_ID : ""
, dataGetter: obj => obj["List"]
, appendData: true
, infoSize: "lg"
, urls: {
create: wctx.url("${prefixUrl}" + "/020/createMpng.do") // 매핑 등록
, load: wctx.url("${prefixUrl}" + "/020/list.do") // 임대기업 검색
, remove: wctx.url("${prefixUrl}" + "/020/remove.do") // 임대기업 삭제
, getInfo: wctx.url("${prefixUrl}" + "/030/info.do") // 임대기업 상세 정보
}
, formats: {
REG_DT: datetimeFormat
}
});
// 검색 조건
$P.ctrl.query = { pageNum: 1, fetchSize: DEFAULT_FETCH_SIZE }; // 1 페이지당 자료 건수 index.jsp에서 확인
/**************************************************************************
* DatasetControl 이벤트
**************************************************************************/
// Dataset 변경 이벤트
$P.ctrl.onDatasetChange = (obj, option) => {
$P.renderList(obj["Total"], option);
// datasetPaging
Apply.fromDataset.paging($P.ctrl.dataset, obj, $P.findn("dataPaging"), $P.findn("dataPagingInfo"));
};
// 현재 선택 자료 변경 이벤트
$P.ctrl.onCurrentChange = (item) => {
if (!item) return;
let key = item.data.ENT_ID;
$P.$findn("tbodyList").setCurrentRow(key);
};
// 선택(체크) 변경 이벤트
$P.ctrl.onSelectionChange = (selected) => {
Apply.fromDataset.gridCheckbox($P.ctrl.dataset, $P.findn("tbodyList"), 1, selected);
Apply.fromDataset.gridButton($P.ctrl.dataset, $P.findn("btnOK"), selected); // 선택 확인 버튼
Apply.fromDataset.gridButton($P.ctrl.dataset, $P.findn("btnRemove"), selected); // 삭제 버튼
};
// 사용자 임대기업 매핑 저장
$P.ctrl.save = (params) => {
if (!params) return;
ajax.post({
url: $P.ctrl.urls.create
, data: params || {}
, success: (resp) => {
let dialogTitle = $("#" + $P.selfDlgId()).find("h5.modal-title").html();
let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, dialogTitle);
// 메시지 출력
dialog.alert({
content: showMessage
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => { }
, onClose: () => {
if (resp.saved) { dialog.close($P.selfDlgId()); }
}
});
}
});
}
// 임대기업 상세정보 dialog
$P.ctrl.getInfo = (params) => {
if (!params) return;
ajax.get({
url: $P.ctrl.urls.getInfo
, data: params || {}
, success: (resp) => {
let dialogName = $P.ctrl.prefixed("Dialog");
let dialogId = dialogName + "-" + uuid();
dialog.open({
id: dialogId
, title: $P.ctrl.prefixName + " 정보"
, size: $P.ctrl.infoSize
, content: resp
, init: () => {
AppSupport.setDialogZindex();
$("#" + dialogId).attr("name", dialogName);
$("#" + dialogId).attr("data-ref-doctx", "${pageName}");
}
, onClose: () => { $P.ctrl.reload({ all: true }); } // 자료 재조회
});
}
});
}
// 삭제 callback
$P.ctrl.onRemove = (params, resp) => {
let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, $P.ctrl.prefixName);
// 메시지 출력
dialog.alert({
content: showMessage
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => { }
, onClose: () => {
if (resp.saved) { $P.ctrl.reload({ all: true }); } // 자료 재조회
}
});
}
// 삭제
$P.ctrl.remove = (params) => {
if (!params) return;
ajax.post({
url: $P.ctrl.urls.remove
, data: params || {}
, success: (resp) => { $P.ctrl.onRemove(params, resp); }
});
}
/**************************************************************************
* DataTable 이벤트
**************************************************************************/
// DataTable에 click, dbclick 이벤트
$P.renderList = (totalSize, option) => {
let dataList = $P.ctrl.dataset;
let empty = dataList.empty;
let trs = empty ? [$P.findn("tmpltNotFound").innerHTML] :
dataList.inStrings($P.findn("tmpltRows").innerHTML
, (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].dataTableClick('" + dataItem.getValue("ENT_ID") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dataTableDblClick('" + dataItem.getValue("ENT_ID") + "');")
);
let noMore = (dataList.length >= totalSize);
let initScroll = ($P.ctrl.query.pageNum < 2);
if (option != null && option.reloaded) {
initScroll = false;
}
$P.findn("tableRspns").changeContent(trs.join(), initScroll, noMore);
// checkbox 체크 해제
$P.$findn("gridAllCheckbox").prop("checked", false);
// 보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked"));
}
// 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 = (dataKey) => {
if (dataKey == "") return;
$P.$findn("tbodyList").setCurrentRow(dataKey);
Apply.toDataset.current($P.ctrl.dataset, dataKey);
}
// dataTable 더블 클릭 이벤트
$P.dataTableDblClick = (dataKey) => {
let params = {
callPurpose: "update"
, entId: dataKey
};
$P.ctrl.getInfo(params);
}
// DataTable에 스크롤이 맨 밑으로 이동했을 때 이벤트
$P.scrollDataList = () => {
$P.ctrl.load($P.ctrl.query.pageNum + 1);
}
/**************************************************************************
* 사용자 함수(function)
**************************************************************************/
/**************************************************************************
* 버튼 clickEvent
**************************************************************************/
// 업무 구분 변경 이벤트
$P.fnReset = (initSearchYN) => {
// 화면 초기화
$P.findn("frmSearch").reset();
// dataset 초기화
$P.ctrl.dataset.clear();
// 기본 데이터 설정
$P.$findn("userId").val("${userId}"); // 사용자 ID
$P.$findn("schEntNo").val("${schEntNo}"); // 기업 번호
if (initSearchYN && $("#schEntNo--${pageName}").val() != "") {
$P.fnSearchList();
}
}
// 검색 버튼 클릭 이벤트
$P.fnSearchList = () => {
// 검색조건
$P.ctrl.query = $P.formFields.get(); // 검색 조건
$P.ctrl.query.fetchSize = DEFAULT_FETCH_SIZE; // 한번에 조회되는 자료 건수
$P.ctrl.query.delYn = "N"; // 삭제 여부
$P.ctrl.load(1);
}
// 엑셀 버튼 이벤트
$P.fnExcel = () => {
if ($P.ctrl.dataset.empty) {
dialog.alert({
content: "검색된 자료가 없습니다."
, onOK: () => { }
});
return;
}
// DataTable(그리드)
$P.ctrl.query.cellDefs =
AppSupport.getCellDefs($P.$findn("theadTr").find("th").not(".dummy-th").not(":eq(0)")
, $($P.findn("tmpltRows").content).find("td").not(".dummy-td").not(":eq(0)"));
$P.ctrl.download();
}
// 확인
$P.fnOK = () => {
let selected = $P.ctrl.dataset.getKeys("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.join(",")
}
$P.ctrl.save(params);
}
});
}
// 임대기업 등록 버튼 클릭 이벤트
$P.fnCreate = () => {
let params = {
callPurpose: "create"
};
$P.ctrl.getInfo(params);
}
// 임대기업 수정 버튼 클릭 이벤트
$P.fnUpdate = () => {
// 임대기업 ID
let entId = $P.ctrl.getValue("ENT_ID");
// 임대기업 ID 가 없다면.. return
if (typeof entId == "undefined" || entId == null || entId == "") return;
let params = {
callPurpose: "update"
, entId: entId
};
$P.ctrl.getInfo(params);
}
// 임대기업 삭제 버튼 클릭 이벤트
$P.fnRemove = () => {
let selected = $P.ctrl.dataset.getKeys("selected");
if (selected.length < 1) return;
dialog.alert({
content: "선택한 " + $P.ctrl.prefixName + " 정보를 삭제하시겠습니까?"
, onOK: () => {
let params = {
entIds: selected.join(",")
}
$P.ctrl.remove(params);
}
});
}
/**************************************************************************
* 초기 설정
**************************************************************************/
// 이벤트
$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);
}
/**************************************************************************
* 최초 실행 함수
**************************************************************************/
// 1. 이벤트 설정
$P.setEvent();
// 2. 초기 설정
$P.fnReset(true);
// 3. 보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked"));
});
</script>

@ -0,0 +1,237 @@
<%@ 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">
<div class="card">
<!-- 입력 영역 -->
<form name="frmEdit">
<!-- hidden -->
<input type="hidden" name="entId" data-map="ENT_ID" />
<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 required" for="entSeCd">기업구분</label>
<select is="id-select" class="form-select" name="entSeCd" data-map="ENT_SE_CD" required>
<option value="">선택하세요</option>
<c:forEach items="${FIM088List}" var="item">
<option value="${item.code}">${item.value}</option>
</c:forEach>
</select>
</div>
<!-- 기업 번호 -->
<div class="col-md-6">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end required" for="entNo">법인(사업자)번호</label>
<input is="id-input" type="text" class="form-control w-30" name="entNo" data-map="ENT_NO" required autocomplete="off" />
</div>
<!-- 기업 명 -->
<div class="col-md-6">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end required" for="entNm">기업명</label>
<input is="id-input" type="text" class="form-control w-40" name="entNm" data-map="ENT_NM" required autocomplete="off" />
</div>
<!-- 대표자 명 -->
<div class="col-md-6">
<label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end required" for="rprsvNm">대표자명</label>
<input is="id-input" type="text" class="form-control w-30" name="rprsvNm" data-map="RPRSV_NM" required autocomplete="off" />
</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="entTelno">전화번호</label>
<input is="id-input" type="text" class="form-control w-30" name="entTelno" data-map="ENT_TELNO" autocomplete="off" />
</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="entFxno--${pageName}">팩스번호</label>
<input is="id-input" type="text" class="form-control w-30" name="entFxno" data-map="ENT_FXNO" autocomplete="off" />
</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="entEmlAddr--${pageName}">이메일</label>
<input is="id-input" type="text" class="form-control w-30" name="entEmlAddr" data-map="ENT_EML_ADDR" />
</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="entAddr">주소</label>
<input is="id-input" type="text" class="form-control w-70" name="entAddr" data-map="ENT_ADDR" autocomplete="off" />
<input is="id-input" type="text" class="form-control w-px-80" name="entZip" data-map="ENT_ZIP" autocomplete="off" />
<button type="button" class="btn btn-sm btn-outline-dark" name="btnZipCode" title="우편번호검색">
검색
</button>
</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="entDtlAddr">상세주소</label>
<input is="id-input" type="text" class="form-control w-85" name="entDtlAddr" data-map="ENT_DTL_ADDR" autocomplete="off" />
</div>
</div>
</form>
<!-- 입력 영역 -->
<!-- 업무 버튼 및 건수 표시 -->
<div>
<span class="container-page-btn">
<!-- 업무 버튼 -->
<span class="container-window-btn-right">
<button type="button" class="btn btn-success w-px-120" name="btnSave" title="저장">
저장
</button>
</span>
</span>
</div>
<!-- 업무 버튼 및 건수 표시 -->
</div> <!-- <div class="card"> -->
</div> <!-- <div class="container flex-grow-1 px-0"> -->
<!-- Content -->
</div>
<!-- / inner page html <div class="content-pop"> -->
<script>
/**************************************************************************
* Global Variable
**************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
/**************************************************************************
* script 진입
**************************************************************************/
$(document).ready(function() {
// pageObject
let $P = pageObject["${pageName}"];
// infoDialog 호출 용도(view 조회(편집불가), create 등록, update 수정)
$P.callPurpose = "${callPurpose}";
// FormFields
$P.formFields = new FimsFormFields($P.selectorn("frmEdit"));
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.ctrl = new DatasetControl({
prefix: "rentEnt"
, prefixName: "임대 기업"
, keymapper: info => info ? info.ENT_ID : ""
, dataGetter: obj => obj["Info"]
, urls: {
create: wctx.url("${prefixUrl}" + "/030/create.do") // 등록
, update: wctx.url("${prefixUrl}" + "/030/update.do") // 수정
}
});
/**************************************************************************
* DatasetControl 이벤트
**************************************************************************/
// 현재 선택 자료 변경 이벤트
$P.ctrl.onCurrentChange = (item) => {
if (!item) return;
// 화면에 Dataset 셋팅
$P.formFields.set($P.ctrl, item);
let key = item.data.ENT_ID;
};
// 저장
$P.ctrl.save = (params) => {
if (!params) return;
let create = ($P.callPurpose == "create");
ajax.post({
url: !create ? $P.ctrl.urls.update : $P.ctrl.urls.create
, data: params || {}
, success: (resp) => {
let dialogTitle = $("#" + $P.selfDlgId()).find("h5.modal-title").html();
let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, dialogTitle);
// 메시지 출력
dialog.alert({
content: showMessage
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => { }
, onClose: () => {
if (resp.saved) { dialog.close($P.selfDlgId()); }
}
});
}
});
}
/**************************************************************************
* 사용자 함수(function)
**************************************************************************/
// 우편번호 검색 결과
$P.callbackSearchAddr = (obj) => {
$P.$findn("entAddr").val(obj.ADDR); // 주소
$P.$findn("entZip").val(obj.ZIP); // 우편번호
$P.$findn("entDtlAddr").val(obj.DTL_ADDR); // 상세 주소
}
/**************************************************************************
* 버튼 clickEvent
**************************************************************************/
// 우편번호 검색
$P.fnZipCode = async() => {
let resp = await fetch(wctx.url("/webjars/html/searchAddr.html"));
let template = await resp.text();
dialog.open({
id: "searchAddrDialog"
, title: "주소 검색"
, size: "lg"
, content: template
, init: () => {
AppSupport.setDialogZindex();
$("#searchAddrCallback").val("pageObject['${pageName}'].callbackSearchAddr");
}
});
}
// 임대기업 등록 버튼 클릭 이벤트
$P.fnSave = () => {
// validate 확인
if (!AppSupport.customValidate($P.$findn("frmEdit").find("input,select,textarea"))) return;
dialog.alert({
content: "현재 " + $P.ctrl.prefixName + " 정보를 저장하시겠습니까?"
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => { $P.ctrl.save($P.formFields.get()); } // formFields
});
}
/**************************************************************************
* 초기 설정
**************************************************************************/
// 이벤트
$P.setEvent = () => {
// 기본 버튼 이벤트
$P.$findn("btnZipCode").on("click", () => { $P.fnZipCode() }); // 우편번호 검색
// 버튼 이벤트
$P.$findn("btnSave").on("click", () => { $P.fnSave() }); // 저장
}
// 화면 초기 설정
$P.initForm = () => {
// 화면 초기화
$P.findn("frmEdit").reset();
}
/**************************************************************************
* 최초 실행 함수
**************************************************************************/
// 1. 이벤트 설정
$P.setEvent();
// 2. 초기 화면 설정
$P.initForm();
// 3. dataset 설정
$P.ctrl.setData([${Info}]);
});
</script>

@ -0,0 +1,475 @@
<%@ 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-wrapper" data-doctx="${pageName}">
<!-- Content -->
<div class="container-xxl flex-grow-1 px-0">
<div class="card wrapper-list">
<!-- 상단 버튼 -->
<div class="container-page-btn">
<button type="button" class="btn btn-outline-dark w-px-120" name="btnReset" title="초기화">
초기화
</button>
<span class="container-window-btn-right">
<button type="button" class="btn btn-search w-px-120" name="btnSearch" title="검색">
검색
</button>
<button type="button" class="btn btn-excel w-px-120" name="btnExcel" title="엑셀">
엑셀
</button>
</span>
</div>
<!-- 상단 버튼 -->
<!-- 검색 조건 영역 -->
<form name="frmSearch">
<!-- hidden -->
<input type="hidden" name="userId" />
<!-- 메인 조건 -->
<div class="container-search">
<div class="row g-1">
<!-- 단속 일자 -->
<div class="col-6">
<label class="form-label form-search-title w-px-120 text-end fw-bold">단속일자</label>
<span class="form-search-linebox">
<input type="text" class="form-control form-date" name="schCrdnYmdFrom"
data-fmt-type="day" autocomplete="off" title="시작 날짜 선택" />
<button type="button" class="bx bx-lg bx-calendar bg-white"></button>
~
<input type="text" class="form-control form-date" name="schCrdnYmdTo"
data-fmt-type="day" autocomplete="off" title="종료 날짜 선택" />
<button type="button" class="bx bx-lg bx-calendar bg-white"></button>
</span>
</div>
<!-- 기업 번호 -->
<div class="col-6">
<label is="name-label" class="form-label form-search-title w-px-120 text-end fw-bold" for="schEntNo">임대기업번호</label>
<select is="id-select" class="form-select w-px-160" name="schEntNo">
<option value="">전체</option>
<c:forEach items="${entNoList}" var="item">
<option value="${item.ENT_NO}">${item.ENT_NO}</option>
</c:forEach>
</select>
</div>
<!-- 차량번호 -->
<div class="col-6">
<label is="name-label" class="form-label form-search-title w-px-120 text-end fw-bold" for="schVhrno">차량번호</label>
<input is="id-input" type="text" class="form-control w-px-160" name="schVhrno" autocomplete="off" />
</div>
</div>
</div> <!-- 메인 조건 -->
</form>
<!-- 검색 조건 영역 -->
<!-- 업무 버튼 및 건수 표시 -->
<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>
<!-- 업무 버튼 -->
<span class="container-window-btn-right">
<button type="button" class="btn btn-primary w-px-120" name="btnCreate" title="임대계약서 등록">
임대계약서 등록
</button>
<button type="button" class="btn btn-primary w-px-120" name="btnRemove" title="임대계약서 삭제">
임대계약서 삭제
</button>
</span>
</div>
</div>
<!-- 업무 버튼 및 건수 표시 -->
<!-- tab -->
<div class="nav-align-top" name="tabMain" >
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<button type="button" class="nav-link w-px-160 h-100 active" role="tab" data-bs-toggle="tab"
onClick="pageObject['${pageName}'].fnSearchList('전체');">
전체
</button>
</li>
<li class="nav-item">
<button type="button" class="nav-link w-px-160 h-100" role="tab" data-bs-toggle="tab"
onClick="pageObject['${pageName}'].fnSearchList('단속');">
단속
</button>
</li>
<li class="nav-item">
<button type="button" class="nav-link w-px-160 h-100" role="tab" data-bs-toggle="tab"
onClick="pageObject['${pageName}'].fnSearchList('세외수입');">
세외수입
</button>
</li>
</ul>
</div>
<!-- tab -->
<!-- DataTables(그리드) -->
<div class="card-datatable text-nowrap">
<div class="dataTables_wrapper dt-bootstrap5 no-footer">
<div class="table-responsive ox-scroll oy-scroll h-px-500" name="tableRspns">
<table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer" aria-describedby="DataTables_Table_0_info">
<thead class="sticky-thead">
<tr name="theadTr" data-search-target="[data-doctx='${pageName}']">
</tr>
</thead>
<template name="tmpltCols">
<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: 160px;">업무구분</th>
<th class="cmn" style="width: 180px;" onclick="FimsSupport.searchFromGridTitle('CRDN_YMD', this.innerText, 'ymd', '');">단속일시</th>
<th class="cmn" style="width: 160px;" onclick="FimsSupport.searchFromGridTitle('VHRNO', this.innerText, 'match', 'part');">차량번호</th>
<th class="cmn" style="width: 120px;" onclick="FimsSupport.searchFromGridTitle('RTPYR_SE_CD', this.innerText, 'codeValue', 'FIM011');">납부자구분</th>
<th class="cmn" style="width: 160px;" onclick="FimsSupport.searchFromGridTitle('RTPYR_NO', this.innerText, 'ymd', '');">납부자번호</th>
<th class="cmn" style="width: 200px;" onclick="FimsSupport.searchFromGridTitle('RTPYR_NM', this.innerText, 'match', 'part');">납부자명</th>
<th class="cmn" style="width: 160px;" onclick="FimsSupport.searchFromGridTitle('VLTN_ARTCL', this.innerText, 'match', 'part');">위반항목</th>
<th class="cmn" style="width: 120px;" onclick="FimsSupport.searchFromGridTitle('CRDN_STDG_NM', this.innerText, 'match', 'part');">단속법정동</th>
<th class="cmn" style="width: 280px;" onclick="FimsSupport.searchFromGridTitle('CRDN_PLC', this.innerText, 'match', 'part');">단속장소</th>
<th class="cmn" style="width: 120px;" onclick="FimsSupport.searchFromGridTitle('FFNLG_CRDN_AMT', this.innerText, 'match', 'part');">단속원금</th>
<th class="cmn" style="width: 160px;" onclick="FimsSupport.searchFromGridTitle('CRDN_STTS_CD', this.innerText, 'codeValue', 'FIM010');">처리상태</th>
<th class="cmn" style="width: 180px;">등록일시</th>
<th class="cmn" style="width: 140px;">등록사용자</th>
<th class="cmn" style="width: 180px;">수정일시</th>
<th class="cmn" style="width: 140px;">수정사용자</th>
<th class="cmn dummy-th"></th>
</template>
<tbody name="tbodyList">
</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-center" onclick ondblclick>{TASK_SE_NM}</td>
<td class="cmn text-center" onclick ondblclick>{CRDN_YMD_TM}</td>
<td class="cmn text-start" onclick ondblclick>{VHRNO}</td>
<td class="cmn text-center" onclick ondblclick>{RTPYR_SE_NM}</td>
<td class="cmn text-center privacy-cell" onclick ondblclick>
<span>{RTPYR_NO}</span>
<span>*************</span>
</td>
<td class="cmn text-start" onclick ondblclick>{RTPYR_NM}</td>
<td class="cmn text-start" onclick ondblclick>{VLTN_ARTCL}</td>
<td class="cmn text-center" onclick ondblclick>{CRDN_STDG_NM}</td>
<td class="cmn text-start" onclick ondblclick>{CRDN_PLC}</td>
<td class="cmn text-end" onclick ondblclick>{FFNLG_CRDN_AMT}</td>
<td class="cmn text-start" onclick ondblclick>{CRDN_STTS_NM}</td>
<td class="cmn text-center" onclick ondblclick>{REG_DT}</td>
<td class="cmn text-center" onclick ondblclick>{RGTR_NM}</td>
<td class="cmn text-center" onclick ondblclick>{MDFCN_DT}</td>
<td class="cmn text-center" onclick ondblclick>{MDFR_NM}</td>
<td class="cmn dummy-td"></td>
</tr>
</template>
<template name="tmpltNotFound">
<tr class="cmn">
<td valign="top" colspan="17" class="dataTables_empty text-center">${prefixName} 정보를 찾지 못했습니다.</td>
</tr>
</template>
</table>
</div>
</div>
</div>
<!-- DataTables(그리드) -->
</div> <!-- <div class="card wrapper-list"> -->
</div> <!-- <div class="container-xxl flex-grow-1 px-0"> -->
<!-- Content -->
<div class="content-backdrop fade"></div>
</div>
<!-- / inner page html <div class="content-wrapper"> -->
<script>
LoadScript("rent02010Script",wctx.url("/webjars/js/fims/rent/rent02010.js?ver=${ver}"));
/**************************************************************************
* Global Variable
**************************************************************************/
pageObject["${pageName}"] = newDoctxFinder("${pageName}");
/**************************************************************************
* script 진입
**************************************************************************/
$(document).ready(function() {
/**************************************************************************
* pageObject
**************************************************************************/
let $P = pageObject["${pageName}"];
// formFields
$P.formFields = new FimsFormFields($P.selectorn("frmSearch"));
// datasetControl
$P.ctrl = newRent02010Control("${pageName}", "[data-doctx=${pageName}]");
/**************************************************************************
* DataTable 이벤트
**************************************************************************/
// DataTable에 click, dbclick 이벤트
$P.renderList = (obj, option) => {
// 데이터 셋
let dataList = $P.ctrl.dataset;
let empty = dataList.empty;
// 업무별 DataTables(그리드) tr, td
let foundContent = $P.findn("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('{CRDN_ID}');");
let trs = empty ?
[$P.findn("tmpltNotFound").content.querySelector(".cmn").outerHTML]
: dataList.inStrings(foundTr.outerHTML, replacer);
let noMore = (dataList.length >= obj["Total"]);
let initScroll = ($P.ctrl.query.pageNum < 2);
if (option != null && option.reloaded) {
initScroll = false;
}
// pagingInfo
$P.pagingSupport.setPagingInfo(obj);
$P.findn("tableRspns").changeContent(trs.join(), initScroll, noMore);
// checkbox 체크 해제
$P.$findn("gridAllCheckbox").prop("checked", false);
// 보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked"));
}
// dataTable 체크박스 클릭 이벤트
$P.dataTableCheckbox = (element, bool) => {
GRID.checkbox.sync(element, bool);
let atLeastOne = GRID.checkbox.countChecked(element) > 0;
// 버튼
$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 = (dataKey) => {
let params = {
callPurpose: "update"
, crdnId: dataKey
, lsctId: $P.ctrl.getValue("LSCT_ID")
};
$P.ctrl.getInfo(params);
}
// DataTables에 스크롤이 맨 밑으로 이동했을 때 이벤트
$P.scrollDataList = () => {
$P.ctrl.load($P.ctrl.query.pageNum + 1);
}
/**************************************************************************
* 사용자 함수(function)
**************************************************************************/
// URL 설정
$P.fnSetUrl = (prefixUrl) => {
$P.ctrl.urls.load = wctx.url(prefixUrl + "/010/list.do"); // 검색 url
$P.ctrl.urls.getInfo = wctx.url(prefixUrl + "/020/info.do"); // 상세 정보 url
}
/**************************************************************************
* 버튼 clickEvent
**************************************************************************/
// 초기화 버튼 이벤트
$P.fnReset = () => {
// 화면 초기화
$P.findn("frmSearch").reset();
// input, select 초기화
let searchForm = $P.$findn("frmSearch");
searchForm.find("input[type='radio']").not("[name='taskSeCd']").prop("checked", false);
searchForm.find("input[type='checkbox']").prop("checked", false);
searchForm.find("input[type='text']").val("");
searchForm.find("input[type='hidden']").val("");
searchForm.find("select").each(function(){ $(this).find("option:eq(0)").prop("selected", true); });
AppSupport.initDatepicker($P.findn("frmSearch")); // 달력 초기화
AppSupport.initDetailSearchButton($P.findn("frmSearch")); // 상세검색 버튼 화살표
// 기본 데이터 설정
$P.$findn("userId").val("${userId}"); // 사용자 ID
$P.$findn("schCrdnYmdFrom").datepicker("setDate", DateSupport.getAddDay(-365)); // 단속 일자 시작
$P.$findn("schCrdnYmdTo").datepicker("setDate", TODAY()); // 단속 일자 종료
$P.$findn("schVhrno").val("167하9750"); // 차량번호
// URL 설정
$P.fnSetUrl("${prefixUrl}");
// dataset 초기화
$P.ctrl.dataset.clear();
// 그리드 th
let colContent = $P.findn("tmpltCols").content;
let cols = $(colContent).find(".cmn");
let colsOuterHTML = "";
cols.each(function() {
colsOuterHTML += this.outerHTML;
});
$P.findn("tableRspns").changeColumn(colsOuterHTML);
}
// 검색 버튼 이벤트
$P.fnSearchList = (tabName) => {
// 검색 조건
$P.ctrl.query = $P.formFields.get(); // 검색 조건
$P.ctrl.query.fetchSize = DEFAULT_FETCH_SIZE; // 한번에 조회되는 자료 건수
$P.ctrl.query.delYn = "N"; // 삭제 여부
// tab
if (tabName == "단속") {
$P.ctrl.query.nxrpCrdnLinkYn = "N";
} else if (tabName == "세외수입") {
$P.ctrl.query.nxrpCrdnLinkYn = "Y";
} else {
$P.ctrl.query.nxrpCrdnLinkYn = "N";
}
// 임대기업번호가 전체라면..
if ($P.ctrl.query.schEntNo == "" ) {
// schEntNo 의 option을 전체를 배열로 담는다.
let arrEntNo = $.map($P.$findn("schEntNo").find("option"), function(e) { return e.value; });
if (arrEntNo.length == 1) {
dialog.alert({
content: "등록되어 있는 임대기업 정보가 없습니다."
+ "<br>" + "'임대기업관리' 메뉴에서 임대기업 정보를 먼저 등록하시기 바랍니다."
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => { }
});
return;
}
// 빈 값(전체)을 제외하고 "," 로 구분하여 schEntNos 에 담는다.
$P.ctrl.query.schEntNos = arrEntNo.filter((element) => element !== "").join(',');
}
$P.ctrl.load(1);
}
// 엑셀 버튼 이벤트
$P.fnExcel = () => {
if ($P.ctrl.dataset.empty) {
dialog.alert({
content: "검색된 자료가 없습니다."
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => { }
});
return;
}
// DataTables(그리드)
$P.ctrl.query.cellDefs =
AppSupport.getCellDefs($P.$findn("theadTr").find("th").not(".dummy-th").not(":eq(0)")
, $($P.findn("tmpltRows").content).find("td").not(".dummy-td").not(":eq(0)"));
$P.ctrl.download();
}
// 임대기업 매핑 등록 버튼 이벤트
$P.fnCreate = () => {
let params = {
callPurpose: "create"
, userId: $P.$findn("userId").val()
, schEntNo: ""
};
$P.ctrl.getInfo(params);
}
// 임대기업 매핑 삭제 버튼 이벤트
$P.fnRemove = () => {
let selected = $P.ctrl.dataset.getKeys("selected"); // 선택 자료
if (selected.length < 1) {
dialog.alert({
content: "선택하신 " + $P.ctrl.prefixName + " 정보가 없습니다."
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => { }
});
return;
}
dialog.alert({
content: "선택한 " + selected.length + "건의 " + $P.ctrl.prefixName + " 정보를 삭제하시겠습니까?"
, onOK: () => {
let params = {
callPurpose: "create"
, mpngIds: selected.join(",")
}
$P.ctrl.remove(params);
}
});
}
/**************************************************************************
* 초기 설정
**************************************************************************/
// 이벤트 설정
$P.setEvent = () => {
// 기본 버튼 이벤트
$P.$findn("btnReset").on("click", () => { $P.fnReset() }); // 초기화
$P.$findn("btnSearch").on("click", () => { $P.fnSearchList() }); // 검색
$P.$findn("btnExcel").on("click", () => { $P.fnExcel() }); // 엑셀
// 업무 버튼 이벤트
$P.$findn("btnCreate").on("click", () => { $P.fnCreate(); }); // 등록
$P.$findn("btnRemove").on("click", () => { $P.fnRemove(); }); // 삭제
// DataTables width 변경 조정
Componentization.fnMakeResizableTable($P.findn("tableRspns"));
// DataTables 스크롤 이벤트 생성
Componentization.fnMakeScrollableTable($P.findn("tableRspns"), $P.scrollDataList);
}
/**************************************************************************
* 최초 실행 함수
**************************************************************************/
// 1. 이벤트 설정
$P.setEvent();
// 2. 초기 설정
$P.fnReset();
// 3. 보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked"));
});
</script>

@ -1,4 +1,4 @@
function newRent02010Control(pageObj, 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: "lsct"
@ -27,7 +27,7 @@ function newRent02010Control(pageObj, pageName, doctx="[data-doctx='rent02010']"
// paging // paging
pagingSupport = new FimsPagingSupport({ pagingSupport = new FimsPagingSupport({
doq: pageObj doq: ctrl
, linkContainer: "[name='dataPaging']" , linkContainer: "[name='dataPaging']"
}); });
@ -36,9 +36,6 @@ function newRent02010Control(pageObj, pageName, doctx="[data-doctx='rent02010']"
**************************************************************************/ **************************************************************************/
// Dataset 변경 이벤트 // Dataset 변경 이벤트
ctrl.onDatasetChange = (obj, option) => { ctrl.onDatasetChange = (obj, option) => {
// pageObj.renderList(obj, option);
// 데이터 셋 // 데이터 셋
let dataList = ctrl.dataset; let dataList = ctrl.dataset;
let empty = dataList.empty; let empty = dataList.empty;
@ -53,14 +50,14 @@ function newRent02010Control(pageObj, pageName, doctx="[data-doctx='rent02010']"
}); });
let replacer = (str, dataItem) => str let replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['" + pageName + "'].dataTableClick('{DATA-INDEX}');") .replace(/{onclick}/gi, "dataTableClick('{DATA-INDEX}');")
.replace(/{ondblclick}/gi, "pageObject['" + pageName + "'].dataTableDblClick('{CRDN_ID}');"); .replace(/{ondblclick}/gi, "dataTableDblClick('{CRDN_ID}');");
let trs = empty ? let trs = empty ?
[ctrl.find("[name='tmpltNotFound']").content.querySelector(".cmn").outerHTML] [ctrl.find("[name='tmpltNotFound']").content.querySelector(".cmn").outerHTML]
: dataList.inStrings(foundTr.outerHTML, replacer); : dataList.inStrings(foundTr.outerHTML, replacer);
let noMore = (dataList.length >= obj["Total"]); let noMore = (dataList.length >= obj["Total"]); // 전체 건수
let initScroll = (ctrl.query.pageNum < 2); let initScroll = (ctrl.query.pageNum < 2);
if (option != null && option.reloaded) { if (option != null && option.reloaded) {
@ -75,9 +72,6 @@ function newRent02010Control(pageObj, pageName, doctx="[data-doctx='rent02010']"
// pagingInfo // pagingInfo
pagingSupport.setPagingInfo(obj); pagingSupport.setPagingInfo(obj);
// 보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked"));
}; };
// 현재 선택 자료 변경 이벤트 // 현재 선택 자료 변경 이벤트
@ -147,5 +141,33 @@ function newRent02010Control(pageObj, pageName, doctx="[data-doctx='rent02010']"
}); });
} }
/**************************************************************************
* DataTable 이벤트
**************************************************************************/
// dataTable 클릭 이벤트
dataTableClick = (dataIndex) => {
if (dataIndex == "") return;
$(ctrl.find("[name='tbodyList']")).setCurrentRow(dataIndex);
Apply.toDataset.current(ctrl.dataset, dataIndex);
}
// dataTable 더블 클릭 이벤트
dataTableDblClick = (dataKey) => {
let params = {
callPurpose: "update"
, crdnId: dataKey
, lsctId: ctrl.getValue("LSCT_ID")
};
ctrl.getInfo(params);
}
// DataTables에 스크롤이 맨 밑으로 이동했을 때 이벤트
scrollDataList = () => {
ctrl.load(ctrl.query.pageNum + 1);
}
return ctrl; return ctrl;
} }

@ -0,0 +1,173 @@
function newRent02010Control(pageName, doctx="[data-doctx='rent02020']") {
let ctrl = new DatasetControl({
doctx: doctx
, prefix: "lsct"
, prefixName: "임대차계약"
, dataGetter: obj => obj["List"]
, keys: ["CRDN_ID"]
, appendData: true
, infoSize: "xl"
, urls: {
load: "/list.do"
, getInfo: "/info.do"
, create: "/create.do"
, update: "/update.do"
, remove: "/remove.do"
}
, formats: {
CRDN_YMD_TM: datetimeFormat
, FFNLG_CRDN_AMT: numberFormat
, REG_DT: datetimeFormat
, MDFCN_DT: datetimeFormat
}
});
// 검색 조건
ctrl.query = { pageNum: 1, fetchSize: DEFAULT_FETCH_SIZE }; // 1 페이지당 자료 건수 index.jsp에서 확인
// paging
pagingSupport = new FimsPagingSupport({
doq: ctrl
, linkContainer: "[name='dataPaging']"
});
/**************************************************************************
* 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, "dataTableClick('{DATA-INDEX}');")
.replace(/{ondblclick}/gi, "dataTableDblClick('{CRDN_ID}');");
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;
}
//
ctrl.find("[name='tableRspns']").changeContent(trs.join(), initScroll, noMore);
// checkbox 체크 해제
$(ctrl.find("[name='gridAllCheckbox']")).prop("checked", false);
// pagingInfo
pagingSupport.setPagingInfo(obj);
};
// 현재 선택 자료 변경 이벤트
ctrl.onCurrentChange = (item) => {
Apply.fromDataset.currentRow(ctrl.dataset, item, ctrl.find("[name='tbodyList']"));
};
// 선택(체크) 변경 이벤트
ctrl.onSelectionChange = (selectedArr) => {
// gridCheckbox
Apply.fromDataset.gridCheckbox(ctrl.dataset, ctrl.find("[name='tbodyList']"), 1, selectedArr);
// 삭제 버튼
Apply.fromDataset.gridButton(ctrl.dataset, ctrl.find("[name='btnRemove']"), selectedArr);
};
// 상세 정보 dialog
ctrl.getInfo = (params) => {
if (!params) return;
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({ all: true }); }
});
}
});
}
// 삭제 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); }
});
}
/**************************************************************************
* DataTable 이벤트
**************************************************************************/
// dataTable 클릭 이벤트
dataTableClick = (dataIndex) => {
if (dataIndex == "") return;
$(ctrl.find("[name='tbodyList']")).setCurrentRow(dataIndex);
Apply.toDataset.current(ctrl.dataset, dataIndex);
}
// dataTable 더블 클릭 이벤트
dataTableDblClick = (dataKey) => {
let params = {
callPurpose: "update"
, crdnId: dataKey
, lsctId: ctrl.getValue("LSCT_ID")
};
ctrl.getInfo(params);
}
// DataTables에 스크롤이 맨 밑으로 이동했을 때 이벤트
scrollDataList = () => {
ctrl.load(ctrl.query.pageNum + 1);
}
return ctrl;
}

@ -0,0 +1,177 @@
function newRent02010Control(pageName, doctx="[data-doctx='rent02010']") {
let ctrl = new DatasetControl({
doctx: doctx
, prefix: "lsct"
, prefixName: "임대차계약"
, dataGetter: obj => obj["List"]
, keys: ["CRDN_ID"]
// , keymapper: info => info ? info.CRDN_ID : ""
, appendData: true
, infoSize: "xl"
, urls: {
load: "/list.do"
, getInfo: "/info.do"
, create: "/create.do"
, update: "/update.do"
, remove: "/remove.do"
}
, formats: {
CRDN_YMD_TM: datetimeFormat
, FFNLG_CRDN_AMT: numberFormat
, REG_DT: datetimeFormat
, MDFCN_DT: datetimeFormat
}
});
// 검색 조건
ctrl.query = { pageNum: 1, fetchSize: DEFAULT_FETCH_SIZE }; // 1 페이지당 자료 건수 index.jsp에서 확인
// paging
pagingSupport = new FimsPagingSupport({
doq: ctrl
, linkContainer: "[name='dataPaging']"
});
/**************************************************************************
* 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, "dataTableClick('{DATA-INDEX}');")
.replace(/{ondblclick}/gi, "dataTableDblClick('{CRDN_ID}');");
// .replace(/{onclick}/gi, "pageObject['" + pageName + "'].dataTableClick('{DATA-INDEX}');")
// .replace(/{ondblclick}/gi, "pageObject['" + pageName + "'].dataTableDblClick('{CRDN_ID}');");
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;
}
//
ctrl.find("[name='tableRspns']").changeContent(trs.join(), initScroll, noMore);
// checkbox 체크 해제
$(ctrl.find("[name='gridAllCheckbox']")).prop("checked", false);
// pagingInfo
pagingSupport.setPagingInfo(obj);
};
// 현재 선택 자료 변경 이벤트
ctrl.onCurrentChange = (item) => {
Apply.fromDataset.currentRow(ctrl.dataset, item, ctrl.find("[name='tbodyList']"));
};
// 선택(체크) 변경 이벤트
ctrl.onSelectionChange = (selectedArr) => {
// gridCheckbox
Apply.fromDataset.gridCheckbox(ctrl.dataset, ctrl.find("[name='tbodyList']"), 1, selectedArr);
// 삭제 버튼
Apply.fromDataset.gridButton(ctrl.dataset, ctrl.find("[name='btnRemove']"), selectedArr);
};
// 상세 정보 dialog
ctrl.getInfo = (params) => {
if (!params) return;
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({ all: true }); }
});
}
});
}
// 삭제 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); }
});
}
/**************************************************************************
* DataTable 이벤트
**************************************************************************/
// dataTable 클릭 이벤트
dataTableClick = (dataIndex) => {
if (dataIndex == "") return;
$(ctrl.find("[name='tbodyList']")).setCurrentRow(dataIndex);
Apply.toDataset.current(ctrl.dataset, dataIndex);
}
// dataTable 더블 클릭 이벤트
dataTableDblClick = (dataKey) => {
let params = {
callPurpose: "update"
, crdnId: dataKey
, lsctId: ctrl.getValue("LSCT_ID")
};
ctrl.getInfo(params);
}
// DataTables에 스크롤이 맨 밑으로 이동했을 때 이벤트
scrollDataList = () => {
ctrl.load(ctrl.query.pageNum + 1);
}
return ctrl;
}
Loading…
Cancel
Save