fix : 화면 수정 및 제품검색기능 수정.

dev
Leeyh1121 5 months ago
parent b40a3efd1c
commit f8a8b311ef

@ -16,7 +16,7 @@ public class DsuseDocController extends AbstractController {
@RequestMapping(
name = "Nims 메인",
value = {"/dsuseDoc/main.do"}
value = {"/dsuseMgtDoc.do"}
)
public ModelAndView main() {
ModelAndView mav = new ModelAndView();

@ -12,7 +12,6 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@RequiredArgsConstructor
@Controller
@RequestMapping(
name = "마약류폐기 결과 처리",
@ -24,8 +23,9 @@ public class DsuseMgtRsltController extends AbstractController {
public class METHOD_URL {
public static final String
dsuseMgtRsltMain = "/dsuseMgtRslt.do" // 부과 제외 관리 메인 화면
, dsuseMgtRsltList = "/dsuseMgtRslt-list.do" // 부과 제외 대장 목록 조회
dsuseMgtRsltMain = "/dsuseMgtRslt.do" // 부과 제외 관리 메인 화면
, dsuseMgtRsltList = "/dsuseMgtRslt-list.do" // 부과 제외 대장 목록 조회
, dsuseMgtRsltInfo = "/dsuseMgtRslt-lnfo.do" // 부과 제외 대장 목록 조회
// , getLevyExclusionInfo = "/020/info.do" // 부과 제외 대장 조회
// , createLevyExclusion = "/020/create.do" // 부과 제외 대장 등록
;
@ -54,4 +54,15 @@ public class DsuseMgtRsltController extends AbstractController {
return setCollectionInfo(new ModelAndView("jsonView"), dsuseMgtReceiptService.getdsuseMgtReceiptList(query),"","");
}
@RequestMapping(name="마약류폐기 신청서 접수 상세", value=METHOD_URL.dsuseMgtRsltInfo)
public ModelAndView getdsuseMgtReceiptInfo() {
ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtRslt-info");
return mav
.addObject("pageName", "dsuseMgtRsltInfo") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
// .addObject("infoPrefix", "dsuseMgtReceipt") // prefix
// .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl
;
}
}

@ -78,7 +78,7 @@ public class ProductController extends AbstractController {
dataObject.put("pg","1");
dataObject.put("ymd","");
dataObject.put("fg2","");
query.setSchProductNm("아네폴주사");
//query.setSchProductNm("아네폴주사");
if(!isEmpty(query.getSchProductCd())) dataObject.put("p",query.getSchProductCd());
if(!isEmpty(query.getSchProductNm())) dataObject.put("pn",query.getSchProductNm());
dataObject.put("dbSkipYn","N");

@ -1,108 +1,132 @@
<%@ 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>
<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--excl01010" title="초기화">
초기화
</button>
</div>
<div class="container-search">
<div class="row g-1">
<div class="col-6">
<span class="form-label fw-bold form-search-title text-end">
<label>
<input type="radio" class="form-check-input" name="taskSeCd" alt="업무구분" value="DPV" onchange="pageObject['levy01010'].fnResetAndChangeBiz(this.value);" disabled="">
취급일자
</label>
<label>
<input type="radio" class="form-check-input" name="taskSeCd" alt="업무구분" value="BPV" onchange="pageObject['levy01010'].fnResetAndChangeBiz(this.value);" disabled="">
보고일자
</label>
<span class="form-search-linebox">
<input type="text" class="form-control form-date" id="schCrdnYmdFrom--${pageName}" name="schCrdnYmdFrom" data-fmt-type="day" title="시작 날짜 선택" maxlength="10">
<button type="button" class="bx bx-sm bx-calendar bg-white"></button>
~
<input type="text" class="form-control form-date" id="schCrdnYmdTo--${pageName}" name="schCrdnYmdTo" data-fmt-type="day" title="종료 날짜 선택" maxlength="10">
<button type="button" class="bx bx-sm bx-calendar bg-white"></button>
</span>
</span>
</div>
<!-- 차량번호 -->
<div class="col-5">
<label class="form-label fw-bold form-search-title text-end" for="schVltnCd--levy01010">처리상태</label>
<select class="form-select" id="schVltnCd--levy01010" name="schVltnCd"><option value="">전체</option><option value="01">폐기 신청서 접수</option><option value="03">폐기보고 맵핑</option><option value="05">종료</option></select>
</div>
<button type="button" class="btn btn-search w-px-120" id="btnSearch--${pageName}" title="검색">
검색
</button>
</div>
<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="schSttsCd--${pageName}" name="schSttsCd">
<option value="">전체</option>
<option value="01">수지구</option>
<option value="03">기흥구</option>
<option value="05">처인구</option>
</select>
</div>
<div class="col-5">
<label class="form-label fw-bold form-search-title text-end"">취급일자</label>
<span class="form-search-linebox">
<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-sm 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-sm bx-calendar bg-white"></button>
</span>
</div>
<!-- 업체명 -->
<div class="col-5">
<label class="form-label fw-bold form-search-title text-end" for="schVhrno--${pageName}">업체명</label>
<input type="text" class="form-control w-px-160" id="schBsshNM--${pageName}" name="schBsshNm" autocomplete="off" readonly/>
<input type="hidden" id="schBsshCd--${pageName}" name="schBsshCd" 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>
<option value="01">폐기 신청서 접수</option>
<option value="03">폐기보고 맵핑</option>
<option value="05">종료</option>
</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>
<button type="button" class="btn btn-search w-px-120" id="btnSearch--excl01010" title="검색">폐기 결과 통보서 출력</button>
<button type="button" class="btn btn-search w-px-120" id="btnSearch--excl01010" title="등록">폐기 결과 보고서 출력</button>
<button type="button" class="btn btn-excel w-px-120" id="btnExcel--excl01010" title="엑셀">
<button type="button" class="btn btn-primary w-px-120" id="btnCreateDsuseMGT--${pageName}" title="폐기 결과 통보서 출력">
폐기 결과 통보서 출력
</button>
<button type="button" class="btn btn-primary w-px-120" id="btnCreateDsuseMGT--${pageName}" title="폐기 결과 보고서 출력">
폐기 결과 보고서 출력
</button>
<button type="button" class="btn btn-excel w-px-120" id="btnExcel--${pageName}" title="엑셀">
엑셀
</button>
</div>
</div>
<div class="table-responsive">
<table class="datatables-ajax table table-bordered dataTable no-footer" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">
<thead>
<tr><th style="width: 15.828px;text-align:center;" tabindex="0">No</th>
<th class="cmn" style="width: 56px;"><input type="checkbox" class="form-check-input" id="gridAllCheckbox--levy01010" onchange="pageObject['levy01010'].control.select(this.checked);"></th>
<th class="sorting sorting_asc" aria-sort="ascending" style="width: 100px;">식별번호</th>
<th class="sorting" style="width: 400px;">보고업체명</th>
<th class="sorting" style="width: 160.141px;">보고일자</th>
<th class="sorting" style="width: 160.141px;">취급일자</th>
<th class="sorting" style="width: 180px;">폐기종류</th><th class="sorting" style="width: 230.469px;">폐기방법</th>
<th class="sorting" style="width: 230.469px;">보고라인수</th>
<th class="sorting" style="width: 180px;">처리자</th>
<th class="sorting" style="width: 230.469px;">처리일자</th>
<th class="sorting" style="width: 230.469px;">처리상태</th>
</tr>
</thead>
<tbody id="dsuseDocList">
<tr data-key="0000000001" class="">
<td style="text-align:center;">1</td>
<td class="cmn text-center"><input type="checkbox" class="form-check-input" name="gridCheckbox" value="20244623020230001049" onchange="pageObject['levy01010'].control.select('20244623020230001049', this.checked);"></td>
<td ondblclick="authorityControl.authorities.newInfo();">2024050000</td>
<td ondblclick="authorityControl.authorities.newInfo();">수지미래산부인과의원</td>
<td ondblclick="authorityControl.authorities.newInfo();">20240401</td>
<td ondblclick="authorityControl.authorities.newInfo();">20240401</td>
<td ondblclick="authorityControl.authorities.newInfo();">보건소폐기</td>
<td ondblclick="authorityControl.authorities.newInfo();">중화</td>
<td ondblclick="authorityControl.authorities.newInfo();">1</td>
<td ondblclick="authorityControl.authorities.newInfo();">api-user</td>
<td ondblclick="authorityControl.authorities.newInfo();">2024-05-01 09:11:08</td>
<td ondblclick="authorityControl.authorities.newInfo();">폐기신청서접수</td>
</tr><tr data-key="0000000000" class="current-row">
<td style="text-align:center;">2</td>
<td class="cmn text-center"><input type="checkbox" class="form-check-input" name="gridCheckbox" value="20244623020230001049" onchange="pageObject['levy01010'].control.select('20244623020230001049', this.checked);"></td>
<td ondblclick="authorityControl.authorities.newInfo();">2024050001</td>
<td ondblclick="authorityControl.authorities.newInfo();">수지미래산부인과의원</td>
<td ondblclick="authorityControl.authorities.newInfo();">20240401</td>
<td ondblclick="authorityControl.authorities.newInfo();">20240401</td>
<td ondblclick="authorityControl.authorities.newInfo();">보건소폐기</td>
<td ondblclick="authorityControl.authorities.newInfo();">소각</td>
<td ondblclick="authorityControl.authorities.newInfo();">3</td>
<td ondblclick="authorityControl.authorities.newInfo();">api-user</td>
<td ondblclick="authorityControl.authorities.newInfo();">2024-05-08 09:11:08</td>
<td ondblclick="authorityControl.authorities.newInfo();">폐기보고매핑</td>
</tr>
</tbody>
</table>
</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 h-px-500" 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 id="theadTr--${pageName}"
data-by="by--${pageName}" data-by-output="byOutput--${pageName}" data-main-option="mainOption--${pageName}" data-sub-option="subOption--${pageName}">
<th class="cmn" style="width: 72px;">No.</th>
<th class="cmn" style="width: 160.141px;">취급일자</th>
<th class="cmn" style="width: 160.141px;">관리번호</th>
<th class="cmn" style="width: 230.469px;">업체명</th>
<th class="cmn" style="width: 100px;">보고건수</th>
<th class="cmn" style="width: 230.469px;">처리상태</th>
<th class="cmn" style="width: 180px;">폐기구분</th>
<th class="cmn" style="width: 230.469px;">폐기사유</th>
<th class="cmn" style="width: 180px;">폐기방법</th>
<th class="cmn" style="width: 230.469px;">폐기장소</th>
<th class="cmn" style="width: 230.469px;">폐기일자</th>
</tr>
</thead>
<tbody id="tbody--${pageName}">
</tbody>
<template id="${infoPrefix}Row--${pageName}">
<tr data-key="USR_RPT_ID_NO">
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{ROW_NUM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{HDR_DE}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSCDMNG_ID}</td>
<td class="cmn text-start" onclick="{onclick}" ondblclick="{ondblclick}">{BSSH_NM}</td>
<td class="cmn text-end" onclick="{onclick}" ondblclick="{ondblclick}">{RND_DTL_RPT_CNT}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{PRGRS_STTS_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_SE_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_PRV_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_MTH_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_LOC}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_DE}</td>
<%-- <td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{USR_RPT_ID_NO}</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="userPagingInfo" class="dataTables_info" role="status" aria-live="polite">1 ~ 2 / 2</label>
<ul id="userPaging" class="pagination pagination-primary" style="display: none;">
@ -110,9 +134,337 @@
</div>
<script>
<!--/ Page Body -->
<script >
var authorityControl = new AuthorityControl();
/**************************************************************************
* Global Variable
**************************************************************************/
pageObject["${pageName}"] = {};
/**************************************************************************
* script 진입
**************************************************************************/
$(document).ready(function() {
// pageObject
let $P = pageObject["${pageName}"];
// FormFields
$P.formFields = new FimsFormFields("#frmSearch--${pageName}");
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.control = new DatasetControl({
urls : {
load : wctx.url("/adds/nims/dsuseMgtRslt-list.do")
// FIXME: POST로 변경
//load : '<c:url value="${apiHost}/api/biz/nims/v1/getDsuseMgts" />'
}
, prefix: "dsuseMgtMapping"
, prefixName: "폐기 보고 확인"
, keymapper: info => info ? info.USR_RPT_ID_NO : ""
, dataGetter: obj => obj.${infoPrefix}List
, appendData: true
, infoSize: "xl"
, formats: {
RPT_DE: dateFormat
, HDR_DE: dateFormat
, DSUSE_DE: dateFormat
}
});
// $P.control 설정
$P.control.defaultFetchSize = FETCH_XS; // 1 페이지당 조회되는 자료 건수 index.jsp에서 확인 FETCH_XS = 30
$P.control.untilPageNum = 0; // 현재 페이지 번호
$P.control.beforeCurrent = null;
$P.control.tableRenderComplete = false; // dataTables 에 자료 추가 완료 여부
/**************************************************************************
* DatasetControl 이벤트
**************************************************************************/
// Dataset 변경 이벤트
/* $P.control.onDatasetChange = (obj) => {
$P.renderList(obj.${infoPrefix}Total);
$("#paging--${pageName}").setPaging({
list: $P.control.dataset
, prefix: "paging--${pageName}"
, start: obj.${infoPrefix}Start
, totalSize: obj.${infoPrefix}Total
, fetchSize: obj.${infoPrefix}Fetch
, func: "pageObject['${pageName}'].control.load({index})"
});
$P.control.tableRenderComplete = true; // dataTables 에 자료 추가 완료
};*/
// 현재 선택 자료 변경 이벤트
$P.control.onCurrentChange = (item) => {
if (!item) return;
let key = item.data.LEVY_EXCL_ID;
$("#tbody--${pageName}").setCurrentRow(key);
};
// 신청서 정보 dialog
$P.control.getInfo = (gdccId) => {
let dialogTitle = "신청서 정보 등록";
let params = {};
ajax.get({
url : wctx.url("/adds/nims/dsuseMgtReceipt-info.do")
, data : params || {}
, success : resp => {
dialog.open({
id : $P.control.prefixed("Dialog")
, title : dialogTitle
, content : resp
, size : $P.control.infoSize
, onClose : () => { $P.refreshList(); }
});
}
});
}
/**************************************************************************
* 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
.replace(/{onclick}/gi, "pageObject['${pageName}'].control.setCurrent('" + dataItem.getValue("LEVY_EXCL_ID") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].getTotalInfo('" + dataItem.getValue("CRDN_ID") + "');");
let trs = empty ? [document.getElementById("${infoPrefix}NotFound--${pageName}").content.outerHTML]
: ${infoPrefix}List.inStrings(foundTr.outerHTML, replacer);
let noMore = (totalSize == ${infoPrefix}List.length);
let initScroll = ($P.control.query.pageNum < 2) && ($P.control.untilPageNum == 0);
$("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
if ($P.control.untilPageNum != 0) {
$P.control.query.fetchSize = $P.control.defaultFetchSize;
$P.control.query.pageNum = $P.control.untilPageNum;
$P.control.untilPageNum = 0;
}
}
// DataTables에 스크롤이 맨 밑으로 이동했을 때 이벤트
$P.scrollDataList = () => {
$P.control.tableRenderComplete = false; // dataTables 에 자료 추가 false
$P.control.load($P.control.query.pageNum + 1);
}
// DataTables에 더블 클릭시 개별총정보 dialog
$P.getTotalInfo = (crdnId) => {
if (typeof crdnId == "undefined" || crdnId == null || crdnId == "") return;
let params = {
callControlName: "pageObject['${pageName}'].control"
, sggCd: $P.control.dataset.getValue("SGG_CD")
, taskSeCd: $P.control.dataset.getValue("TASK_SE_CD")
, crdnId: crdnId
}
ajax.get({
url : wctx.url("/adds/nims/dsuseMgtReceipt-info.do")
, data: params
, success: resp => {
dialog.open({
id: "dsuseMgtReceiptinfoDialog"
, title: "신청서 정보 상세"
, content: resp
, size: "xl"
, init: () => { }
, onClose: () => { }
});
}
});
}
$P.control.getBsshInfo = (gdccId) => {
let dialogTitle = "마약류 취급자 조회";
let params = {};
ajax.get({
url : wctx.url("/adds/nims/bssh-main.do")
, data : params || {}
, success : resp => {
dialog.open({
id : $P.control.prefixed("Dialog")
, title : dialogTitle
, content : resp
, size : $P.control.infoSize
, onClose : () => { $P.control.setData(); }
});
}
});
}
/**************************************************************************
* 사용자 함수(function)
**************************************************************************/
// 검색 자료 재조회
$P.fnRefreshList = () => {
$P.control.untilPageNum = $P.control.query.pageNum;
$P.control.query.fetchSize = $P.control.defaultFetchSize * $P.control.query.pageNum;
$P.control.load(1);
}
// 사용자검색 callback
$P.callbackFindUser = (userId, userNm) => {
$("#schRgtrCd--${pageName}").val(userId); // 사용자 ID
$("#schRgtrNm--${pageName}").val(userNm); // 사용자 명
}
// 전자우편 안내문 등록 버튼 이벤트
$P.fnCreateEpostGdcc = (title) => {
$P.control.getInfo();
}
// 전자우편 안내문 등록 버튼 이벤트
$P.fnSearchBssh = (title) => {
$P.control.getBsshInfo();
}
/**************************************************************************
* 버튼 clickEvent
**************************************************************************/
// 업무 구분 변경 이벤트
$P.fnResetAndChangeBiz = (taskSeCd) => {
// 업무 구분 코드
if (typeof taskSeCd == "undefined" || taskSeCd == null || taskSeCd == "") {
taskSeCd = $("#layout-navbar input[name='taskSeCd']:checked").val();
}
// 초기 기본 설정
$P.initForm(taskSeCd);
// dataset 초기화
$P.control.dataset.clear();
}
// 검색 버튼 클릭 이벤트
$P.fnSearchList = () => {
// 검색조건
$P.control.query = $P.formFields.get(); // 검색 조건
$P.control.query.fetchSize = $P.control.defaultFetchSize; // 한번에 조회되는 자료 건수
$P.control.query.delYn = "N"; // 삭제 여부
$P.control.load(1);
}
// 엑셀 버튼 클릭 이벤트
$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.fnResetAndChangeBiz()); // 초기화
$("#btnSearch--${pageName}").on("click", () => $P.fnSearchList()); // 검색
$("#btnExcel--${pageName}").on("click", () => $P.fnExcel()); // 엑셀
// 동적검색에서 엔터(Enter) 키를 누르면 검색한다.
$("#term--${pageName}").keypress(function(e) {
if (e.keyCode == 13) {
$P.fnSearchList();
}
});
// 안내문 등록 버튼 이벤트
$("#btnCreateDsuseMGT--${pageName}").on("click", function() {
$P.fnCreateEpostGdcc($(this).attr("title"));
});
// 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($(this).attr("title"));
});
// DataTables width 변경 조정 (업무별 그리드가 존재 한다면.. crdn06010-main.jsp 참고)
fnMakeResizableTable($("#table-responsive--${pageName}")[0]);
// DataTables 스크롤 이벤트 생성
fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollDataList);
}
// 초기 화면 설정
$P.initForm = (taskSeCd) => {
// 화면 초기화
$("#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()); // 부과 제외 일자 종료
}
/**************************************************************************
* 최초 실행 함수
**************************************************************************/
// 1. 이벤트 설정
$P.setEvent();
// 2. 초기 설정 및 업무 구분 변경
$P.fnResetAndChangeBiz($("#layout-navbar input[name='taskSeCd']:checked").val());
});
</script>
</script>

