[FO] 일계부 동력 사용시간 List, 기타 공통 수정
This commit is contained in:
@@ -32,6 +32,19 @@ public class RecordCalendarDao implements RecordCalendarPortOut {
|
|||||||
|
|
||||||
String pathFormat = "/record/%s/%s/%s";
|
String pathFormat = "/record/%s/%s/%s";
|
||||||
|
|
||||||
|
List<CalendarChildren> monthlyList = new ArrayList<>();
|
||||||
|
monthlyList.add(new CalendarChildren(
|
||||||
|
"MONTHLY",
|
||||||
|
"임산물 현황 등록",
|
||||||
|
monthlyStatus.isForestNone() ? 0 : 1,
|
||||||
|
monthlyStatus.isForestNone() ? "/info/monthly" : String.format("/info/monthly/month/%s", command.getSearchMonth())));
|
||||||
|
|
||||||
|
monthlyList.add(new CalendarChildren(
|
||||||
|
"BANK",
|
||||||
|
"은행 자동이체 내역 등록",
|
||||||
|
monthlyStatus.isBankNone() ? 0 : 1,
|
||||||
|
(LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMM")).equals(command.getSearchMonth())) ? "/info/bank" : null));
|
||||||
|
|
||||||
List<RecordCalendar> refineList = new ArrayList<>();
|
List<RecordCalendar> refineList = new ArrayList<>();
|
||||||
for (DailyRecordCalendarDto calendar : calendarList) {
|
for (DailyRecordCalendarDto calendar : calendarList) {
|
||||||
RecordCalendar refine = new RecordCalendar();
|
RecordCalendar refine = new RecordCalendar();
|
||||||
@@ -97,20 +110,8 @@ public class RecordCalendarDao implements RecordCalendarPortOut {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
childList.add(new CalendarChildren(
|
|
||||||
"MONTHLY",
|
|
||||||
"임산물 현황 등록",
|
|
||||||
monthlyStatus.isForestNone() ? 0 : 1,
|
|
||||||
String.format("/info/monthly/month/%s", command.getSearchMonth())));
|
|
||||||
|
|
||||||
childList.add(new CalendarChildren(
|
|
||||||
"BANK",
|
|
||||||
"은행 자동이체 내역 등록",
|
|
||||||
monthlyStatus.isBankNone() ? 0 : 1,
|
|
||||||
(LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMM")).equals(command.getSearchMonth())) ? "/info/bank" : null));
|
|
||||||
|
|
||||||
refine.setChildren(childList);
|
refine.setChildren(childList);
|
||||||
|
refine.setMonthly(monthlyList);
|
||||||
refineList.add(refine);
|
refineList.add(refine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,4 +15,5 @@ public class RecordCalendar {
|
|||||||
private Integer start;
|
private Integer start;
|
||||||
private Integer end;
|
private Integer end;
|
||||||
private List<CalendarChildren> children;
|
private List<CalendarChildren> children;
|
||||||
|
private List<CalendarChildren> monthly;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,5 +15,5 @@
|
|||||||
{"no":14, "start":24, "end":25, "children": [{}, {}]},
|
{"no":14, "start":24, "end":25, "children": [{}, {}]},
|
||||||
{"no":15, "start":26, "end":27, "children": [{}, {}, {}, {}]},
|
{"no":15, "start":26, "end":27, "children": [{}, {}, {}, {}]},
|
||||||
{"no":16, "start":28, "end":29, "children": []},
|
{"no":16, "start":28, "end":29, "children": []},
|
||||||
{"no":17, "start":30, "end":30, "children": []}
|
{"no":17, "start":30, "end":31, "children": []}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -14,6 +14,5 @@
|
|||||||
{"no":13, "start":22, "end":23, "children": []},
|
{"no":13, "start":22, "end":23, "children": []},
|
||||||
{"no":14, "start":24, "end":25, "children": [{}, {}]},
|
{"no":14, "start":24, "end":25, "children": [{}, {}]},
|
||||||
{"no":15, "start":26, "end":27, "children": [{}, {}, {}, {}]},
|
{"no":15, "start":26, "end":27, "children": [{}, {}, {}, {}]},
|
||||||
{"no":16, "start":28, "end":29, "children": []},
|
{"no":16, "start":28, "end":28, "children": []}
|
||||||
{"no":17, "start":30, "end":30, "children": []}
|
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -15,5 +15,5 @@
|
|||||||
{"no":14, "start":24, "end":25, "children": [{}, {}]},
|
{"no":14, "start":24, "end":25, "children": [{}, {}]},
|
||||||
{"no":15, "start":26, "end":27, "children": [{}, {}, {}, {}]},
|
{"no":15, "start":26, "end":27, "children": [{}, {}, {}, {}]},
|
||||||
{"no":16, "start":28, "end":29, "children": []},
|
{"no":16, "start":28, "end":29, "children": []},
|
||||||
{"no":17, "start":30, "end":30, "children": []}
|
{"no":17, "start":30, "end":31, "children": []}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -15,5 +15,5 @@
|
|||||||
{"no":14, "start":24, "end":25, "children": [{}, {}]},
|
{"no":14, "start":24, "end":25, "children": [{}, {}]},
|
||||||
{"no":15, "start":26, "end":27, "children": [{}, {}, {}, {}]},
|
{"no":15, "start":26, "end":27, "children": [{}, {}, {}, {}]},
|
||||||
{"no":16, "start":28, "end":29, "children": []},
|
{"no":16, "start":28, "end":29, "children": []},
|
||||||
{"no":17, "start":30, "end":30, "children": []}
|
{"no":17, "start":30, "end":31, "children": []}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ function useDataset($target) {
|
|||||||
value = false;
|
value = false;
|
||||||
} else if(typeof value === 'string' && value.includes('{')){
|
} else if(typeof value === 'string' && value.includes('{')){
|
||||||
value = JSON.parse(value);
|
value = JSON.parse(value);
|
||||||
} else if(!isNaN(value)) {
|
} else if(!isNaN(value) && !value.startsWith('0')) {
|
||||||
value = parseFloat(value);
|
value = parseFloat(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -137,7 +137,7 @@
|
|||||||
maxView: 0,
|
maxView: 0,
|
||||||
minDate: this.data.minDate,
|
minDate: this.data.minDate,
|
||||||
maxDate: this.data.maxDate,
|
maxDate: this.data.maxDate,
|
||||||
beforeShowDay: this._beforeShowDay.bind(this)
|
beforeShowDay: (date) => this._beforeShowDay(date)
|
||||||
})
|
})
|
||||||
this.instances.datepicker = this.instances.datepickerComp.getDatepickerInstance()
|
this.instances.datepicker = this.instances.datepickerComp.getDatepickerInstance()
|
||||||
|
|
||||||
@@ -182,12 +182,12 @@
|
|||||||
_setupEventListeners() {
|
_setupEventListeners() {
|
||||||
// // Bind methods to maintain context
|
// // Bind methods to maintain context
|
||||||
this.boundMethods = {
|
this.boundMethods = {
|
||||||
handleDateChange: this._handleDateChange.bind(this),
|
handleDateChange: ({ detail }) => this._handleDateChange({ detail }),
|
||||||
handleMonthChange: this._handleMonthChange.bind(this),
|
handleMonthChange: ({ detail }) => this._handleMonthChange({ detail }),
|
||||||
handleWeekChange: this._handleWeekChange.bind(this),
|
handleWeekChange: ({ detail }) => this._handleWeekChange({ detail }),
|
||||||
handlePrevWeek: this._handlePrevWeek.bind(this),
|
handlePrevWeek: () => this._handlePrevWeek(),
|
||||||
handleNextWeek: this._handleNextWeek.bind(this),
|
handleNextWeek: () => this._handleNextWeek(),
|
||||||
handleModeToggle: this._handleModeToggle.bind(this)
|
handleModeToggle: () => this._handleModeToggle()
|
||||||
}
|
}
|
||||||
|
|
||||||
// // Add event listeners
|
// // Add event listeners
|
||||||
@@ -291,8 +291,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
_initializeWeekMode() {
|
_initializeWeekMode() {
|
||||||
this.state.weekPaging = 0
|
const selectedDate = this.instances.datepicker.getDate()
|
||||||
|
const selectedDay = selectedDate.getDate()
|
||||||
|
|
||||||
|
// // 선택된 날짜가 포함된 주차 계산
|
||||||
|
this.state.weekPaging = Math.floor((selectedDay - 1) / DatepickerComponent.CONSTANTS.DAYS_PER_WEEK)
|
||||||
|
|
||||||
this._weekPagination()
|
this._weekPagination()
|
||||||
|
this._updateWeekNavigationButtons()
|
||||||
}
|
}
|
||||||
|
|
||||||
_initializeMonthMode() {
|
_initializeMonthMode() {
|
||||||
@@ -310,21 +316,47 @@
|
|||||||
this._weekPagination(direction)
|
this._weekPagination(direction)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_updateWeekNavigationButtons() {
|
||||||
|
if (this.state.mode !== 'week') return
|
||||||
|
|
||||||
|
const currentDate = this.instances.datepicker.getDate()
|
||||||
|
|
||||||
|
// // 이전주 버튼 상태 확인
|
||||||
|
const prevWeekDate = this._getPrevWeekDate(currentDate)
|
||||||
|
const isPrevDisabled = prevWeekDate <= this.data.minDate
|
||||||
|
this._toggleButtonDisabled(this.elements.prevWeek, isPrevDisabled)
|
||||||
|
|
||||||
|
// // 다음주 버튼 상태 확인
|
||||||
|
const nextWeekDate = this._getNextWeekDate(currentDate)
|
||||||
|
const isNextDisabled = nextWeekDate >= this.data.maxDate
|
||||||
|
this._toggleButtonDisabled(this.elements.nextWeek, isNextDisabled)
|
||||||
|
}
|
||||||
|
|
||||||
|
_getPrevWeekDate(currentDate) {
|
||||||
|
const endWeekDate = this.state.weekPaging * DatepickerComponent.CONSTANTS.DAYS_PER_WEEK - 6
|
||||||
|
return new Date(currentDate.getFullYear(), currentDate.getMonth(), endWeekDate)
|
||||||
|
}
|
||||||
|
|
||||||
|
_getNextWeekDate(currentDate) {
|
||||||
|
const endWeekDate = (this.state.weekPaging + 2) * DatepickerComponent.CONSTANTS.DAYS_PER_WEEK
|
||||||
|
return new Date(currentDate.getFullYear(), currentDate.getMonth(), endWeekDate)
|
||||||
|
}
|
||||||
|
|
||||||
_weekPagingPrev() {
|
_weekPagingPrev() {
|
||||||
const currentDate = this.instances.datepicker.getDate()
|
const currentDate = this.instances.datepicker.getDate()
|
||||||
const endWeekDate = this.state.weekPaging * DatepickerComponent.CONSTANTS.DAYS_PER_WEEK - 6
|
|
||||||
const date = new Date(currentDate.getFullYear(), currentDate.getMonth(), endWeekDate)
|
|
||||||
|
|
||||||
this._disablePrevNextButtons('prev', date)
|
|
||||||
|
|
||||||
|
// // 현재 주가 1주차(weekPaging = 0)라면 이전 달로 이동
|
||||||
if (this.state.weekPaging <= 0) {
|
if (this.state.weekPaging <= 0) {
|
||||||
this._moveToPreviousMonth()
|
this._moveToPreviousMonth()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// // 이전 주로 이동
|
||||||
this.state.weekPaging -= 1
|
this.state.weekPaging -= 1
|
||||||
this._clickFirstVisibleCell()
|
this._clickFirstVisibleCell()
|
||||||
this._dispatchWeekChangeEvent('prev', currentDate)
|
this._dispatchWeekChangeEvent('prev', currentDate)
|
||||||
|
this._weekPagination('prev')
|
||||||
|
this._updateWeekNavigationButtons()
|
||||||
}
|
}
|
||||||
|
|
||||||
_weekPagingNext() {
|
_weekPagingNext() {
|
||||||
@@ -414,6 +446,7 @@
|
|||||||
this.state.weekPaging = lastWeekOfPrevMonth
|
this.state.weekPaging = lastWeekOfPrevMonth
|
||||||
this._weekPagination('prev')
|
this._weekPagination('prev')
|
||||||
this._clickFirstVisibleCell()
|
this._clickFirstVisibleCell()
|
||||||
|
this._updateWeekNavigationButtons()
|
||||||
}
|
}
|
||||||
|
|
||||||
_moveToNextMonth() {
|
_moveToNextMonth() {
|
||||||
@@ -426,6 +459,7 @@
|
|||||||
// // 주 모드에서 월 이동 시 적절한 날짜가 선택되도록 loadMonthData 호출
|
// // 주 모드에서 월 이동 시 적절한 날짜가 선택되도록 loadMonthData 호출
|
||||||
// // changeMonth 이벤트가 자동으로 발생하여 loadMonthData가 호출됨
|
// // changeMonth 이벤트가 자동으로 발생하여 loadMonthData가 호출됨
|
||||||
this._weekPagination('next')
|
this._weekPagination('next')
|
||||||
|
this._updateWeekNavigationButtons()
|
||||||
}
|
}
|
||||||
|
|
||||||
_setFirstDateDay(date) {
|
_setFirstDateDay(date) {
|
||||||
@@ -451,6 +485,7 @@
|
|||||||
// // Month setup and data loading
|
// // Month setup and data loading
|
||||||
_setupMonth(date) {
|
_setupMonth(date) {
|
||||||
this.state.currentMonth = this._getMonthKey(date)
|
this.state.currentMonth = this._getMonthKey(date)
|
||||||
|
console.log('this.state.currentMonth', this.state.currentMonth, date)
|
||||||
|
|
||||||
const allCells = this._getAllCells()
|
const allCells = this._getAllCells()
|
||||||
const thisMonthCells = this._getThisMonthCells()
|
const thisMonthCells = this._getThisMonthCells()
|
||||||
@@ -518,9 +553,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
async _finalizeDateLoading(date) {
|
async _finalizeDateLoading(date) {
|
||||||
const today = new Date()
|
// this._setupMonth(date)
|
||||||
this._setupMonth(today)
|
|
||||||
|
|
||||||
|
const today = new Date()
|
||||||
const targetDate = this._getTargetDate(date, today)
|
const targetDate = this._getTargetDate(date, today)
|
||||||
this.instances.datepicker.setDate(targetDate)
|
this.instances.datepicker.setDate(targetDate)
|
||||||
|
|
||||||
@@ -600,7 +635,6 @@
|
|||||||
// TODO
|
// TODO
|
||||||
//const response = await fetch(`http://localhost:8888/assets/json/${month}.json`)
|
//const response = await fetch(`http://localhost:8888/assets/json/${month}.json`)
|
||||||
const response = await fetch(`/api/record/calendar/${month}`)
|
const response = await fetch(`/api/record/calendar/${month}`)
|
||||||
|
|
||||||
return await response.json()
|
return await response.json()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -664,13 +698,12 @@
|
|||||||
// data: {no: 2, start: 3, end: 4, children: Array(2)}
|
// data: {no: 2, start: 3, end: 4, children: Array(2)}
|
||||||
// currentDate: {start: '2025.06.15', end: '2025.06.16'}
|
// currentDate: {start: '2025.06.15', end: '2025.06.16'}
|
||||||
// viewDate: instanceof Date
|
// viewDate: instanceof Date
|
||||||
kri.logger.debug('changeDateCallback', data, currentDate, viewDate);
|
console.log('changeDateCallback', data, currentDate, viewDate);
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
formControl.setDetail(data, currentDate, viewDate);
|
formControl.setDetail(data, currentDate, viewDate);
|
||||||
|
|
||||||
}, function(monthKey, currentDate){
|
}, function(monthKey, currentDate){
|
||||||
kri.logger.debug('changeMonthCallback', monthKey, currentDate);
|
console.log('changeMonthCallback', monthKey, currentDate);
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@@ -701,24 +734,24 @@
|
|||||||
let formControl = {
|
let formControl = {
|
||||||
setDetail(rowdata, currentDate, viewDate) {
|
setDetail(rowdata, currentDate, viewDate) {
|
||||||
const searchMonth = viewDate.getFullYear().toString() + (viewDate.getMonth() + 1).toString().padStart(2, '0');
|
const searchMonth = viewDate.getFullYear().toString() + (viewDate.getMonth() + 1).toString().padStart(2, '0');
|
||||||
let rowList = [];
|
let childList = rowdata.children;
|
||||||
let etcList = [];
|
let monthlyList = rowdata.monthly;
|
||||||
if (rowdata == null) {
|
if (rowdata == null) {
|
||||||
kri.logger.error('달력 선택 데이터 없음.')
|
kri.logger.error('달력 선택 데이터 없음.')
|
||||||
}
|
}
|
||||||
if (rowdata != null && typeof rowdata === 'object' && rowdata.children !== undefined) {
|
// if (rowdata != null && typeof rowdata === 'object' && rowdata.children !== undefined) {
|
||||||
rowList = rowdata.children.filter(f => !(f.code === 'MONTHLY' || f.code === 'BANK'));
|
// rowList = rowdata.children.filter(f => !(f.code === 'MONTHLY' || f.code === 'BANK'));
|
||||||
etcList = rowdata.children.filter(f => f.code === 'MONTHLY' || f.code === 'BANK');
|
// monthlyList = rowdata.children.filter(f => f.code === 'MONTHLY' || f.code === 'BANK');
|
||||||
}
|
// }
|
||||||
|
|
||||||
let tmpl = $.templates('#dailyNoneTmpl');
|
let tmpl = $.templates('#dailyNoneTmpl');
|
||||||
let html = '';
|
let html = '';
|
||||||
if (rowList === undefined || rowList.length === 0) {
|
if (childList === undefined || childList.length === 0) {
|
||||||
html = tmpl.render({
|
html = tmpl.render({
|
||||||
month: searchMonth,
|
month: searchMonth,
|
||||||
no: rowdata.no,
|
no: rowdata.no,
|
||||||
date: currentDate,
|
date: currentDate,
|
||||||
etcList: etcList,
|
monthlyList: monthlyList,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
tmpl = $.templates('#dailyListTmpl');
|
tmpl = $.templates('#dailyListTmpl');
|
||||||
@@ -726,8 +759,8 @@
|
|||||||
month: searchMonth,
|
month: searchMonth,
|
||||||
no: rowdata.no,
|
no: rowdata.no,
|
||||||
date: currentDate,
|
date: currentDate,
|
||||||
list: rowList,
|
list: childList,
|
||||||
etcList: etcList,
|
monthlyList: monthlyList,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -779,8 +812,10 @@
|
|||||||
</script>
|
</script>
|
||||||
<script id="etcRowTmpl" type="text/x-jsrender">
|
<script id="etcRowTmpl" type="text/x-jsrender">
|
||||||
<div class="regist-btn-area">
|
<div class="regist-btn-area">
|
||||||
{{for etcList}}
|
{{for monthlyList}}
|
||||||
<a href="{{:path ? path : 'javascript:void(0);'}}" class="btn{{if total != null && total != 0}} complete{{/if}}">
|
<a href="{{:path ? path : 'javascript:void(0);'}}" class="btn{{if total != null && total != 0}} complete{{/if}}">
|
||||||
|
|
||||||
|
|
||||||
<p>{{:codeLabel}}</p>
|
<p>{{:codeLabel}}</p>
|
||||||
{{if total != null && total != 0}}
|
{{if total != null && total != 0}}
|
||||||
<span>등록완료</span>
|
<span>등록완료</span>
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
<ul class="detail-list"
|
<ul class="detail-list"
|
||||||
th:if="${item.name eq 'EXPENSE'}"
|
th:if="${item.name eq 'EXPENSE'}"
|
||||||
>
|
>
|
||||||
<th:block th:if="${#strings.isEmpty(expenseList)}">
|
<th:block th:if="${#lists.isEmpty(expenseList)}">
|
||||||
<li>
|
<li>
|
||||||
<p>없음</p>
|
<p>없음</p>
|
||||||
</li>
|
</li>
|
||||||
@@ -111,7 +111,7 @@
|
|||||||
<ul class="detail-list"
|
<ul class="detail-list"
|
||||||
th:if="${item.name eq 'POWER'}"
|
th:if="${item.name eq 'POWER'}"
|
||||||
>
|
>
|
||||||
<th:block th:if="${#strings.isEmpty(powerList)}">
|
<th:block th:if="${#lists.isEmpty(powerList)}">
|
||||||
<li>
|
<li>
|
||||||
<p>없음</p>
|
<p>없음</p>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -179,33 +179,34 @@
|
|||||||
const $estimatedValue = $(ENV.modal.selector).find('form input[name="estimatedValue"]');
|
const $estimatedValue = $(ENV.modal.selector).find('form input[name="estimatedValue"]');
|
||||||
$price.on('keyup', function() {
|
$price.on('keyup', function() {
|
||||||
if ($(this).val() === '') {
|
if ($(this).val() === '') {
|
||||||
modalControl._priceActive($estimatedValue);
|
modalControl._inputActive($estimatedValue);
|
||||||
} else {
|
} else {
|
||||||
modalControl._priceDisabled($estimatedValue);
|
modalControl._inputDisabled($estimatedValue);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$estimatedValue.on('keyup', function() {
|
$estimatedValue.on('keyup', function() {
|
||||||
if ($(this).val() === '') {
|
if ($(this).val() === '') {
|
||||||
modalControl._priceActive($price);
|
modalControl._inputActive($price);
|
||||||
} else {
|
} else {
|
||||||
modalControl._priceDisabled($price);
|
modalControl._inputDisabled($price);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// data set
|
// data set
|
||||||
selectboxInstance2.setValue($formWrap.find('input[name="unitCode"]').val());
|
selectboxInstance2.setValue($formWrap.find('input[name="unitCode"]').val());
|
||||||
|
|
||||||
if ($price.val() === '' && $estimatedValue.val() !== '') {
|
if ($price.val() === '' && $estimatedValue.val() !== '') {
|
||||||
modalControl._priceDisabled($price);
|
modalControl._inputDisabled($price);
|
||||||
} else if ($price.val() !== '' && $estimatedValue.val() === '') {
|
} else if ($price.val() !== '' && $estimatedValue.val() === '') {
|
||||||
modalControl._priceDisabled($estimatedValue);
|
modalControl._inputDisabled($estimatedValue);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_priceActive($input) {
|
_inputActive($input) {
|
||||||
$input.val('').attr('disabled', false);
|
$input.val('').attr('disabled', false);
|
||||||
$input.parent().parent().closest('.component-input').removeClass('input-disabled');
|
$input.parent().parent().closest('.component-input').removeClass('input-disabled');
|
||||||
},
|
},
|
||||||
_priceDisabled($input) {
|
_inputDisabled($input) {
|
||||||
$input.val('').attr('disabled', true);
|
$input.val('').attr('disabled', true);
|
||||||
$input.parent().parent().closest('.component-input').addClass('input-disabled');
|
$input.parent().parent().closest('.component-input').addClass('input-disabled');
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -192,38 +192,35 @@
|
|||||||
const $estimatedValue = $(ENV.modal.selector).find('form input[name="estimatedValue"]');
|
const $estimatedValue = $(ENV.modal.selector).find('form input[name="estimatedValue"]');
|
||||||
$price.on('keyup', function() {
|
$price.on('keyup', function() {
|
||||||
if ($(this).val() === '') {
|
if ($(this).val() === '') {
|
||||||
modalControl._priceActive($estimatedValue);
|
modalControl._inpuActive($estimatedValue);
|
||||||
} else {
|
} else {
|
||||||
modalControl._priceDisabled($estimatedValue);
|
modalControl._inputDisabled($estimatedValue);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$estimatedValue.on('keyup', function() {
|
$estimatedValue.on('keyup', function() {
|
||||||
if ($(this).val() === '') {
|
if ($(this).val() === '') {
|
||||||
modalControl._priceActive($price);
|
modalControl._inpuActive($price);
|
||||||
} else {
|
} else {
|
||||||
modalControl._priceDisabled($price);
|
modalControl._inputDisabled($price);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// data set
|
// data set
|
||||||
selectboxInstance1.setValue($formWrap.find('input[name="cropCode"]').val());
|
selectboxInstance1.setValue($formWrap.find('input[name="cropCode"]').val());
|
||||||
//selectboxInstance1.update();
|
|
||||||
|
|
||||||
selectboxInstance2.setValue($formWrap.find('input[name="unitCode"]').val());
|
selectboxInstance2.setValue($formWrap.find('input[name="unitCode"]').val());
|
||||||
//selectboxInstance2.update();
|
|
||||||
|
|
||||||
if ($price.val() === '' && $estimatedValue.val() !== '') {
|
if ($price.val() === '' && $estimatedValue.val() !== '') {
|
||||||
modalControl._priceDisabled($price);
|
modalControl._inputDisabled($price);
|
||||||
} else if ($price.val() !== '' && $estimatedValue.val() === '') {
|
} else if ($price.val() !== '' && $estimatedValue.val() === '') {
|
||||||
modalControl._priceDisabled($estimatedValue);
|
modalControl._inputDisabled($estimatedValue);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_priceActive($input) {
|
_inpuActive($input) {
|
||||||
$input.val('').attr('disabled', false);
|
$input.val('').attr('disabled', false);
|
||||||
$input.parent().parent().closest('.component-input').removeClass('input-disabled');
|
$input.parent().parent().closest('.component-input').removeClass('input-disabled');
|
||||||
},
|
},
|
||||||
_priceDisabled($input) {
|
_inputDisabled($input) {
|
||||||
$input.val('').attr('disabled', true);
|
$input.val('').attr('disabled', true);
|
||||||
$input.parent().parent().closest('.component-input').addClass('input-disabled');
|
$input.parent().parent().closest('.component-input').addClass('input-disabled');
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-field type-hour">
|
<div class="input-field type-hour">
|
||||||
<input type="number" inputmode="decimal" pattern="[0-9]*" id="leasedHours" name="ownedHours" th:value="${detail.ownedHours}" maxlength="10" placeholder="임차해서 사용한 동력 사용시간을 입력해 주세요">
|
<input type="number" inputmode="decimal" pattern="[0-9]*" id="leasedHours" name="leasedHours" th:value="${detail.leasedHours}" maxlength="10" placeholder="임차해서 사용한 동력 사용시간을 입력해 주세요">
|
||||||
<span class="input-field-txt">시간</span>
|
<span class="input-field-txt">시간</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -13,25 +13,25 @@
|
|||||||
<th:block th:if="not ${dailyRecord.startDay eq dailyRecord.endDay}">
|
<th:block th:if="not ${dailyRecord.startDay eq dailyRecord.endDay}">
|
||||||
[[${#temporals.format(dailyRecord.startDate, 'M월 d일')}]]~[[${#temporals.format(dailyRecord.endDate, 'd일')}]], <br>
|
[[${#temporals.format(dailyRecord.startDate, 'M월 d일')}]]~[[${#temporals.format(dailyRecord.endDate, 'd일')}]], <br>
|
||||||
</th:block>
|
</th:block>
|
||||||
<strong>동력 사용내역 [[${#lists.isEmpty(incomeList) ? 0 : #lists.size(incomeList)}]]건 등록</strong> <br>
|
<strong>동력 사용내역 [[${#lists.isEmpty(powerList) ? 0 : #lists.size(powerList)}]]건 등록</strong> <br>
|
||||||
되었습니다.
|
되었습니다.
|
||||||
</h3>
|
</h3>
|
||||||
<p>동력 사용내역을 등록해 주세요.</p>
|
<p>동력 사용내역을 등록해 주세요.</p>
|
||||||
</hgroup>
|
</hgroup>
|
||||||
|
|
||||||
<!--/* 신규 등록 */-->
|
<!--/* 신규 등록 */-->
|
||||||
<th:block th:if="${#lists.isEmpty(incomeList)}">
|
<th:block th:if="${#lists.isEmpty(powerList)}">
|
||||||
<button type="button" class="btn btn-m btn-secondary btn-full button-modal01" data-testid="button-modal01"
|
<button type="button" class="btn btn-m btn-secondary btn-full button-modal01" data-testid="button-modal01"
|
||||||
th:disabled="${#strings.equals(dailyRecord.incomeStatus, 'TODAY_NONE')}">
|
th:disabled="${#strings.equals(dailyRecord.powerStatus, 'TODAY_NONE')}">
|
||||||
<i class="ico-small" aria-hidden="true"
|
<i class="ico-small" aria-hidden="true"
|
||||||
th:classappend="${#strings.equals(dailyRecord.incomeStatus, 'TODAY_NONE') ? 'ico-add-disabled' : 'ico-add'}"></i>
|
th:classappend="${#strings.equals(dailyRecord.powerStatus, 'TODAY_NONE') ? 'ico-add-disabled' : 'ico-add'}"></i>
|
||||||
<span class="btn-txt">추가 등록</span>
|
<span class="btn-txt">추가 등록</span>
|
||||||
</button>
|
</button>
|
||||||
<div class="component-input align-center">
|
<div class="component-input align-center">
|
||||||
<label class="checkbox-inner" id="todayNone">
|
<label class="checkbox-inner" id="todayNone">
|
||||||
<input type="checkbox" name="todayNone"
|
<input type="checkbox" name="todayNone"
|
||||||
data-type="INCOME"
|
data-type="POWER"
|
||||||
th:checked="${#strings.equals(dailyRecord.incomeStatus, 'TODAY_NONE')}">
|
th:checked="${#strings.equals(dailyRecord.powerStatus, 'TODAY_NONE')}">
|
||||||
<span class="checkbox-item">
|
<span class="checkbox-item">
|
||||||
<span class="checkbox-txt">금일 등록내용 없음</span>
|
<span class="checkbox-txt">금일 등록내용 없음</span>
|
||||||
</span>
|
</span>
|
||||||
@@ -39,10 +39,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</th:block>
|
</th:block>
|
||||||
<!--/* 목록 */-->
|
<!--/* 목록 */-->
|
||||||
<th:block th:unless="${#lists.isEmpty(incomeList)}">
|
<th:block th:unless="${#lists.isEmpty(powerList)}">
|
||||||
<section class="regist-item-area">
|
<section class="regist-item-area">
|
||||||
<p class="total">
|
<p class="total">
|
||||||
<span>총 <strong>[[${#lists.size(incomeList)}]]</strong>건</span>
|
<span>총 <strong>[[${#lists.size(powerList)}]]</strong>건</span>
|
||||||
<button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()">
|
<button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()">
|
||||||
<i class="ico-reset ico-small" aria-hidden="true"></i>
|
<i class="ico-reset ico-small" aria-hidden="true"></i>
|
||||||
<span>초기화</span>
|
<span>초기화</span>
|
||||||
@@ -50,18 +50,15 @@
|
|||||||
</p>
|
</p>
|
||||||
<div class="item-list">
|
<div class="item-list">
|
||||||
<div class="list-item"
|
<div class="list-item"
|
||||||
th:each="item, itemStatus : ${incomeList}">
|
th:each="item, itemStatus : ${powerList}">
|
||||||
<div class="item-tit-group">
|
<div class="item-tit-group">
|
||||||
<p class="item-name">[[${item.categorySelf}]]</p>
|
<p class="item-name">[[${item.equipmentName}]]</p>
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="delete" th:onclick="krip.daily.removeConfirm([[${item.id}]])"><span class="hide-txt">삭제</span></button>
|
<button type="button" class="delete" th:onclick="krip.daily.removeConfirm([[${item.id}]])"><span class="hide-txt">삭제</span></button>
|
||||||
<button type="button" class="edit" th:onclick="krip.daily.createModal([[${item.id}]])"><span class="hide-txt">수정</span></button>
|
<button type="button" class="edit" th:onclick="krip.daily.createModal([[${item.id}]])"><span class="hide-txt">수정</span></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ul class="detail-list">
|
<ul class="detail-list">
|
||||||
equipmentName
|
|
||||||
|
|
||||||
|
|
||||||
<li th:if="${not #strings.isEmpty(item.ownedHours)}">
|
<li th:if="${not #strings.isEmpty(item.ownedHours)}">
|
||||||
<p>자가 사용시간</p>
|
<p>자가 사용시간</p>
|
||||||
<span th:text="|${item.ownedHours}시간|">0시간</span>
|
<span th:text="|${item.ownedHours}시간|">0시간</span>
|
||||||
@@ -90,7 +87,7 @@
|
|||||||
<span class="btn-txt">이전 단계로 이동</span>
|
<span class="btn-txt">이전 단계로 이동</span>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-l btn-primary"
|
<button type="button" class="btn btn-l btn-primary"
|
||||||
th:disabled="${not #strings.equals(dailyRecord.incomeStatus, 'TODAY_NONE') and #lists.isEmpty(incomeList)}"
|
th:disabled="${not #strings.equals(dailyRecord.powerStatus, 'TODAY_NONE') and #lists.isEmpty(powerList)}"
|
||||||
th:onclick="krip.daily.goToNext([[${nextStep}]], [[${reqVO.searchMonth}]], [[${reqVO.groupNo}]])">
|
th:onclick="krip.daily.goToNext([[${nextStep}]], [[${reqVO.searchMonth}]], [[${reqVO.groupNo}]])">
|
||||||
<span class="btn-txt">다음 단계로 이동</span>
|
<span class="btn-txt">다음 단계로 이동</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -154,63 +151,35 @@
|
|||||||
|
|
||||||
let modalControl = {
|
let modalControl = {
|
||||||
_bindModelUI() {
|
_bindModelUI() {
|
||||||
const $select1 = document.querySelector('#cropCode');
|
const $ownedHour = $(ENV.modal.selector).find('form input[name="ownedHours"]');
|
||||||
const selectboxInstance1 = new etUI.components.SelectBox();
|
const $leasedHour = $(ENV.modal.selector).find('form input[name="leasedHours"]');
|
||||||
selectboxInstance1.core.init($select1, {
|
$ownedHour.on('keyup', function() {
|
||||||
selectItemCallback({selectValue, dataValue}){
|
|
||||||
console.log('selectItemCallback', selectValue, dataValue)
|
|
||||||
$('input[name="cropCode"]').val(dataValue)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const $select2 = document.querySelector('#unitCode');
|
|
||||||
const selectboxInstance2 = new etUI.components.SelectBox();
|
|
||||||
selectboxInstance2.core.init($select2, {
|
|
||||||
selectItemCallback({selectValue, dataValue}){
|
|
||||||
console.log('selectItemCallback', selectValue, dataValue)
|
|
||||||
$('input[name="unitCode"]').val(dataValue)
|
|
||||||
|
|
||||||
etUI.pages.initDirectInputToggle();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const $formWrap = $(ENV.modal.selector).find('form');
|
|
||||||
const $price = $(ENV.modal.selector).find('form input[name="price"]');
|
|
||||||
const $estimatedValue = $(ENV.modal.selector).find('form input[name="estimatedValue"]');
|
|
||||||
$price.on('keyup', function() {
|
|
||||||
if ($(this).val() === '') {
|
if ($(this).val() === '') {
|
||||||
modalControl._priceActive($estimatedValue);
|
modalControl._inputActive($leasedHour);
|
||||||
} else {
|
} else {
|
||||||
modalControl._priceDisabled($estimatedValue);
|
modalControl._inputDisabled($leasedHour);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$estimatedValue.on('keyup', function() {
|
$leasedHour.on('keyup', function() {
|
||||||
if ($(this).val() === '') {
|
if ($(this).val() === '') {
|
||||||
modalControl._priceActive($price);
|
modalControl._inputActive($ownedHour);
|
||||||
} else {
|
} else {
|
||||||
modalControl._priceDisabled($price);
|
modalControl._inputDisabled($ownedHour);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// data set
|
if ($ownedHour.val() === '' && $leasedHour.val() !== '') {
|
||||||
selectboxInstance1.setValue($formWrap.find('input[name="cropCode"]').val());
|
modalControl._inputDisabled($ownedHour);
|
||||||
//selectboxInstance1.update();
|
} else if ($ownedHour.val() !== '' && $leasedHour.val() === '') {
|
||||||
|
modalControl._inputDisabled($leasedHour);
|
||||||
selectboxInstance2.setValue($formWrap.find('input[name="unitCode"]').val());
|
|
||||||
//selectboxInstance2.update();
|
|
||||||
|
|
||||||
if ($price.val() === '' && $estimatedValue.val() !== '') {
|
|
||||||
modalControl._priceDisabled($price);
|
|
||||||
} else if ($price.val() !== '' && $estimatedValue.val() === '') {
|
|
||||||
modalControl._priceDisabled($estimatedValue);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_priceActive($input) {
|
_inputActive($input) {
|
||||||
$input.val('').attr('disabled', false);
|
$input.val('').attr('disabled', false);
|
||||||
$input.parent().parent().closest('.component-input').removeClass('input-disabled');
|
$input.parent().parent().closest('.component-input').removeClass('input-disabled');
|
||||||
},
|
},
|
||||||
_priceDisabled($input) {
|
_inputDisabled($input) {
|
||||||
$input.val('').attr('disabled', true);
|
$input.val('').attr('disabled', true);
|
||||||
$input.parent().parent().closest('.component-input').addClass('input-disabled');
|
$input.parent().parent().closest('.component-input').addClass('input-disabled');
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user