fit : 매핑 조회기능 수정중.

dev
Leeyh1121 5 months ago
parent c4abe0945b
commit c93b35f97f

@ -128,9 +128,10 @@
<div class="card col-6"> <div class="card col-6">
<label class="form-label fw-bold form-search-title" for="Rslt--${pageName}">결과 정보</label> <label class="form-label fw-bold form-search-title" for="Rslt--${pageName}">결과 정보</label>
<div class="card-datatable text-nowrap"> <div class="card-datatable text-nowrap">
<div class="dataTables_wrapper dt-bootstrap5 no-footer" id="DataTables_Table_0_wrapper--${pageName}"> <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--${pageName}"> <div class="table-responsive ox-scroll oy-scroll h-px-250" id="table-responsive-1--${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"> <table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer"
id="DataTables_Table_1--${pageName}" aria-describedby="DataTables_Table_1_info">
<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}">
@ -179,10 +180,10 @@
<label class="form-label fw-bold form-search-title" for="RsltDetail--${pageName}">제품 정보</label> <label class="form-label fw-bold form-search-title" for="RsltDetail--${pageName}">제품 정보</label>
<div class="row g-1"> <div class="row g-1">
<div class="card-datatable text-nowrap"> <div class="card-datatable text-nowrap">
<div class="dataTables_wrapper dt-bootstrap5 no-footer" id="DataTables_Table_1_wrapper--${pageName}"> <div class="dataTables_wrapper dt-bootstrap5 no-footer" id="DataTables_Table_2_wrapper--${pageName}">
<div class="table-responsive ox-scroll oy-scroll h-px-300" id="table-responsive-1--${pageName}"> <div class="table-responsive ox-scroll oy-scroll h-px-300" id="table-responsive-2--${pageName}">
<table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer" <table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer"
id="DataTables_Table_1--${pageName}" aria-describedby="DataTables_Table_0_info"> id="DataTables_Table_2--${pageName}" aria-describedby="DataTables_Table_2_info">
<thead class="sticky-thead"> <thead class="sticky-thead">
<tr> <tr>
<th class="cmn" style="width: 72px;">No.</th> <th class="cmn" style="width: 72px;">No.</th>
@ -279,6 +280,29 @@
} }
}); });
$P.mappingControl = new DatasetControl({
urls : {
load : '<c:url value="${apiHost}/api/biz/nims/v1/getDsuseMgtMapping" />',
}
, prefix: "dsuseMgtMapping"
, prefixName: "마약류 제품 조회"
, keymapper: info => info ? info.dscdmngId : ""
, dataGetter : obj => {
if (!obj.success){
dialog.alert(obj.message);
return false;
}
return obj.data
}
, appendData: true
, infoSize: "xl"
, formats: {
hdrDe: dateFormat
, rptDe: dateFormat
, dsuseDe: dateFormat
}
});
/************************************************************************** /**************************************************************************
* DatasetControl 이벤트 * DatasetControl 이벤트
**************************************************************************/ **************************************************************************/
@ -305,6 +329,13 @@
var dscdmngId = item.data.dscdmngId; var dscdmngId = item.data.dscdmngId;
$P.detailControl.query = { "schDscdmngId" : dscdmngId}; $P.detailControl.query = { "schDscdmngId" : dscdmngId};
$P.detailControl.load(1); $P.detailControl.load(1);
$P.mappingControl.query = {
dscdmngId: $P.formFields.get().dscdmngId,
userId: "suji"
//userId: "${currentUser.account}"
};
$P.mappingControl.load(1);
} }
$P.detailControl.onCurrentChange = (item) => { $P.detailControl.onCurrentChange = (item) => {
@ -314,6 +345,19 @@
$("#tbody--${pageName}Detail").setCurrentRow(key); $("#tbody--${pageName}Detail").setCurrentRow(key);
}; };
$P.mappingControl.onDatasetChange = (obj) => {
};
$P.mappingControl.onCurrentChange = item => {
if (!item) return;
let key = item.data.usrRptIdNo;
$("#tbody--${pageName}Mapping").setCurrentRow(key);
// Dataset 셋팅
$P.formFields.set($P.mappingControl, item);
}
// 저장 callback // 저장 callback
@ -375,7 +419,7 @@
/************************************************************************** /**************************************************************************
* 버튼 clickEvent * 버튼 clickEvent
**************************************************************************/ **************************************************************************/
// 저장 // 저장
$P.fnSave = () => { $P.fnSave = () => {
// validate 확인 // validate 확인
@ -389,51 +433,22 @@
} }
}); });
} }
//추가
$P.fnAdd = () => {
$P.productList.addData($P.productFormFields.get());
}
$P.fnDel = () => {
// validate 확인
if (!customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;
dialog.alert({
content: "현재 " + $P.control.prefixName + " 정보를 저장하시겠습니까?"
, init: () => { setDialogZindex(); }
, onOK: () => {
$P.control.save($P.bsshFormFields.get()); // formFields
}
});
}
/************************************************************************** /**************************************************************************
* 초기 셋팅 * 초기 셋팅
**************************************************************************/ **************************************************************************/
// 이벤트 설정 // 이벤트 설정
$P.setEvent = () => { $P.setEvent = () => {
// 안내문 등록 버튼 이벤트
$("#btnBsshSearch--${pageName}").on("click", function() {
$P.fnSearchBssh($(this).attr("title"));
});
$("#btnProductSearch--${pageName}").on("click", function() {
$P.fnSearchProduct($(this).attr("title"));
});
// 버튼 이벤트 // 버튼 이벤트
$("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장 $("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장
$("#btnAdd--${pageName}").on("click", () => $P.fnAdd()); // 추가
$("#btnDel--${pageName}").on("click", () => $P.fnDel()); // 추가
} }
// 초기 화면 설정 // 초기 화면 설정
$P.initForm = () => { $P.initForm = () => {
fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollDataList); // fnMakeScrollableTable($("#table-responsive-0--${pageName}")[0], $P.scrollDataList);
// fnMakeScrollableTable($("#table-responsive-1--${pageName}")[0], $P.scrollDataList);
// fnMakeScrollableTable($("#table-responsive-2--${pageName}")[0], $P.scrollDataList);
// Dialog 마우스로 드래그 할 수 있도록 설정. // Dialog 마우스로 드래그 할 수 있도록 설정.
//fnMakeDraggableDialog(document.getElementById($P.control.prefix + "Dialog")); //fnMakeDraggableDialog(document.getElementById($P.control.prefix + "Dialog"));
} }

@ -98,7 +98,7 @@
<tbody id="tbody--${pageName}"> <tbody id="tbody--${pageName}">
</tbody> </tbody>
<template id="${infoPrefix}Row--${pageName}"> <template id="${infoPrefix}Row--${pageName}">
<tr data-key="DSCDMNG_ID"> <tr data-key="{DSCDMNG_ID}">
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{ROW_NUM}</td> <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}">{HDR_DE}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSCDMNG_ID}</td> <td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSCDMNG_ID}</td>

Loading…
Cancel
Save