임대계약서 관리 추가.

main
jjh 3 months ago
parent 85e8e2c494
commit 634f387d5b

@ -153,6 +153,17 @@
<input type="text" class="form-control w-px-160" name="schRgtrNm" /> <input type="text" class="form-control w-px-160" name="schRgtrNm" />
<button type="button" class="btn btn-sm btn-outline-dark" name="btnFindUser" title="사용자 검색">검색</button> <button type="button" class="btn btn-sm btn-outline-dark" name="btnFindUser" title="사용자 검색">검색</button>
</div> </div>
<!-- 납부자 번호 -->
<div class="col-4">
<label is="name-label" class="form-label form-search-title w-px-120 text-end fw-bold" for="schRtpyrNo">schRtpyrNo</label>
<input is="id-input" type="text" class="form-control w-px-160" name="schRtpyrNo" autocomplete="off" />
</div>
</div> </div>
</div> <!-- 상세 조건 --> </div> <!-- 상세 조건 -->
</form> </form>

@ -142,13 +142,13 @@
</div> </div>
<!-- 납부자 번호 --> <!-- 납부자 번호 -->
<div class="col-4"> <div class="col-4">
<label is="name-label" class="form-label form-search-title w-px-120 text-end fw-bold" for="schRtpyrNm">납부자번호</label> <label is="name-label" class="form-label form-search-title w-px-120 text-end fw-bold" for="schRtpyrNo">납부자번호</label>
<input is="id-input" type="text" class="form-control w-px-160" name="schRtpyrNm" autocomplete="off" /> <input is="id-input" type="text" class="form-control w-px-160" name="schRtpyrNo" autocomplete="off" />
</div> </div>
<!-- 납부자 명 --> <!-- 납부자 명 -->
<div class="col-4"> <div class="col-4">
<label is="name-label" class="form-label form-search-title w-px-120 text-end fw-bold" for="schRtpyrNo">납부자명</label> <label is="name-label" class="form-label form-search-title w-px-120 text-end fw-bold" for="schRtpyrNm">납부자명</label>
<input is="id-input" type="text" class="form-control w-px-160" name="schRtpyrNo" autocomplete="off" /> <input is="id-input" type="text" class="form-control w-px-160" name="schRtpyrNm" autocomplete="off" />
</div> </div>
<!-- 등록일자, 수정일자 --> <!-- 등록일자, 수정일자 -->
<div class="col-4"> <div class="col-4">

@ -99,13 +99,13 @@
</div> </div>
<!-- 납부자 번호 --> <!-- 납부자 번호 -->
<div class="col-4"> <div class="col-4">
<label is="name-label" class="form-label form-search-title w-px-120 text-end fw-bold" for="schRtpyrNm">납부자번호</label> <label is="name-label" class="form-label form-search-title w-px-120 text-end fw-bold" for="schRtpyrNo">납부자번호</label>
<input is="id-input" type="text" class="form-control w-px-160" name="schRtpyrNm" autocomplete="off" /> <input is="id-input" type="text" class="form-control w-px-160" name="schRtpyrNo" autocomplete="off" />
</div> </div>
<!-- 납부자 명 --> <!-- 납부자 명 -->
<div class="col-4"> <div class="col-4">
<label is="name-label" class="form-label form-search-title w-px-120 text-end fw-bold" for="schRtpyrNo">납부자명</label> <label is="name-label" class="form-label form-search-title w-px-120 text-end fw-bold" for="schRtpyrNm">납부자명</label>
<input is="id-input" type="text" class="form-control w-px-160" name="schRtpyrNo" autocomplete="off" /> <input is="id-input" type="text" class="form-control w-px-160" name="schRtpyrNm" autocomplete="off" />
</div> </div>
<!-- 등록일자, 수정일자 --> <!-- 등록일자, 수정일자 -->
<div class="col-4"> <div class="col-4">

