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

dev
Jonguk. Lim 4 months ago
parent 096e174f6b
commit 4e9e0ae3c4

@ -84,9 +84,7 @@
<thead class="sticky-thead"> <thead class="sticky-thead">
<tr id="theadTr--${pageName}" <tr id="theadTr--${pageName}"
data-by="by--${pageName}" data-by-output="byOutput--${pageName}" data-main-option="mainOption--${pageName}" data-sub-option="subOption--${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: 60px;">No.</th>
<th class="cmn" style="width: 170px;">관할관청</th> <th class="cmn" style="width: 170px;">관할관청</th>
<th class="cmn" style="width: 100px;">종 폐기건수</th>
<th class="cmn" style="width: 120px;">마약류취급의료업</th> <th class="cmn" style="width: 120px;">마약류취급의료업</th>
<th class="cmn" style="width: 100px;">마약류소매업</th> <th class="cmn" style="width: 100px;">마약류소매업</th>
<th class="cmn" style="width: 100px;">마약류도매업</th> <th class="cmn" style="width: 100px;">마약류도매업</th>
@ -94,16 +92,15 @@
<th class="cmn" style="width: 100px;">마약류수출입업</th> <th class="cmn" style="width: 100px;">마약류수출입업</th>
<th class="cmn" style="width: 100px;">마약류원료사용</th> <th class="cmn" style="width: 100px;">마약류원료사용</th>
<th class="cmn" style="width: 120px;">마약류취급학술연구</th> <th class="cmn" style="width: 120px;">마약류취급학술연구</th>
<th class="cmn" style="width: 100px;">폐기수량</th> <th class="cmn text-blue" style="width: 100px;">폐기건수</th>
<th class="cmn text-blue" style="width: 100px;">폐기수량</th>
</tr> </tr>
</thead> </thead>
<tbody id="tbody--${pageName}"> <tbody id="tbody--${pageName}">
</tbody> </tbody>
<template id="${infoPrefix}Row--${pageName}"> <template id="${infoPrefix}Row--${pageName}">
<tr data-key="{dept_cd}" class="{fw-bold-if-total}"> <tr data-key="{dept_cd}" class="{fw-bold-if-total}">
<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="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{dept_nm}</td>
<td class="text-end" onclick="{onclick}" ondblclick="{ondblclick}">{dsuseCnt}</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>
@ -111,7 +108,8 @@
<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}">{dsuseQy}</td> <td class="text-end text-blue" onclick="{onclick}" ondblclick="{ondblclick}">{dsuseCnt}</td>
<td class="text-end text-blue" onclick="{onclick}" ondblclick="{ondblclick}">{dsuseQy}</td>
</tr> </tr>
</template> </template>
<template id="${infoPrefix}NotFound--${pageName}"> <template id="${infoPrefix}NotFound--${pageName}">

