fix: 폐기보고 확인된 데이타 조회 처리 추가

dev
Jonguk. Lim 5 months ago
parent b71bd0549b
commit c358729268

@ -132,9 +132,6 @@
<div class="card col-6">
<label class="form-label fw-bold form-search-title" for="Rslt--${pageName}">결과 정보</label>
<input type="hidden" id="setUsrRptIdNo--${pageName}" name="setUsrRptIdNo" />
<!-- <input type="hidden" id="setOrgUsrRptIdNo--${pageName}" name="setOrgUsrRptIdNo" />
<input type="hidden" id="setRptTyCd--${pageName}" name="setRptTyCd" />
<input type="hidden" id="setStatus--${pageName}" name="setStatus" /> -->
<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-250" id="table-responsive-1--${pageName}">
@ -398,6 +395,14 @@
// 저장
$P.control.save = () => {
// FIXME: 확인
alert("저장 row : "+JSON.stringify($P.mappingControl.dataset.getCurrent()));
// if(!$P.mappingControl.dataset.getCurrent().usrRptIdNo){
// dialog.alert("선택된 NIMS 폐기 보고 데이타가 없습니다");
// return false;
// }
ajax.post({
url: '<c:url value="${apiHost}/api/biz/nims/v1/modifyMappingDsuseMgt"/>'
, data: JSON.stringify({
@ -408,7 +413,6 @@
rptTyCd: $P.mappingControl.dataset.getCurrent().rptTyCd,
stts: $P.mappingControl.dataset.getCurrent().status,
userId: "${currentUser.account}"
// rgtr: "${currentUser.account}",
})
, contentType : "application/json; charset=utf-8"
, success: resp => {
@ -472,30 +476,30 @@
}
$P.renderMappingDtlList = () => {
let ${infoPrefix}MappingDtlList = $P.mappingDtlControl.dataset;
let empty = ${infoPrefix}MappingDtlList.empty;
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") + "');")
);
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());
$("#tbody--${pageName}MappingDtl").find("tr").each(function(){
$("#tbody--${pageName}MappingDtl").html(trs.join());
col0 = $(this).find("td").eq(0).find("input");
col0val = $(this).find("td").eq(0).find("input").val();
$("#tbody--${pageName}MappingDtl").find("tr").each(function(){
if(col0val != "" && col0val != null){
col0.prop("checked",true);
}
col0 = $(this).find("td").eq(0).find("input");
col0val = $(this).find("td").eq(0).find("input").val();
});
}
if(col0val != "" && col0val != null){
col0.prop("checked",true);
}
});
}
/**************************************************************************
* 사용자 함수(function)
**************************************************************************/
@ -512,8 +516,15 @@
// 저장
$P.fnSave = () => {
let checkData = $("#setUsrRptIdNo--${pageName}").val();
$P.mappingControl.setCurrent(checkData);
// FIXME: 확인
alert('checkData : ' + checkData);
//$P.mappingControl.setCurrent(checkData);
const row = $P.mappingControl.getCurrent();
// FIXME: 확인
alert('row data : ' + JSON.stringify(row));
dialog.alert({
content: "현재 선택에 체크 된 폐기 보고 확인 정보를 저장하시겠습니까?"
, init: () => { setDialogZindex(); }
@ -557,9 +568,9 @@
// NIMS 보고 완료 확인인 경우 저장 버튼 숨김
if($P.control.getCurrent().prgrsSttsCd == "99"){
$("#btnSave--${pageName}").hide();
$("#btnSave--${pageName}").prop("disabled", true);
}else{
$("#btnSave--${pageName}").show();
$("#btnSave--${pageName}").prop("disabled", false);
}
});

@ -261,16 +261,30 @@
// 현재 선택 자료 변경 이벤트
$P.control.onCurrentChange = (item) => {
if (!item) {
$P.detailControl.setData([]);
$P.detailControl.setData([]);
$("#btnPrgsSttus--${pageName}").prop("disabled", true);
$("#btnCreateDsuseMgtMapping--${pageName}").prop("disabled", true);
return;
}
let key = item.data.DSCDMNG_ID;
$("#tbody--${pageName}").setCurrentRow(key);
var dscdmngId = item.data.DSCDMNG_ID;
let dscdmngId = item.data.DSCDMNG_ID;
$P.detailControl.query = { "schDscdmngId" : dscdmngId};
$P.detailControl.load(1);
if(item.data.PRGRS_STTS_CD == '21'){
$("#btnPrgsSttus--${pageName}").prop("disabled", false);
}else{
$("#btnPrgsSttus--${pageName}").prop("disabled", true);
}
if(item.data.PRGRS_STTS_CD == '06' || item.data.PRGRS_STTS_CD == '21'){
$("#btnCreateDsuseMgtMapping--${pageName}").prop("disabled", false);
}else{
$("#btnCreateDsuseMgtMapping--${pageName}").prop("disabled", true);
}
};

Loading…
Cancel
Save