You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1101 lines
45 KiB
Plaintext

<%@ 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="pageKorName" scope="request">단속 자료 검사</c:set>
<div class="content-wrapper">
<div class="container-xxl flex-grow-1 px-0">
<div class="card wrapper-list">
<div class="container-page-btn">
<button type="button" id="btnReset--${pageName}" class="btn btn-outline-dark w-px-120" title="초기화">
초기화
</button>
<div class="w-100 d-flex justify-content-center">
<div class="btn-group">
<button type="button" id="btnPhotoInspection--${pageName}"
class="btn btn-blue btn-outline-some" title="단속사진 비교">단속사진 비교</button>
<button type="button" id="btnSameVehicleInspection--${pageName}"
class="btn btn-blue btn-outline-some" title="동일단속차량 검사">동일단속차량 검사</button>
</div>
</div>
<span class="container-window-btn-right">
<button type="button" id="btnSearch--${pageName}"
class="btn btn-search w-px-120" title="검색">검색</button>
<button type="button" id="btnExcel--${pageName}"
class="btn btn-excel w-px-120" title="엑셀 저장">엑셀</button>
</span>
</div>
<form id="frmSearch--${pageName}" name="frmSearch">
<div class="container-search">
<div class="row g-1">
<div class="col-12">
<span class="form-label fw-bold form-search-title w-px-120 text-end">업무구분</span>
<span class="form-search-linebox">
<c:forEach items="${TaskListForSgg}" var="item">
<label>
<input name="taskSeCd" type="radio" value="${item.code}"
class="form-check-input" alt="업무구분"
onchange="pageObject['${pageName}'].fnResetAndChangeBiz(this.value);">
${item.value}
</label>
</c:forEach>
</span>
</div>
<div class="col-6">
<label class="form-label fw-bold form-search-title w-px-120 text-end" for="schCrdnYmdFrom--${pageName}">단속일자</label>
<span class="form-search-linebox">
<input type="text" id="schCrdnYmdFrom--${pageName}" name="schCrdnYmdFrom"
class="form-control form-date"
data-fmt-type="day" title="시작 날짜 선택" />
<button type="button" class="bx bx-lg bx-calendar bg-white"></button>
~
<input type="text" id="schCrdnYmdTo--${pageName}" name="schCrdnYmdTo"
class="form-control form-date"
data-fmt-type="day" title="종료 날짜 선택">
<button type="button" class="bx bx-lg bx-calendar bg-white"></button>
</span>
</div>
<div class="col-6">
<label class="form-label fw-bold form-search-title w-px-120 text-end" for="crdnInptSeCd--${pageName}">단속구분</label>
<select id="crdnInptSeCd--${pageName}" name="crdnInptSeCd" class="form-select">
<option value="">전체</option>
<c:forEach items="${FIM003List}" var="item">
<option value="${item.code}">${item.value}</option>
</c:forEach>
</select>
</div>
<div class="col-6">
<label class="form-label fw-bold form-search-title w-px-120 text-end" for="vhrno--${pageName}">차량번호</label>
<input type="text" id="vhrno--${pageName}" name="vhrno" class="form-control" />
</div>
<div class="col-6">
<span class="area-samevehicleinspection">
<span class="form-label fw-bold form-search-title w-px-120 text-end">단속건수</span>
<input type="text" name="schCrdnCntFrom" class="form-control w-px-50" placeholder="2" />
~ <input type="text" name="schCrdnCntTo" class="form-control w-px-50"/>
</span>
</div>
<div class="col-6">
<label>
<input type="checkbox" name="schExclEnd" class="form-check-input" />
서손자료제외
</label>
<label class="area-samevehicleinspection">
<input type="checkbox" name="schOnlySamePlace" class="form-check-input" />
동일장소만조회
</label>
<label class="area-photoinspection">
<input type="checkbox" name="schOnlyUnpay" class="form-check-input" />
미납만조회
</label>
<span slot="search">
<template class="pvs">
<slot>
<label class="area-photoinspection">
<input type="checkbox" name="schExclOvtime" class="form-check-input" />
2시간초과 처리 자료 제외
</label>
</slot>
</template>
</span>
</div>
<!-- 동적검색 -->
<div class="col-6">
<input type="hidden" id="by--${pageName}" name="by" />
<input type="text" class="form-control fw-bold w-px-120 text-end" id="byOutput--${pageName}" value="동적 검색" readonly />
<input type="hidden" id="mainOption--${pageName}" name="mainOption" />
<input type="hidden" id="subOption--${pageName}" name="subOption" />
<input type="text" class="form-control w-px-400" id="term--${pageName}" name="term" autocomplete="off" />
<!-- 상세 검색조건 버튼 -->
<span class="flr">
<button type="button" class="btn btn-open-detail" data-bs-toggle="collapse" data-bs-target="#searchDetail--${pageName}">
<i class="bx bx-chevron-down"></i>
상세검색
</button>
</span>
</div>
</div>
</div>
<div id="searchDetail--${pageName}" class="container-search container-search-detail collapse">
<div class="row">
<div class="col-4">
<label class="form-label fw-bold form-search-title w-px-120 text-end" for="crdnSttsCd--${pageName}">자료상태</label>
<select id="crdnSttsCd--${pageName}" name="crdnSttsCd" class="form-select">
<option value="">전체</option>
<c:forEach items="${FIM010List}" var="item">
<option value="${item.code}">${item.value}</option>
</c:forEach>
</select>
</div>
<!-- 등록일자, 수정일자 -->
<div class="col-4">
<select class="form-select w-px-120 text-center" id="schRegDateOpt--${pageName}" name="schRegDateOpt">
<option value="regDt">등록일자</option>
<option value="mdfcnDt">수정일자</option>
</select>
<span class="form-search-linebox">
<input type="text" class="form-control form-date" id="schRegDateFrom--${pageName}" name="schRegDateFrom"
data-fmt-type="day" title="시작 날짜 선택" />
<button type="button" class="bx bx-lg bx-calendar bg-white"></button>
~
<input type="text" class="form-control form-date" id="schRegDateTo--${pageName}" name="schRegDateTo"
data-fmt-type="day" title="종료 날짜 선택">
<button type="button" class="bx bx-lg bx-calendar bg-white"></button>
</span>
</div>
<!-- 등록자명, 수정자명 -->
<div class="col-4">
<select class="form-select w-px-120 text-center" id="schRgtrOpt--${pageName}" name="schRgtrOpt">
<option value="rgtr">등록자</option>
<option value="mdfr">수정자</option>
</select>
<input type="hidden" id="schRgtrCd--${pageName}" name="schRgtrCd" />
<input type="text" class="form-control w-px-160" id="schRgtrNm--${pageName}" name="schRgtrNm" />
<button type="button" class="btn btn-sm btn-outline-dark" id="btnFindUser--${pageName}" title="사용자 검색">검색</button>
</div>
</div>
</div>
</form>
<div id="gridbuttonArea--${pageName}" class="container-page-btn">
<div class="d-flex flex-row justify-content-between">
<span id="photoInspectionPaging--${pageName}PagingInfo"
class="dataTables_info area-photoinspection" role="status" aria-live="polite"></span>
<ul id="photoInspectionPaging--${pageName}"
class="pagination pagination-primary area-photoinspection">
</ul>
</div>
<div class="d-flex flex-row justify-content-between">
<span id="sameVehicleInspectionMainPaging--${pageName}PagingInfo"
class="dataTables_info area-samevehicleinspection" role="status" aria-live="polite"></span>
<ul id="sameVehicleInspectionMainPaging--${pageName}"
class="pagination pagination-primary area-samevehicleinspection">
</ul>
</div>
<span class="container-window-btn-right">
<button type="button" id="btnInstLevyExcl--${pageName}" class="btn btn-primary"
title="비부과 등록">비부과 등록</button>
<span slot="button">
<template class="pvs">
<slot>
<button id="btnOpenOverTime--${pageName}"
class="btn btn-primary area-photoinspection"
title="2시간 초과 처리">2시간 초과 처리</button>
</slot>
</template>
</span>
</span>
</div>
<div class="card-datatable text-nowrap area-photoinspection">
<div id="photoInspection_Table_0_wrapper--${pageName}" class="dataTables_wrapper dt-bootstrap5 no-footer">
<div id="photoInspection-responsive--${pageName}" class="table-responsive ox-scroll oy-scroll h-px-200">
<table id="photoInspection_Table_0--${pageName}"
class="table-layout-fixed datatables-ajax table table-bordered dataTable no-footer">
<thead class="sticky-thead">
<tr data-by="by--${pageName}" data-by-output="byOutput--${pageName}"
data-main-option="mainOption--${pageName}" data-sub-option="subOption--${pageName}">
<th style="width: 80px;">No.</th>
<th onclick="searchFromGridTitle('CRDN_YMD','단속일자','ymd','');"
style="width: 180px;">단속일시</th>
<th onclick="searchFromGridTitle('VHRNO',this.innerText,'match','part');"
style="width: 120px;">차량번호</th>
<th style="width: 100px;" class="text-orange">위반건수</th>
<th style="width: 100px;" class="text-orange">검사결과</th>
<th style="width: 250px;" class="text-orange">처리방법</th>
<th onclick="searchFromGridTitle('CRDN_STDG_NM',this.innerText,'match','perfect');"
style="width: 100px;">위반동</th>
<th onclick="searchFromGridTitle('CRDN_PLC',this.innerText,'match','part');"
style="width: 300px;">단속장소</th>
<th onclick="searchFromGridTitle('ATCH_FILE_CNT',this.innerText,'match','perfect');"
style="width: 100px;">사진매수</th>
<th onclick="searchFromGridTitle('CRDN_STTS_CD',this.innerText,'codeValue','FIM010');"
style="width: 120px;">처리상태</th>
<th onclick="searchFromGridTitle('FFNLG_CRDN_AMT',this.innerText,'match','perfect');"
style="width: 100px;">원금액</th>
<th onclick="searchFromGridTitle('ADVNTCE_AMT',this.innerText,'match','perfect');"
style="width: 100px;">감경금액</th>
<th onclick="searchFromGridTitle('CRDN_INPT_SE_CD',this.innerText,'codeValue','FIM003');"
style="width: 120px;">자료출처</th>
<th class="dummy-th"></th>
</tr>
</thead>
<tbody id="photoInspectionTbody--${pageName}"></tbody>
<template id="photoInspectionRow--${pageName}">
<tr data-key="{CRDN_ID}">
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{ROW_NUM}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{CRDN_YMD_TM}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{VHRNO}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{CRDN_CNT}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{INSP_RSLT}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{PRCS_MTHD}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{CRDN_STDG_NM}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start text-truncate"
style="max-width:500px;">{CRDN_PLC}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{ATCH_FILE_CNT}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{CRDN_STTS_CD}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-end">{FFNLG_CRDN_AMT}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-end">{ADVNTCE_AMT}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{CRDN_INPT_SE_CD}</td>
<td class="dummy-td"></td>
</tr>
</template>
<template id="photoInspectionNotFound--${pageName}">
<tr class="odd">
<td valign="top" colspan="14" class="dataTables_empty text-center">
단속 정보를 찾지 못했습니다.
</td>
</tr>
</template>
</table>
</div>
</div>
</div>
<div class="area-photoinspection h-px-200">
선택자료
<strong id="curDataVhrno--${pageName}"></strong>
<div id="curDataFiles--${pageName}" class="ox-scroll d-flex w-100 h-px-175 bg-bordergray">
</div>
</div>
<div class="area-photoinspection h-px-200">
비교자료(선택자료의 다음 자료가 보여집니다.)
<strong id="nextDataVhrno--${pageName}"></strong>
<div id="nextDataFiles--${pageName}" class="ox-scroll d-flex w-100 h-px-175 bg-bordergray">
</div>
</div>
<span class="area-samevehicleinspection">
<div class="d-flex justify-content-evenly min-w-px-1400">
<div class="card-datatable text-nowrap d-inline-flex">
<div id="sameVehicleInspectionMain_Table_0_wrapper--${pageName}"
class="dataTables_wrapper dt-bootstrap5 no-footer">
<div id="sameVehicleInspectionMain-responsive--${pageName}"
class="table-responsive ox-scroll oy-scroll h-px-400 w-px-350">
<table id="sameVehicleInspectionMain_Table_0--${pageName}"
class="table-layout-fixed datatables-ajax table table-bordered dataTable no-footer">
<thead class="sticky-thead">
<tr data-by="by--${pageName}" data-by-output="byOutput--${pageName}"
data-main-option="mainOption--${pageName}" data-sub-option="subOption--${pageName}">
<th onclick="searchFromGridTitle('VHRNO',this.innerText,'match','part');"
style="width:120px">차량번호</th>
<th onclick="searchFromGridTitle('CRDN_STDG_NM',this.innerText,'match','perfect');"
style="width:100px">단속동</th>
<th class="text-orange"
style="width:100px">단속건수</th>
<th class="dummy-th"></th>
</tr>
</thead>
<tbody id="sameVehicleInspectionMainTbody--${pageName}"></tbody>
<template id="sameVehicleInspectionMainRow--${pageName}">
<tr data-key="{CRDN_ID_LIST}">
<td onclick="{onclick}" class="text-center">{VHRNO}</td>
<td onclick="{onclick}" class="text-center">{CRDN_STDG_NM}</td>
<td onclick="{onclick}" class="text-center">{CRDN_CNT}</td>
<td class="dummy-td"></td>
</tr>
</template>
<template id="sameVehicleInspectionMainNotFound--${pageName}">
<tr class="odd">
<td valign="top" colspan="4" class="dataTables_empty text-center">
단속 정보를 찾지 못했습니다.
</td>
</tr>
</template>
</table>
</div>
</div>
</div>
<div class="card-datatable text-nowrap d-inline-flex ms-3">
<div id="sameVehicleInspectionSub_Table_0_wrapper--${pageName}" class="dataTables_wrapper dt-bootstrap5 no-footer">
<div id="sameVehicleInspectionSub-responsive--${pageName}"
class="table-responsive ox-scroll oy-scroll h-px-400 w-px-1000">
<table id="sameVehicleInspectionSub_Table_0--${pageName}"
class="table-layout-fixed datatables-ajax table table-bordered dataTable no-footer">
<thead class="sticky-thead">
<tr data-by="by--${pageName}" data-by-output="byOutput--${pageName}"
data-main-option="mainOption--${pageName}" data-sub-option="subOption--${pageName}">
<th onclick="searchFromGridTitle('CRDN_YMD','단속일자','ymd','');"
style="width:180px">단속일시</th>
<th onclick="searchFromGridTitle('CRDN_INPT_SE_CD',this.innerText,'codeValue','FIM003');"
style="width:120px">자료출처</th>
<th onclick="searchFromGridTitle('TEAM_NM',this.innerText,'match','perfect');"
style="width:120px">단속조</th>
<th onclick="searchFromGridTitle('VHRNO',this.innerText,'match','part');"
style="width:120px">차량번호</th>
<th onclick="searchFromGridTitle('CRDN_STDG_NM',this.innerText,'match','perfect');"
style="width:120px">단속동</th>
<th onclick="searchFromGridTitle('CRDN_PLC',this.innerText,'match','part');"
style="width:120px">단속장소</th>
<th onclick="searchFromGridTitle('CRDN_STTS_CD',this.innerText,'codeValue','FIM010');"
style="width:120px">처리상태</th>
<th onclick="searchFromGridTitle('FFNLG_CRDN_AMT',this.innerText,'match','perfect');"
style="width:120px">금액</th>
<th onclick="searchFromGridTitle('RTPYR_NM',this.innerText,'match','part');"
style="width:120px">성명</th>
<th style="width:160px">주민번호</th>
<th class="dummy-th"></th>
</tr>
</thead>
<tbody id="sameVehicleInspectionSubTbody--${pageName}"></tbody>
<template id="sameVehicleInspectionSubRow--${pageName}">
<tr data-key="{CRDN_ID}">
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{CRDN_YMD_TM}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{CRDN_INPT_SE_CD}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{TEAM_NM}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{VHRNO}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{CRDN_STDG_NM}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start text-truncate"
style="max-width:500px;min-width: 300px;">{CRDN_PLC}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{CRDN_STTS_CD}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-end">{FFNLG_CRDN_AMT}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{RTPYR_NM}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center privacy-cell">
<span>{RTPYR_NO}</span>
<span>************</span>
</td>
<td class="dummy-td"></td>
</tr>
</template>
<template id="sameVehicleInspectionSubNotFound--${pageName}">
<tr class="odd">
<td valign="top" colspan="10" class="dataTables_empty text-center">단속 정보를 찾지 못했습니다.</td>
</tr>
</template>
</table>
</div>
</div>
</div>
</div>
</span>
</div>
</div>
<div class="content-backdrop fade"></div>
</div>
<script>
LoadScript("inspectionScript","/resources/js/fims/crdn/inspection.js");
/**************************************************************************
* Global Variable
**************************************************************************/
var FIM002 = new CommonCodes(${FIM002});
var FIM003 = new CommonCodes(${FIM003});
var FIM010 = new CommonCodes(${FIM010});
var FIM026 = new CommonCodes(${FIM026});
pageObject["${pageName}"] = {};
$(document).ready(function(){
var $P = pageObject["${pageName}"];
/**************************************************************************
* DatasetControl
**************************************************************************/
//단속사진검사 datasetControl 인스턴스
$P.photoInspectionControl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.CRDN_ID : "",
urls : {
load : ""
},
formats: {
CRDN_YMD_TM : datetimeFormat,
CRDN_INPT_SE_CD : FIM003,
CRDN_STTS_CD : FIM010,
FFNLG_CRDN_AMT : numberFormat,
ADVNTCE_AMT : numberFormat
}
});
$P.photoInspectionControl.defaultFetchSize = FETCH_XS;
$P.photoInspectionControl.query = { pageNum : 1, fetchSize : $P.photoInspectionControl.defaultFetchSize };
$P.photoInspectionControl.beforeCurrent = null;
//동일차량검사 datasetControl 인스턴스
$P.sameVehicleMainControl = new DatasetControl({
dataGetter : obj => obj["List"], appendData:true,
keymapper : info => info ? info.CRDN_ID_LIST : "",
urls : {
load : ""
},
formats: {
CRDN_CNT : numberFormat,
FFNLG_CRDN_AMT : numberFormat
}
});
$P.sameVehicleMainControl.defaultFetchSize = FETCH_XS;
$P.sameVehicleMainControl.query = { pageNum : 1, fetchSize : $P.sameVehicleMainControl.defaultFetchSize };
$P.sameVehicleMainControl.beforeCurrent = null;
$P.sameVehicleSubControl = new DatasetControl({
dataGetter : obj => obj["List"],
keymapper : info => info ? info.CRDN_ID : "",
urls : {
load : ""
},
formats: {
CRDN_YMD_TM : datetimeFormat,
CRDN_INPT_SE_CD : FIM003,
CRDN_STTS_CD : FIM010,
FFNLG_CRDN_AMT : numberFormat
}
});
$P.photoInspectionControl.getNext = (key) => {
var ds = $P.photoInspectionControl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == key);
if(ds.length > index+1){
return ds[index+1];
} else {
return null;
}
}
/**************************************************************************
* Dataset.on
**************************************************************************/
$P.photoInspectionControl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate("photoInspection");
var trs = Apply.fromDataset.getTbody($P.photoInspectionControl.dataset, t.found, t.notFound, t.replacer);
$P.renderInspectionDataList(obj["Total"], $P.photoInspectionControl.dataset.length, trs, "photoInspection", option);
Apply.fromDataset.paging($P.photoInspectionControl.dataset, obj, "photoInspectionPaging--${pageName}");
};
$P.photoInspectionControl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.photoInspectionControl.dataset, dataItem, $("#photoInspectionTbody--${pageName}")[0]);
var dataKey = "";
var curDataVhrno = "";
var nextDataKey = "";
var nextDataVhrno = "";
if(!$P.photoInspectionControl.dataset.empty){
dataKey = $P.photoInspectionControl.dataset.getKey(dataItem);
curDataVhrno = $P.photoInspectionControl.dataset.getData(dataKey)["VHRNO"];
var nextData = $P.photoInspectionControl.getNext(dataKey);
nextDataKey = nextData != null ? nextData.CRDN_ID : "";
nextDataVhrno = nextData != null ? nextData.VHRNO : "";
}
$P.showPhoto(dataKey,nextDataKey,curDataVhrno,nextDataVhrno);
}
$P.sameVehicleMainControl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate("sameVehicleInspectionMain");
var trs = Apply.fromDataset.getTbody($P.sameVehicleMainControl.dataset, t.found, t.notFound, t.replacer);
$P.renderInspectionDataList(obj["Total"], $P.sameVehicleMainControl.dataset.length, trs, "sameVehicleInspectionMain", option);
Apply.fromDataset.paging($P.sameVehicleMainControl.dataset, obj, "sameVehicleInspectionMainPaging--${pageName}");
};
$P.sameVehicleMainControl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.sameVehicleMainControl.dataset, dataItem, $("#sameVehicleInspectionMainTbody--${pageName}")[0]);
if(dataItem){
$P.searchDetailInspectionDataList(dataItem.data["CRDN_ID_LIST"]);
} else {
$("#sameVehicleInspectionSubTbody--${pageName}").html("");
}
}
$P.sameVehicleSubControl.dataset.onDatasetChange = (obj, option) => {
var t = $P.getGridTemplate("sameVehicleInspectionSub");
var trs = Apply.fromDataset.getTbody($P.sameVehicleSubControl.dataset, t.found, t.notFound, t.replacer);
$P.renderInspectionDataList(obj["Total"], $P.sameVehicleSubControl.dataset.length, trs, "sameVehicleInspectionSub", option);
};
$P.sameVehicleSubControl.dataset.onCurrentChange = (dataItem) => {
Apply.fromDataset.currentRow($P.sameVehicleSubControl.dataset, dataItem, $("#sameVehicleInspectionSubTbody--${pageName}")[0]);
};
/**************************************************************************
* pageObject.function
**************************************************************************/
$P.fnReset = () => {
var searchForm = $("#frmSearch--${pageName}");
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); });
$("#byOutput--${pageName}").val("동적 검색");
$("#schRgtrNm--${pageName}").prop("readonly", true); // 사용자 이름
$('#schCrdnYmdFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-7).date);
$('#schCrdnYmdTo--${pageName}').datepicker('setDate', TODAY());
$P.photoInspectionControl.dataset.setData([]);
$P.sameVehicleMainControl.dataset.setData([]);
};
$P.fnResetAndChangeBiz = (taskSeCd) => {
$P.fnReset();
$P.photoInspectionControl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn02/020/list.do");
$P.sameVehicleMainControl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn02/020/list.do");
$P.sameVehicleSubControl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn02/020/list.do");
var clsForTask = taskSeCd.toLowerCase();
//업무별 조회조건
renderForTask("frmSearch--${pageName}", clsForTask);
//업무별 버튼
renderForTask("gridbuttonArea--${pageName}", clsForTask);
//버튼 이벤트 재매핑
$("#btnOpenOverTime--${pageName}").off("click");
$("#btnOpenOverTime--${pageName}").on("click", () => $P.openOverTimePop());
$('#btnPhotoInspection--${pageName}').trigger("click");
}
$P.getParams = () => {
var formFields = new FimsFormFields("#frmSearch--${pageName}");
var data = formFields.get();
if($P.currentDisplay == "photoInspection"){
data.fetchSize = $P.photoInspectionControl.defaultFetchSize;
} else if($P.currentDisplay == "sameVehicleInspection"){
data.fetchSize = $P.sameVehicleMainControl.defaultFetchSize;
}
return data;
}
$P.searchInspectionList = () => {
switch ($P.currentDisplay) {
case "photoInspection":
$P.photoInspectionControl.query = $P.getParams();
$P.photoInspectionControl.query.inspectionDataType = "photo";
$P.photoInspectionControl.load(1);
break;
case "sameVehicleInspection":
$P.sameVehicleMainControl.query = $P.getParams();
$P.sameVehicleMainControl.query.inspectionDataType = "sameVehicleMain";
$P.sameVehicleMainControl.load(1);
break;
default: break;
}
}
$P.searchDetailInspectionDataList = (dataKey) => {
$P.sameVehicleSubControl.query = {};
$P.sameVehicleSubControl.query.inspectionDataType = "sameVehicleSub";
$P.sameVehicleSubControl.query.crdnIds = dataKey;
$P.sameVehicleSubControl.query.taskSeCd = $P.sameVehicleMainControl.query.taskSeCd;
$P.sameVehicleSubControl.load(0);
}
$P.scrollInspectionDataList = () => {
switch ($P.currentDisplay) {
case "photoInspection":
$P.photoInspectionControl.load($P.photoInspectionControl.query.pageNum + 1);
break;
case "sameVehicleInspection":
$P.sameVehicleMainControl.load($P.sameVehicleMainControl.query.pageNum + 1);
break;
default: break;
}
}
$P.refreshInspectionList = () => {
switch ($P.currentDisplay) {
case "photoInspection":
$P.photoInspectionControl.beforeCurrent = {
key : $P.photoInspectionControl.dataset.getCurrent()["CRDN_ID"],
index : $P.photoInspectionControl.dataset.getCurrent()["ROW_NUM"] - 1
};
Apply.fromDatasetControl.reload($P.photoInspectionControl).then((resp)=>{
Apply.toDataset.set($P.photoInspectionControl.dataset, resp);
$P.photoInspectionControl.dataset.onDatasetChange(resp, {reloaded : true});
if($P.photoInspectionControl.beforeCurrent != null){
let beforeCurrentKey = $P.photoInspectionControl.beforeCurrent.key;
let beforeCurrentIndex = $P.photoInspectionControl.beforeCurrent.index;
$P.photoInspectionControl.beforeCurrent = null;
if(!$P.photoInspectionControl.dataset.empty){
var info = $P.photoInspectionControl.dataset.getData(beforeCurrentKey);
if(info != null){
$P.photoInspectionControl.dataset.setCurrent(beforeCurrentKey, true);
} else {
if(beforeCurrentIndex > ($P.photoInspectionControl.dataset.length - 1)){
info = $P.photoInspectionControl.dataset.getDataset()[$P.photoInspectionControl.dataset.length - 1];
} else {
info = $P.photoInspectionControl.dataset.getDataset()[beforeCurrentIndex];
}
$P.photoInspectionControl.dataset.setCurrent(info["CRDN_ID"], true);
}
}
}
});
break;
case "sameVehicleInspection":
$P.sameVehicleMainControl.beforeCurrent = {
key : $P.sameVehicleMainControl.dataset.getCurrent()["CRDN_ID_LIST"],
index : $P.sameVehicleMainControl.dataset.getCurrent()["ROW_NUM"] - 1
};
Apply.fromDatasetControl.reload($P.sameVehicleMainControl).then((resp)=>{
Apply.toDataset.set($P.sameVehicleMainControl.dataset, resp);
$P.sameVehicleMainControl.dataset.onDatasetChange(resp, {reloaded : true});
if($P.sameVehicleMainControl.beforeCurrent != null){
var beforeCurrentKey = $P.sameVehicleMainControl.beforeCurrent.key;
var beforeCurrentIndex = $P.sameVehicleMainControl.beforeCurrent.index;
$P.sameVehicleMainControl.beforeCurrent = null;
if(!$P.sameVehicleMainControl.dataset.empty){
var info = $P.sameVehicleMainControl.dataset.getData(beforeCurrentKey);
if(info != null){
$P.sameVehicleMainControl.dataset.setCurrent(beforeCurrentKey,true);
} else {
if(beforeCurrentIndex > ($P.sameVehicleMainControl.dataset.length - 1)){
info = $P.sameVehicleMainControl.dataset.getDataset()[$P.sameVehicleMainControl.dataset.length - 1];
} else {
info = $P.sameVehicleMainControl.dataset.getDataset()[beforeCurrentIndex];
}
$P.sameVehicleMainControl.dataset.setCurrent(info["CRDN_ID_LIST"],true);
}
}
}
});
break;
default: break;
}
}
$P.fnExcelDown = async() => {
if($P.currentDisplay == "photoInspection"){
if($P.photoInspectionControl.dataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
var cellDefs = getCellDefs(
$("#photoInspection_Table_0--${pageName} thead th").not(".dummy-th").not(":eq(0)"),
$($("#photoInspectionRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)")
);
$P.photoInspectionControl.query.cellDefs = cellDefs;
$P.photoInspectionControl.download();
} else {
if($P.sameVehicleMainControl.dataset.empty){
alert("조회된 자료가 없습니다.");
return;
}
var excelTarget = await dialog2("저장할 자료를 선택하세요.","",
[{key:"main",value:"단속건수 엑셀저장"},{key:"sub",value:"상세내역 엑셀저장"},{key:"cancel",value:"취소"}]);
if(excelTarget == "main"){
var cellDefs = getCellDefs(
$("#sameVehicleInspectionMain_Table_0--${pageName} thead th").not(".dummy-th"),
$($("#sameVehicleInspectionMainRow--${pageName}")[0].content).find("td").not(".dummy-td")
);
$P.sameVehicleMainControl.query.cellDefs = cellDefs;
$P.sameVehicleMainControl.download();
} else if(excelTarget == "sub"){
var cellDefs = getCellDefs(
$("#sameVehicleInspectionSub_Table_0--${pageName} thead th").not(".dummy-th"),
$($("#sameVehicleInspectionSubRow--${pageName}")[0].content).find("td").not(".dummy-td"),
getCellDefsForPrivacyCell
);
$P.sameVehicleSubControl.query.cellDefs = cellDefs;
$P.sameVehicleSubControl.download();
}
}
}
$P.getGridTemplate = (gridType) => {
var notFound;
var found;
var replacer;
switch (gridType) {
case "photoInspection":
notFound = [document.getElementById("photoInspectionNotFound--${pageName}").innerHTML]
found = document.getElementById("photoInspectionRow--${pageName}").innerHTML;
replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','photoInspection');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','photoInspection');");
break;
case "sameVehicleInspectionMain":
notFound = [document.getElementById("sameVehicleInspectionMainNotFound--${pageName}").innerHTML];
found = document.getElementById("sameVehicleInspectionMainRow--${pageName}").innerHTML;
replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickInspectionDataList('" + dataItem.getValue("CRDN_ID_LIST") + "','sameVehicleInspectionMain');");
break;
case "sameVehicleInspectionSub":
notFound = [document.getElementById("sameVehicleInspectionSubNotFound--${pageName}").innerHTML]
found = document.getElementById("sameVehicleInspectionSubRow--${pageName}").innerHTML;
replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','sameVehicleInspectionSub');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickInspectionDataList('" + dataItem.getValue("CRDN_ID") + "','sameVehicleInspectionSub');");
break;
}
return {
found : found,
notFound : notFound,
replacer : replacer
};
}
$P.renderInspectionDataList = (total, listLength, trs, renderDataType, option) => {
let noMore = (listLength >= total);
switch (renderDataType) {
case "photoInspection":
var initScroll = ($P.photoInspectionControl.query.pageNum < 2);
if(option != null && option.reloaded){
initScroll = false;
}
$("#photoInspection-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore);
break;
case "sameVehicleInspectionMain":
var initScroll = ($P.sameVehicleMainControl.query.pageNum < 2);
if(option != null && option.reloaded){
initScroll = false;
}
$("#sameVehicleInspectionMain-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore);
break;
case "sameVehicleInspectionSub":
$("#sameVehicleInspectionSubTbody--${pageName}").html(trs);
break;
default: break;
}
//보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked"));
}
$P.clickInspectionDataList = (dataKey, gridType) => {
switch (gridType) {
case "photoInspection":
if(dataKey != ""){
$("#photoInspectionTbody--${pageName}").setCurrentRow(dataKey);
Apply.toDataset.current($P.photoInspectionControl.dataset, dataKey);
}
var curDataVhrno = $P.photoInspectionControl.dataset.getData(dataKey)["VHRNO"];
var nextData = $P.photoInspectionControl.getNext(dataKey);
var nextDataKey = nextData != null ? nextData.CRDN_ID : "";
var nextDataVhrno = nextData != null ? nextData.VHRNO : "";
$P.showPhoto(dataKey,nextDataKey,curDataVhrno,nextDataVhrno);
break;
case "sameVehicleInspectionMain":
if(dataKey == ""){
return;
}
$("#sameVehicleInspectionMainTbody--${pageName}").setCurrentRow(dataKey);
Apply.toDataset.current($P.sameVehicleMainControl.dataset, dataKey);
$P.searchDetailInspectionDataList(dataKey);
break;
case "sameVehicleInspectionSub":
if(dataKey == ""){
return;
}
$("#sameVehicleInspectionSubTbody--${pageName}").setCurrentRow(dataKey);
Apply.toDataset.current($P.sameVehicleSubControl.dataset, dataKey);
break;
}
}
$P.dblclickInspectionDataList = (dataKey) => {
var taskSeCd = $("#frmSearch--${pageName} input[name='taskSeCd']:checked").val();
var dialogUrl = wctx.url("/sprt/sprt02/010/main.do");
let params = {
callControlName : "pageObject['${pageName}'].photoInspectionControl"
, crdnId : dataKey
}
ajax.get({
url : dialogUrl,
data : params,
success : (resp) => {
dialog.open({
id : "totalInfoMainDialog",
title : "개별총정보", size : "xxl", content : resp,
init : () => {}
});
}
});
}
$P.showPhoto = (dataKey, nextDataKey, curDataVhrno, nextDataVhrno) => {
if(dataKey == ""){
$("#curDataVhrno--${pageName}").html("");
$("#nextDataVhrno--${pageName}").html("");
$("#curDataFiles--${pageName}").html("");
$("#nextDataFiles--${pageName}").html("");
return;
}
$("#curDataVhrno--${pageName}").html(curDataVhrno);
$("#nextDataVhrno--${pageName}").html(nextDataVhrno);
ajax.get({
url:"file/list.do",
data: {
infoType : "100",
infoKeys : [dataKey, nextDataKey],
fetchSize : 0
},
success : (resp) => {
var fileList = resp.fileList;
var currentDataFileList = fileList.filter(x => x.INF_KEY == dataKey);
var nextDataFileList = fileList.filter(x => x.INF_KEY == nextDataKey);
$("#curDataFiles--${pageName}").html("");
$("#nextDataFiles--${pageName}").html("");
currentDataFileList.forEach(function(item, index, array){
var output = fnMakeImgTagForInspection(item.URL, item.FILE_NM,"cur"+item.FILE_ID+'${pageName}',item.MOSAIC);
$("#curDataFiles--${pageName}").append(output);
});
nextDataFileList.forEach(function(item, index, array){
var output = fnMakeImgTagForInspection(item.URL, item.FILE_NM,"next"+item.FILE_ID+'${pageName}',item.MOSAIC);
$("#nextDataFiles--${pageName}").append(output);
});
}
});
}
$P.openLevyExclPop = (levyExclSeCd) => {
var info = "";
if ($P.currentDisplay == "photoInspection") {
info = $P.photoInspectionControl.dataset.getCurrent("item");
} else if ($P.currentDisplay == "sameVehicleInspection") {
info = $P.sameVehicleSubControl.dataset.getCurrent("item");
} else {
return;
}
if (info == undefined || info == "") {
return;
}
var params = {
"crdnId" : info.data.CRDN_ID,
"levyExclSeCd" : levyExclSeCd,
"openerPageName" : "${pageName}",
"savedCallbackFuncName" : "pageObject['${pageName}']['popupSavedCallback']",
"callPurpose" : "create"
};
var taskSeCd = $("#frmSearch--${pageName} [name='taskSeCd']:checked").val();
ajax.get({
url : wctx.url(taskSeCd + "/excl/excl01/020/info.do"),
data : params,
success : (resp) => {
if((typeof resp) != "string"){
dialog.alert({
content : resp.message,
init : function(){
focusClose();
}
});
return;
}
dialog.open({
id : "levyExclDialog--${pageName}",
title : "부과제외 정보",
content : resp,
size : "md",
init : () => {},
onClose : () => {}
});
}
});
};
$P.openOverTimePop = () => {
if ($P.currentDisplay != "photoInspection") {
return;
}
var info = $P.photoInspectionControl.dataset.getCurrent("item");
if (info == undefined || info == "") {
return;
}
var params = {
"crdnId" : info.data.CRDN_ID,
"openerPageName" : "${pageName}",
"savedCallbackFuncName" : "pageObject['${pageName}']['popupSavedCallback']"
};
ajax.get({
url : wctx.url("/PVS/crdn/crdn02/050/info.do"),
data : params,
success : (resp) => {
if((typeof resp) != "string"){
dialog.alert({
content : resp.message,
init : function(){
focusClose();
}
});
return;
}
dialog.open({
id : "overTimeProcessDialog--${pageName}",
title : "2시간 초과 처리",
content : resp,
size : "lg",
init : () => {},
onClose : () => {}
});
}
});
}
$P.popupSavedCallback = (saved) => {
if($("#levyExclDialog--${pageName}").length > 0){
dialog.close("levyExclDialog--${pageName}");
}
if(saved){
$P.refreshInspectionList();
}
}
// 사용자검색 callback
$P.callbackFindUser = (userId, userNm) => {
$("#schRgtrCd--${pageName}").val(userId); // 사용자 ID
$("#schRgtrNm--${pageName}").val(userNm); // 사용자 명
}
// 사용자검색 버튼 클릭 이벤트
$P.fnGetFindUser = () => {
let params = {
openerPageName: "${pageName}"
, callbackFuncName: "pageObject['${pageName}']['callbackFindUser']"
}
ajax.get({
url: wctx.url("/user/user02/010/main.do") + "?openerPageName=${pageName}"
, data: params || {}
, success: resp => {
dialog.open({
id: "userDialog--${pageName}"
, title: "사용자 검색"
, content: resp
, size: "lg"
, init: () => { setDialogZindex(); }
});
}
});
}
/**************************************************************************
* element.on
**************************************************************************/
$('#btnReset--${pageName}').on('click', () => $P.fnReset()); //초기화버튼
$('#btnPhotoInspection--${pageName}').on('click', () => {
$(".area-photoinspection").show();
$(".area-samevehicleinspection").hide();
$('#btnPhotoInspection--${pageName}').addClass("active");
$('#btnSameVehicleInspection--${pageName}').removeClass("active");
$P.currentDisplay = "photoInspection";
});
$('#btnSameVehicleInspection--${pageName}').on('click', () => {
$(".area-samevehicleinspection").show();
$(".area-photoinspection").hide();
$('#btnSameVehicleInspection--${pageName}').addClass("active");
$('#btnPhotoInspection--${pageName}').removeClass("active");
$P.currentDisplay = "sameVehicleInspection";
});
$('#btnSearch--${pageName}').on('click', () => $P.searchInspectionList()); //검색버튼
// 동적검색에서 엔터(Enter) 키를 누르면 검색한다.
$("#term--${pageName}").onEnterPress($P.searchInspectionList);
$('#btnExcel--${pageName}').on('click', () => $P.fnExcelDown());
$("#btnFindUser--${pageName}").on("click", () => $P.fnGetFindUser()); // 사용자 검색
$("#btnInstLevyExcl--${pageName}").on("click", () => $P.openLevyExclPop("1"));
fnMakeResizableTable($("#photoInspection-responsive--${pageName}")[0]);
fnMakeResizableTable($("#sameVehicleInspectionMain-responsive--${pageName}")[0]);
fnMakeResizableTable($("#sameVehicleInspectionSub-responsive--${pageName}")[0]);
//스크롤 테이블
fnMakeScrollableTable($("#photoInspection-responsive--${pageName}")[0], $P.scrollInspectionDataList);
fnMakeScrollableTable($("#sameVehicleInspectionMain-responsive--${pageName}")[0], $P.scrollInspectionDataList);
/**************************************************************************
* 초기화
**************************************************************************/
initDatepicker("frmSearch--${pageName}"); //달력 초기화
initDetailSearchButton("frmSearch--${pageName}");
var defaultBizValue = $("#layout-navbar input[name='taskSeCd']:checked").val();
$("#frmSearch--${pageName} input[name='taskSeCd'][value='" + defaultBizValue + "']").prop("checked",true);
$P.fnResetAndChangeBiz(defaultBizValue);
//보안모드
fn_securityModeToggle($("#securityMode--top").is(":checked"));
$("#frmSearch--${pageName} input[name='taskSeCd']").each(function(i) {
$(this).prop("disabled", "true");
});
});
</script>