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