@ -71,6 +71,9 @@
<table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer" aria-describedby="DataTables_Table_0_info"> <table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer" aria-describedby="DataTables_Table_0_info">
<thead class="sticky-thead"> <thead class="sticky-thead">
<tr name="theadTr" data-search-target="[data-doctx='${pageName}']"> <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: 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>
@ -88,8 +91,8 @@
<th class="cmn" style="width: 180px;">등록일시</th> <th class="cmn" style="width: 180px;">등록일시</th>
<th class="cmn" style="width: 140px;">등록사용자</th> <th class="cmn" style="width: 140px;">등록사용자</th>
<th class="cmn dummy-th"></th> <th class="cmn dummy-th"></th>
</tr> </template>
</thead>
<tbody name="tbodyList"> <tbody name="tbodyList">
</tbody> </tbody>
<template is="curly-brackets" name="tmpltRows"> <template is="curly-brackets" name="tmpltRows">
@ -114,7 +117,7 @@
</tr> </tr>
</template> </template>
<template name="tmpltNotFound"> <template name="tmpltNotFound">
<tr class="odd"> <tr class="cmn">
<td valign="top" colspan="17" class="dataTables_empty text-center">${prefixName} 정보를 찾지 못했습니다.</td> <td valign="top" colspan="17" class="dataTables_empty text-center">${prefixName} 정보를 찾지 못했습니다.</td>
</tr> </tr>
</template> </template>
@ -212,10 +215,10 @@
, size: $P.ctrl.infoSize , size: $P.ctrl.infoSize
, content: resp , content: resp
, init: () => { , init: () => {
AppSupport.setDialogZindex();
$("#" + dialogId).attr("name", dialogName); $("#" + dialogId).attr("name", dialogName);
$("#" + dialogId).attr("data-ref-doctx", "${pageName}"); $("#" + dialogId).attr("data-ref-doctx", "${pageName}");
AppSupport.setDialogZindex();
} }
, onClose: () => { $P.ctrl.reload({ all: true }); } // 자료 재조회 , onClose: () => { $P.ctrl.reload({ all: true }); } // 자료 재조회
}); });
@ -257,12 +260,22 @@
let dataList = $P.ctrl.dataset; let dataList = $P.ctrl.dataset;
let empty = dataList.empty; let empty = dataList.empty;
let trs = empty ? [$P.findn("tmpltNotFound").innerHTML] : // 업무별 DataTables(그리드) tr, td
dataList.inStrings($P.findn("tmpltRows").innerHTML let foundContent = $P.findn("tmpltRows").content;
, (str, dataItem) => str 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('" + dataItem.getValue("MPNG_ID") + "');") .replace(/{onclick}/gi, "pageObject['${pageName}'].dataTableClick('" + dataItem.getValue("MPNG_ID") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dataTableDblClick('" + dataItem.getValue("MPNG_ID") + "');") .replace(/{ondblclick}/gi, "pageObject['${pageName}'].dataTableDblClick('" + dataItem.getValue("MPNG_ID")+ "');");
);
let trs = empty ?
[$P.findn("tmpltNotFound").content.querySelector(".cmn").outerHTML]
: dataList.inStrings(foundTr.outerHTML, replacer);
let noMore = (dataList.length >= totalSize); let noMore = (dataList.length >= totalSize);
let initScroll = ($P.ctrl.query.pageNum < 2); let initScroll = ($P.ctrl.query.pageNum < 2);
@ -329,12 +342,33 @@
// 화면 초기화 // 화면 초기화
$P.findn("frmSearch").reset(); $P.findn("frmSearch").reset();
// dataset 초기화 // input, select 초기화
$P.ctrl.dataset.clear(); 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("userId").val("${userId}"); // 사용자 ID
$P.$findn("schUserAcnt").val("${userAcnt}"); // 사용자 계정 $P.$findn("schUserAcnt").val("${userAcnt}"); // 사용자 계정
// 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);
} }
// 검색 버튼 이벤트 // 검색 버튼 이벤트

@ -0,0 +1,507 @@
<%@ 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="schVhrno">차량번호</label>
<input is="id-input" type="text" class="form-control w-px-160" name="schVhrno" autocomplete="off" />
</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>
</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="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-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-key="CRDN_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="CRDN_ID" 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>
/**************************************************************************
* 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: "lsct"
, prefixName: "임대차계약"
, keymapper: info => info ? info.CRDN_ID : ""
, dataGetter: obj => obj["List"]
, appendData: true
, infoSize: "xl"
, urls: {
load: wctx.url("${prefixUrl}" + "/010/list.do") // 임대차계약 검색
, remove: wctx.url("${prefixUrl}" + "/010/remove.do") // 임대차계약 삭제
, getInfo: wctx.url("${prefixUrl}" + "/020/info.do") // 임대차계약 상세 정보
}
, formats: {
CRDN_YMD_TM: datetimeFormat
, FFNLG_CRDN_AMT: numberFormat
, REG_DT: datetimeFormat
, MDFCN_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.CRDN_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("btnRemove"), selected); // 삭제 버튼
};
// 상세정보 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: () => {
$("#" + dialogId).attr("name", dialogName);
$("#" + dialogId).attr("data-ref-doctx", "${pageName}");
AppSupport.setDialogZindex();
}
, 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;
// 업무별 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('" + dataItem.getValue("CRDN_ID") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dataTableDblClick('" + dataItem.getValue("CRDN_ID") + "');");
let trs = empty ?
[$P.findn("tmpltNotFound").content.querySelector(".cmn").outerHTML]
: dataList.inStrings(foundTr.outerHTML, replacer);
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("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"
, mpngId: dataKey
, userId: $P.$findn("userId").val()
, schEntNo: $P.ctrl.getValue("ENT_NO")
};
$P.ctrl.getInfo(params);
}
// DataTables에 스크롤이 맨 밑으로 이동했을 때 이벤트
$P.scrollDataList = () => {
$P.ctrl.load($P.ctrl.query.pageNum + 1);
}
/**************************************************************************
* 사용자 함수(function)
**************************************************************************/
/**************************************************************************
* 버튼 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"); // 차량번호
// 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 = () => {
// 검색조건
$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: "검색된 자료가 없습니다."
, 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>
Loading…
Cancel
Save