fix: 폐기보고통계 - 마약류구분별통계

dev
Jonguk. Lim 4 months ago
parent ee4e4bd170
commit 4778d74056

@ -0,0 +1,103 @@
package cokr.xit.adds.nims;
import cokr.xit.foundation.component.QueryRequest;
/**
*
*/
public class DsuseMgtStatisticsQuery extends QueryRequest{
private static final long serialVersionUID = 1L;
//검색조건
private String schSggCd; // 관활 관청
private String schDateFrom; // 검색 일자 시작
private String schDateTo; // 검색 일자 종료
private String schBsshCd; // 업체코드
private String schSttsCd; // 진행상태코드
private String deptCd; // 부서 코드
private String userId; // 사용자 ID
private String useYn; // 사용 여부
private String nimsRptYn; // NIMS 보고 여부
public String getNimsRptYn() {
return ifEmpty(nimsRptYn, () -> null);
}
public <T extends DsuseMgtStatisticsQuery> T setNimsRptYn(String nimsRptYn) {
this.nimsRptYn = nimsRptYn;
return self();
}
public String getSchSggCd() {
return ifEmpty(schSggCd, () -> null);
}
public <T extends DsuseMgtStatisticsQuery> T setSchSggCd(String schSggCd) {
this.schSggCd = schSggCd;
return self();
}
public String getSchDateFrom() {
return ifEmpty(schDateFrom, () -> null);
}
public <T extends DsuseMgtStatisticsQuery> T setSchDateFrom(String schDateFrom) {
this.schDateFrom = schDateFrom;
return self();
}
public String getSchDateTo() {
return ifEmpty(schDateTo, () -> null);
}
public <T extends DsuseMgtStatisticsQuery> T setSchDateTo(String schDateTo) {
this.schDateTo = schDateTo;
return self();
}
public String getSchBsshCd() {
return ifEmpty(schBsshCd, () -> null);
}
public <T extends DsuseMgtStatisticsQuery> T setSchBsshCd(String schBsshCd) {
this.schBsshCd = schBsshCd;
return self();
}
public String getSchSttsCd() {
return ifEmpty(schSttsCd, () -> null);
}
public <T extends DsuseMgtStatisticsQuery> T setSchSttsCd(String schSttsCd) {
this.schSttsCd = schSttsCd;
return self();
}
public String getdeptCd() {
return ifEmpty(deptCd, () -> null);
}
public <T extends DsuseMgtStatisticsQuery> T setdeptCd(String deptCd) {
this.deptCd = deptCd;
return self();
}
public String getuserId() {
return ifEmpty(userId, () -> null);
}
public <T extends DsuseMgtStatisticsQuery> T setuserId(String userId) {
this.userId = userId;
return self();
}
public String getuseYn() {
return ifEmpty(useYn, () -> null);
}
public <T extends DsuseMgtStatisticsQuery> T setuseYn(String useYn) {
this.useYn = useYn;
return self();
}
}

@ -0,0 +1,23 @@
package cokr.xit.adds.nims.dao;
import java.util.List;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import cokr.xit.adds.nims.DsuseMgtStatisticsQuery;
import cokr.xit.foundation.component.AbstractMapper;
import cokr.xit.foundation.data.DataObject;
/**
* DAO
*/
@Mapper("dsuseMgtStatisticsMapper")
public interface DsuseMgtStatisticsMapper extends AbstractMapper {
/**
* / and /
* @return / and /
*/
List<DataObject> selectDsuseMgtNcrdAndPrtmStatistics(DsuseMgtStatisticsQuery query);
}

@ -4,9 +4,12 @@ import java.util.List;
import cokr.xit.adds.nims.DsuseMgtDetailQuery;
import cokr.xit.adds.nims.DsuseMgtRsltQuery;
import cokr.xit.adds.nims.DsuseMgtStatisticsQuery;
import cokr.xit.foundation.data.DataObject;
public interface AddsNimsService {
List<DataObject> getDsuseMgtDetailList(DsuseMgtDetailQuery query);
List<DataObject> getDsuseMgtRsltImgList(DsuseMgtRsltQuery query);
List<DataObject> getDsuseMgtNcrdAndPrtmStatistics(DsuseMgtStatisticsQuery query);
}

