fix : 폐기 맵핑 정보 조회 기능 완료

dev
Leeyh1121 5 months ago
parent ba221e1fa5
commit 46352ac018

@ -136,36 +136,32 @@
<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: 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: 180px;">취급일자</th>
<th class="cmn" style="width: 230.469px;">폐기일자</th>
<th class="cmn" style="width: 180px;">폐기장소</th>
</tr>
</thead>
<tbody id="tbody--${pageName}">
<tbody id="tbody--${pageName}Mapping">
</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>
<template id="${infoPrefix}Row--${pageName}Mapping">
<tr data-key="{orgUsrRptIdNo}">
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}"></td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{dscdmngId}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{bsshNm}</td>
<td class="cmn text-start" onclick="{onclick}" ondblclick="{ondblclick}">{indutyNm}</td>
<td class="cmn text-end" onclick="{onclick}" ondblclick="{ondblclick}">{dsuseMthCd}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{dsusePrvNm}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{hdrDe}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{dsuseDe}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{dsuseLoc}</td>
</tr>
</template>
<template id="${infoPrefix}NotFound--${pageName}">
<template id="${infoPrefix}NotFound--${pageName}Mapping">
<tr class="odd">
<td valign="top" colspan="13" class="dataTables_empty text-center">${prefixName} 정보를 찾지 못했습니다.</td>
</tr>
@ -193,24 +189,22 @@
<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 id="tbody--${pageName}MappingDtl">
</tbody>
<template id="${infoPrefix}Row--${pageName}Detail">
<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}">{PRDUCT_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{PRDUCT_CD}</td>
<td class="cmn text-start" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_QY}</td>
<td class="cmn text-end" onclick="{onclick}" ondblclick="{ondblclick}">{PRD_VALID_DE}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{MIN_DISTB}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{PCE}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_QY}</td>
<template id="${infoPrefix}Row--${pageName}MappingDtl">
<tr data-key="{mnfSeq}">
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}"></td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{prductNm}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{prductCd}</td>
<td class="cmn text-start" onclick="{onclick}" ondblclick="{ondblclick}">{dsuseQy}</td>
<td class="cmn text-end" onclick="{onclick}" ondblclick="{ondblclick}">{prdValidDe}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{minDistbQy} {minDistbUnit}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{pceQy} {pceUnit}</td>
</tr>
</template>
<template id="${infoPrefix}NotFound--${pageName}Detail">
<template id="${infoPrefix}NotFound--${pageName}MappingDtl">
<tr class="odd">
<td valign="top" colspan="5" class="dataTables_empty text-center">${prefixName} 상세 정보를 찾지 못했습니다.</td>
</tr>
@ -260,8 +254,7 @@
, keymapper: info => info ? info.dscdmngId : ""
, dataGetter: obj => obj.${infoPrefix}Info
, infoSize: "xl"
});
});
$P.detailControl = new DatasetControl({
urls : {
@ -286,7 +279,7 @@
}
, prefix: "dsuseMgtMapping"
, prefixName: "마약류 제품 조회"
, keymapper: info => info ? info.dscdmngId : ""
, keymapper: info => info ? info.usrRptIdNo : ""
, dataGetter : obj => {
if (!obj.success){
dialog.alert(obj.message);
@ -303,6 +296,14 @@
}
});
$P.mappingDtlControl = new DatasetControl({
prefix: "dsuseMgtMapping"
, prefixName: "마약류 취급업체 조회"
, keymapper: info => info ? info.mnfSeq : ""
, dataGetter: obj => obj.${infoPrefix}MappingDtl
, infoSize: "xl"
});
/**************************************************************************
* DatasetControl 이벤트
**************************************************************************/
@ -347,18 +348,33 @@
};
$P.mappingControl.onDatasetChange = (obj) => {
$P.renderMappingList(obj.${infoPrefix}Total);
};
$P.mappingControl.onCurrentChange = item => {
if (!item) return;
let key = item.data.usrRptIdNo;
let key = item.data.usrRptIdNo;
$("#tbody--${pageName}Mapping").setCurrentRow(key);
// Dataset 셋팅
$P.formFields.set($P.mappingControl, item);
//$P.formFields.set($P.mappingControl, item);
$P.mappingDtlControl.setData(item.data.listDtl);
console.log(item.data.listDtl);
}
$P.mappingDtlControl.onDatasetChange = (obj) => {
$P.renderMappingDtlList(obj.${infoPrefix}Total);
};
$P.mappingDtlControl.onCurrentChange = item => {
if (!item) return;
let key = item.data.mnfSeq;
$("#tbody--${pageName}MappingDtl").setCurrentRow(key);
}
// 저장 callback
$P.control.onSave = (resp) => {
@ -407,6 +423,36 @@
$("#tbody--${pageName}Detail").html(trs.join());
}
$P.renderMappingList = () => {
let ${infoPrefix}MappingList = $P.mappingControl.dataset;
let empty = ${infoPrefix}MappingList.empty;
let trs = empty ?
[document.getElementById("${infoPrefix}NotFound--${pageName}Mapping").innerHTML] : <%-- from template#${infoPrefix}NotFound --%>
${infoPrefix}MappingList.inStrings(
document.getElementById("${infoPrefix}Row--${pageName}Mapping").innerHTML, <%-- from template#${infoPrefix}Row --%>
(str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].mappingControl.setCurrent('" + dataItem.getValue("usrRptIdNo") + "');")
);
$("#tbody--${pageName}Mapping").html(trs.join());
}
$P.renderMappingDtlList = () => {
let ${infoPrefix}MappingDtlList = $P.mappingDtlControl.dataset;
let empty = ${infoPrefix}MappingDtlList.empty;
let trs = empty ?
[document.getElementById("${infoPrefix}NotFound--${pageName}MappingDtl").innerHTML] : <%-- from template#${infoPrefix}NotFound --%>
${infoPrefix}MappingDtlList.inStrings(
document.getElementById("${infoPrefix}Row--${pageName}MappingDtl").innerHTML, <%-- from template#${infoPrefix}Row --%>
(str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].mappingDtlControl.setCurrent('" + dataItem.getValue("usrRptIdNo") + "');")
);
$("#tbody--${pageName}MappingDtl").html(trs.join());
}
/**************************************************************************
* 사용자 함수(function)
**************************************************************************/

Loading…
Cancel
Save