발송일자,납기일자 입력 창이 다이얼로그 창으로 표시되도록 수정함.

main
이범준 8 months ago
parent dfd6372703
commit c92c08c87a

@ -421,27 +421,37 @@
} }
// 우편통합발송 버튼 이벤트 // 우편통합발송 버튼 이벤트
$P.fnCreateSndngLink = (title) => { $P.fnCreateSndngLink = async(title) => {
// validate 확인 // validate 확인
if (!customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return; if (!customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;
let popupWidth = 480; var resp = await fetch(wctx.url("/resources/html/inputDateDialog.html"));
let popupHeight = 480; var template = await resp.text();
let popupX = (window.screen.width / 2) - (popupWidth / 2); dialog.open({
let popupY= (window.screen.height / 2) - (popupHeight / 2); id : "inputEPostDateDialog",
title: title,
window.open( size : "md",
wctx.url("/resources/html/inputDateDialog.html" content: template,
+ "?openerPageName=${pageName}" init : () => {
+ "&prefix=" + "sndngLink" $("#divPostSndng").show();
+ "&callPurpose=" + "create" initDatepicker("frmInputDate");
+ "&sndngYmd=" + $P.control.dataset.getValue("SNDNG_YMD") $("#sndngYmd").datepicker("setDate", $P.control.dataset.getValue("SNDNG_YMD"));
+ "&sndngEndYmd=" + $P.control.dataset.getValue("SNDNG_END_YMD") $("#sndngEndYmd").datepicker("setDate", $P.control.dataset.getValue("SNDNG_END_YMD"));
) },
, "inputEPostDateDialog" onOK : () => {
, 'status=no, height=' + popupHeight + ', width=' + popupWidth + ', left='+ popupX + ', top='+ popupY if (!inputDateComparison($("#sndngYmd").val(), $("#sndngEndYmd").val())) {
); return;
}
$P.callbackDate({
"sndngYmd" : $("#sndngYmd").val(),
"sndngEndYmd" : $("#sndngEndYmd").val(),
"postSndngSeCd" : $("#frmInputDate").find("[name='postSndngSeCd']:checked").val()
});
}
});
} }
// 사전통지출력 버튼 이벤트 // 사전통지출력 버튼 이벤트

@ -491,30 +491,39 @@
} }
// 감경부과등록 버튼 이벤트 // 감경부과등록 버튼 이벤트
fnCreateRductLevy${pageName} = () => { fnCreateRductLevy${pageName} = async() => {
// validate 확인 // validate 확인
if (!customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return; if (!customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;
let callbackFuncName = "createRductLevy${pageName}";
let sndngYmd = DateUtil.getDateDay().date; let sndngYmd = DateUtil.getDateDay().date;
let dudtYmd = DateUtil.getDateDay(20).date; let dudtYmd = DateUtil.getDateDay(20).date;
let popupWidth = 480; var resp = await fetch(wctx.url("/resources/html/inputDateDialog.html"));
let popupHeight = 480; var template = await resp.text();
let popupX = (window.screen.width / 2) - (popupWidth / 2); dialog.open({
let popupY= (window.screen.height / 2) - (popupHeight / 2); id : "inputRductLevyDateDialog",
title: "감경부과등록",
window.open( size : "md",
wctx.url("/resources/html/inputDateDialog.html" content: template,
+ "?callbackFuncName=" + callbackFuncName init : () => {
+ "&CALL_PURPOSE=" + "levy" $("#divPostSndng").hide();
+ "&SNDNG_YMD=" + sndngYmd initDatepicker("frmInputDate");
+ "&DUDT_YMD=" + dudtYmd $("#sndngYmd").datepicker("setDate", sndngYmd);
) $("#sndngEndYmd").datepicker("setDate", sndngEndYmd);
, "inputEPostDateDialog" },
, 'status=no, height=' + popupHeight + ', width=' + popupWidth + ', left='+ popupX + ', top='+ popupY onOK : () => {
); if (!inputDateComparison($("#sndngYmd").val(), $("#sndngEndYmd").val())) {
return;
}
$P.callbackDate({
"sndngYmd" : $("#sndngYmd").val(),
"dudtYmd" : $("#sndngEndYmd").val()
});
}
});
} }
/************************************************************************** /**************************************************************************

@ -1,33 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Favicon -->
<link rel="icon" type="image/x-icon" href="/resources/image/favicon.ico" />
<!-- Fonts -->
<link rel="stylesheet" href="/resources/font/publicsans/fontface.css" />
<!-- Icons. Uncomment required icon fonts -->
<link rel="stylesheet" href="/resources/3rd-party/sneat/fonts/boxicons.css" />
<link rel="stylesheet" href="/resources/3rd-party/sneat/fonts/fontawesome.css" />
<link rel="stylesheet" href="/resources/3rd-party/sneat/fonts/flag-icons.css" />
<link rel="stylesheet" href="/resources/css/fims/framework/common/xit-icon.css" />
<!-- Core CSS -->
<link rel="stylesheet" href="/resources/css/fims/framework/common/xit-core.css" />
<link rel="stylesheet" href="/resources/3rd-party/sneat/css/theme-default.css" />
<link rel="stylesheet" href="/resources/3rd-party/sneat/css/docs.css" />
<link rel="stylesheet" href="/resources/css/fims/framework/common/xit-core-extend.css" />
<!-- Vendors CSS -->
<link rel="stylesheet" href="/resources/3rd-party/sneat/libs/perfect-scrollbar/perfect-scrollbar.css" />
<link rel="stylesheet" href="/resources/css/styles.css" />
<link rel="stylesheet" href="/resources/css/fims/framework/common/common.css"/>
<link rel="stylesheet" href="/resources/3rd-party/sneat/libs/bootstrap-datepicker/bootstrap-datepicker.css" />
<title>일자선택</title>
</head>
<body>
<div class="card m-4 p-3"> <div class="card m-4 p-3">
<form id="frmInputDate" name="frmInputDate" method="post"> <form id="frmInputDate" name="frmInputDate" method="post">
<div class="container-search"> <div class="container-search">
@ -57,121 +27,4 @@
</div> </div>
</div> </div>
</form> </form>
<div>
<span class="container-page-btn">
<span class="container-window-btn-right">
<button type="button" class="btn btn-primary w-px-80" title="확인" onclick="fnOK()">확인</button>
</span>
</span>
</div>
</div> </div>
<!-- Core JS -->
<script src="/resources/3rd-party/sneat/js/helpers.js"></script>
<script src="/resources/3rd-party/sneat/js/config.js"></script>
<script src="/resources/3rd-party/sneat/libs/popper/popper.js"></script>
<script src="/resources/3rd-party/sneat/js/bootstrap.js"></script>
<script src="/resources/3rd-party/sneat/libs/jquery/jquery.js" ></script>
<script src="/resources/3rd-party/sneat/libs/perfect-scrollbar/perfect-scrollbar.js"></script>
<script src="/resources/3rd-party/sneat/js/menu.js"></script>
<script src="/resources/3rd-party/sneat/libs/bootstrap-datepicker/bootstrap-datepicker.js"></script>
<script src="/resources/3rd-party/bootstrap-datepicker/bootstrap-datepicker-support.js"></script>
<script src="/resources/js/fims/framework/cmm/cmmnDateUtil.js"></script>
<script src="/resources/js/fims/framework/cmm/initAfterPageLoad.js"></script>
<script language="javascript">
// parameter
var openerPageName = location.search.split("&")[0].split("=")[1];
var prefix = location.search.split("&")[1].split("=")[1];
var callPurpose = location.search.split("&")[2].split("=")[1];
var sndngYmd = location.search.split("&")[3].split("=")[1];
var sndngEndYmd = location.search.split("&")[4].split("=")[1];
// form-date 항목에서 키보드로 입력시 날짜 포맷팅 적용
$("#frmInputDate").find(".form-date").each(function() {
$(this).on("input", function() {
let value = this.value.replaceAll("-", "");
if (value.length > 7) {
this.value = value.substring(0, 4) + "-" + value.substring(4, 6) + "-" + value.substring(6);
} else if (value.length > 5) {
this.value = value.substring(0, 4) + "-" + value.substring(4);
}
});
});
function inputDateComparison(sndngYmd, sndngEndYmd) {
let startDate = inputDateSplit(sndngYmd); // 시작일
let endDate = inputDateSplit(sndngEndYmd); // 종료일
if (typeof startDate == "undefined" || startDate == null || startDate == "") {
alert("시작일이 입력되지 않았습니다.\n시작일을 입력해주세요.");
$("#sndngYmd").focus();
return false;
}
if (typeof endDate == "undefined" || endDate == null || endDate == "") {
alert("종료일이 입력되지 않았습니다.\n종료일을 입력해주세요.");
$("#sndngEndYmd").focus();
return false;
}
// 입력일을 확인하는 이유는 현재 작성한 일자가 시작일인지 종료일인지 확인하기 위해서이다.
if (startDate > endDate) {
alert("시작일이 종료일보다 이 후 일수는 없습니다.\n다시 선택하여 주시기 바랍니다.");
$("#sndngYmd").focus();
return false;
}
return true;
}
// 날짜형식에 "-"이 사용된 경우에 한하여 날짜값에서 "-" 기호를 제거한다.
function inputDateSplit(obj) {
if (obj == "") {
return obj;
} else {
let dateArray = obj.split("-");
return dateArray[0] + dateArray[1] + dateArray[2];
}
}
function fnOK() {
// 날짜 확인
if (inputDateComparison($("#sndngYmd").val(), $("#sndngEndYmd").val())) {
let obj = {
prefix : prefix // 호출 prefix
, callPurpose : callPurpose // 호출 용도
, sndngYmd : $("#sndngYmd").val()
, dudtYmd : $("#sndngEndYmd").val()
, postSndngSeCd : $("input[name='postSndngSeCd']:checked").val()
};
window.opener.pageObject[openerPageName].callbackDate(obj);
window.close();
}
}
$(document).ready(function() {
// 달력 초기화
initDatepicker("frmInputDate");
$("#sndngYmd").datepicker("setDate", sndngYmd);
$("#sndngEndYmd").datepicker("setDate", sndngEndYmd);
if (prefix == "sndngLink") {
$("#divPostSndng").show();
} else {
$("#divPostSndng").hide();
}
});
</script>
</body>
</html>

@ -19,7 +19,7 @@ async function dialog2(msg, type, buttons){
var template = await resp.text(); var template = await resp.text();
var container = "<div class='container-fluid text-center' style='font-size:1.4em;'>{content}</div>"; var container = "<div class='container-fluid text-center' style='font-size:1.4em;'>{content}</div>";
if(type == "prompt"){ if(type == "prompt"){
var rsn = '<br/><input type="text" id="rsn" class="form-control w-100" />'; var rsn = '<br/><textarea type="text" id="rsn" class="form-control w-100"></textarea>';
content = container.replace(/{content}/g, msg + rsn); content = container.replace(/{content}/g, msg + rsn);
} else { } else {
content = container.replace(/{content}/g, msg); content = container.replace(/{content}/g, msg);

@ -5,6 +5,44 @@ function TODAY(){
return dateFormat.format(new Date()); return dateFormat.format(new Date());
} }
function inputDateComparison(sndngYmd, sndngEndYmd) {
let startDate = inputDateSplit(sndngYmd); // 시작일
let endDate = inputDateSplit(sndngEndYmd); // 종료일
if (typeof startDate == "undefined" || startDate == null || startDate == "") {
alert("시작일이 입력되지 않았습니다.\n시작일을 입력해주세요.");
$("#sndngYmd").focus();
return false;
}
if (typeof endDate == "undefined" || endDate == null || endDate == "") {
alert("종료일이 입력되지 않았습니다.\n종료일을 입력해주세요.");
$("#sndngEndYmd").focus();
return false;
}
// 입력일을 확인하는 이유는 현재 작성한 일자가 시작일인지 종료일인지 확인하기 위해서이다.
if (startDate > endDate) {
alert("시작일이 종료일보다 이 후 일수는 없습니다.\n다시 선택하여 주시기 바랍니다.");
$("#sndngYmd").focus();
return false;
}
return true;
}
// 날짜형식에 "-"이 사용된 경우에 한하여 날짜값에서 "-" 기호를 제거한다.
function inputDateSplit(obj) {
if (obj == "") {
return obj;
} else {
let dateArray = obj.split("-");
return dateArray[0] + dateArray[1] + dateArray[2];
}
}
var DateUtil = { var DateUtil = {
/*============================ /*============================
* 현재날짜로부터 단위로 계산된 날짜(yyyymmdd) 반환 * 현재날짜로부터 단위로 계산된 날짜(yyyymmdd) 반환

Loading…
Cancel
Save