|
|
|
@ -64,15 +64,15 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-md-4">
|
|
|
|
|
<label for="prdlstMstCd--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">제조 번호</label>
|
|
|
|
|
<input type="text" class="form-control w-60" id="prdlstMstCd--${pageName}" name="mnfNo" data-map="mnfNo" readonly>
|
|
|
|
|
<input type="text" class="form-control w-60" id="prdlstMstCd--${pageName}" name="mnfNo" data-map="mnfNo">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-md-4">
|
|
|
|
|
<label for="prdlstMstCd--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">제조 일련 번호</label>
|
|
|
|
|
<input type="text" class="form-control w-60" id="prdlstMstCd--${pageName}" name="mnfSeq" data-map="mnfSeq" readonly>
|
|
|
|
|
<input type="text" class="form-control w-60" id="prdlstMstCd--${pageName}" name="mnfSeq" data-map="mnfSeq">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-md-4">
|
|
|
|
|
<label for="rgsDt--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">유효기간</label>
|
|
|
|
|
<input type="text" class="form-control w-60" id="rgsDt--${pageName}" name="prdValidDe" data-map="prdValidDe" readonly>
|
|
|
|
|
<input type="text" class="form-control w-60" id="rgsDt--${pageName}" name="prdValidDe" data-map="prdValidDe">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-md-4">
|
|
|
|
|
<label for="prdMinDistbQy--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">최소 유통단위 수량</label>
|
|
|
|
@ -94,8 +94,8 @@
|
|
|
|
|
<span class="container-page-btn">
|
|
|
|
|
<span class="container-window-btn-right">
|
|
|
|
|
<!-- 업무 버튼 -->
|
|
|
|
|
<button type="button" class="btn btn-primary w-px-80" id="btnAdd--${pageName}" title="저장">추가</button>
|
|
|
|
|
<button type="button" class="btn btn-primary w-px-80" id="btnDel--${pageName}" title="저장">제거</button>
|
|
|
|
|
<button type="button" class="btn btn-primary w-px-80" id="btnAdd--${pageName}" title="추가">추가</button>
|
|
|
|
|
<button type="button" class="btn btn-primary w-px-80" id="btnDel--${pageName}" title="삭제">삭제</button>
|
|
|
|
|
</span>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
@ -120,16 +120,16 @@
|
|
|
|
|
<tbody id="tbody--productList">
|
|
|
|
|
</tbody>
|
|
|
|
|
<template id="productListRow--productList">
|
|
|
|
|
<tr data-key="{prductCd}">
|
|
|
|
|
<td class="cmn text-center" {onclick}="" {ondblclick}="">{prductCd}</td>
|
|
|
|
|
<td {onclick}="" {ondblclick}="">{prductNm}</td>
|
|
|
|
|
<td class="cmn text-end" {onclick}="" {ondblclick}="">{pceQy}</td>
|
|
|
|
|
<td class="cmn text-center prdDsuseImg" {onclick}="" {ondblclick}=""></td>
|
|
|
|
|
<td class="cmn text-center" {onclick}="" {ondblclick}="">{prdValidDe}</td>
|
|
|
|
|
<td class="cmn text-center" {onclick}="" {ondblclick}="">{mnfNo}</td>
|
|
|
|
|
<td class="cmn text-center" {onclick}="" {ondblclick}="">{mnfSeq}</td>
|
|
|
|
|
<td class="cmn text-center" {onclick}="" {ondblclick}="">{minDistbQy} {minDistbUnit}</td>
|
|
|
|
|
<td class="cmn text-center" {onclick}="" {ondblclick}="">{pceQy} {pceUnit}</td>
|
|
|
|
|
<tr data-key="{keyCnt}">
|
|
|
|
|
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{prductCd}</td>
|
|
|
|
|
<td onclick="{onclick}" ondblclick="{ondblclick}">{prductNm}</td>
|
|
|
|
|
<td class="cmn text-end" onclick="{onclick}" ondblclick="{ondblclick}">{dsuseQy}</td>
|
|
|
|
|
<td class="cmn text-center prdDsuseImg" onclick="{onclick}" ondblclick="{ondblclick}"></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>
|
|
|
|
|
<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="productListNotFound--productList">
|
|
|
|
@ -159,6 +159,7 @@
|
|
|
|
|
* Global Variable
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
pageObject["${pageName}"] = {};
|
|
|
|
|
prdRowKey = 0;
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
|
* script 진입
|
|
|
|
@ -193,7 +194,7 @@
|
|
|
|
|
$P.productControl = new DatasetControl({
|
|
|
|
|
prefix: "dsuseMgtReceiptProduct"
|
|
|
|
|
, prefixName: "마약류 제품 조회"
|
|
|
|
|
, keymapper: info => info ? info.prductCd : ""
|
|
|
|
|
, keymapper: info => info ? info.keyCnt : ""
|
|
|
|
|
, dataGetter: obj => obj.${infoPrefix}Info
|
|
|
|
|
, infoSize: "xl"
|
|
|
|
|
});
|
|
|
|
@ -201,7 +202,7 @@
|
|
|
|
|
$P.productList = new Dataset({
|
|
|
|
|
prefix: "dsuseMgtReceiptProductList"
|
|
|
|
|
, prefixName: "마약류 제품 조회"
|
|
|
|
|
, keymapper: info => info ? info.prductCd : ""
|
|
|
|
|
, keymapper: info => info ? info.keyCnt : ""
|
|
|
|
|
, dataGetter: obj => {
|
|
|
|
|
if (!obj.success){
|
|
|
|
|
dialog.alert(obj.message);
|
|
|
|
@ -318,17 +319,17 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//$P.control.onSave(resp)
|
|
|
|
|
dialog.alert("저장됐습니다.");
|
|
|
|
|
dialog.alert("처리 되었습니다.");
|
|
|
|
|
dialog.close("dsuseMgtReceiptDialog");
|
|
|
|
|
//this._load();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.productList.onDatasetChange = item => {
|
|
|
|
|
if (!item) return;
|
|
|
|
|
|
|
|
|
|
let empty = $P.productList.empty;
|
|
|
|
|
$P.productList.onAppend = item => {
|
|
|
|
|
|
|
|
|
|
if (!item) return;
|
|
|
|
|
|
|
|
|
|
// 업무별 DataTables(그리드) tr, td
|
|
|
|
|
let foundContent = document.getElementById("productListRow--productList").content;
|
|
|
|
@ -341,14 +342,29 @@
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
let replacer = (str, dataItem) => str
|
|
|
|
|
.replace(/{onclick}/gi, "pageObject['${pageName}'].productList.setCurrent('" + dataItem.getValue("prductCd") + "');");
|
|
|
|
|
.replace(/{onclick}/gi, "pageObject['${pageName}'].productList.setCurrent('" + dataItem.getValue("keyCnt") + "');");
|
|
|
|
|
|
|
|
|
|
let di = $P.productList.getData(item[0].keyCnt, "item");
|
|
|
|
|
|
|
|
|
|
let trs = empty ? [document.getElementById("$productListNotFound--productList").content.outerHTML]
|
|
|
|
|
: $P.productList.inStrings(foundTr.outerHTML, replacer);
|
|
|
|
|
let tr = di.inString(foundTr.outerHTML, replacer);
|
|
|
|
|
|
|
|
|
|
$("#table-responsive--${pageName}")[0].changeContent(trs.join(), true, true);
|
|
|
|
|
$("#tbody--productList").append(tr);
|
|
|
|
|
|
|
|
|
|
fnMakeGridImageViewer($("#tbody--productList").find("td.prdDsuseImg").get(), "dsusePrdImgFiles");
|
|
|
|
|
fnMakeGridImageViewer($("#tbody--productList").find("td.prdDsuseImg").last()[0], "dsusePrdImgFiles");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.productList.onRemove = item => {
|
|
|
|
|
|
|
|
|
|
let key = item[0].data.keyCnt;
|
|
|
|
|
|
|
|
|
|
$("#tbody--productList").find("tr[data-key='"+key+"']").remove();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.productList.onCurrentChange = item => {
|
|
|
|
|
if (!item) return;
|
|
|
|
|
|
|
|
|
|
let key = item.data.keyCnt;
|
|
|
|
|
$("#tbody--productList").setCurrentRow(key);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
@ -440,20 +456,25 @@
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const prdFrm = $P.productFormFields.get();
|
|
|
|
|
const prdInfo = ""+prdFrm.prductCd+prdFrm.prdValidDe+prdFrm.mnfNo+prdFrm.mnfSeq;
|
|
|
|
|
let isDup = $P.productList
|
|
|
|
|
.getDataset()
|
|
|
|
|
.filter(item => item.prductCd == $P.productFormFields.get().prductCd)
|
|
|
|
|
.filter(item => prdInfo == ""+item.prductCd+item.prdValidDe+item.mnfNo+item.mnfSeq)
|
|
|
|
|
.length > 0;
|
|
|
|
|
|
|
|
|
|
if(isDup){
|
|
|
|
|
const msg = "이미 추가된 제품 입니다<br>제품코드: " + prdFrm.prductCd +"<br>유효기간: "+ prdFrm.prdValidDe +"<br>제조번호: "+ prdFrm.mnfNo +"<br>제조일련번호: "+ prdFrm.mnfSeq;
|
|
|
|
|
dialog.alert({
|
|
|
|
|
content: "등록한 상품[" + $P.productFormFields.get().prductCd + "]입니다"
|
|
|
|
|
content: msg
|
|
|
|
|
});
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$P.productList.addData([$P.productFormFields.get()]);
|
|
|
|
|
console.log($P.productFormFields.get());
|
|
|
|
|
const data = {...$P.productFormFields.get(), keyCnt : ""+prdRowKey++};
|
|
|
|
|
console.log(data);
|
|
|
|
|
$P.productList.append([data]);
|
|
|
|
|
// FIXME: 상품필드 초기화 코드 추가
|
|
|
|
|
//
|
|
|
|
|
}
|
|
|
|
@ -462,11 +483,12 @@
|
|
|
|
|
// validate 확인
|
|
|
|
|
if (!customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;
|
|
|
|
|
|
|
|
|
|
const row = $P.productList.getCurrent();
|
|
|
|
|
dialog.alert({
|
|
|
|
|
content: "현재 " + $P.control.prefixName + " 정보를 저장하시겠습니까?"
|
|
|
|
|
content: "아래 제품을 삭제하시겠습니까?<br>제품명: "+row.prductNm + "<br>유효기간: " +row.prdValidDe+"<br>제조번호: "+row.mnfNo+"<br>일련번호: " + row.mnfSeq
|
|
|
|
|
, init: () => { setDialogZindex(); }
|
|
|
|
|
, onOK: () => {
|
|
|
|
|
$P.control.save($P.bsshFormFields.get()); // formFields
|
|
|
|
|
$P.productList.remove($P.productList.getCurrent().keyCnt);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -496,7 +518,6 @@
|
|
|
|
|
|
|
|
|
|
// 초기 화면 설정
|
|
|
|
|
$P.initForm = () => {
|
|
|
|
|
fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollDataList);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -511,7 +532,7 @@
|
|
|
|
|
$P.initForm();
|
|
|
|
|
|
|
|
|
|
// 3. Dataset 설정
|
|
|
|
|
//$P.control.setData([${dsuseReceptInfo}]);
|
|
|
|
|
$P.control.setData([${dsuseReceptInfo}]);
|
|
|
|
|
//$P.productControl.setData([${opnnDlbrMbrInfo}]);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|