@ -8,8 +8,10 @@ import org.springframework.stereotype.Service;
import cokr.xit.adds.nims.DsuseMgtDetailQuery;
import cokr.xit.adds.nims.DsuseMgtRsltQuery;
import cokr.xit.adds.nims.DsuseMgtStatisticsQuery;
import cokr.xit.adds.nims.dao.DsuseMgtDetailMapper;
import cokr.xit.adds.nims.dao.DsuseMgtRsltMapper;
import cokr.xit.adds.nims.dao.DsuseMgtStatisticsMapper;
import cokr.xit.adds.nims.service.AddsNimsService;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.foundation.data.DataObject;
@ -23,6 +25,9 @@ public class AddsNimsServiceBean extends AbstractServiceBean implements AddsNims
@Resource(name = "dsuseMgtRsltMapper")
private DsuseMgtRsltMapper dsuseMgtRsltMapper;
@Resource(name = "dsuseMgtStatisticsMapper")
private DsuseMgtStatisticsMapper dsuseMgtStatisticsMapper;
@Override
public List<DataObject> getDsuseMgtDetailList(DsuseMgtDetailQuery query){
return dsuseMgtDetailMapper.selectDsuseMgtDetailList(query);
@ -32,4 +37,9 @@ public class AddsNimsServiceBean extends AbstractServiceBean implements AddsNims
public List<DataObject> getDsuseMgtRsltImgList(DsuseMgtRsltQuery query) {
return dsuseMgtRsltMapper.selectDsuseMgtRsltImgList(query);
}
@Override
public List<DataObject> getDsuseMgtNcrdAndPrtmStatistics(DsuseMgtStatisticsQuery query) {
return dsuseMgtStatisticsMapper.selectDsuseMgtNcrdAndPrtmStatistics(query);
}
}