@ -87,9 +87,9 @@
<th class="cmn align-content-center p-1" style="width: 170px;" rowspan="2">관할관청</th> <th class="cmn align-content-center p-1" style="width: 170px;" rowspan="2">관할관청</th>
<th class="cmn align-content-center p-1" style="width: 350px;" rowspan="2">제품명</th> <th class="cmn align-content-center p-1" style="width: 350px;" rowspan="2">제품명</th>
<th class="cmn align-content-center p-1" style="width: 146px;" rowspan="2">제품코드</th> <th class="cmn align-content-center p-1" style="width: 146px;" rowspan="2">제품코드</th>
<th class="cmn" colspan="4">처리상태별 건수</th> <th class="cmn fw-bold" colspan="4">처리상태별 건수</th>
<th class="cmn align-content-center p-1" style="width: 100px;" rowspan="2">폐기건수</th> <th class="cmn align-content-center p-1 text-blue" style="width: 100px;" rowspan="2">폐기건수</th>
<th class="cmn align-content-center p-1" style="width: 100px;" rowspan="2">폐기수량</th> <th class="cmn align-content-center p-1 text-blue" style="width: 100px;" rowspan="2">폐기수량</th>
</tr> </tr>
<tr id="theadTr--${pageName}" <tr id="theadTr--${pageName}"
data-by="by--${pageName}" data-by-output="byOutput--${pageName}" data-main-option="mainOption--${pageName}" data-sub-option="subOption--${pageName}"> data-by="by--${pageName}" data-by-output="byOutput--${pageName}" data-main-option="mainOption--${pageName}" data-sub-option="subOption--${pageName}">
@ -111,8 +111,8 @@
<td class="text-end" onclick="{onclick}" ondblclick="{ondblclick}">{rsltCnt}</td> <td class="text-end" onclick="{onclick}" ondblclick="{ondblclick}">{rsltCnt}</td>
<td class="text-end" onclick="{onclick}" ondblclick="{ondblclick}">{mappingCnt}</td> <td class="text-end" onclick="{onclick}" ondblclick="{ondblclick}">{mappingCnt}</td>
<td class="text-end" onclick="{onclick}" ondblclick="{ondblclick}">{cpltCnt}</td> <td class="text-end" onclick="{onclick}" ondblclick="{ondblclick}">{cpltCnt}</td>
<td class="text-end" onclick="{onclick}" ondblclick="{ondblclick}">{dsuseCnt}</td> <td class="text-end text-blue" onclick="{onclick}" ondblclick="{ondblclick}">{dsuseCnt}</td>
<td class="text-end" onclick="{onclick}" ondblclick="{ondblclick}">{dsuseQy}</td> <td class="text-end text-blue" onclick="{onclick}" ondblclick="{ondblclick}">{dsuseQy}</td>
</tr> </tr>
</template> </template>
<template id="${infoPrefix}NotFound--${pageName}"> <template id="${infoPrefix}NotFound--${pageName}">
@ -140,10 +140,12 @@
**************************************************************************/ **************************************************************************/
pageObject["${pageName}"] = {}; pageObject["${pageName}"] = {};
/************************************************************************** /**************************************************************************
* script 진입 * script 진입
**************************************************************************/ **************************************************************************/
$(document).ready(function() { $(document).ready(function() {
let totalDs = null;
// pageObject // pageObject
let $P = pageObject["${pageName}"]; let $P = pageObject["${pageName}"];
@ -160,7 +162,18 @@
, prefix: "dsuseMgtDsuseQyByPrdStatistics" , prefix: "dsuseMgtDsuseQyByPrdStatistics"
, prefixName: "제품별 폐기 현황" , prefixName: "제품별 폐기 현황"
, keymapper: info => info ? info.prduct_cd : "" , keymapper: info => info ? info.prduct_cd : ""
, dataGetter: obj => obj.${infoPrefix}List , dataGetter: obj => {
let list = obj.${infoPrefix}List;
// TOTAL 데이터
totalDs = new Dataset({
keymapper: info => info? info.dept_cd : ''
, dataGetter: obj => obj
});
totalDs.setData(list.filter(d => d.dept_cd === 'TOTAL'));
return list.filter(d => d.dept_cd !== 'TOTAL');
}
, appendData: true , appendData: true
, infoSize: "xl" , infoSize: "xl"
}); });
@ -176,6 +189,14 @@
// Dataset 변경 이벤트 // Dataset 변경 이벤트
$P.control.onDatasetChange = (obj) => { $P.control.onDatasetChange = (obj) => {
$P.renderList(obj.${infoPrefix}Total); $P.renderList(obj.${infoPrefix}Total);
$("#${infoPrefix}Paging--${pageName}").setPagingInfo({
list: $P.control.dataset
, prefix: "${infoPrefix}Paging--${pageName}"
, start: obj.${infoPrefix}Start
, totalSize: $P.control.dataset.length
, fetchSize: obj.${infoPrefix}Fetch
, func: "pageObject['${pageName}'].control.load({index})"
});
}; };
// 현재 선택 자료 변경 이벤트 // 현재 선택 자료 변경 이벤트
@ -208,21 +229,28 @@
let replacer = (str, dataItem) => { let replacer = (str, dataItem) => {
str = str.replace(/{onclick}/gi, "pageObject['${pageName}'].control.setCurrent('" + dataItem.getValue("prduct_cd") + "');") str = str.replace(/{onclick}/gi, "pageObject['${pageName}'].control.setCurrent('" + dataItem.getValue("prduct_cd") + "');")
if(dataItem.getValue("dept_cd") == "TOTAL"){ str = str.replace(/{fw-bold-if-total}/gi, "");
str = str.replace(/{fw-bold-if-total}/gi, "fw-bold"); return str;
} else {
str = str.replace(/{fw-bold-if-total}/gi, "");
}
return str;
} }
let trs = empty ? [document.getElementById("${infoPrefix}NotFound--${pageName}").content.outerHTML] let trs = empty ? [document.getElementById("${infoPrefix}NotFound--${pageName}").content.outerHTML]
: ${infoPrefix}List.inStrings(foundTr.outerHTML, replacer); : ${infoPrefix}List.inStrings(foundTr.outerHTML, replacer);
$("#tbody--${pageName}").html(trs.join()); $("#tbody--${pageName}").html(trs.join());
// TOTAL 데이터 추가
let replacer2 = (str, dataItem) => {
str = str.replace(/{onclick}/gi, "pageObject['${pageName}'].control.setCurrent('" + dataItem.getValue("prduct_cd") + "');")
str = str.replace(/{fw-bold-if-total}/gi, "fw-bold");
str = str.replace(/{ROW_NUM}/gi, "");
return str;
}
let tr = totalDs.inStrings(foundTr.outerHTML, replacer2);
$("#tbody--${pageName}").append(tr);
} }
$P.control.getBsshInfo = (gdccId) => { $P.control.getBsshInfo = (gdccId) => {
let dialogTitle = "마약류 취급업체 조회"; let dialogTitle = "마약류 취급업체 조회";
let params = {openPage : "frmSearch--${pageName}"}; let params = {openPage : "frmSearch--${pageName}"};

@ -86,10 +86,9 @@
<table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer" id="DataTables_Table_0--${pageName}" aria-describedby="DataTables_Table_0_info"> <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"> <thead class="sticky-thead">
<tr id="theadTr0--${pageName}"> <tr id="theadTr0--${pageName}">
<th class="cmn text-center align-content-center p-1" style="width: 60px;" rowspan="2">NO.</th> <th class="cmn align-content-center p-1" style="width: 170px;" rowspan="2">관할관청</th>
<th class="cmn align-content-center p-1" style="width: 170px;" rowspan="2">관할관청</th> <th class="cmn fw-bold" colspan="7">마약 / 향정 구분</th>
<th class="cmn" colspan="7">마약 / 향정 구분</th> <th class="cmn fw-bold" colspan="4">중점 / 일반 구분</th>
<th class="cmn" colspan="4">중점 / 일반 구분</th>
</tr> </tr>
<tr id="theadTr--${pageName}" <tr id="theadTr--${pageName}"
data-by="by--${pageName}" data-by-output="byOutput--${pageName}" data-main-option="mainOption--${pageName}" data-sub-option="subOption--${pageName}"> data-by="by--${pageName}" data-by-output="byOutput--${pageName}" data-main-option="mainOption--${pageName}" data-sub-option="subOption--${pageName}">
@ -110,7 +109,6 @@
</tbody> </tbody>
<template id="${infoPrefix}Row--${pageName}"> <template id="${infoPrefix}Row--${pageName}">
<tr data-key="{dept_cd}" class="{fw-bold-if-total}"> <tr data-key="{dept_cd}" class="{fw-bold-if-total}">
<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="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>
@ -185,7 +183,7 @@
**************************************************************************/ **************************************************************************/
// Dataset 변경 이벤트 // Dataset 변경 이벤트
$P.control.onDatasetChange = (obj) => { $P.control.onDatasetChange = (obj) => {
$P.renderList(obj.${infoPrefix}Total); $P.renderList();
}; };
// 현재 선택 자료 변경 이벤트 // 현재 선택 자료 변경 이벤트
@ -203,7 +201,7 @@
* DataTables 이벤트 * DataTables 이벤트
**************************************************************************/ **************************************************************************/
// DataTables에 click, dbclick 이벤트 // DataTables에 click, dbclick 이벤트
$P.renderList = (totalSize) => { $P.renderList = () => {
let ${infoPrefix}List = $P.control.dataset; let ${infoPrefix}List = $P.control.dataset;
let empty = ${infoPrefix}List.empty; let empty = ${infoPrefix}List.empty;

Loading…
Cancel
Save