@ -14,7 +14,7 @@
<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="schSttsCd--${pageName}" name="schSttsCd">
<select class="form-select" id="schSggCd--${pageName}" name="schSggCd">
<option value="">전체</option>
<option value="01">수지구</option>
<option value="03">기흥구</option>
@ -33,9 +33,9 @@
</div>
<!-- 업체명 -->
<div class="col-5">
<label class="form-label fw-bold form-search-title text-end" for="schVhrno--${pageName}">업체명</label>
<input type="text" class="form-control w-px-160" id="schBsshNM--${pageName}" name="schBsshNm" autocomplete="off" readonly/>
<input type="hidden" id="schBsshCd--${pageName}" name="schBsshCd" autocomplete="off" />
<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>
@ -75,54 +75,97 @@
</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 h-px-500" 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 id="theadTr--${pageName}"
data-by="by--${pageName}" data-by-output="byOutput--${pageName}" data-main-option="mainOption--${pageName}" data-sub-option="subOption--${pageName}">
<th class="cmn" style="width: 72px;">No.</th>
<th class="cmn" style="width: 160.141px;">취급일자</th>
<th class="cmn" style="width: 160.141px;">관리번호</th>
<th class="cmn" style="width: 230.469px;">업체명</th>
<th class="cmn" style="width: 100px;">보고건수</th>
<th class="cmn" style="width: 230.469px;">처리상태</th>
<th class="cmn" style="width: 180px;">폐기구분</th>
<th class="cmn" style="width: 230.469px;">폐기사유</th>
<th class="cmn" style="width: 180px;">폐기방법</th>
<th class="cmn" style="width: 230.469px;">폐기장소</th>
<th class="cmn" style="width: 230.469px;">폐기일자</th>
</tr>
</thead>
<tbody id="tbody--${pageName}">
</tbody>
<template id="${infoPrefix}Row--${pageName}">
<tr data-key="USR_RPT_ID_NO">
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{ROW_NUM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{HDR_DE}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSCDMNG_ID}</td>
<td class="cmn text-start" onclick="{onclick}" ondblclick="{ondblclick}">{BSSH_NM}</td>
<td class="cmn text-end" onclick="{onclick}" ondblclick="{ondblclick}">{RND_DTL_RPT_CNT}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{PRGRS_STTS_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_SE_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_PRV_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_MTH_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_LOC}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_DE}</td>
<%-- <td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{USR_RPT_ID_NO}</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 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 h-px-250" 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 id="theadTr--${pageName}"
data-by="by--${pageName}" data-by-output="byOutput--${pageName}" data-main-option="mainOption--${pageName}" data-sub-option="subOption--${pageName}">
<th class="cmn" style="width: 72px;">No.</th>
<th class="cmn" style="width: 160.141px;">취급일자</th>
<th class="cmn" style="width: 160.141px;">관리번호</th>
<th class="cmn" style="width: 230.469px;">업체명</th>
<th class="cmn" style="width: 100px;">보고건수</th>
<th class="cmn" style="width: 230.469px;">처리상태</th>
<th class="cmn" style="width: 180px;">폐기구분</th>
<th class="cmn" style="width: 230.469px;">폐기사유</th>
<th class="cmn" style="width: 180px;">폐기방법</th>
<th class="cmn" style="width: 230.469px;">폐기장소</th>
<th class="cmn" style="width: 230.469px;">폐기일자</th>
</tr>
</thead>
<tbody id="tbody--${pageName}">
</tbody>
<template id="${infoPrefix}Row--${pageName}">
<tr data-key="{USR_RPT_ID_NO}">
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{ROW_NUM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{HDR_DE}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSCDMNG_ID}</td>
<td class="cmn text-start" onclick="{onclick}" ondblclick="{ondblclick}">{BSSH_NM}</td>
<td class="cmn text-end" onclick="{onclick}" ondblclick="{ondblclick}">{RND_DTL_RPT_CNT}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{PRGRS_STTS_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_SE_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_PRV_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_MTH_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_LOC}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_DE}</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="card">
<div class="row g-1">
<div class="card-datatable text-nowrap">
<div class="dataTables_wrapper dt-bootstrap5 no-footer" id="DataTables_Table_1_wrapper--${pageName}">
<div class="table-responsive ox-scroll oy-scroll h-px-300" id="table-responsive-1--${pageName}">
<table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer"
id="DataTables_Table_1--${pageName}" aria-describedby="DataTables_Table_0_info">
<thead class="sticky-thead">
<tr>
<th class="cmn" style="width: 72px;">No.</th>
<th class="sorting sorting_asc" aria-sort="ascending" style="width: 223.719px;">제품명</th>
<th class="sorting" style="width: 146.156px;">제품코드</th>
<th class="sorting" style="width: 160.141px;">폐기수량</th>
<th class="sorting" style="width: 230.469px;">유효기간</th>
<th class="sorting" style="width: 230.469px;">최소 유통단위 수량</th>
<th class="sorting" style="width: 230.469px;">낱개 단위 수량</th>
<th class="sorting" style="width: 230.469px;">폐기 수량</th>
</tr>
</thead>
<tbody id="tbody--${pageName}Detail">
</tbody>
<template id="${infoPrefix}Row--${pageName}Detail">
<tr data-key="DSCDMNG_SN">
<td {onclick}="" {ondblclick}="">{ROW_NUM}</td>
<td {onclick}="" {ondblclick}="">{PRDUCT_NM}</td>
<td {onclick}="" {ondblclick}="">{PRDUCT_CD}</td>
<td {onclick}="" {ondblclick}="">{DSUSE_QY}</td>
<td {onclick}="" {ondblclick}="">{PRD_VALID_DE}</td>
<td {onclick}="" {ondblclick}="">{MIN_DISTB}</td>
<td {onclick}="" {ondblclick}="">{PCE}</td>
<td {onclick}="" {ondblclick}="">{DSUSE_QY}</td>
</tr>
</template>
<template id="${infoPrefix}NotFound--${pageName}Detail">
<tr class="odd">
<td valign="top" colspan="5" class="dataTables_empty text-center">${prefixName} 상세 정보를 찾지 못했습니다.</td>
</tr>
</template>
</table>
</div>
</div>
<!-- / DataTables(그리드) -->
</div> <!-- / DataTables(그리드) -->
</div> <!-- <div class="row g-1"> -->
</div> <!-- <div class="card"> -->
<div class="d-flex flex-row p-3 justify-content-between">
<label id="userPagingInfo" class="dataTables_info" role="status" aria-live="polite">1 ~ 2 / 2</label>
@ -175,11 +218,28 @@
$P.control.beforeCurrent = null;
$P.control.tableRenderComplete = false; // dataTables 에 자료 추가 완료 여부
$P.detailControl = new DatasetControl({
urls : {
load : wctx.url("/adds/nims/dsuseMgtDetail-list.do")
// FIXME: POST로 변경
//load : '<c:url value="${apiHost}/api/biz/nims/v1/getDsuseMgts" />'
}
// , query.schDscdmngId : $P.control.getValue("DSCDMNG_ID")
// , data : {"schDscdmngId" : $P.control.getValue("DSCDMNG_ID")}
, prefix : "dsuseMgtDetail"
, prefixName : "신청서접수상세"
, keymapper : info => info ? info.DSCDMNG_SN : ""
, dataGetter : obj => obj.dsuseMgtDetailList
, formats : {
PRD_VALID_DE: dateFormat
}
});
/**************************************************************************
* DatasetControl 이벤트
**************************************************************************/
// Dataset 변경 이벤트
/* $P.control.onDatasetChange = (obj) => {
$P.control.onDatasetChange = (obj) => {
$P.renderList(obj.${infoPrefix}Total);
$("#paging--${pageName}").setPaging({
@ -192,17 +252,35 @@
});
$P.control.tableRenderComplete = true; // dataTables 에 자료 추가 완료
};*/
};
$P.detailControl.onDatasetChange = (obj) => {
$P.renderDetailList(obj.${infoPrefix}Total);
};
// 현재 선택 자료 변경 이벤트
$P.control.onCurrentChange = (item) => {
if (!item) return;
let key = item.data.LEVY_EXCL_ID;
let key = item.data.USR_RPT_ID_NO;
$("#tbody--${pageName}").setCurrentRow(key);
var dscdmngId = item.data.DSCDMNG_ID;
$P.detailControl.query = { "schDscdmngId" : dscdmngId};
$P.detailControl.load(1);
};
// 현재 선택 자료 변경 이벤트
$P.detailControl.onCurrentChange = (item) => {
if (!item) return;
let key = item.data.DSCDMNG_SN;
$("#tbody--${pageName}Detail").setCurrentRow(key);
};
// 신청서 정보 dialog
$P.control.getInfo = (gdccId) => {
let dialogTitle = "신청서 정보 등록";
@ -243,8 +321,8 @@
//
let replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].control.setCurrent('" + dataItem.getValue("LEVY_EXCL_ID") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].getTotalInfo('" + dataItem.getValue("CRDN_ID") + "');");
.replace(/{onclick}/gi, "pageObject['${pageName}'].control.setCurrent('" + dataItem.getValue("USR_RPT_ID_NO") + "');");
// .replace(/{ondblclick}/gi, "pageObject['${pageName}'].getTotalInfo('" + dataItem.getValue("CRDN_ID") + "');");
let trs = empty ? [document.getElementById("${infoPrefix}NotFound--${pageName}").content.outerHTML]
: ${infoPrefix}List.inStrings(foundTr.outerHTML, replacer);
@ -261,59 +339,48 @@
}
}
$P.renderDetailList = () => {
let ${infoPrefix}List = $P.detailControl.dataset;
let empty = ${infoPrefix}List.empty;
// DataTables에 스크롤이 맨 밑으로 이동했을 때 이벤트
$P.scrollDataList = () => {
$P.control.tableRenderComplete = false; // dataTables 에 자료 추가 false
let trs = empty ?
[document.getElementById("${infoPrefix}NotFound--${pageName}Detail").innerHTML] : <%-- from template#${infoPrefix}NotFound --%>
${infoPrefix}List.inStrings(
document.getElementById("${infoPrefix}Row--${pageName}Detail").innerHTML, <%-- from template#${infoPrefix}Row --%>
(str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].detailControl.setCurrent('" + dataItem.getValue("DSCDMNG_SN") + "');")
);
$P.control.load($P.control.query.pageNum + 1);
$("#tbody--${pageName}Detail").html(trs.join());
}
// DataTables에 더블 클릭시 개별총정보 dialog
$P.getTotalInfo = (crdnId) => {
if (typeof crdnId == "undefined" || crdnId == null || crdnId == "") return;
let params = {
callControlName: "pageObject['${pageName}'].control"
, sggCd: $P.control.dataset.getValue("SGG_CD")
, taskSeCd: $P.control.dataset.getValue("TASK_SE_CD")
, crdnId: crdnId
}
// DataTables에 스크롤이 맨 밑으로 이동했을 때 이벤트
$P.scrollDataList = () => {
$P.control.tableRenderComplete = false; // dataTables 에 자료 추가 false
ajax.get({
url : wctx.url("/adds/nims/dsuseMgtReceipt-info.do")
, data: params
, success: resp => {
dialog.open({
id: "dsuseMgtReceiptinfoDialog"
, title: "신청서 정보 상세"
, content: resp
, size: "xl"
, init: () => { }
, onClose: () => { }
});
}
});
$P.control.load($P.control.query.pageNum + 1);
}
$P.control.getBsshInfo = (gdccId) => {
let dialogTitle = "마약류 취급 조회";
let params = {};
let dialogTitle = "마약류 취급업체 조회";
let params = {openPage : "frmSearch--${pageName}"};
ajax.get({
url : wctx.url("/adds/nims/bssh-main.do")
, data : params || {}
, data : params
, success : resp => {
dialog.open({
id : $P.control.prefixed("Dialog")
id : "bsshMainDialog"
, title : dialogTitle
, content : resp
, size : $P.control.infoSize
, onClose : () => { $P.control.setData(); }
, onClose : () => { }
});
}
});
}
}
/**************************************************************************

@ -14,7 +14,7 @@
<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="schSttsCd--${pageName}" name="schSttsCd">
<select class="form-select" id="schSggCd--${pageName}" name="schSggCd">
<option value="">전체</option>
<option value="01">수지구</option>
<option value="03">기흥구</option>
@ -33,9 +33,9 @@
</div>
<!-- 업체명 -->
<div class="col-5">
<label class="form-label fw-bold form-search-title text-end" for="schVhrno--${pageName}">업체명</label>
<input type="text" class="form-control w-px-160" id="schBsshNM--${pageName}" name="schBsshNm" autocomplete="off" readonly/>
<input type="hidden" id="schBsshCd--${pageName}" name="schBsshCd" autocomplete="off" />
<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>
@ -74,55 +74,98 @@
</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 h-px-500" 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 id="theadTr--${pageName}"
data-by="by--${pageName}" data-by-output="byOutput--${pageName}" data-main-option="mainOption--${pageName}" data-sub-option="subOption--${pageName}">
<th class="cmn" style="width: 72px;">No.</th>
<th class="cmn" style="width: 160.141px;">취급일자</th>
<th class="cmn" style="width: 160.141px;">관리번호</th>
<th class="cmn" style="width: 230.469px;">업체명</th>
<th class="cmn" style="width: 100px;">보고건수</th>
<th class="cmn" style="width: 230.469px;">처리상태</th>
<th class="cmn" style="width: 180px;">폐기구분</th>
<th class="cmn" style="width: 230.469px;">폐기사유</th>
<th class="cmn" style="width: 180px;">폐기방법</th>
<th class="cmn" style="width: 230.469px;">폐기장소</th>
<th class="cmn" style="width: 230.469px;">폐기일자</th>
</tr>
</thead>
<tbody id="tbody--${pageName}">
</tbody>
<template id="${infoPrefix}Row--${pageName}">
<tr data-key="USR_RPT_ID_NO">
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{ROW_NUM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{HDR_DE}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSCDMNG_ID}</td>
<td class="cmn text-start" onclick="{onclick}" ondblclick="{ondblclick}">{BSSH_NM}</td>
<td class="cmn text-end" onclick="{onclick}" ondblclick="{ondblclick}">{RND_DTL_RPT_CNT}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{PRGRS_STTS_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_SE_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_PRV_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_MTH_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_LOC}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_DE}</td>
<%-- <td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{USR_RPT_ID_NO}</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 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 h-px-250" 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 id="theadTr--${pageName}"
data-by="by--${pageName}" data-by-output="byOutput--${pageName}" data-main-option="mainOption--${pageName}" data-sub-option="subOption--${pageName}">
<th class="cmn" style="width: 72px;">No.</th>
<th class="cmn" style="width: 160.141px;">취급일자</th>
<th class="cmn" style="width: 160.141px;">관리번호</th>
<th class="cmn" style="width: 230.469px;">업체명</th>
<th class="cmn" style="width: 100px;">보고건수</th>
<th class="cmn" style="width: 230.469px;">처리상태</th>
<th class="cmn" style="width: 180px;">폐기구분</th>
<th class="cmn" style="width: 230.469px;">폐기사유</th>
<th class="cmn" style="width: 180px;">폐기방법</th>
<th class="cmn" style="width: 230.469px;">폐기장소</th>
<th class="cmn" style="width: 230.469px;">폐기일자</th>
</tr>
</thead>
<tbody id="tbody--${pageName}">
</tbody>
<template id="${infoPrefix}Row--${pageName}">
<tr data-key="{USR_RPT_ID_NO}">
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{ROW_NUM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{HDR_DE}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSCDMNG_ID}</td>
<td class="cmn text-start" onclick="{onclick}" ondblclick="{ondblclick}">{BSSH_NM}</td>
<td class="cmn text-end" onclick="{onclick}" ondblclick="{ondblclick}">{RND_DTL_RPT_CNT}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{PRGRS_STTS_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_SE_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_PRV_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_MTH_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_LOC}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_DE}</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="card">
<div class="row g-1">
<div class="card-datatable text-nowrap">
<div class="dataTables_wrapper dt-bootstrap5 no-footer" id="DataTables_Table_1_wrapper--${pageName}">
<div class="table-responsive ox-scroll oy-scroll h-px-300" id="table-responsive-1--${pageName}">
<table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer"
id="DataTables_Table_1--${pageName}" aria-describedby="DataTables_Table_0_info">
<thead class="sticky-thead">
<tr>
<th class="cmn" style="width: 72px;">No.</th>
<th class="sorting sorting_asc" aria-sort="ascending" style="width: 223.719px;">제품명</th>
<th class="sorting" style="width: 146.156px;">제품코드</th>
<th class="sorting" style="width: 160.141px;">폐기수량</th>
<th class="sorting" style="width: 230.469px;">유효기간</th>
<th class="sorting" style="width: 230.469px;">최소 유통단위 수량</th>
<th class="sorting" style="width: 230.469px;">낱개 단위 수량</th>
<th class="sorting" style="width: 230.469px;">폐기 수량</th>
</tr>
</thead>
<tbody id="tbody--${pageName}Detail">
</tbody>
<template id="${infoPrefix}Row--${pageName}Detail">
<tr data-key="DSCDMNG_SN">
<td {onclick}="" {ondblclick}="">{ROW_NUM}</td>
<td {onclick}="" {ondblclick}="">{PRDUCT_NM}</td>
<td {onclick}="" {ondblclick}="">{PRDUCT_CD}</td>
<td {onclick}="" {ondblclick}="">{DSUSE_QY}</td>
<td {onclick}="" {ondblclick}="">{PRD_VALID_DE}</td>
<td {onclick}="" {ondblclick}="">{MIN_DISTB}</td>
<td {onclick}="" {ondblclick}="">{PCE}</td>
<td {onclick}="" {ondblclick}="">{DSUSE_QY}</td>
</tr>
</template>
<template id="${infoPrefix}NotFound--${pageName}Detail">
<tr class="odd">
<td valign="top" colspan="5" class="dataTables_empty text-center">${prefixName} 상세 정보를 찾지 못했습니다.</td>
</tr>
</template>
</table>
</div>
</div>
<!-- / DataTables(그리드) -->
</div> <!-- / DataTables(그리드) -->
</div> <!-- <div class="row g-1"> -->
</div> <!-- <div class="card"> -->
<div class="d-flex flex-row p-3 justify-content-between">
<label id="userPagingInfo" class="dataTables_info" role="status" aria-live="polite">1 ~ 2 / 2</label>
@ -174,12 +217,29 @@
$P.control.untilPageNum = 0; // 현재 페이지 번호
$P.control.beforeCurrent = null;
$P.control.tableRenderComplete = false; // dataTables 에 자료 추가 완료 여부
$P.detailControl = new DatasetControl({
urls : {
load : wctx.url("/adds/nims/dsuseMgtDetail-list.do")
// FIXME: POST로 변경
//load : '<c:url value="${apiHost}/api/biz/nims/v1/getDsuseMgts" />'
}
// , query.schDscdmngId : $P.control.getValue("DSCDMNG_ID")
// , data : {"schDscdmngId" : $P.control.getValue("DSCDMNG_ID")}
, prefix : "dsuseMgtDetail"
, prefixName : "신청서접수상세"
, keymapper : info => info ? info.DSCDMNG_SN : ""
, dataGetter : obj => obj.dsuseMgtDetailList
, formats : {
PRD_VALID_DE: dateFormat
}
});
/**************************************************************************
* DatasetControl 이벤트
**************************************************************************/
// Dataset 변경 이벤트
/* $P.control.onDatasetChange = (obj) => {
$P.control.onDatasetChange = (obj) => {
$P.renderList(obj.${infoPrefix}Total);
$("#paging--${pageName}").setPaging({
@ -192,15 +252,32 @@
});
$P.control.tableRenderComplete = true; // dataTables 에 자료 추가 완료
};*/
};
$P.detailControl.onDatasetChange = (obj) => {
$P.renderDetailList(obj.${infoPrefix}Total);
};
// 현재 선택 자료 변경 이벤트
$P.control.onCurrentChange = (item) => {
if (!item) return;
let key = item.data.LEVY_EXCL_ID;
let key = item.data.USR_RPT_ID_NO;
$("#tbody--${pageName}").setCurrentRow(key);
var dscdmngId = item.data.DSCDMNG_ID;
$P.detailControl.query = { "schDscdmngId" : dscdmngId};
$P.detailControl.load(1);
};
// 현재 선택 자료 변경 이벤트
$P.detailControl.onCurrentChange = (item) => {
if (!item) return;
let key = item.data.DSCDMNG_SN;
$("#tbody--${pageName}Detail").setCurrentRow(key);
};
// 신청서 정보 dialog
@ -209,11 +286,11 @@
let params = {};
ajax.get({
url : wctx.url("/adds/nims/dsuseMgtReceipt-info.do")
url : wctx.url("/adds/nims/dsuseMgtRslt-lnfo.do")
, data : params || {}
, success : resp => {
dialog.open({
id : $P.control.prefixed("Dialog")
id : "dsuseMgtRsltDialog"
, title : dialogTitle
, content : resp
, size : $P.control.infoSize
@ -243,8 +320,8 @@
//
let replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].control.setCurrent('" + dataItem.getValue("LEVY_EXCL_ID") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].getTotalInfo('" + dataItem.getValue("CRDN_ID") + "');");
.replace(/{onclick}/gi, "pageObject['${pageName}'].control.setCurrent('" + dataItem.getValue("USR_RPT_ID_NO") + "');");
// .replace(/{ondblclick}/gi, "pageObject['${pageName}'].getTotalInfo('" + dataItem.getValue("CRDN_ID") + "');");
let trs = empty ? [document.getElementById("${infoPrefix}NotFound--${pageName}").content.outerHTML]
: ${infoPrefix}List.inStrings(foundTr.outerHTML, replacer);
@ -261,6 +338,22 @@
}
}
$P.renderDetailList = () => {
let ${infoPrefix}List = $P.detailControl.dataset;
let empty = ${infoPrefix}List.empty;
let trs = empty ?
[document.getElementById("${infoPrefix}NotFound--${pageName}Detail").innerHTML] : <%-- from template#${infoPrefix}NotFound --%>
${infoPrefix}List.inStrings(
document.getElementById("${infoPrefix}Row--${pageName}Detail").innerHTML, <%-- from template#${infoPrefix}Row --%>
(str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].detailControl.setCurrent('" + dataItem.getValue("DSCDMNG_SN") + "');")
);
$("#tbody--${pageName}Detail").html(trs.join());
}
// DataTables에 스크롤이 맨 밑으로 이동했을 때 이벤트
$P.scrollDataList = () => {
@ -269,52 +362,24 @@
$P.control.load($P.control.query.pageNum + 1);
}
// DataTables에 더블 클릭시 개별총정보 dialog
$P.getTotalInfo = (crdnId) => {
if (typeof crdnId == "undefined" || crdnId == null || crdnId == "") return;
let params = {
callControlName: "pageObject['${pageName}'].control"
, sggCd: $P.control.dataset.getValue("SGG_CD")
, taskSeCd: $P.control.dataset.getValue("TASK_SE_CD")
, crdnId: crdnId
}
ajax.get({
url : wctx.url("/adds/nims/dsuseMgtReceipt-info.do")
, data: params
, success: resp => {
dialog.open({
id: "dsuseMgtReceiptinfoDialog"
, title: "폐기 신청 상세"
, content: resp
, size: "xl"
, init: () => { }
, onClose: () => { }
});
}
});
}
$P.control.getBsshInfo = (gdccId) => {
let dialogTitle = "마약류 취급업체 조회";
let params = {};
let params = {openPage : "frmSearch--${pageName}"};
ajax.get({
url : wctx.url("/adds/nims/bssh-main.do")
, data : params || {}
, data : params
, success : resp => {
dialog.open({
id : $P.control.prefixed("Dialog")
id : "bsshMainDialog"
, title : dialogTitle
, content : resp
, size : $P.control.infoSize
, onClose : () => { $P.control.setData(); }
, onClose : () => { }
});
}
});
}
}
/**************************************************************************
* 사용자 함수(function)

@ -92,17 +92,37 @@
* DatasetControl
**************************************************************************/
$P.control = new DatasetControl({
urls : {
urls : {
//load : wctx.url("/adds/nims/product-list.do")
load : '<c:url value="${apiHost}/api/biz/nims/v1/getNimsProductInfoKd" />',
}
, prefix: "productMain"
, prefixName: "마약류 제품 조회"
, keymapper: info => info ? info.prductCd : ""
, dataGetter : obj => obj.productMainList
, dataGetter : obj => {
if (!obj.success)
dialog.alert(obj.message);
return obj.data;
}
, appendData: true
, infoSize: "xl"
});
/*
json.post({
url:'http://localhost:9076/api/biz/nims/v1/getNimsProductInfoKd',
data: { "k": "",
"fg": "1",
"pg": "1",
"ymd": "",
"fg2": "",
"p": "8806489012426",
"pn": "",
"dbSkipYn": "N",
"userId": "suji"
// "userId": "${currentUser.account}"
},
success: resp => $P.control.setData(resp)
});*/
// $P.control 설정
$P.control.defaultFetchSize = FETCH_XS; // 1 페이지당 조회되는 자료 건수 index.jsp에서 확인 FETCH_XS = 30
@ -190,8 +210,19 @@
**************************************************************************/
$P.fnSearchList = () => {
$P.control.query = { "k": "",
"fg": "1",
"pg": "1",
"ymd": "",
"fg2": "",
"p": $P.formFields.get().schProductCd,
"pn": $P.formFields.get().schProductNm,
"dbSkipYn": "N",
"userId": "suji"
// "userId": "${currentUser.account}"
};
// 검색조건
$P.control.query = $P.formFields.get(); // 검색 조건
// $P.control.query = $P.formFields.get(); // 검색 조건
$P.control.query.fetchSize = $P.control.defaultFetchSize; // 한번에 조회되는 자료 건수
$P.control.query.delYn = "N"; // 삭제 여부

Loading…
Cancel
Save