@ -43,6 +43,7 @@ import cokr.xit.adds.nims.DsuseMgtDetailQuery;
import cokr.xit.adds.nims.DsuseMgtDocQuery;
import cokr.xit.adds.nims.DsuseMgtReceiptQuery;
import cokr.xit.adds.nims.DsuseMgtRsltQuery;
import cokr.xit.adds.nims.DsuseMgtStatisticsQuery;
import cokr.xit.adds.nims.service.AddsNimsService;
import cokr.xit.adds.nims.service.DsuseMgtDocService;
import cokr.xit.adds.nims.service.DsuseMgtReceiptService;
@ -336,6 +337,20 @@ public class AddsNimsController extends ApplicationController {
// 보고 문서 관리
//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
// 폐기 관리 통계
//-------------------------------------------------------------------------------------------------
@RequestMapping(value = "/getDsuseMgtNcrdAndPrtmStatistics.do", name="마약/항정 and 중점/일반 별 통계")
public ModelAndView getDsuseMgtNcrdAndPrtmStatistics(DsuseMgtStatisticsQuery query) {
//query.setOrderBy("dsuse_de DESC, dsuse_mth_cd, dscdmng_id");
//setFetchSize(query);
return setCollectionInfo(new ModelAndView("jsonView"), addsNimsService.getDsuseMgtNcrdAndPrtmStatistics(query),"","");
// return addsNimsService.getDsuseMgtNcrdAndPrtmStatistics(query);
}
//-------------------------------------------------------------------------------------------------
// 보고 문서 관리
//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
@ -394,6 +409,16 @@ public class AddsNimsController extends ApplicationController {
mav.addObject("pageName", "dsuseMgtDoc");
return mav;
}
@RequestMapping(value = "/dsuseMgtStatistics.do", name="폐기관리 통계 메인")
public ModelAndView dsuseMgtStatistics() {
ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtStatistics-main");
setCmmCode("ADDS11", mav);
List<DataObject> deptList = sggDeptService.getDepartmentList(new DepartmentQuery());
mav.addObject("DEPTList", deptList);
return mav.addObject("pageName", "dsuseMgtStatistics") /* View(jsp)에서 사용할 id 뒤에 붙일 suffix */;
}
//-------------------------------------------------------------------------------------------------
// menu 호출 처리
//-------------------------------------------------------------------------------------------------

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cokr.xit.adds.nims.dao.DsuseMgtStatisticsMapper">
<select id="selectDsuseMgtNcrdAndPrtmStatistics" parameterType="map" resultType="dataobject">
/* 마약/항정 and 중점/일반 별 통계 */
WITH tgt AS (
SELECT tdm.dept_cd
, IF(tpi.nrcd_se_nm = '대마', '1', '0') AS '대마'
, IF(tpi.nrcd_se_nm = '마약', '1', '0') AS '마약'
, IF(tpi.nrcd_se_nm = '한외마약', '1', '0') AS '한외마약'
, IF(tpi.nrcd_se_nm = '향정', '1', '0') AS '향정'
, IF(tpi.nrcd_se_nm = '향정제외', '1', '0') AS '향정제외'
, IF(tpi.nrcd_se_nm IS NULL, '1', '0') AS '기타'
, IF(tpi.prtm_se_nm = '비마약류', 1, 0) AS '비마약류'
, IF(tpi.prtm_se_nm = '일반관리대상', 1, 0) AS '일반관리대상'
, IF(tpi.prtm_se_nm = '중점관리대상', 1, 0) AS '중점관리대상'
, COUNT(tpi.prduct_cd) OVER(PARTITION BY tdm.dept_cd) AS TOTAL
FROM tb_dsuse_mgt tdm
JOIN tb_dsuse_mgt_dtl tdmd ON tdm.dscdmng_id = tdmd.dscdmng_id
JOIN tb_prduct_info tpi ON tdmd.prduct_cd = tpi.prduct_cd
)
SELECT T.*
, ROW_NUMBER() over (ORDER BY T.dept_cd) AS ROW_NUM
, IF(td.dept_nm IS NULL, T.dept_cd, dept_nm) AS dept_nm
FROM (SELECT tgt.dept_cd
, SUM(tgt.대마) AS '대마'
, SUM(tgt.마약) AS '마약'
, SUM(tgt.한외마약) AS '한외마약'
, SUM(tgt.향정) AS '향정'
, SUM(tgt.향정제외) AS '향정제외'
, SUM(tgt.기타) AS '기타'
, SUM(tgt.대마 + tgt.마약 + tgt.한외마약 + tgt.향정 + tgt.향정제외 + tgt.기타) AS '마약향정계'
, SUM(tgt.비마약류) AS '비마약류'
, SUM(tgt.일반관리대상) AS '일반관리대상'
, SUM(tgt.중점관리대상) AS '중점관리대상'
, SUM(tgt.비마약류 + tgt.일반관리대상 + tgt.중점관리대상) AS '중점일반계'
FROM tgt
GROUP BY tgt.dept_cd
UNION ALL
SELECT 'TOTAL' AS dept_cd
, SUM(tgt.대마) AS '대마'
, SUM(tgt.마약) AS '마약'
, SUM(tgt.한외마약) AS '한외마약'
, SUM(tgt.향정) AS '향정'
, SUM(tgt.향정제외) AS '향정제외'
, SUM(tgt.기타) AS '기타'
, SUM(tgt.대마 + tgt.마약 + tgt.한외마약 + tgt.향정 + tgt.향정제외 + tgt.기타) AS '마약향정계'
, SUM(tgt.비마약류) AS '비마약류'
, SUM(tgt.일반관리대상) AS '일반관리대상'
, SUM(tgt.중점관리대상) AS '중점관리대상'
, SUM(tgt.비마약류 + tgt.일반관리대상 + tgt.중점관리대상) AS '중점일반계'
FROM tgt
) T
LEFT JOIN tb_dept td
ON T.dept_cd = td.dept_cd
</select>
</mapper>

@ -0,0 +1,374 @@
<%@ 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>
<!-- Page Body -->
<div class="container-page-btn">
<button type="button" class="btn btn-outline-dark w-px-120" id="btnReset--${pageName}" title="초기화">
초기화
</button>
</div>
<form id="frmSearch--${pageName}" name="frmSearch">
<div class="container-search">
<div class="row g-1">
<div class="col-5">
<label class="form-label fw-bold form-search-title text-end" for="schSggCd--${pageName}">관할관청</label>
<select class="form-select" id="schSggCd--${pageName}" name="schSggCd" style="pointer-events: none;">
<option value="">전체</option>
<c:forEach items="${DEPTList}" var="item">
<option value="${item.DEPT_CD}">${item.DEPT_NM}</option>
</c:forEach>
</select>
</div>
<div class="col-7">
<label class="form-label fw-bold form-search-title text-end">폐기일자</label>
<span class="form-search-linebox" id="inputHdrDe">
<input type="text" class="form-control form-date" id="schDateFrom--${pageName}" name="schDateFrom" 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" id="schDateTo--${pageName}" name="schDateTo" data-fmt-type="day" autocomplete="off" title="종료 날짜 선택" />
<button type="button" class="bx bx-lg bx-calendar bg-white"></button>
</span>
<input type="checkbox" id="chkDsuseDe--${pageName}" name="chkDsuseDe" title="폐기일자 적용" style="align-items: baseline"/>&nbsp;<strong>폐기일자 적용</strong>
</div>
<!-- 업체명 -->
<div class="col-5">
<label class="form-label fw-bold form-search-title text-end" for="schBsshNm--${pageName}">업체명</label>
<input type="text" class="form-control w-px-160" id="schBsshNM--${pageName}" name="schBsshNm" data-map="bsshNm" autocomplete="off" readonly/>
<input type="hidden" id="schBsshCd--${pageName}" name="schBsshCd" data-map="bsshCd" autocomplete="off" />
<button type="button" class="btn btn-search w-px-120" id="btnBsshSearch--${pageName}" title="업체 검색">
업체 검색
</button>
</div>
<!-- 처리상태 -->
<div class="col-6">
<label class="form-label fw-bold form-search-title text-end" for="schSttsCd--${pageName}">처리상태</label>
<select class="form-select" id="schSttsCd--${pageName}" name="schSttsCd">
<option value="">전체</option>
<c:forEach items="${ADDS11}" var="item">
<option value="${item.code}">${item.value}</option>
</c:forEach>
</select>
</div>
<div class="col-1">
<button type="button" class="btn btn-search w-px-120" id="btnSearch--${pageName}" title="검색">
검색
</button>
</div>
</div>
</div>
</form>
<!-- 업무 버튼 및 건수 표시 -->
<div class="d-flex flex-row justify-content-between p-3">
<div>
<div class="input-group" id="DataTables_Table_0_length">
</div>
</div>
</div>
<!-- DataTables(그리드) -->
<div class="card-datatable text-nowrap">
<div class="dataTables_wrapper dt-bootstrap5 no-footer" id="DataTables_Table_0_wrapper--${pageName}">
<div class="table-responsive ox-scroll oy-scroll" style="height: 580px !important;" id="table-responsive--${pageName}">
<table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer" id="DataTables_Table_0--${pageName}" aria-describedby="DataTables_Table_0_info">
<thead class="sticky-thead">
<tr>
<th class="cmn text-center" style="width: 60px;" rowspan="2">NO.</th>
<th class="cmn" style="width: 170px;" rowspan="2">관할관청</th>
<th class="cmn" colspan="7">마약 / 향정 구분</th>
<th class="cmn" colspan="4">중점 / 일반 구분</th>
</tr>
<tr id="theadTr--${pageName}"
data-by="by--${pageName}" data-by-output="byOutput--${pageName}" data-main-option="mainOption--${pageName}" data-sub-option="subOption--${pageName}">
<%-- <th class="row-num" style="width: 60px;">No.</th>--%>
<%-- <th class="cmn" style="width: 170px;">관할관청</th>--%>
<th class="cmn" style="width: 90px;">대마</th>
<th class="cmn" style="width: 90px;">마약</th>
<th class="cmn" style="width: 90px;">한외마약</th>
<th class="cmn" style="width: 90px;">향정</th>
<th class="cmn" style="width: 90px;">향정제외</th>
<th class="cmn" style="width: 90px;">기타</th>
<th class="cmn" style="width: 90px;">계</th>
<th class="cmn" style="width: 90px;">비마약류</th>
<th class="cmn" style="width: 120px;">일반관리대상</th>
<th class="cmn" style="width: 120px;">중점관리대상</th>
<th class="cmn" style="width: 90px;">계</th>
</tr>
</thead>
<tbody id="tbody--${pageName}">
</tbody>
<template id="${infoPrefix}Row--${pageName}">
<tr data-key="{dept_cd}">
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{ROW_NUM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{dept_nm}</td>
<td class="text-end" onclick="{onclick}" ondblclick="{ondblclick}">{대마}</td>
<td class="text-end" onclick="{onclick}" ondblclick="{ondblclick}">{마약}</td>
<td class="text-end" onclick="{onclick}" ondblclick="{ondblclick}">{한외마약}</td>
<td class="text-end" onclick="{onclick}" ondblclick="{ondblclick}">{향정}</td>
<td class="text-end" onclick="{onclick}" ondblclick="{ondblclick}">{향정제외}</td>
<td class="text-end" onclick="{onclick}" ondblclick="{ondblclick}">{기타}</td>
<td class="text-end" onclick="{onclick}" ondblclick="{ondblclick}">{마약향정계}</td>
<td class="text-end" onclick="{onclick}" ondblclick="{ondblclick}">{비마약류}</td>
<td class="text-end" onclick="{onclick}" ondblclick="{ondblclick}">{일반관리대상}</td>
<td class="text-end" onclick="{onclick}" ondblclick="{ondblclick}">{중점관리대상}</td>
<td class="text-end" onclick="{onclick}" ondblclick="{ondblclick}">{중점일반계}</td>
</tr>
</template>
<template id="${infoPrefix}NotFound--${pageName}">
<tr class="odd">
<td valign="top" colspan="13" class="dataTables_empty text-center">${prefixName} 정보를 찾지 못했습니다.</td>
</tr>
</template>
</table>
</div>
</div>
</div>
<!-- / DataTables(그리드) -->
<div class="d-flex flex-row p-3 justify-content-between">
<label id="${infoPrefix}Paging--${pageName}PagingInfo" class="dataTables_info" role="status" aria-live="polite"></label>
<ul id="${infoPrefix}Paging--${pageName}" class="pagination pagination-primary" style="display: none;">
</ul>
</div>
<script>
<!--/ Page Body -->
/**************************************************************************
* Global Variable
**************************************************************************/
pageObject["${pageName}"] = {};
/**************************************************************************
* script 진입
**************************************************************************/
$(document).ready(function() {
// pageObject
let $P = pageObject["${pageName}"];
// FormFields
$P.formFields = new AddsFormFields("#frmSearch--${pageName}");
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.control = new DatasetControl({
urls : {
load : wctx.url("/adds/nims/getDsuseMgtNcrdAndPrtmStatistics.do")
}
, prefix: "dsuseMgtStatistics"
, prefixName: "폐기 보고 통계"
, keymapper: info => info ? info.dept_cd : ""
, dataGetter: obj => obj.${infoPrefix}List
, appendData: true
, infoSize: "xl"
});
// $P.control 설정
$P.control.defaultFetchSize = FETCH_XXS; // 1 페이지당 조회되는 자료 건수 index.jsp에서 확인 FETCH_XS = 30
//$P.control.query = { pageNum : 1, fetchSize : $P.control.defaultFetchSize };
$P.control.beforeCurrent = null;
/**************************************************************************
* DatasetControl 이벤트
**************************************************************************/
// Dataset 변경 이벤트
$P.control.onDatasetChange = (obj) => {
$P.renderList(obj.${infoPrefix}Total);
};
// 현재 선택 자료 변경 이벤트
$P.control.onCurrentChange = (item) => {
if (!item) {
return;
}
let key = item.data.dept_cd;
$("#tbody--${pageName}").setCurrentRow(key);
};
/**************************************************************************
* DataTables 이벤트
**************************************************************************/
// DataTables에 click, dbclick 이벤트
$P.renderList = (totalSize) => {
let ${infoPrefix}List = $P.control.dataset;
let empty = ${infoPrefix}List.empty;
// 업무별 DataTables(그리드) tr, td
let foundContent = document.getElementById("${infoPrefix}Row--${pageName}").content;
let foundTr = $(foundContent).find("tr")[0].cloneNode(false);
let foundTds = $(foundContent).find("td");
foundTds.each(function() {
foundTr.appendChild(this.cloneNode(true));
});
let replacer = (str, dataItem) => str
let trs = empty ? [document.getElementById("${infoPrefix}NotFound--${pageName}").content.outerHTML]
: ${infoPrefix}List.inStrings(foundTr.outerHTML, replacer);
$("#tbody--${pageName}").html(trs.join());
}
$P.control.getBsshInfo = (gdccId) => {
let dialogTitle = "마약류 취급업체 조회";
let params = {openPage : "frmSearch--${pageName}"};
ajax.get({
url : wctx.url("/adds/nims/bssh-popup.do")
, data : params
, success : resp => {
dialog.open({
id : "bsshPopupDialog"
, title : dialogTitle
, content : resp
, size : $P.control.infoSize
, onClose : () => { }
});
}
});
}
/**************************************************************************
* 사용자 함수(function)
**************************************************************************/
// 사용자검색 callback
$P.callbackFindUser = (userId, userNm) => {
$("#schRgtrCd--${pageName}").val(userId); // 사용자 ID
$("#schRgtrNm--${pageName}").val(userNm); // 사용자 명
}
// 업체 검색 버튼 이벤트
$P.fnSearchBssh = () => {
$P.control.getBsshInfo();
}
/**************************************************************************
* 버튼 clickEvent
**************************************************************************/
// 업무 구분 변경 이벤트
$P.fnReset = () => {
//$P.control.dataset.clear();
// 초기 기본 설정
$P.initForm();
// dataset 초기화
}
// 검색 버튼 클릭 이벤트
$P.fnSearchList = () => {
// 검색조건
$P.control.query = $P.formFields.get(); // 검색 조건
if(!$('#chkDsuseDe--${pageName}').is(":checked")){
$P.control.query.schDateFrom = '';
$P.control.query.schDateTo = '';
}
$P.control.query.fetchSize = $P.control.defaultFetchSize; // 한번에 조회되는 자료 건수
$P.control.query.delYn = "N"; // 삭제 여부
$P.control.load();
}
// 엑셀 버튼 클릭 이벤트
$P.fnExcel = () => {
if ($P.control.dataset.empty) {
dialog.alert({
content: "검색된 자료가 없습니다."
, onOK: () => { }
});
return;
}
// DataTables(그리드)
let cellDefs = getCellDefs($("#theadTr--${pageName} th").not(".dummy-th").not(":eq(0)")
, $($("#${infoPrefix}Row--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
$P.control.query.cellDefs = cellDefs;
$P.control.download();
}
/**************************************************************************
* 초기 설정
**************************************************************************/
// 이벤트 설정
$P.setEvent = () => {
// 기본 버튼 이벤트
$("#btnReset--${pageName}").on("click", () => $P.fnReset()); // 초기화
$("#btnSearch--${pageName}").on("click", () => $P.fnSearchList()); // 검색
$("#btnExcel--${pageName}").on("click", () => $P.fnExcel()); // 엑셀
// 동적검색에서 엔터(Enter) 키를 누르면 검색한다.
$("#term--${pageName}").keypress(function(e) {
if (e.keyCode == 13) {
$P.fnSearchList();
}
});
// form-date 항목에서 키보드로 입력시 날짜 포맷팅 적용
$("#frmSearch--${pageName}").find(".form-date").each(function() {
$(this).on("input", function() {
let value = this.value.replaceAll("-", "");
if (value.length > 7) {
this.value = value.substring(0, 4) + "-" + value.substring(4, 6) + "-" + value.substring(6);
} else if (value.length > 5) {
this.value = value.substring(0, 4) + "-" + value.substring(4);
}
});
});
// 업체 검색 버튼 이벤트
$("#btnBsshSearch--${pageName}").on("click", function() {
$P.fnSearchBssh();
});
// DataTables width 변경 조정 (업무별 그리드가 존재 한다면.. crdn06010-main.jsp 참고)
fnMakeResizableTable($("#table-responsive--${pageName}")[0]);
}
// 초기 화면 설정
$P.initForm = () => {
// 화면 초기화
$("#frmSearch--${pageName}")[0].reset();
// input, select 초기화
let searchForm = $("#frmSearch--${pageName}");
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); });
// 기본 데이터 설정
initDatepicker("frmSearch--${pageName}"); // 달력 초기화
$("#schDateFrom--${pageName}").datepicker("setDate", DateUtil.getDateDay(-7).date); // 부과 제외 일자 시작
$("#schDateTo--${pageName}").datepicker("setDate", new Date()); // 부과 제외 일자 종료
$('#schSttsCd--${pageName}').val('06');
$('#schSggCd--${pageName}').val("${currentUser.deptCode}");
$P.fnSearchList();
}
/**************************************************************************
* 최초 실행 함수
**************************************************************************/
// 1. 이벤트 설정
$P.setEvent();
// 2. 초기 설정 및 업무 구분 변경
//$P.fnReset();
$P.control.load(1);
});
</script>
Loading…
Cancel
Save