[FO] 일계부 이전/다음/종료/완료 페이지 이동 처리, 건의사항 등록
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -5,63 +5,82 @@ krip.daily.httpUrl = {
|
||||
root: '/record/calendar',
|
||||
daily: '/record/daily/{month}/{groupNo}',
|
||||
target: '/record/{target}/{month}/{groupNo}',
|
||||
// income: '/record/daily/{month}/{groupNo}/income',
|
||||
// work: '/record/daily/{month}/{groupNo}/work',
|
||||
// expense: '/record/daily/{month}/{groupNo}/expense',
|
||||
// power: '/record/daily/{month}/{groupNo}/power',
|
||||
// forestry: '/record/daily/{month}/{groupNo}/forestry',
|
||||
};
|
||||
|
||||
/**
|
||||
* 일계부 현황으로 이동
|
||||
*/
|
||||
krip.daily.goToMain = function() {
|
||||
location.href = krip.daily.httpUrl.root;
|
||||
};
|
||||
|
||||
krip.daily.goToPrev = function(target, searchMonth, groupNo) {
|
||||
let url = krip.daily.httpUrl.target;
|
||||
url = url.replace('{month}', searchMonth);
|
||||
url = url.replace('{groupNo}', groupNo);
|
||||
url = url.replace('{target}', target);
|
||||
|
||||
console.log(url);
|
||||
};
|
||||
|
||||
/**
|
||||
* 이전 단계로 이동
|
||||
*/
|
||||
krip.daily.goToPrev = function() {
|
||||
// TODO : history.back 으로 해결 되는가?
|
||||
history.back();
|
||||
};
|
||||
|
||||
/**
|
||||
* 다음 단계로 이동
|
||||
* @param target
|
||||
* @param searchMonth
|
||||
* @param groupNo
|
||||
*/
|
||||
krip.daily.goToNext = function(target, searchMonth, groupNo) {
|
||||
let url = krip.daily.httpUrl.target;
|
||||
url = url.replace('{month}', searchMonth);
|
||||
url = url.replace('{groupNo}', groupNo);
|
||||
url = url.replace('{target}', target);
|
||||
url = url.replace('{target}', target.toLowerCase());
|
||||
|
||||
if (target === 'LAST') {
|
||||
alert('LAST');
|
||||
|
||||
const commentModal = document.querySelector('.commentModal').ui;
|
||||
commentModal.open();
|
||||
|
||||
/*
|
||||
commentModal.open({
|
||||
afterClose() {
|
||||
console.log(1111)
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
//modal02.afterClose
|
||||
|
||||
/*
|
||||
const $modal1 = document.querySelector('.modal02');
|
||||
const modalInstance1 = new etUI.components.Modal();
|
||||
modalInstance1.core.init($modal1, {
|
||||
afterClose(){
|
||||
console.log('ssssssssssssss')
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
location.href = url;
|
||||
};
|
||||
|
||||
/**
|
||||
* 금일 등록내용 없음 변경
|
||||
* @param month
|
||||
* 완료 단계로 이동
|
||||
* @param searchMonth
|
||||
* @param groupNo
|
||||
* @param target
|
||||
* @param checked
|
||||
*/
|
||||
krip.daily.todayNone = function(month, groupNo, target, checked) {
|
||||
let url = '/api/record/daily/{month}/{groupNo}/today-none'.replace('{month}', month).replace('{groupNo}', groupNo);
|
||||
url += '?target=' + target;
|
||||
url += '&status=' + (checked ? 'Y' : 'N');
|
||||
krip.daily.goToDone = function(searchMonth, groupNo) {
|
||||
let url = krip.daily.httpUrl.daily + '/done';
|
||||
url = url.replace('{month}', searchMonth);
|
||||
url = url.replace('{groupNo}', groupNo);
|
||||
|
||||
ajaxUtil._ajaxAsync(
|
||||
url,
|
||||
{},
|
||||
function (rstData, status) {
|
||||
console.log('rstData', rstData)
|
||||
|
||||
$('.component-btns').find('.btn-primary').attr('disabled', !checked);
|
||||
},
|
||||
);
|
||||
location.replace(url);
|
||||
};
|
||||
|
||||
/**
|
||||
* 기본 UI
|
||||
*/
|
||||
krip.daily.baseBindUI = function() {
|
||||
etUI.locales.ko = {
|
||||
dialog: {
|
||||
@@ -97,6 +116,10 @@ krip.daily.baseBindUI = function() {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 수정 팝업
|
||||
* @param id
|
||||
*/
|
||||
krip.daily.createModal = function(id) {
|
||||
if (ENV.httpUrl.form === undefined) {
|
||||
kri.logger.warn('[daily] form url is none.');
|
||||
@@ -126,6 +149,10 @@ krip.daily.createModal = function(id) {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 삭제 안내 팝업
|
||||
* @param id
|
||||
*/
|
||||
krip.daily.removeConfirm = function(id) {
|
||||
etUI.dialog.alert({
|
||||
title: '삭제 안내',
|
||||
@@ -138,6 +165,10 @@ krip.daily.removeConfirm = function(id) {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 삭제 처리
|
||||
* @param id
|
||||
*/
|
||||
krip.daily.remove = function(id) {
|
||||
if (ENV.httpUrl.remove === undefined) {
|
||||
kri.logger.warn('[daily] remove url is none.');
|
||||
@@ -153,6 +184,9 @@ krip.daily.remove = function(id) {
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* 초기화 안내 팝업
|
||||
*/
|
||||
krip.daily.resetConfirm = function() {
|
||||
etUI.dialog.alert({
|
||||
title: '초기화 안내',
|
||||
@@ -165,6 +199,9 @@ krip.daily.resetConfirm = function() {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 초기화 처리
|
||||
*/
|
||||
krip.daily.reset = function() {
|
||||
if (ENV.httpUrl.reset === undefined) {
|
||||
kri.logger.warn('[daily] reset url is none.');
|
||||
@@ -178,4 +215,51 @@ krip.daily.reset = function() {
|
||||
location.reload();
|
||||
},
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* 금일 등록내용 없음 변경 처리
|
||||
* @param month
|
||||
* @param groupNo
|
||||
* @param target
|
||||
* @param checked
|
||||
*/
|
||||
krip.daily.todayNone = function(month, groupNo, target, checked) {
|
||||
let url = '/api/record/daily/{month}/{groupNo}/today-none'.replace('{month}', month).replace('{groupNo}', groupNo);
|
||||
url += '?target=' + target;
|
||||
url += '&status=' + (checked ? 'Y' : 'N');
|
||||
|
||||
ajaxUtil._ajaxAsync(
|
||||
url,
|
||||
{},
|
||||
function (rstData, status) {
|
||||
console.log('rstData', rstData)
|
||||
|
||||
$('.component-btns').find('.btn-primary').attr('disabled', !checked);
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* 임가 건의사항 등록 처리
|
||||
* @param month
|
||||
* @param groupNo
|
||||
*/
|
||||
krip.daily.createComment = function(month, groupNo) {
|
||||
const f = document.commentReqForm;
|
||||
|
||||
const obj = $(f).serializeObject();
|
||||
console.log(obj)
|
||||
if (f.content.value === '') {
|
||||
krip.daily.goToDone(month, groupNo);
|
||||
return;
|
||||
}
|
||||
|
||||
ajaxUtil._ajaxAsync(
|
||||
'/api/suggestion',
|
||||
obj,
|
||||
function () {
|
||||
krip.daily.goToDone(month, groupNo);
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user