|
|
|
@ -21,12 +21,12 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
<!-- / 업무 버튼 표시 -->
|
|
|
|
|
<!-- / 업무 버튼 표시 -->
|
|
|
|
|
<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-responsiv-0--${pageName}">
|
|
|
|
|
<div class="table-responsive ox-scroll oy-scroll h-px-600" id="table-responsive-0--${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>
|
|
|
|
|
<thead class="sticky-thead">
|
|
|
|
|
<tr>
|
|
|
|
|
<th class="sorting" style="width: 146.156px;">제품코드</th>
|
|
|
|
|
<th class="sorting" style="width: 350.141px;">제품명</th>
|
|
|
|
@ -37,7 +37,7 @@
|
|
|
|
|
<th class="sorting" style="width: 130.469px;">취급자번호</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody id="tbody--${pageName}">
|
|
|
|
|
<tbody id="tbody--${pageName}">
|
|
|
|
|
</tbody>
|
|
|
|
|
<template id="${infoPrefix}Row--${pageName}">
|
|
|
|
|
<tr data-key="{keyCnt}">
|
|
|
|
@ -87,29 +87,27 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</form>
|
|
|
|
|
<!-- 업무 버튼 표시 -->
|
|
|
|
|
<div>
|
|
|
|
|
</div>
|
|
|
|
|
<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-500" id="table-responsive-1--${pageName}">
|
|
|
|
|
<div class="table-responsive ox-scroll oy-scroll h-px-600" 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_1_info">
|
|
|
|
|
<thead>
|
|
|
|
|
<thead class="sticky-thead">
|
|
|
|
|
<tr>
|
|
|
|
|
<%-- <th class="sorting" style="width: 146.156px;">제품코드</th>--%>
|
|
|
|
|
<%-- <th class="sorting" style="width: 330.141px;">제품명</th>--%>
|
|
|
|
|
<th class="sorting" style="width: 120.469px;">유효기간</th>
|
|
|
|
|
<th class="sorting" style="width: 160.469px;">제조번호</th>
|
|
|
|
|
<th class="sorting" style="width: 160.469px;">제조일련번호</th>
|
|
|
|
|
<th class="sorting" style="width: 146px;">제품코드</th>
|
|
|
|
|
<th class="sorting" style="width: 110px;">유효기간</th>
|
|
|
|
|
<th class="sorting" style="width: 155px;">제조번호</th>
|
|
|
|
|
<th class="sorting" style="width: 155px;">제조일련번호</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody id="tbody--${pageName}Detail">
|
|
|
|
|
<tbody id="tbody--${pageName}Detail">
|
|
|
|
|
</tbody>
|
|
|
|
|
<template id="${infoPrefix}Row--${pageName}Detail">
|
|
|
|
|
<tr data-key="{keyCnt}">
|
|
|
|
|
<%-- <td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{prductCd}</td>--%>
|
|
|
|
|
<%-- <td class="cmn text-start" onclick="{onclick}" ondblclick="{ondblclick}">{prductNm}</td>--%>
|
|
|
|
|
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{prductCd}</td>
|
|
|
|
|
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{prdValidDe}</td>
|
|
|
|
|
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{mnfNo}</td>
|
|
|
|
|
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{mnfSeq}</td>
|
|
|
|
@ -186,12 +184,12 @@
|
|
|
|
|
, appendData: true
|
|
|
|
|
, infoSize: "xl"
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// $P.control 설정
|
|
|
|
|
$P.control.defaultFetchSize = FETCH_XXS; // 1 페이지당 조회되는 자료 건수 index.jsp에서 확인 FETCH_XS = 30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$P.seqInfoControl = new DatasetControl({
|
|
|
|
|
urls : {
|
|
|
|
|
load : wctx.url("/adds/nims/getNimsProductSeqInfo.do"), // 시리얼번호 검색
|
|
|
|
@ -222,7 +220,7 @@
|
|
|
|
|
prdValidDe: dateFormat
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// $P.control 설정
|
|
|
|
|
$P.seqInfoControl.defaultFetchSize = FETCH_MD; // 1 페이지당 조회되는 자료 건수 index.jsp에서 확인 FETCH_XS = 30
|
|
|
|
|
|
|
|
|
@ -232,19 +230,19 @@
|
|
|
|
|
* DatasetControl 이벤트
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
// Dataset 변경 이벤트
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$P.control.onDatasetChange = (obj, option) => {
|
|
|
|
|
$P.renderList(obj.${infoPrefix}Total, option);
|
|
|
|
|
$P.renderList(obj.totalCount, option);
|
|
|
|
|
|
|
|
|
|
$("#${infoPrefix}Paging--${pageName}").setPagingInfo({
|
|
|
|
|
list: $P.control.dataset
|
|
|
|
|
, prefix: "${infoPrefix}Paging--${pageName}"
|
|
|
|
|
, start: obj.${infoPrefix}Start
|
|
|
|
|
, totalSize: $P.control.dataset.length
|
|
|
|
|
, totalSize: obj.totalCount
|
|
|
|
|
, fetchSize: obj.${infoPrefix}Fetch
|
|
|
|
|
, func: "pageObject['${pageName}'].control.load({index})"
|
|
|
|
|
//, func: "pageObject['${pageName}'].control.load({index})"
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -258,7 +256,7 @@
|
|
|
|
|
|
|
|
|
|
let key = item.data.keyCnt;
|
|
|
|
|
$("#tbody--${pageName}").setCurrentRow(key);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#btnSearch3--${pageName}").prop("disabled", false);
|
|
|
|
|
$P.fnDetailSearchList();
|
|
|
|
|
}
|
|
|
|
@ -280,12 +278,9 @@
|
|
|
|
|
, prefix: "${infoPrefix}DetailPaging--${pageName}"
|
|
|
|
|
, totalSize: obj.totalCount
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
// 저장 callback
|
|
|
|
|
|
|
|
|
|
// 저장
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
|
* DataTables 이벤트
|
|
|
|
@ -296,26 +291,16 @@
|
|
|
|
|
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("keyCnt") + "');");
|
|
|
|
|
// .replace(/{ondblclick}/gi, "pageObject['${pageName}'].fnSave()");
|
|
|
|
|
|
|
|
|
|
let trs = empty ? [document.getElementById("${infoPrefix}NotFound--${pageName}").innerHTML]
|
|
|
|
|
: ${infoPrefix}List.inStrings(foundTr.outerHTML, replacer);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#tbody--${pageName}").html(trs.join());
|
|
|
|
|
let trs = empty ?
|
|
|
|
|
[document.getElementById("${infoPrefix}NotFound--${pageName}").innerHTML] :
|
|
|
|
|
${infoPrefix}List.inStrings(
|
|
|
|
|
document.getElementById("${infoPrefix}Row--${pageName}").innerHTML,
|
|
|
|
|
(str, dataItem) => str
|
|
|
|
|
.replace(/{onclick}/gi, "pageObject['${pageName}'].control.setCurrent('" + dataItem.getValue("keyCnt") + "');"));
|
|
|
|
|
let noMore = (${infoPrefix}List.length >= totalSize);
|
|
|
|
|
let initScroll = ($P.control.query.pageNum < 2);
|
|
|
|
|
|
|
|
|
|
$("#table-responsive-0--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.renderDetailList = (totalSize, option) => {
|
|
|
|
@ -328,15 +313,12 @@
|
|
|
|
|
document.getElementById("${infoPrefix}Row--${pageName}Detail").innerHTML, <%-- from template#${infoPrefix}Row --%>
|
|
|
|
|
(str, dataItem) => str
|
|
|
|
|
.replace(/{onclick}/gi, "pageObject['${pageName}'].seqInfoControl.setCurrent('" + dataItem.getValue("keyCnt") + "');")
|
|
|
|
|
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].fnSave()")
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].fnSave()"));
|
|
|
|
|
|
|
|
|
|
let noMore = (${infoPrefix}DetailList.length >= totalSize);
|
|
|
|
|
let initScroll = ($P.seqInfoControl.query.pageNum < 2);
|
|
|
|
|
|
|
|
|
|
$("#table-responsive-1--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#table-responsive-1--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
|
|
|
|
|
}
|
|
|
|
|
/**************************************************************************
|
|
|
|
|
* 사용자 함수(function)
|
|
|
|
@ -347,8 +329,23 @@
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
//그리드(좌)조회(새로 조회)
|
|
|
|
|
$P.fnSearchList = () => {
|
|
|
|
|
if($P.formFields.get().schProductNm.length + $P.formFields.get().schProductCd.length === 0){
|
|
|
|
|
dialog.alert({
|
|
|
|
|
content: "상품명 또는 상품번호중 하나는 필수입니다."
|
|
|
|
|
});
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($P.formFields.get().schProductNm.length !== 0 && $P.formFields.get().schProductNm.length < 2){
|
|
|
|
|
dialog.alert({
|
|
|
|
|
content: "상품명은 2자 이상으로 조회해 주세요."
|
|
|
|
|
});
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.control.query = {
|
|
|
|
|
... $P.formFields.get(),
|
|
|
|
|
pg: 1,
|
|
|
|
|
p: $P.formFields.get().schProductCd,
|
|
|
|
|
pn: $P.formFields.get().schProductNm,
|
|
|
|
|
bc: '${bsshCd}', //업체코드
|
|
|
|
@ -359,6 +356,14 @@
|
|
|
|
|
|
|
|
|
|
$P.control.load(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$P.scrollList = () => {
|
|
|
|
|
$P.control.query.pg = $P.control.query.pageNum + 1;
|
|
|
|
|
$P.control.load($P.control.query.pageNum + 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//그리드(우)조회(새로 조회)
|
|
|
|
|
$P.fnDetailSearchList = () => {
|
|
|
|
|
$P.seqInfoControl.query = {
|
|
|
|
@ -376,14 +381,14 @@
|
|
|
|
|
|
|
|
|
|
$P.seqInfoControl.load(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//그리드(우)조회(스크롤)
|
|
|
|
|
$P.scrollDetailDataList = () => {
|
|
|
|
|
|
|
|
|
|
$P.seqInfoControl.query.pg = $P.seqInfoControl.query.pageNum + 1;
|
|
|
|
|
$P.seqInfoControl.load($P.seqInfoControl.query.pageNum + 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 저장
|
|
|
|
|
$P.fnSave = () => {
|
|
|
|
|
let openPage = new AddsFormFields("#${openPage}");
|
|
|
|
@ -397,7 +402,7 @@
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
// 이벤트 설정
|
|
|
|
|
$P.setEvent = () => {
|
|
|
|
|
// form-date 항목에서 키보드로 입력시 날짜 포맷팅 적용
|
|
|
|
|
// form-date 항목에서 키보드로 입력시 날짜 포맷팅 적용
|
|
|
|
|
$("#frmSearch--${pageName}").find(".form-date").each(function() {
|
|
|
|
|
$(this).on("input", function() {
|
|
|
|
|
let value = this.value.replaceAll("-", "");
|
|
|
|
@ -409,20 +414,21 @@
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 버튼 이벤트
|
|
|
|
|
$("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장
|
|
|
|
|
$("#btnSearch--${pageName}").on("click", () => $P.fnSearchList());
|
|
|
|
|
$("#btnSearch3--${pageName}").on("click", () => $P.fnDetailSearchList());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#frmSearch--${pageName} input").onEnterPress($P.fnSearchList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#frmSearch--${pageName}Detail input").onEnterPress($P.fnDetailSearchList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Componentization.fnMakeScrollableTable($("#table-responsive-0--${pageName}")[0], $P.scrollList);
|
|
|
|
|
Componentization.fnMakeScrollableTable($("#table-responsive-1--${pageName}")[0], $P.scrollDetailDataList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 초기 화면 설정
|
|
|
|
|
$P.initForm = () => {
|
|
|
|
|
$("#btnSearch3--${pageName}").prop("disabled", true);
|
|
|
|
|