임차인계약서 관리 메뉴 수정.

main
jjh 2 months ago
parent 6092c296f4
commit 1df696e9b0

@ -100,12 +100,6 @@
<button type="button" class="btn btn-primary w-px-120" name="btnRemove" title="임대차계약서 삭제"> <button type="button" class="btn btn-primary w-px-120" name="btnRemove" title="임대차계약서 삭제">
계약서 삭제 계약서 삭제
</button> </button>
<button type="button" class="btn btn-primary w-px-120" name="btnCreateAprvDmnd" title="임대차계약서 승인 요청">
승인 요청
</button>
<button type="button" class="btn btn-primary w-px-120" name="btnRemoveAprvDmnd" title="임대차계약서 승인 요청 취소">
승인 요청 취소
</button>
</span> </span>
</div> </div>
</div> </div>
@ -134,14 +128,8 @@
</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>
</li>
<li class="nav-item">
<button type="button" class="nav-link w-px-160 h-100" role="tab" data-bs-toggle="tab" name="tabItem2"
onClick="pageObject['${pageName}'].fnSearchList('승인완료');">
승인완료
</button> </button>
</li> </li>
</ul> </ul>
@ -161,9 +149,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;">업무구분</th> <th class="cmn" style="width: 160px;">업무구분</th>
<th class="cmn" style="width: 100px;">대상여부</th> <th class="cmn" style="width: 160px;">대상여부</th>
<th class="cmn" style="width: 180px;" onclick="FimsSupport.searchFromGridTitle('CHG_DMND_DT', this.innerText, 'ymd', '');">요청일시</th>
<th class="cmn" style="width: 180px;" onclick="FimsSupport.searchFromGridTitle('CHG_APRV_DT', this.innerText, 'ymd', '');">승인일시</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>
@ -189,9 +175,7 @@
<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 fw-bold text-blue" onclick ondblclick>{TRGT_STTS_NM}</td> <td class="cmn text-center fw-bold text-blue" onclick ondblclick>{TRGT_STTS_NM}</td>
<td class="cmn text-center" onclick ondblclick>{CHG_DMND_DT}</td> <td class="cmn text-center" onclick ondblclick>{CRDN_DT}</td>
<td class="cmn text-center" onclick ondblclick>{CHG_APRV_DT}</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>
<td class="cmn text-center privacy-cell" onclick ondblclick> <td class="cmn text-center privacy-cell" onclick ondblclick>
@ -213,7 +197,7 @@
</template> </template>
<template name="tmpltNotFound"> <template name="tmpltNotFound">
<tr class="cmn"> <tr class="cmn">
<td valign="top" colspan="21" class="dataTables_empty text-center">${prefixName} 정보를 찾지 못했습니다.</td> <td valign="top" colspan="19" class="dataTables_empty text-center">${prefixName} 정보를 찾지 못했습니다.</td>
</tr> </tr>
</template> </template>
</table> </table>
@ -265,9 +249,6 @@
if (tabName == "계약서등록") { if (tabName == "계약서등록") {
$P.$findn("btnRemove").prop("disabled", !atLeastOne); $P.$findn("btnRemove").prop("disabled", !atLeastOne);
$P.$findn("btnCreateAprvDmnd").prop("disabled", !atLeastOne);
} else if (tabName == "승인요청") {
$P.$findn("btnRemoveAprvDmnd").prop("disabled", !atLeastOne);
} }
Apply.toDataset.selection($P.ctrl.dataset, element, bool); Apply.toDataset.selection($P.ctrl.dataset, element, bool);
@ -286,8 +267,8 @@
$P.dataTableDblClick = (dataIndex) => { $P.dataTableDblClick = (dataIndex) => {
let params = { let params = {
callPurpose: "view" callPurpose: "view"
, lsctId: $P.ctrl.getValue("LSCT_ID")
, 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);
@ -338,75 +319,18 @@
}); });
} }
// 임대계약서 승인 요청
$P.createAprvDmnd = (params) => {
if (!params) return;
ajax.get({
url: wctx.url("${prefixUrl}" + "/010/createAprv.do")
, data: params || {}
, success: (resp) => {
let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, "승인 요청");
// 메시지 출력
dialog.alert({
content: showMessage
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => { }
, onClose: () => {
if (resp.saved) { $P.ctrl.reload({ all: true }); }
}
});
}
});
}
// 임대계약서 승인 요청 취소
$P.removeAprvDmnd = (params) => {
if (!params) return;
ajax.get({
url: wctx.url("${prefixUrl}" + "/010/removeAprv.do")
, data: params || {}
, success: (resp) => {
let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, "승인 요청 취소");
// 메시지 출력
dialog.alert({
content: showMessage
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => { }
, onClose: () => {
if (resp.saved) { $P.ctrl.reload({ all: true }); }
}
});
}
});
}
// 버튼 설정 // 버튼 설정
$P.setButton = (tabName) => { $P.setButton = (tabName) => {
// tab // tab
if (tabName == "대상") { if (tabName == "대상") {
$P.$findn("btnCreate").prop("disabled", false); $P.$findn("btnCreate").prop("disabled", false);
$P.$findn("btnRemove").prop("disabled", true); $P.$findn("btnRemove").prop("disabled", true);
$P.$findn("btnCreateAprvDmnd").prop("disabled", true);
$P.$findn("btnRemoveAprvDmnd").prop("disabled", true);
} else if (tabName == "계약서등록") { } else if (tabName == "계약서등록") {
$P.$findn("btnCreate").prop("disabled", true); $P.$findn("btnCreate").prop("disabled", true);
$P.$findn("btnRemove").prop("disabled", false); $P.$findn("btnRemove").prop("disabled", false);
$P.$findn("btnCreateAprvDmnd").prop("disabled", false);
$P.$findn("btnRemoveAprvDmnd").prop("disabled", true);
} else if (tabName == "승인요청") {
$P.$findn("btnCreate").prop("disabled", true);
$P.$findn("btnRemove").prop("disabled", true);
$P.$findn("btnCreateAprvDmnd").prop("disabled", true);
$P.$findn("btnRemoveAprvDmnd").prop("disabled", false);
} else { } else {
$P.$findn("btnCreate").prop("disabled", true); $P.$findn("btnCreate").prop("disabled", true);
$P.$findn("btnRemove").prop("disabled", true); $P.$findn("btnRemove").prop("disabled", true);
$P.$findn("btnCreateAprvDmnd").prop("disabled", true);
$P.$findn("btnRemoveAprvDmnd").prop("disabled", true);
} }
} }
@ -476,13 +400,8 @@
if (tabName == "계약서등록") { if (tabName == "계약서등록") {
$P.ctrl.query.chgDmndYn = "N"; // 변경 요청 여부 N $P.ctrl.query.chgDmndYn = "N"; // 변경 요청 여부 N
$P.ctrl.query.chgAprvYn = "N"; // 변경 승인 여부 N $P.ctrl.query.chgAprvYn = "N"; // 변경 승인 여부 N
} else if (tabName == "승인요청") {
$P.ctrl.query.chgDmndYn = "Y"; // 변경 요청 여부 Y
$P.ctrl.query.chgAprvYn = "N"; // 변경 승인 여부 N
} else if (tabName == "승인완료") {
$P.ctrl.query.chgDmndYn = "Y"; // 변경 요청 여부 Y
$P.ctrl.query.chgAprvYn = "Y"; // 변경 승인 여부 Y
} }
$P.ctrl.query.trgtSttsNm = tabName; $P.ctrl.query.trgtSttsNm = tabName;
// 임대기업번호가 전체라면.. // 임대기업번호가 전체라면..
@ -565,58 +484,6 @@
}); });
} }
// 임대계약서 승인 요청
$P.fnCreateAprvDmnd = () => {
let selected = $P.ctrl.getDataset("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"
, lsctIds: selected.map(info => info.LSCT_ID).join(",")
}
$P.createAprvDmnd(params);
}
});
}
// 임대계약서 승인 요청 취소
$P.fnRemoveAprvDmnd = () => {
let selected = $P.ctrl.getDataset("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: "remove"
, lsctIds: selected.map(info => info.LSCT_ID).join(",")
}
$P.removeAprvDmnd(params);
}
});
}
/************************************************************************** /**************************************************************************
* 초기 설정 * 초기 설정
**************************************************************************/ **************************************************************************/
@ -630,8 +497,6 @@
// 업무 버튼 이벤트 // 업무 버튼 이벤트
$P.$findn("btnCreate").on("click", () => { $P.fnCreate(); }); // 등록 $P.$findn("btnCreate").on("click", () => { $P.fnCreate(); }); // 등록
$P.$findn("btnRemove").on("click", () => { $P.fnRemove(); }); // 삭제 $P.$findn("btnRemove").on("click", () => { $P.fnRemove(); }); // 삭제
$P.$findn("btnCreateAprvDmnd").on("click", () => { $P.fnCreateAprvDmnd(); }); // 승인 요청
$P.$findn("btnRemoveAprvDmnd").on("click", () => { $P.fnRemoveAprvDmnd(); }); // 승인 요청 취소
// DataTables width 변경 조정 // DataTables width 변경 조정
Componentization.fnMakeResizableTable($P.findn("tableRspns")); Componentization.fnMakeResizableTable($P.findn("tableRspns"));

