fix : 제품 항목 추가 수정중.

dev
Leeyh1121 5 months ago
parent 10302888cb
commit 9f000cdff4

@ -9,141 +9,148 @@
<div class="container flex-grow-1 px-0">
<!-- Page Body -->
<div class="card">
<!-- 입력 영역 -->
<!-- <form id="frmEdit--${pageName}" name="frmEdit"> -->
<form id="bssh--${pageName}" name="bssh">
<!-- hidden -->
<label for="bssh--${pageName}">마약류 취급업체 정보</label>
<div class="row my-1 mx-4 g-1 border-card rounded-3">
<div class="col-md-4">
<label for="bsshNm--${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="bsshNm--${pageName}" name="bsshNm" data-map="bsshNm" readonly>
</div>
<div class="col-md-4">
<label for="bsshCd--${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="bsshNm--${pageName}" name="bsshCd" data-map="bsshCd" readonly>
</div>
<button type="button" class="btn btn-search w-px-120" id="btnBsshSearch--${pageName}" title="검색">검색</button>
<div class="col-md-4">
<label for="rprsntvNm--${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="rprsntvNm--${pageName}" name="rprsntvNm" data-map="rprsntvNm" readonly>
</div>
<div class="col-md-4">
<label for="prmisnNo--${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="prmisnNo--${pageName}" name="prmisnNo" data-map="prmisnNo" readonly>
</div>
<div class="col-md-4">
<label for="bizrNo--${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="bizrno--${pageName}" name="bizrno" data-map="bizrno" readonly>
</div>
<div class="col-md-8">
<label for="addr--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">폐기사유</label>
<select class="form-select" id="schVltnCd--${pageName}" name="schVltnCd"><option value="">사고마약류(파손)</option><option value="01">사고마약류(변질,부패)</option><option value="02">유효기한 또는 사용기한 경과</option><option value="03">재고관리 또는 보관을 하기에 곤란한 사유(유효기한 임박)</option>
<option value="04">재고관리 또는 보관을 하기에 곤란한 사유(사용중단)</option>
<option value="05">재고관리 또는 보관을 하기에 곤란한 사유(폐업)</option>
<option value="06">재고관리 또는 보관을 하기에 곤란한 사유(환자반납)</option>
<option value="07">기타(사고마약류(도난,분실,재해) 발생보고 완료건)</option>
<option value="08">기타(제조공정 중 폐기물)</option></select>
</div>
<form id="bssh--${pageName}" name="bssh">
<!-- hidden -->
<label for="bssh--${pageName}">마약류 취급업체 정보</label>
<div class="row my-1 mx-4 g-1 border-card rounded-3">
<div class="col-md-4">
<label for="bsshNm--${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="bsshNm--${pageName}" name="bsshNm" data-map="bsshNm" readonly>
</div>
<div class="col-md-4">
<label for="bsshCd--${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="bsshNm--${pageName}" name="bsshCd" data-map="bsshCd" readonly>
</div>
<button type="button" class="btn btn-search w-px-120" id="btnBsshSearch--${pageName}" title="검색">검색</button>
<div class="col-md-4">
<label for="rprsntvNm--${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="rprsntvNm--${pageName}" name="rprsntvNm" data-map="rprsntvNm" readonly>
</div>
<div class="col-md-4">
<label for="prmisnNo--${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="prmisnNo--${pageName}" name="prmisnNo" data-map="prmisnNo" readonly>
</div>
<div class="col-md-4">
<label for="bizrNo--${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="bizrno--${pageName}" name="bizrno" data-map="bizrno" readonly>
</div>
<div class="col-md-8">
<label for="addr--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">폐기사유</label>
<select class="form-select" id="schVltnCd--${pageName}" name="schVltnCd"><option value="">사고마약류(파손)</option><option value="01">사고마약류(변질,부패)</option><option value="02">유효기한 또는 사용기한 경과</option><option value="03">재고관리 또는 보관을 하기에 곤란한 사유(유효기한 임박)</option>
<option value="04">재고관리 또는 보관을 하기에 곤란한 사유(사용중단)</option>
<option value="05">재고관리 또는 보관을 하기에 곤란한 사유(폐업)</option>
<option value="06">재고관리 또는 보관을 하기에 곤란한 사유(환자반납)</option>
<option value="07">기타(사고마약류(도난,분실,재해) 발생보고 완료건)</option>
<option value="08">기타(제조공정 중 폐기물)</option></select>
</div>
</div>
<div class="row my-1 mx-1 g-1 border-card rounded"></div>
</form>
<form id="product--${pageName}" name="product">
<label for="product--${pageName}">폐기정보 상세</label>
<div class="row my-1 mx-4 g-1 border-card rounded-3">
<div class="col-md-4">
<label for="prductNm--${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="prductNm--${pageName}" name="prductNm" data-map="prductNm" readonly>
</div>
<div class="col-md-4">
<label for="prductCd--${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="prductCd--${pageName}" name="prductCd" data-map="prductCd" readonly>
</div>
<div class="col-md-4">
<button type="button" class="btn btn-search w-px-120" id="btnProductBarcodeSearch--${pageName}" title="검색">바코드 검색</button>
<button type="button" class="btn btn-search w-px-120" id="btnProductSearch--${pageName}" title="검색">제품 검색</button>
</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="prdlstMstCd" data-map="" readonly>
</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="prdlstMstCd" data-map="" readonly>
</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="rgsDt" data-map="rgsDt" readonly>
</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>
<input type="text" class="form-control w-30" id="prdMinDistbQy--${pageName}" name="prdMinDistbQy" data-map="prdMinDistbQy" readonly>
<input type="text" class="form-control w-30" id="stdPackngStleNm--${pageName}" name="stdPackngStleNm" data-map="stdPackngStleNm" readonly>
</div>
<div class="col-md-4">
<label for="prdTotPceQy--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">낱개 단위 수량</label>
<input type="text" class="form-control w-30" id="prdTotPceQy--${pageName}" name="prdTotPceQy" data-map="prdTotPceQy" readonly>
<input type="text" class="form-control w-30" id="pceCoUnitNm--${pageName}" name="pceCoUnitNm" data-map="pceCoUnitNm" readonly>
</div>
<div class="col-md-4">
<label for="dsuseQy--${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="dsuseQy--${pageName}" name="dsuseQy" data-map="dsuseQy">
</div>
</form>
<form id="product--${pageName}" name="product">
<label for="product--${pageName}">폐기정보 상세</label>
<div class="row my-1 mx-4 g-1 border-card rounded-3">
<div class="col-md-4">
<label for="prductNm--${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="prductNm--${pageName}" name="prductNm" data-map="prductNm" readonly>
</div>
<div class="col-md-4">
<label for="prductCd--${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="prductCd--${pageName}" name="prductCd" data-map="prductCd" readonly>
</div>
<div style=" align-content: center; text-align: center;">
<span>
<!-- 업무 버튼 -->
<button type="button" class="btn btn-primary w-px-80" id="btnSave--excl02040" title="저장">추가</button>
<button type="button" class="btn btn-primary w-px-80" id="btnSave--excl02040" title="저장">제거</button>
</span>
<div class="col-md-4">
<button type="button" class="btn btn-search w-px-120" id="btnProductBarcodeSearch--${pageName}" title="검색">바코드 검색</button>
<button type="button" class="btn btn-search w-px-120" id="btnProductSearch--${pageName}" title="검색">제품 검색</button>
</div>
</form>
<table class="datatables-ajax table table-bordered dataTable no-footer" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">
<thead>
<tr><th style="width: 15.828px;text-align:center;" tabindex="0">No</th>
<th class="sorting sorting_asc" aria-sort="ascending" style="width: 223.719px;">제품명</th>
<th class="sorting" style="width: 146.156px;">제품코드</th>
<th class="sorting" style="width: 160.141px;">제품번호</th>
<th class="sorting" style="width: 160.141px;">제조 일련 번호</th>
<th class="sorting" style="width: 230.469px;">유효기간</th>
<th class="sorting" style="width: 230.469px;">최소 유통단위 수량</th>
<th class="sorting" style="width: 230.469px;">낱개 단위 수량</th>
<th class="sorting" style="width: 230.469px;">폐기 수량</th>
<th class="sorting" style="width: 230.469px;">이미지</th>
</tr>
</thead>
<tbody id="userList">
</tbody>
<template id="prductRow">
<tr data-key="{PRDUCT_CD}">
<td style="text-align:center;"><input value="{PRDUCT_CD}" onchange="userControl.select('{PRDUCT_CD}', this.checked);" type="checkbox" class="form-check-input"></td>
<td {onclick}="" {ondblclick}="">{PRDUCT_CD}</td>
<td {onclick}="" {ondblclick}="">{PRDUCT_NM}</td>
<td {onclick}="" {ondblclick}="">{MNF_NO}</td>
<td {onclick}="" {ondblclick}="">{PRD_VALID_DE}</td>
<td {onclick}="" {ondblclick}="">{MIN_DISTB_QY}</td>
<td {onclick}="" {ondblclick}="">{PCE_QY}</td>
<td {onclick}="" {ondblclick}="">{DSUSE_QY}</td>
<td {onclick}="" {ondblclick}=""></td>
</tr>
</template>
</table>
<!-- </form> /입력 영역 -->
</div> <!-- <div class="card"> -->
<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="prdlstMstCd" readonly>
</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="prdlstMstCd" readonly>
</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="rgsDt" readonly>
</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>
<input type="text" class="form-control w-30" id="prdMinDistbQy--${pageName}" name="minDistbQy" data-map="prdMinDistbQy" readonly>
<input type="text" class="form-control w-30" id="stdPackngStleNm--${pageName}" name="minDistbUnit" data-map="stdPackngStleNm" readonly>
</div>
<div class="col-md-4">
<label for="prdTotPceQy--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">낱개 단위 수량</label>
<input type="text" class="form-control w-30" id="prdTotPceQy--${pageName}" name="pceQy" data-map="prdTotPceQy" readonly>
<input type="text" class="form-control w-30" id="pceCoUnitNm--${pageName}" name="pceUnit" data-map="pceCoUnitNm" readonly>
</div>
<div class="col-md-4">
<label for="dsuseQy--${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="dsuseQy--${pageName}" name="dsuseQy" data-map="dsuseQy">
</div>
</div>
<div style=" align-content: center; text-align: center;">
<span>
<!-- 업무 버튼 -->
<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>
</div>
</form>
<table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer" id="DataTables_Table_0--productList" aria-describedby="DataTables_Table_0_info">
<thead class="sticky-thead">
<tr id="theadTr--productList"
data-by="by--productList" data-by-output="byOutput--productList" data-main-option="mainOption--productList" data-sub-option="subOption--productList">
<th style="width: 15.828px;text-align:center;" tabindex="0">No</th>
<th class="sorting sorting_asc" aria-sort="ascending" style="width: 223.719px;">제품명</th>
<th class="sorting" style="width: 146.156px;">제품코드</th>
<th class="sorting" style="width: 160.141px;">제품번호</th>
<th class="sorting" style="width: 160.141px;">제조 번호</th>
<th class="sorting" style="width: 160.141px;">제조 일련 번호</th>
<th class="sorting" style="width: 230.469px;">유효기간</th>
<th class="sorting" style="width: 230.469px;">최소 유통단위 수량</th>
<th class="sorting" style="width: 230.469px;">최소 유통단위</th>
<th class="sorting" style="width: 230.469px;">낱개 단위 수량</th>
<th class="sorting" style="width: 230.469px;">낱개 단위</th>
<th class="sorting" style="width: 230.469px;">폐기 수량</th>
<th class="sorting" style="width: 230.469px;">이미지</th>
</tr>
</thead>
<tbody id="tbody--productList">
</tbody>
<template id="productListRow--productList">
<tr data-key="{prductCd}">
<td style="text-align:center;"><input value="prductCd" onchange="userControl.select('{prductCd}', this.checked);" type="checkbox" class="form-check-input"></td>
<td class="cmn text-center" {onclick}="" {ondblclick}="">{prductCd}</td>
<td class="cmn text-center" {onclick}="" {ondblclick}="">{prductNm}</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}="">{prdValidDe}</td>
<td class="cmn text-center" {onclick}="" {ondblclick}="">{minDistbQy}</td>
<td class="cmn text-center" {onclick}="" {ondblclick}="">{minDistbUnit}</td>
<td class="cmn text-center" {onclick}="" {ondblclick}="">{pceQy}</td>
<td class="cmn text-center" {onclick}="" {ondblclick}="">{pceUnit}</td>
<td class="cmn text-center" {onclick}="" {ondblclick}="">{dsuseQy}</td>
<td class="cmn text-center" {onclick}="" {ondblclick}=""></td>
</tr>
</template>
<template id="productListNotFound--productList">
<tr class="odd">
<td valign="top" colspan="13" class="dataTables_empty text-center">제품 정보를 찾지 못했습니다.</td>
</tr>
</template>
</table>
</div> <!-- <div class="card"> -->
<!-- 업무 버튼 표시 -->
<div>
<span class="container-page-btn">
<span class="container-window-btn-right">
<!-- 업무 버튼 -->
<button type="button" class="btn btn-primary w-px-80" id="btnSave--${pageName}" title="저장">저장</button>
<div>
<span class="container-page-btn">
<span class="container-window-btn-right">
<!-- 업무 버튼 -->
<button type="button" class="btn btn-primary w-px-80" id="btnSave--${pageName}" title="저장">저장</button>
</span>
</span>
</span>
</div>
</div>
<!-- / 업무 버튼 표시 -->
</div> <!-- / Content <div class="container flex-grow-1 px-0"> -->
</div> <!-- / inner page html <div class="content-wrapper"> -->
@ -182,6 +189,14 @@
, dataGetter: obj => obj.${infoPrefix}Info
, infoSize: "xl"
});
$P.productList = new Dataset({
prefix: "dsuseMgtReceiptProductList"
, prefixName: "마약류 제품 조회"
, keymapper: info => info ? info.prductCd : ""
, dataGetter: obj => obj
, infoSize: "xl"
});
/**************************************************************************
* DatasetControl 이벤트
**************************************************************************/
@ -271,6 +286,34 @@
});
}
$P.productList.onDataSetChange = item => {
if (!item) return;
let empty = $P.productListList.empty;
// 업무별 DataTables(그리드) tr, td
let foundContent = document.getElementById("productListRow--productList").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}'].productList.setCurrent('" + dataItem.getValue("prductCd") + "');");
let trs = empty ? [document.getElementById("$productListNotFound--productList").content.outerHTML]
: $P.productList.inStrings(foundTr.outerHTML, replacer);
$("#table-responsive--${pageName}")[0].changeContent(trs.join(), true, true);
}
/**************************************************************************
* DataTables 이벤트
**************************************************************************/
/**************************************************************************
* 사용자 함수(function)
**************************************************************************/
@ -305,6 +348,24 @@
}
});
}
//추가
$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
}
});
}
/**************************************************************************
* 초기 셋팅
@ -322,6 +383,11 @@
// 버튼 이벤트
$("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장
$("#btnAdd--${pageName}").on("click", () => $P.fnAdd()); // 추가
$("#btnDel--${pageName}").on("click", () => $P.fnDel()); // 추가
}
// 초기 화면 설정

Loading…
Cancel
Save