fix: 부서(관할구청) 코드 세션값 적용
parent
68fe447649
commit
d804d716dc
@ -1,188 +0,0 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
|
||||
<c:set var="prefixName" scope="request">폐기관리 등록</c:set>
|
||||
|
||||
<!-- inner page html -->
|
||||
<div class="content-wrapper">
|
||||
<!-- Content -->
|
||||
<div class="container flex-grow-1 px-0">
|
||||
<!-- Page Body -->
|
||||
<div class="card">
|
||||
<!-- 입력 영역 -->
|
||||
<form id="bssh--${pageName}" name="bssh">
|
||||
<!-- hidden -->
|
||||
<input type="hidden" name="dscdmngId" data-map="dscdmngId" />
|
||||
<label for="bssh--${pageName}" style="margin-top: 10px; padding-left: 20px;"><strong>취급업체 정보</strong></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>
|
||||
<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="dsusePrvCd--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">폐기사유</label>
|
||||
<select class="form-select" id="dsusePrvCd--${pageName}" name="dsusePrvCd">
|
||||
<c:forEach items="${ADDS04}" var="item">
|
||||
<option value="${item.code}">${item.value}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div>
|
||||
</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>
|
||||
</div>
|
||||
<!-- / 업무 버튼 표시 -->
|
||||
</div> <!-- / Content <div class="container flex-grow-1 px-0"> -->
|
||||
</div> <!-- / inner page html <div class="content-wrapper"> -->
|
||||
|
||||
<script>
|
||||
/**************************************************************************
|
||||
* Global Variable
|
||||
**************************************************************************/
|
||||
pageObject["${pageName}"] = {};
|
||||
|
||||
/**************************************************************************
|
||||
* script 진입
|
||||
**************************************************************************/
|
||||
$(document).ready(function() {
|
||||
// pageObject
|
||||
let $P = pageObject["${pageName}"];
|
||||
|
||||
// FormFields
|
||||
$P.bsshFormFields = new AddsFormFields("#bssh--${pageName}");
|
||||
|
||||
/**************************************************************************
|
||||
* DatasetControl
|
||||
**************************************************************************/
|
||||
$P.control = new DatasetControl({
|
||||
prefix: "dsuseMgtReceiptBssh"
|
||||
, prefixName: "폐기 신청서 접수 정보"
|
||||
, keymapper: info => info ? info.bsshCd : ""
|
||||
, dataGetter: obj => obj.${infoPrefix}Info
|
||||
, infoSize: "xl"
|
||||
});
|
||||
|
||||
$P.control.onCurrentChange = item => {
|
||||
if (!item) return;
|
||||
|
||||
// Dataset 셋팅
|
||||
$P.bsshFormFields.set($P.control, item);
|
||||
}
|
||||
|
||||
// 저장 callback
|
||||
$P.control.onSave = (resp) => {
|
||||
let dialogTitle = $("#" + $P.control.prefix + "Dialog--${openerPageName}").find("h5.modal-title").html();
|
||||
let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, dialogTitle);
|
||||
|
||||
// 메시지 출력
|
||||
dialog.alert({
|
||||
content: showMessage
|
||||
, init: () => { setDialogZindex(); }
|
||||
, onOK: () => { }
|
||||
});
|
||||
|
||||
if (resp.saved) {
|
||||
dialog.close($P.control.prefix + "Dialog--${openerPageName}");
|
||||
}
|
||||
}
|
||||
|
||||
// 저장
|
||||
$P.control.save = (jsonBssh) => {
|
||||
let saveBsshData = {
|
||||
...jsonBssh,
|
||||
userId: "${currentUser.account}"
|
||||
}
|
||||
|
||||
ajax.post({
|
||||
url: '<c:url value="${apiHost}/api/biz/nims/v1/modifyDsuseMgtReceiptMstInfo" />'
|
||||
, data: JSON.stringify(saveBsshData)
|
||||
, contentType: "application/json"
|
||||
, success: resp => {
|
||||
if(!resp.success){
|
||||
dialog.alert({
|
||||
content: resp.message
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
//$P.control.onSave(resp)
|
||||
dialog.alert("정상 처리 하였습니다.");
|
||||
dialog.close("dsuseMgtReceiptDialog");
|
||||
//this._load();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* 버튼 clickEvent
|
||||
**************************************************************************/
|
||||
// 저장
|
||||
$P.fnSave = () => {
|
||||
// validate 확인
|
||||
if (!customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;
|
||||
|
||||
let bsshData = $P.bsshFormFields.get();
|
||||
if(bsshData.bsshCd == ""){
|
||||
dialog.alert({
|
||||
content: "마약류 취급업체 정보를 입력해주세요."
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
dialog.alert({
|
||||
content: "현재 " + $P.control.prefixName + " 정보를 저장하시겠습니까?"
|
||||
, init: () => { setDialogZindex(); }
|
||||
, onOK: () => {
|
||||
$P.control.save(bsshData); // formFields
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* 초기 셋팅
|
||||
**************************************************************************/
|
||||
// 이벤트 설정
|
||||
$P.setEvent = () => {
|
||||
|
||||
// 버튼 이벤트
|
||||
$("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* 최초 실행 함수
|
||||
**************************************************************************/
|
||||
// 1. 이벤트 설정
|
||||
$P.setEvent();
|
||||
|
||||
// 2. 초기 화면 설정
|
||||
//$P.initForm();
|
||||
|
||||
// 3. Dataset 설정
|
||||
$P.control.setData([${dsuseReceptInfo}]);
|
||||
});
|
||||
|
||||
</script>
|
@ -1,82 +0,0 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
<c:set var="prefixName" scope="request">폐기 신청서 접수</c:set>
|
||||
|
||||
<div class="wrapper" style="padding-top:2em">
|
||||
|
||||
<input type="file" id="img1" name="img" accept="image/*"><br>
|
||||
<input type="file" id="img2" name="img" accept="image/*"><br>
|
||||
<button id="btnSave">save</button>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
document.querySelector("#btnSave").addEventListener("click", function () {
|
||||
|
||||
let dsuseMgt =
|
||||
{
|
||||
userId: "suji",
|
||||
prgrsSttsCd: "01",
|
||||
bsshCd: "H00008333",
|
||||
rndDtlRptCnt: 2,
|
||||
dsusePrvCd: "04"
|
||||
};
|
||||
|
||||
let dsuseMgtDtls = [
|
||||
{
|
||||
prductCd: "8806717024900",
|
||||
prductNm: "베리콜시럽",
|
||||
minDistbQy: 1,
|
||||
minDistbUnit: "",
|
||||
pceQy: 1,
|
||||
pceUnit: "개",
|
||||
mnfNo: "A1111",
|
||||
prdValidDe: "20300303",
|
||||
mnfSeq: "A11111111",
|
||||
dsuseQy: 10
|
||||
},
|
||||
{
|
||||
prductCd: "8806718050823",
|
||||
prductNm: "아쿠아폴주20밀리리터(프로포폴) (20㎖)",
|
||||
minDistbQy: 1,
|
||||
minDistbUnit: "박스",
|
||||
pceQy: 5,
|
||||
pceUnit: "바이알",
|
||||
mnfNo: "A1111",
|
||||
prdValidDe: "20300303",
|
||||
mnfSeq: "A11111111",
|
||||
dsuseQy: 30
|
||||
}
|
||||
];
|
||||
|
||||
let formData = new FormData();
|
||||
formData.append("dsuseMgtJsonStr", JSON.stringify(dsuseMgt));
|
||||
formData.append("dsuseMgtDtlsJsonStr", JSON.stringify(dsuseMgtDtls));
|
||||
|
||||
$("input[type=file]").each(function (i) {
|
||||
formData.append("dsusePrdImgFiles", $('input[type=file]')[i].files[0]);
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: '<c:url value="${apiHost}/api/biz/nims/v1/saveDsuseMgtReceipt" />',
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function (res) {
|
||||
console.log(res);
|
||||
if (!res.success) {
|
||||
alert(res.code + ':' + res.message);
|
||||
return false;
|
||||
}
|
||||
console.log(res.data);
|
||||
},
|
||||
error: function (error) {
|
||||
console.log(error);
|
||||
if (error.responseJSON && typeof error.responseJSON === 'object') {
|
||||
console.log(error.responseJSON);
|
||||
}
|
||||
}
|
||||
});
|
||||
}, {passive: true});
|
||||
</script>
|
Loading…
Reference in New Issue