JS 기본 구조 및 기본 함수
/**
* Date: 최초작성일
* Author: 작성자
* Description: 메뉴명
*
**/
var GP_SM_PR_003 = {
//전역 변수
initMessage: undefined,
// 초기화 함수
init : function(){
let that = this;
that.event();
},
event: function() {
let that = this;
},
ajaxFunc : function (url, WEBDATA, msg) {
let that = this;
ngsWidget.ajax(0, 'C', url, WEBDATA, function (index, result, data) {
ngsWidget.splashHide();
if (result != 'SUCCESS') {
setTimeout(() => {
ngsWidget.messageBox({type: 'danger', html: ngsLang.getLang(data.errMsg)});
}, 50);
return;
}
setTimeout(() => {
ngsWidget.messageBox({type: 'success', html: ngsLang.getLang(msg)});
$('#findBtn1').click();
}, 50);
}, undefined, {index: 0, op: 'process', seq: 1, spec: 'JOB', product: 'MES'}, false, that);
},
popUpSaveCallBack: function (index, data, rowIndex, popupName) {
},
//#region 조회조건 기간 SETTING
getMonth : (diff) => {
const today = new Date();
const month = new Date(today.getFullYear(), today.getMonth() + diff, 1);
const fromDate = new Date(month.getFullYear(), month.getMonth(), 1);
const toDate = new Date(month.getFullYear(), month.getMonth() + 1, 0);
return { fromDate, toDate };
},
getDay : (diff) => {
const today = new Date();
const fromDate = new Date(today.setDate(today.getDate() + diff));
const toDate = fromDate;
return { fromDate, toDate };
},
convertToyyyyMMdd : (date) => {
if (date) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
return null;
},
//#endregion
};
// 문서 로드 완료 후 초기화
$(document).ready(() => {
ngsWidget.init(1, "GRID", "GP_SM_PR_003", GP_SM_PR_003);
GP_SM_PR_003.init();
});
Init Callback 함수
pageLoadedCallBack
Last updated