@ -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}">
@ -26,42 +26,60 @@
<!-- 검색 조건 영역 --> <!-- 검색 조건 영역 -->
<form name="frmSearch"> <form name="frmSearch">
<!-- hidden -->
<input type="hidden" name="userId" />
<!-- 메인 조건 --> <!-- 메인 조건 -->
<div class="container-search"> <div class="container-search">
<div class="row g-1"> <div class="row g-1">
<!-- 단속 일자 --> <!-- 단속 일자 -->
<div class="col-6"> <div class="col-6">
<label class="form-label form-search-title w-px-120 text-end fw-bold">단속일자</label> <label class="form-label form-search-title w-px-120 text-end fw-bold required">단속일자</label>
<span class="form-search-linebox"> <span class="form-search-linebox">
<input type="text" class="form-control form-date" name="schCrdnYmdFrom" <input type="text" class="form-control form-date" name="schCrdnYmdFrom"
data-fmt-type="day" autocomplete="off" title="시작 날짜 선택" /> data-fmt-type="day" autocomplete="off" title="시작 날짜 선택" required />
<button type="button" class="bx bx-lg bx-calendar bg-white"></button> <button type="button" class="bx bx-lg bx-calendar bg-white"></button>
~ ~
<input type="text" class="form-control form-date" name="schCrdnYmdTo" <input type="text" class="form-control form-date" name="schCrdnYmdTo"
data-fmt-type="day" autocomplete="off" title="종료 날짜 선택" /> data-fmt-type="day" autocomplete="off" title="종료 날짜 선택" required />
<button type="button" class="bx bx-lg bx-calendar bg-white"></button> <button type="button" class="bx bx-lg bx-calendar bg-white"></button>
</span> </span>
</div> </div>
<!-- 기업 번호 --> <!-- 기업 번호 -->
<div class="col-6"> <div class="col-6">
<label is="name-label" class="form-label form-search-title w-px-120 text-end fw-bold" for="schEntNo">임대기업번호</label> <label is="name-label" class="form-label form-search-title w-px-120 text-end fw-bold" for="entId">임대기업번호</label>
<select is="id-select" class="form-select w-px-160" name="schEntNo"> <select is="id-select" class="form-select w-px-160" name="entId">
<option value="">전체</option> <option value="">전체</option>
<c:forEach items="${entNoList}" var="item"> <c:forEach items="${entRegNoList}" var="item">
<option value="${item.ENT_NO}">${item.ENT_NO}</option> <option value="${item.ENT_ID}">${item.ENT_REG_NO}</option>
</c:forEach> </c:forEach>
</select> </select>
</div> </div>
<!-- 차량번호 --> <!-- 자동차등록번호 -->
<div class="col-6"> <div class="col-6">
<label is="name-label" class="form-label form-search-title w-px-120 text-end fw-bold" for="schVhrno">차량번호</label> <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" /> <input is="id-input" type="text" class="form-control w-px-160" name="schVhrno" autocomplete="off" />
</div> </div>
<!-- 동적검색 -->
<div class="col-6">
<input type="hidden" name="by" />
<input type="text" class="form-control w-px-120 text-end fw-bold" name="byOutput" value="동적 검색" readonly />
<input type="hidden" name="mainOption" />
<input type="hidden" name="subOption" />
<input type="text" class="form-control w-px-400" name="term" autocomplete="off" />
<!-- 상세 검색조건 버튼 -->
<span class="flr">
<button type="button" class="btn btn-open-detail" data-bs-toggle="collapse" data-bs-target="[data-doctx='${pageName}'] [name='searchDetail']">
<i class="bx bx-chevron-down"></i>
상세검색
</button>
</span>
</div> <!-- 동적검색 -->
</div> </div>
</div> <!-- 메인 조건 --> </div> <!-- 메인 조건 -->
<!-- 상세 조건 -->
<div name="searchDetail" class="container-search container-search-detail collapse">
<div class="row g-1">
</div>
</div> <!-- 상세 조건 -->
</form> </form>
<!-- 검색 조건 영역 --> <!-- 검색 조건 영역 -->
@ -76,11 +94,11 @@
</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-120" 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-120" name="btnRemove" title="임대차계약서 승인 요청 취소">
임대계약서 삭제 승인 요청 취소
</button> </button>
</span> </span>
</div> </div>
@ -88,24 +106,36 @@
<!-- 업무 버튼 및 건수 표시 --> <!-- 업무 버튼 및 건수 표시 -->
<!-- tab --> <!-- tab -->
<div class="nav-align-top" name="tabMain" > <div class="nav-align-top" name="tabMain">
<ul class="nav nav-tabs" role="tablist"> <ul class="nav nav-tabs" role="tablist">
<li class="nav-item"> <li class="nav-item">
<button type="button" class="nav-link w-px-160 h-100 active" role="tab" data-bs-toggle="tab" <button type="button" class="nav-link w-px-160 h-100 active" role="tab" data-bs-toggle="tab" name="tabItem0"
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" 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" <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>
</li>
<li class="nav-item">
<button type="button" class="nav-link w-px-160 h-100" role="tab" data-bs-toggle="tab" name="tabItem3"
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" name="tabItem4"
onClick="pageObject['${pageName}'].fnSearchList('승인완료');">
승인완료
</button> </button>
</li> </li>
</ul> </ul>
@ -123,15 +153,25 @@
</thead> </thead>
<template name="tmpltCols"> <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;">업무구분</th> <th class="cmn" style="width: 160px;">업무구분</th>
<th class="cmn" style="width: 120px;">대상여부</th>
<th class="cmn" style="width: 180px;" onclick="FimsSupport.searchFromGridTitle('CHG_DMND_DT', this.innerText, 'ymd', '');">요청일시</th>
<th class="cmn" style="width: 160px;" onclick="FimsSupport.searchFromGridTitle('CHG_APRV_YN', this.innerText, 'codeValue', 'CMN006');">승인여부</th>
<th class="cmn" style="width: 180px;" onclick="FimsSupport.searchFromGridTitle('CHG_APRV_DT', this.innerText, 'ymd', '');">승인일시</th>
<th class="cmn" style="width: 160px;" onclick="FimsSupport.searchFromGridTitle('CHG_AUTZR', this.innerText, 'match', 'part');">승인자</th>
<th class="cmn" style="width: 160px;" onclick="FimsSupport.searchFromGridTitle('CHG_APRV_RSN', 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_REG_NO', this.innerText, 'match', 'part');">법인(사업자)번호</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: 180px;" onclick="FimsSupport.searchFromGridTitle('CTRT_BGNG_DT', this.innerText, 'ymd', '');">계약시작일시</th>
<th class="cmn" style="width: 160px;" onclick="FimsSupport.searchFromGridTitle('RTPYR_NO', this.innerText, 'ymd', '');">납부자번호</th> <th class="cmn" style="width: 180px;" onclick="FimsSupport.searchFromGridTitle('CTRT_END_DT', 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: 100px;" onclick="FimsSupport.searchFromGridTitle('HIRER_SE_CD', this.innerText, 'codeValue', 'FIM089');">임차인구분</th>
<th class="cmn" style="width: 160px;" onclick="FimsSupport.searchFromGridTitle('VLTN_ARTCL', this.innerText, 'match', 'part');">위반항목</th> <th class="cmn" style="width: 160px;" onclick="FimsSupport.searchFromGridTitle('HIRER_REG_NO', this.innerText, 'match', 'part');">임차인번호</th>
<th class="cmn" style="width: 200px;" onclick="FimsSupport.searchFromGridTitle('HIRER_NM', this.innerText, 'match', 'part');">임차인명</th>
<th class="cmn" style="width: 160px;" onclick="FimsSupport.searchFromGridTitle('HIRER_TELNO', this.innerText, 'match', 'part');">전화번호</th>
<th class="cmn" style="width: 160px;" onclick="FimsSupport.searchFromGridTitle('HIRER_MBL_TELNO', 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: 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: 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: 120px;" onclick="FimsSupport.searchFromGridTitle('FFNLG_CRDN_AMT', this.innerText, 'match', 'part');">단속원금</th>
@ -146,19 +186,27 @@
<tbody name="tbodyList"> <tbody name="tbodyList">
</tbody> </tbody>
<template is="curly-brackets" name="tmpltRows"> <template is="curly-brackets" name="tmpltRows">
<tr data-index="DATA-INDEX"> <tr data-index="{data-index}">
<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>{CRDN_YMD_TM}</td> <td class="cmn text-center fw-bold text-blue" onclick ondblclick>{TRGT_STTS_NM}</td>
<td class="cmn text-center" onclick ondblclick>{CHG_DMND_DT}</td>
<td class="cmn text-center" onclick ondblclick>{CHG_APRV_NM}</td>
<td class="cmn text-center" onclick ondblclick>{CHG_APRV_DT}</td>
<td class="cmn text-center" onclick ondblclick>{CHG_AUTZR}</td>
<td class="cmn text-start" onclick ondblclick>{CHG_APRV_RSN}</td>
<td class="cmn text-start" onclick ondblclick>{ENT_NM}</td>
<td class="cmn text-center" onclick ondblclick>{ENT_REG_NO}</td>
<td class="cmn text-center" onclick ondblclick>{CRDN_DT}</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>{CTRT_BGNG_DT}</td>
<td class="cmn text-center privacy-cell" onclick ondblclick> <td class="cmn text-center" onclick ondblclick>{CTRT_END_DT}</td>
<span>{RTPYR_NO}</span> <td class="cmn text-center" onclick ondblclick>{HIRER_SE_NM}</td>
<span>*************</span> <td class="cmn text-center" onclick ondblclick>{HIRER_REG_NO}</td>
</td> <td class="cmn text-start" onclick ondblclick>{HIRER_NM}</td>
<td class="cmn text-start" onclick ondblclick>{RTPYR_NM}</td> <td class="cmn text-center" onclick ondblclick>{HIRER_TELNO}</td>
<td class="cmn text-start" onclick ondblclick>{VLTN_ARTCL}</td> <td class="cmn text-center" onclick ondblclick>{HIRER_MBL_TELNO}</td>
<td class="cmn text-center" onclick ondblclick>{CRDN_STDG_NM}</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-start" onclick ondblclick>{CRDN_PLC}</td>
<td class="cmn text-end" onclick ondblclick>{FFNLG_CRDN_AMT}</td> <td class="cmn text-end" onclick ondblclick>{FFNLG_CRDN_AMT}</td>
@ -172,7 +220,7 @@
</template> </template>
<template name="tmpltNotFound"> <template name="tmpltNotFound">
<tr class="cmn"> <tr class="cmn">
<td valign="top" colspan="17" class="dataTables_empty text-center">${prefixName} 정보를 찾지 못했습니다.</td> <td valign="top" colspan="29" class="dataTables_empty text-center">${prefixName} 정보를 찾지 못했습니다.</td>
</tr> </tr>
</template> </template>
</table> </table>
@ -189,7 +237,7 @@
<!-- / inner page html <div class="content-wrapper"> --> <!-- / inner page html <div class="content-wrapper"> -->
<script> <script>
LoadScript("rent02010Script",wctx.url("/webjars/js/fims/rent/rent02010.js?ver=${ver}")); LoadScript("rent02050Script", wctx.url("/webjars/js/fims/rent/rent02050.js?ver=${ver}"));
/************************************************************************** /**************************************************************************
* Global Variable * Global Variable
@ -200,70 +248,33 @@
* script 진입 * script 진입
**************************************************************************/ **************************************************************************/
$(document).ready(function() { $(document).ready(function() {
/************************************************************************** // pageObject
* pageObject
**************************************************************************/
let $P = pageObject["${pageName}"]; let $P = pageObject["${pageName}"];
// formFields
$P.formFields = new FimsFormFields($P.selectorn("frmSearch"));
// datasetControl // datasetControl
$P.ctrl = newRent02010Control("${pageName}", "[data-doctx=${pageName}]"); $P.ctrl = newRent02050Control("${pageName}", "[data-doctx=${pageName}]");
// paging
$P.pagingSupport = new FimsPagingSupport({
ctrl: $P.ctrl // DatasetControl
, ignoreCtrlPrefix: true // ctrl.prefix 가 있더라도 무시
, linkContainer: "[name='dataPaging']" // <ul class="pagination pagination-primary" name="dataPaging">
});
/************************************************************************** /**************************************************************************
* DataTable 이벤트 * 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 체크박스 클릭 이벤트 // dataTable 체크박스 클릭 이벤트
$P.dataTableCheckbox = (element, bool) => { $P.dataTableCheckbox = (element, bool) => {
GRID.checkbox.sync(element, bool); GRID.checkbox.sync(element, bool);
let atLeastOne = GRID.checkbox.countChecked(element) > 0; let atLeastOne = GRID.checkbox.countChecked(element) > 0;
let tabName = $P.$findn("tabMain").find("button.active").text().trim();
// 버튼 if (tabName == "대상") {
$P.$findn("btnRemove").prop("disabled", !atLeastOne); $P.$findn("btnCreate").prop("disabled", !atLeastOne);
} else if (tabName == "승인요청") {
$P.$findn("btnRemove").prop("disabled", !atLeastOne);
}
Apply.toDataset.selection($P.ctrl.dataset, element, bool); Apply.toDataset.selection($P.ctrl.dataset, element, bool);
} }
@ -278,10 +289,9 @@
} }
// dataTable 더블 클릭 이벤트 // dataTable 더블 클릭 이벤트
$P.dataTableDblClick = (dataKey) => { $P.dataTableDblClick = (dataIndex) => {
let params = { let params = {
callPurpose: "update" callPurpose: "view"
, crdnId: dataKey
, lsctId: $P.ctrl.getValue("LSCT_ID") , lsctId: $P.ctrl.getValue("LSCT_ID")
}; };
@ -298,21 +308,42 @@
**************************************************************************/ **************************************************************************/
// URL 설정 // URL 설정
$P.setUrl = (prefixUrl) => { $P.setUrl = (prefixUrl) => {
$P.ctrl.urls.load = wctx.url(prefixUrl + "/010/list.do"); // 검색 url $P.ctrl.urls.load = wctx.url(prefixUrl + "/050/list.do"); // 검색
$P.ctrl.urls.getInfo = wctx.url(prefixUrl + "/020/info.do"); // 상세 정보 url $P.ctrl.urls.getInfo = wctx.url(prefixUrl + "/020/info.do"); // 상세 정보
$P.ctrl.urls.create = wctx.url(prefixUrl + "/050/createAprv.do") // 승인 요청
$P.ctrl.urls.remove = wctx.url(prefixUrl + "/050/removeAprv.do") // 승인 요청 취소
}
// 버튼 설정
$P.setButton = (tabName) => {
// tab
if (tabName == "대상") {
$P.$findn("btnCreate").prop("disabled", false);
$P.$findn("btnRemove").prop("disabled", true);
} else if (tabName == "승인요청") {
$P.$findn("btnCreate").prop("disabled", true);
$P.$findn("btnRemove").prop("disabled", false);
} else {
$P.$findn("btnCreate").prop("disabled", true);
$P.$findn("btnRemove").prop("disabled", true);
}
} }
/************************************************************************** /**************************************************************************
* 버튼 clickEvent * 버튼 clickEvent
**************************************************************************/ **************************************************************************/
// 초기화 버튼 이벤트 // 초기화
$P.fnReset = () => { $P.fnReset = () => {
// 화면 초기화 // 화면 초기화
$P.findn("frmSearch").reset(); $P.findn("frmSearch").reset();
// dataset 초기화
$P.ctrl.dataset.clear();
// URL 설정
$P.setUrl("${prefixUrl}");
// input, select 초기화 // input, select 초기화
let searchForm = $P.$findn("frmSearch"); 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='checkbox']").prop("checked", false);
searchForm.find("input[type='text']").val(""); searchForm.find("input[type='text']").val("");
searchForm.find("input[type='hidden']").val(""); searchForm.find("input[type='hidden']").val("");
@ -322,16 +353,10 @@
AppSupport.initDetailSearchButton($P.findn("frmSearch")); // 상세검색 버튼 화살표 AppSupport.initDetailSearchButton($P.findn("frmSearch")); // 상세검색 버튼 화살표
// 기본 데이터 설정 // 기본 데이터 설정
$P.$findn("userId").val("${userId}"); // 사용자 ID
$P.$findn("schCrdnYmdFrom").datepicker("setDate", DateSupport.getAddDay(-365)); // 단속 일자 시작 $P.$findn("schCrdnYmdFrom").datepicker("setDate", DateSupport.getAddDay(-365)); // 단속 일자 시작
$P.$findn("schCrdnYmdTo").datepicker("setDate", TODAY()); // 단속 일자 종료 $P.$findn("schCrdnYmdTo").datepicker("setDate", TODAY()); // 단속 일자 종료
$P.$findn("schVhrno").val("167하9750"); // 차량번호 $P.$findn("schVhrno").val("167하9750"); // 자동차등록번호
$P.$findn("byOutput").val("동적 검색"); // 동적 검색
// URL 설정
$P.setUrl("${prefixUrl}");
// dataset 초기화
$P.ctrl.dataset.clear();
// 그리드 th // 그리드 th
let colContent = $P.findn("tmpltCols").content; let colContent = $P.findn("tmpltCols").content;
@ -342,30 +367,47 @@
colsOuterHTML += this.outerHTML; colsOuterHTML += this.outerHTML;
}); });
$P.findn("tableRspns").changeColumn(colsOuterHTML); $P.findn("tableRspns").changeColumn(colsOuterHTML);
// 버튼 설정
$(".nav-link.active").removeClass("active"); // 기존의 활성화된 탭에서 active 클래스 제거
$P.$findn("tabItem0").addClass("active"); // 새로운 탭에 active 클래스 추가
let tabName = $P.$findn("tabMain").find("button.active").text().trim();
$P.setButton(tabName);
} }
// 검색 버튼 이벤트 // 검색
$P.fnSearchList = (tabName) => { $P.fnSearchList = (tabName) => {
// 검색 조건 // validate 확인
$P.ctrl.query = $P.formFields.get(); // 검색 조건 if (!AppSupport.customValidate($P.$findn("frmSearch").find("input,select,textarea"))) return;
$P.ctrl.query.fetchSize = DEFAULT_FETCH_SIZE; // 한번에 조회되는 자료 건수
$P.ctrl.query.delYn = "N"; // 삭제 여부
// tab // 버튼 설정
if (tabName == "단속") { if (!tabName) {
$P.ctrl.query.nxrpCrdnLinkYn = "N"; tabName = $P.$findn("tabMain").find("button.active").text().trim();
} else if (tabName == "세외수입") { }
$P.ctrl.query.nxrpCrdnLinkYn = "Y"; $P.setButton(tabName);
} else {
$P.ctrl.query.nxrpCrdnLinkYn = "N"; // 검색 조건
$P.ctrl.query = new FimsFormFields($P.selectorn("frmSearch")).get(); // 검색 조건
$P.ctrl.query.fetchSize = DEFAULT_FETCH_SIZE; // 한번에 조회되는 자료 건수
$P.ctrl.query.delYn = "N"; // 삭제 여부
if (tabName == "승인요청") {
$P.ctrl.query.chgDmndYn = "Y"; // 변경 요청 여부 Y
$P.ctrl.query.chgAprvYn = "N"; // 변경 승인 여부 N
} else if (tabName == "승인완료") {
$P.ctrl.query.chgDmndYn = "Y"; // 변경 요청 여부 Y
$P.ctrl.query.chgAprvYn = "Y"; // 변경 승인 여부 Y
} }
$P.ctrl.query.trgtSttsNm = tabName;
// 임대기업번호가 전체라면.. // 임대기업번호가 전체라면..
if ($P.ctrl.query.schEntNo == "" ) { if ($P.ctrl.query.entId == "" ) {
// schEntNo 의 option을 전체를 배열로 담는다. // schEntNo 의 option을 전체를 배열로 담는다.
let arrEntNo = $.map($P.$findn("schEntNo").find("option"), function(e) { return e.value; }); let arrEntId = $.map($P.$findn("entId").find("option"), function(e) { return e.value; });
if (arrEntNo.length == 1) { if (arrEntId.length == 1) {
dialog.alert({ dialog.alert({
content: "등록되어 있는 임대기업 정보가 없습니다." content: "등록되어 있는 임대기업 정보가 없습니다."
+ "<br>" + "'임대기업관리' 메뉴에서 임대기업 정보를 먼저 등록하시기 바랍니다." + "<br>" + "'임대기업관리' 메뉴에서 임대기업 정보를 먼저 등록하시기 바랍니다."
@ -373,16 +415,16 @@
, onOK: () => { } , onOK: () => { }
}); });
return; return;
} }
// 빈 값(전체)을 제외하고 "," 로 구분하여 schEntNos 에 담는다. // 빈 값(전체)을 제외하고 "," 로 구분하여 entIds 에 담는다.
$P.ctrl.query.schEntNos = arrEntNo.filter((element) => element !== "").join(','); $P.ctrl.query.entIds = arrEntId.filter((element) => element !== "").join(',');
} }
$P.ctrl.load(1); $P.ctrl.load(1);
} }
// 엑셀 버튼 이벤트 // 엑셀
$P.fnExcel = () => { $P.fnExcel = () => {
if ($P.ctrl.dataset.empty) { if ($P.ctrl.dataset.empty) {
dialog.alert({ dialog.alert({
@ -395,26 +437,41 @@
// DataTables(그리드) // DataTables(그리드)
$P.ctrl.query.cellDefs = $P.ctrl.query.cellDefs =
AppSupport.getCellDefs($P.$findn("theadTr").find("th").not(".dummy-th").not(":eq(0)") 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.findn("tmpltRows").content).find("td").not(".dummy-td").not(":eq(0)"));
$P.ctrl.download(); $P.ctrl.download();
} }
// 임대기업 매핑 등록 버튼 이벤트 // 임대계약서 승인 요청
$P.fnCreate = () => { $P.fnCreate = () => {
let params = { let selected = $P.ctrl.getDataset("selected"); // 선택 자료
callPurpose: "create"
, userId: $P.$findn("userId").val()
, schEntNo: ""
};
$P.ctrl.getInfo(params); 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"
, lsctIds: selected.map(info => info.LSCT_ID).join(",")
}
$P.ctrl.create(params);
}
});
} }
// 임대기업 매핑 삭제 버튼 이벤트 // 임대계약서 승인 요청 취소
$P.fnRemove = () => { $P.fnRemove = () => {
let selected = $P.ctrl.dataset.getKeys("selected"); // 선택 자료 let selected = $P.ctrl.getDataset("selected"); // 선택 자료
if (selected.length < 1) { if (selected.length < 1) {
dialog.alert({ dialog.alert({
@ -426,11 +483,11 @@
} }
dialog.alert({ dialog.alert({
content: "선택한 " + selected.length + "건의 " + $P.ctrl.prefixName + " 정보를 삭제하시겠습니까?" content: "선택한 " + selected.length + "건의 " + $P.ctrl.prefixName + " 정보를 승인 요청을 취소하시겠습니까?"
, onOK: () => { , onOK: () => {
let params = { let params = {
callPurpose: "create" callPurpose: "remove"
, mpngIds: selected.join(",") , lsctIds: selected.map(info => info.LSCT_ID).join(",")
} }
$P.ctrl.remove(params); $P.ctrl.remove(params);
@ -444,13 +501,13 @@
// 이벤트 설정 // 이벤트 설정
$P.setEvent = () => { $P.setEvent = () => {
// 기본 버튼 이벤트 // 기본 버튼 이벤트
$P.$findn("btnReset").on("click", () => { $P.fnReset() }); // 초기화 $P.$findn("btnReset").on("click", () => { $P.fnReset() }); // 초기화
$P.$findn("btnSearch").on("click", () => { $P.fnSearchList() }); // 검색 $P.$findn("btnSearch").on("click", () => { $P.fnSearchList() }); // 검색
$P.$findn("btnExcel").on("click", () => { $P.fnExcel() }); // 엑셀 $P.$findn("btnExcel").on("click", () => { $P.fnExcel() }); // 엑셀
// 업무 버튼 이벤트 // 업무 버튼 이벤트
$P.$findn("btnCreate").on("click", () => { $P.fnCreate(); }); // 등록 $P.$findn("btnCreate").on("click", () => { $P.fnCreate(); }); // 승인 요청
$P.$findn("btnRemove").on("click", () => { $P.fnRemove(); }); // 삭제 $P.$findn("btnRemove").on("click", () => { $P.fnRemove(); }); // 승인 요청 취소
// DataTables width 변경 조정 // DataTables width 변경 조정
Componentization.fnMakeResizableTable($P.findn("tableRspns")); Componentization.fnMakeResizableTable($P.findn("tableRspns"));

@ -17,7 +17,7 @@ function newRent02010Control(pageName, doctx="[data-doctx='rent02010']") {
, formats: { , formats: {
CHG_DMND_DT: datetimeFormat CHG_DMND_DT: datetimeFormat
, CHG_APRV_DT: datetimeFormat , CHG_APRV_DT: datetimeFormat
, CRDN_YMD_TM: datetimeFormat , CRDN_DT: datetimeFormat
, FFNLG_CRDN_AMT: numberFormat , FFNLG_CRDN_AMT: numberFormat
, REG_DT: datetimeFormat , REG_DT: datetimeFormat
, MDFCN_DT: datetimeFormat , MDFCN_DT: datetimeFormat

@ -0,0 +1,170 @@
function newRent02050Control(pageName, doctx="[data-doctx='rent02050']") {
let ctrl = new DatasetControl({
doctx: doctx
, prefix: "lsct"
, prefixName: "임대차계약"
, dataGetter: obj => obj["List"]
, keys: ["LSCT_ID"]
, appendData: true
, infoSize: "xl"
, urls: {
load: "/list.do"
, getInfo: "/info.do"
, create: "/create.do"
, update: "/update.do"
, remove: "/remove.do"
}
, formats: {
CHG_DMND_DT: datetimeFormat
, CHG_APRV_DT: datetimeFormat
, CRDN_DT: datetimeFormat
, CTRT_BGNG_DT: datetimeFormat
, CTRT_END_DT: datetimeFormat
, FFNLG_CRDN_AMT: numberFormat
, REG_DT: datetimeFormat
, MDFCN_DT: datetimeFormat
}
});
// 검색 조건
ctrl.query = { pageNum: 1, fetchSize: DEFAULT_FETCH_SIZE }; // 1 페이지당 자료 건수 index.jsp에서 확인
/**************************************************************************
* 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["Paging"]?.totalSize); // 전체 건수
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) => {
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);
// gridButton
Apply.fromDataset.gridButton(ctrl.dataset, ctrl.find("[name='btnCreate']"), 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.onCreate = (params, resp) => {
let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, "승인 요청");
// 메시지 출력
dialog.alert({
content: showMessage
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => { }
, onClose: () => {
if (resp.saved) { ctrl.reload({ all: true }); }
}
});
}
// 등록
ctrl.create = (params) => {
if (!params) return;
ajax.post({
url: ctrl.urls.create
, data: params || {}
, success: (resp) => { ctrl.onCreate(params, resp); }
});
}
// 삭제 callback
ctrl.onRemove = (params, resp) => {
let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, "승인 요청 취소");
// 메시지 출력
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;
}
Loading…
Cancel
Save