Merge branch 'daily' into dev

This commit is contained in:
김현주
2025-06-18 18:03:06 +09:00
36 changed files with 1403 additions and 126 deletions

View File

@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="app.module.front.usecase.daily.power.adapters.persistence.DailyPowerMapper">
<select id="getDailyPowerList"
resultType="app.module.front.usecase.daily.power.adapters.persistence.model.DailyPowerDto">
select ds.id, ds.daily_record_seq
, ds.equipment_name, ds.owned_hours, ds.leased_hours
from daily_power ds
<include refid="app.module.front.usecase.daily.record.adapters.persistence.DailyRecordMapper.InnerJoinByDailyRecord"/>
where ds.is_deleted = false
<if test="id != null and id != '0'">
and ds.id = ${id}
</if>
order by
ds.id desc
</select>
<select id="getRecordExistCount" resultType="int">
select count(1)
from daily_power ds
<include refid="app.module.front.usecase.daily.record.adapters.persistence.DailyRecordMapper.InnerJoinByDailyRecord"/>
where ds.is_deleted = false
<if test="id != null and id != '0'">
and ds.id = ${id}
</if>
</select>
<insert id="createDailyPower" useGeneratedKeys="true" keyProperty="id">
insert into daily_power (
daily_record_seq
, equipment_name, owned_hours, leased_hours
, is_deleted
, <include refid="common.fields.CreateUpdateBaseColumns"/>
) values (
#{dailyRecordSeq}
, #{equipmentName}, #{ownedHours}, #{leasedHours}
, false
, <include refid="common.fields.CreateUpdateBaseValues"/>
)
</insert>
<update id="updateDailyPower">
update daily_power set <include refid="common.fields.UpdateBaseSet"/>
, equipment_name = #{equipmentName}
, owned_hours = #{ownedHours}
, leased_hours = #{leasedHours}
where is_deleted = false
and daily_record_seq = #{dailyRecordSeq}
and id = #{id}
</update>
<update id="removeDailyPower">
update daily_power set
<include refid="common.fields.DeleteBaseSet"/>
where is_deleted = false
and daily_record_seq = #{dailyRecordSeq}
<if test="id != null and id != ''">
and id = #{id}
</if>
</update>
</mapper>

View File

@@ -39,4 +39,15 @@
and dr.record_month = #{searchMonth}
</select>
<select id="getMonthlyStatus">
select mis.forest_product_status as forest_product, mis.bank_auto_transfer_input_status as bank_input, mis.bank_auto_transfer_output_status as bank_output
from monthly_input_status mis
where mis.is_deleted = false
and mis.household_seq = #{householdSeq}
and mis.month = #{searchMonth}
order by
mis.id desc
limit 1
</select>
</mapper>

View File

@@ -0,0 +1,3 @@
<svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.33203 6.5V3.5C7.33203 3.23478 7.43739 2.98043 7.62492 2.79289C7.81246 2.60536 8.06681 2.5 8.33203 2.5H20.332C20.5972 2.5 20.8516 2.60536 21.0391 2.79289C21.2267 2.98043 21.332 3.23478 21.332 3.5V17.5C21.332 17.7652 21.2267 18.0196 21.0391 18.2071C20.8516 18.3946 20.5972 18.5 20.332 18.5H17.332V21.5C17.332 22.052 16.882 22.5 16.325 22.5H4.33903C4.20716 22.5008 4.07643 22.4755 3.95435 22.4256C3.83228 22.3757 3.72126 22.3022 3.62769 22.2093C3.53412 22.1164 3.45982 22.0059 3.40909 21.8841C3.35835 21.7624 3.33216 21.6319 3.33203 21.5L3.33503 7.5C3.33503 6.948 3.78503 6.5 4.34103 6.5H7.33203ZM5.33403 8.5L5.33203 20.5H15.332V8.5H5.33403ZM9.33203 6.5H17.332V16.5H19.332V4.5H9.33203V6.5ZM7.33203 11.5H13.332V13.5H7.33203V11.5ZM7.33203 15.5H13.332V17.5H7.33203V15.5Z" fill="#DEE2E6"/>
</svg>

After

Width:  |  Height:  |  Size: 898 B

View File

@@ -0,0 +1,3 @@
<svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3.66797 3.5H21.668C21.9332 3.5 22.1875 3.60536 22.3751 3.79289C22.5626 3.98043 22.668 4.23478 22.668 4.5V20.5C22.668 20.7652 22.5626 21.0196 22.3751 21.2071C22.1875 21.3946 21.9332 21.5 21.668 21.5H3.66797C3.40275 21.5 3.1484 21.3946 2.96086 21.2071C2.77333 21.0196 2.66797 20.7652 2.66797 20.5V4.5C2.66797 4.23478 2.77333 3.98043 2.96086 3.79289C3.1484 3.60536 3.40275 3.5 3.66797 3.5ZM4.66797 5.5V19.5H20.668V5.5H4.66797ZM7.66797 13.5H9.66797V17.5H7.66797V13.5ZM11.668 7.5H13.668V17.5H11.668V7.5ZM15.668 10.5H17.668V17.5H15.668V10.5Z" fill="#DEE2E6"/>
</svg>

After

Width:  |  Height:  |  Size: 667 B

View File

@@ -7410,12 +7410,18 @@ button.swiper-pagination-bullet {
.footer .footer-menu ul li.menu-regi.active {
background-image: url("../images/common/ico_menu_regi_active.svg");
}
.footer .footer-menu ul li.menu-regi.disabled {
background-image: url("../images/common/ico_menu_regi_disabled.svg");
}
.footer .footer-menu ul li.menu-stat {
background-image: url("../images/common/ico_menu_stat.svg");
}
.footer .footer-menu ul li.menu-stat.active {
background-image: url("../images/common/ico_menu_stat_active.svg");
}
.footer .footer-menu ul li.menu-stat.disabled {
background-image: url("../images/common/ico_menu_stat_disabled.svg");
}
.footer .footer-menu ul li.menu-info {
background-image: url("../images/common/ico_menu_info.svg");
}
@@ -7425,6 +7431,10 @@ button.swiper-pagination-bullet {
.footer .footer-menu ul li.active a {
color: #4bbc43;
}
.footer .footer-menu ul li.disabled a {
cursor: default;
color: #CED4DA;
}
.acco-wrap .daily-report-area .date {
position: relative;
@@ -7455,6 +7465,9 @@ button.swiper-pagination-bullet {
margin-top: 1.6rem;
margin-bottom: 0.5rem;
}
.acco-wrap .modal-content .alert-box + .form-group {
margin-top: 3.2rem;
}
.acco-wrap .modal-content .alert-box + .form-desc {
margin-top: 0.8rem;
}

View File

@@ -28,6 +28,15 @@ krip.daily.goToPrev = function() {
* @param groupNo
*/
krip.daily.goToNext = function(target, searchMonth, groupNo) {
if (target == null) {
if ($('._nextStep').data('last')) {
target = 'LAST';
} else {
krip.daily.goToDone(searchMonth, groupNo);
return;
}
}
if (target === 'LAST') {
// 임가 건의사항 팝업
const commentModal = document.querySelector('.commentModal').ui;
@@ -231,7 +240,7 @@ krip.daily.createComment = function(month, groupNo) {
const f = document.commentReqForm;
const obj = $(f).serializeObject();
console.log(obj)
console.log(obj, month, groupNo)
if (f.content.value === '') {
krip.daily.goToDone(month, groupNo);
return;

View File

@@ -153,19 +153,19 @@
<dd class="address">
<p>주소</p>
<span>
Office 1. (06652) 서울시 서초구 사임당로 18, 석오빌딩 8F
</span>
Office 1. (06652) 서울시 서초구 사임당로 18, 석오빌딩 8F
</span>
<span>
Office 2. (06651) 서울시 서초구 사임당로 32, 재우빌딩 9F
</span>
Office 2. (06651) 서울시 서초구 사임당로 32, 재우빌딩 9F
</span>
</dd>
<dd>
<p>이메일</p>
<span>info@kric.com</span>
<a href="mailto:info@kric.com"><span>info@kric.com</span></a>
</dd>
<dd>
<p>고객센터 전화번호</p>
<span>02-3415-5187</span>
<a href="tel:02-3415-5187"><span>02-3415-5187</span></a>
</dd>
</dl>
<p class="copyright">
@@ -184,24 +184,15 @@
or #strings.containsIgnoreCase(currentURI?.uri, '/record/') ? 'active' : ''}">
<a href="javascript:void(0);" onclick="kri.menu.daily();">일계부</a>
</li>
<!--/* TODO : 2차 오픈 */-->
<!--<li class="menu-regi"><a href="">입력현황</a></li>
<li class="menu-stat"><a href="">통계</a></li>-->
<!--/* TODO : 2차 오픈 s */-->
<li class="menu-regi disabled"><a href="javascript:void(0)">입력현황</a></li>
<li class="menu-stat disabled"><a href="javascript:void(0)">통계</a></li>
<!--/* TODO : 2차 오픈 e */-->P
<li class="menu-info"
th:classappend="${#strings.equals(currentURI?.uri, '/user')
or #strings.containsIgnoreCase(currentURI?.uri, '/user/') ? 'actives' : ''}">
th:classappend="${#strings.equals(currentURI?.uri, '/info')
or #strings.containsIgnoreCase(currentURI?.uri, '/info/') ? 'active' : ''}">
<a href="javascript:void(0);" onclick="kri.menu.my();">내정보</a>
</li>
<!--/* TODO : 전체메뉴 적용 전 임시 메뉴 S */-->
<li sec:authorize="isAnonymous()" th:remove="tag">
<a href="/login">[로그인]</a>
</li>
<li sec:authorize="isAuthenticated()" th:remove="tag">
<strong th:text="${#authentication.principal.ownerName}">로그인 사용자명</strong>
, seq=<strong th:text="${#authentication.principal.householdSeq}">로그인 사용자SEQ</strong>
<a href="/logout">[로그아웃]</a>
</li>
<!--/* TODO : 전체메뉴 적용 전 임시 메뉴 E */-->
</ul>
</nav>
</footer>

View File

@@ -780,7 +780,7 @@
<script id="etcRowTmpl" type="text/x-jsrender">
<div class="regist-btn-area">
{{for etcList}}
<a href="{{:path}}" 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>
{{if total != null && total != 0}}
<span>등록완료</span>

View File

@@ -12,26 +12,140 @@
</div>
</th:block>
<main id="content" role="main">
일계부 등록이
모두 완료 되었습니다.
<div class="inner">
<hgroup class="tit-group">
<i class="ico-alert-lightgreen ico-xlarge" aria-hidden="true"></i>
<h3>
일계부 등록이 <br>
모두 완료 되었습니다.
</h3>
<p>
입력하신 내용은 자동으로 등록되었습니다. <br>
항목에 대한 '추가/수정/삭제'는 일계부에서 가능합니다.
</p>
</hgroup>
<section class="regist-item-area complete">
<div class="item-list">
<div class="list-item"
th:each="item, itemStatus : ${dailyRecord.targetList}"
th:classappend="${(item.name eq 'INCOME' && #lists.isEmpty(incomeList))
|| (item.name eq 'EXPENSE' && #lists.isEmpty(expenseList))
|| (item.name eq 'POWER' && #lists.isEmpty(powerList))} ? 'no-data'"
>
<div class="item-tit-group">
<p class="item-name">[[${item.desc}]]</p>
</div>
<!--/* 수입 */-->
<ul class="detail-list"
th:if="${item.name eq 'INCOME'}"
>
<th:block th:if="${#lists.isEmpty(incomeList)}">
<li>
<p>없음</p>
</li>
</th:block>
<th:block th:each="child, childStatus : ${incomeList}">
<li>
<p>[[${child.categorySelf}]]</p>
<span th:if="${not #strings.isEmpty(child.price)}"
th:text="|${#numbers.formatInteger(child.price, 1, 'COMMA')}원|">302,000원</span>
<span th:if="${not #strings.isEmpty(child.estimatedValue)}"
th:text="|${#numbers.formatInteger(child.estimatedValue, 1, 'COMMA')}원|">302,000원</span>
</li>
</th:block>
</ul>
<!--/* 지출 */-->
<ul class="detail-list"
th:if="${item.name eq 'EXPENSE'}"
>
<th:block th:if="${#strings.isEmpty(expenseList)}">
<li>
<p>없음</p>
</li>
</th:block>
<th:block th:each="child, childStatus : ${expenseList}">
<li>
<p>[[${child.categorySelf}]]</p>
<span th:if="${not #strings.isEmpty(child.price)}"
th:text="|${#numbers.formatInteger(child.price, 1, 'COMMA')}원|">302,000원</span>
<span th:if="${not #strings.isEmpty(child.estimatedValue)}"
th:text="|${#numbers.formatInteger(child.estimatedValue, 1, 'COMMA')}원|">302,000원</span>
</li>
</th:block>
</ul>
<!--/* TODO 임업노동 투입 */-->
<!--/*<ul class="detail-list"
th:if="${item.name eq 'WORK'}"
>
<th:block th:if="${#strings.isEmpty(workList)}">
<li>
<p>없음</p>
</li>
</th:block>
<th:block th:each="child, childStatus : ${workList}">
<li>
<p>호두</p>
<span>
<span>수확</span>
<span>총 23시간</span>
</span>
</li>
<li>
<p>밤</p>
<span>
<span>줍기</span>
<span>총 12시간</span>
</span>
</li>
<li>
<p>밤</p>
<span>
<span>선별</span>
<span>총 2시간</span>
</span>
</li>
</th:block>
</ul>*/-->
<!--/* 동력 사용시간 */-->
<ul class="detail-list"
th:if="${item.name eq 'POWER'}"
>
<th:block th:if="${#strings.isEmpty(powerList)}">
<li>
<p>없음</p>
</li>
</th:block>
<th:block th:each="child, childStatus : ${powerList}">
<li>
<p>[[${child.equipmentName}]]</p>
<span th:if="${not #strings.isEmpty(child.ownedHours)}"
th:text="|총${#numbers.formatInteger(child.ownedHours, 1, 'COMMA')}시간|">총8시간</span>
<span th:if="${not #strings.isEmpty(child.leasedHours)}"
th:text="|총${#numbers.formatInteger(child.leasedHours, 1, 'COMMA')}시간|">총8시간</span>
</li>
</th:block>
</ul>
<!--/* TODO 임업생산물 중 자가소비량 */-->
<!--/* TODO 농업생산물 중 자가소비량 */-->
</div>
</div>
</section>
</div>
</main>
<div class="component-btns fixed">
<div class="btns-row">
<button type="button" class="btn btn-l btn-primary" onclick="krip.daily.goToMain();">
<span class="btn-txt">확인</span>
</button>
</div>
</div>
</div>
<section layout:fragment="script">
<script th:src="@{/static/ui/page/daily-record.js}"></script>
<script th:inline="javascript">
let ENV = {
httpUrl: {
create: /*[[|/api/record/daily/${reqVO.searchMonth}/${reqVO.groupNo}|]]*/'createUrl',
},
month: [[${reqVO.searchMonth}]],
groupNo: [[${reqVO.groupNo}]],
submitted: false,
};
let formControl = {
};
</script>
</section>
</html>

View File

@@ -30,56 +30,6 @@
</li>
</ul>
</div>
<div class="list-item no-data">
<div class="item-tit-group">
<p class="item-name">임업노동 투입</p>
</div>
<ul class="detail-list">
<li>
<p>없음</p>
</li>
</ul>
</div>
<div class="list-item no-data">
<div class="item-tit-group">
<p class="item-name">지출</p>
</div>
<ul class="detail-list">
<li>
<p>없음</p>
</li>
</ul>
</div>
<div class="list-item no-data">
<div class="item-tit-group">
<p class="item-name">동력 사용시간</p>
</div>
<ul class="detail-list">
<li>
<p>없음</p>
</li>
</ul>
</div>
<div class="list-item no-data">
<div class="item-tit-group">
<p class="item-name">임업생산물 중 자가소비량</p>
</div>
<ul class="detail-list">
<li>
<p>없음</p>
</li>
</ul>
</div>
<div class="list-item no-data">
<div class="item-tit-group">
<p class="item-name">농업생산물 중 자가소비량</p>
</div>
<ul class="detail-list">
<li>
<p>없음</p>
</li>
</ul>
</div>
</div>
</section>

View File

@@ -60,7 +60,7 @@
</span>
</label>
</div>
<!--/*<div class="component-input">
<div class="component-input">
<label class="switch-inner type-txt">
<span class="switch-label">동력 사용시간</span>
<input type="checkbox" name="powerStatus" value="TARGET" data-target="power"
@@ -70,7 +70,7 @@
</span>
</label>
</div>
<div class="component-input">
<!--/*<div class="component-input">
<label class="switch-inner type-txt">
<span class="switch-label">자가임업 생산물 중 자가소비량</span>
<input type="checkbox" name="forestryStatus" value="TARGET" data-target="forestry"
@@ -114,7 +114,7 @@
</div>
<section layout:fragment="script">
<script th:src="@{/ui/page/daily-record.js}"></script>
<script th:src="@{/static/ui/page/daily-record.js}"></script>
<script th:inline="javascript">
let ENV = {
httpUrl: {
@@ -164,7 +164,8 @@
create() {
const f = document.reqForm;
if ($(f).find('input:checked').length === 0) {
const $checked = $(f).find('input:checked');
if ($checked.length === 0) {
f.todayNone.value = 'Y';
}
@@ -179,6 +180,8 @@
} else {
krip.daily.goToDone(ENV.month, ENV.groupNo);
}
} else if ($checked.data('target') !== undefined) {
krip.daily.goToNext($checked.data('target'), ENV.month, ENV.groupNo);
} else {
krip.daily.goToMain();
}

View File

@@ -108,7 +108,7 @@
<!-- 모달 팝업 -->
<div class="layer-wrap">
<div class="component-modal acco-wrap modal01" data-props-dimm-click="true">
<div class="component-modal acco-wrap formModal" data-props-dimm-click="true">
<div class="modal-dimm"></div>
<div class="modal-frame">
<div class="modal-container">
@@ -148,7 +148,7 @@
// 등록 버튼
selectorId: '.button-modal01',
// 등록 영역
selector: '.modal01',
selector: '.formModal',
},
month: /*[[${reqVO.searchMonth}]]*/'month',
groupNo: /*[[${reqVO.groupNo}]]*/'groupNo',

View File

@@ -112,7 +112,7 @@
<!-- 모달 팝업 -->
<div class="layer-wrap">
<div class="component-modal acco-wrap modal01" data-props-dimm-click="true">
<div class="component-modal acco-wrap formModal" data-props-dimm-click="true">
<div class="modal-dimm"></div>
<div class="modal-frame">
<div class="modal-container">
@@ -152,7 +152,7 @@
// 등록 버튼
selectorId: '.button-modal01',
// 등록 영역
selector: '.modal01',
selector: '.formModal',
},
month: /*[[${reqVO.searchMonth}]]*/'month',
groupNo: /*[[${reqVO.groupNo}]]*/'groupNo',

View File

@@ -0,0 +1,77 @@
<!DOCTYPE html>
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
xmlns:th="http://www.thymeleaf.org" lang="ko">
<th:block>
<div class="modal-content-inner">
<p class="form-desc">필수입력</p>
<form name="reqModalForm">
<input type="hidden" name="id" th:value="${detail.id}">
<section class="form-group">
<div class="component-input">
<div class="input-label">
<label for="equipmentName" class="label-txt">
명칭
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
</label>
</div>
<div class="input-field">
<input type="text" id="equipmentName" name="equipmentName" th:value="${detail.equipmentName}" maxlength="30" placeholder="사용 기계 이름을 입력해 주세요">
</div>
<ul class="guide-info">
<li>예 : 예초기</li>
</ul>
</div>
</section>
<hr>
<section class="form-group">
<div class="component-segment">
<div class="segment-label">
<p class="label-txt">
동력 사용시간 <i class="ico-required-mark" role="img" aria-label="필수">*</i>
</p>
<span class="label-sub-txt">
동력 사용시간은 자가와 임차로 구분해 입력해 주세요.
</span>
</div>
</div>
<div class="component-input type-sub">
<div class="input-label">
<label for="ownedHours" class="label-txt">
자가 사용시간
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
</label>
</div>
<div class="input-field type-hour">
<input type="number" inputmode="numeric" pattern="[0-9]*" id="ownedHours" name="ownedHours" th:value="${detail.ownedHours}" maxlength="10" placeholder="자가에서 사용한 동력 사용시간을 입력해 주세요">
<span class="input-field-txt">시간</span>
</div>
</div>
<div class="component-input type-sub">
<div class="input-label">
<label for="leasedHours" class="label-txt">
임차 사용시간
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
</label>
</div>
<div class="input-field type-hour">
<input type="number" inputmode="numeric" pattern="[0-9]*" id="leasedHours" name="ownedHours" th:value="${detail.ownedHours}" maxlength="10" placeholder="임차해서 사용한 동력 사용시간을 입력해 주세요">
<span class="input-field-txt">시간</span>
</div>
</div>
</section>
</form>
<div class="component-btns">
<div class="btns-row">
<button type="button" class="btn btn-full btn-l btn-primary" onclick="modalControl.createVaild();">
<span class="btn-txt">등록</span>
</button>
</div>
</div>
</div>
</th:block>
</html>

View File

@@ -0,0 +1,251 @@
<!DOCTYPE html>
<html layout:decorate="~{layout/layout-none}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
xmlns:th="http://www.thymeleaf.org" lang="ko">
<div layout:fragment="content" th:classappend="acco-wrap">
<main id="content" role="main">
<div class="inner">
<hgroup class="tit-group">
<h3>
<th:block th:if="${dailyRecord.startDay eq dailyRecord.endDay}">
[[${#temporals.format(dailyRecord.startDate, 'M월 d일')}]], <br>
</th:block>
<th:block th:if="not ${dailyRecord.startDay eq dailyRecord.endDay}">
[[${#temporals.format(dailyRecord.startDate, 'M월 d')}]]~[[${#temporals.format(dailyRecord.endDate, 'd일')}]], <br>
</th:block>
<strong>동력 사용내역 [[${#lists.isEmpty(incomeList) ? 0 : #lists.size(incomeList)}]]건 등록</strong> <br>
되었습니다.
</h3>
<p>동력 사용내역을 등록해 주세요.</p>
</hgroup>
<!--/* 신규 등록 */-->
<th:block th:if="${#lists.isEmpty(incomeList)}">
<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')}">
<i class="ico-small" aria-hidden="true"
th:classappend="${#strings.equals(dailyRecord.incomeStatus, 'TODAY_NONE') ? 'ico-add-disabled' : 'ico-add'}"></i>
<span class="btn-txt">추가 등록</span>
</button>
<div class="component-input align-center">
<label class="checkbox-inner" id="todayNone">
<input type="checkbox" name="todayNone"
data-type="INCOME"
th:checked="${#strings.equals(dailyRecord.incomeStatus, 'TODAY_NONE')}">
<span class="checkbox-item">
<span class="checkbox-txt">금일 등록내용 없음</span>
</span>
</label>
</div>
</th:block>
<!--/* 목록 */-->
<th:block th:unless="${#lists.isEmpty(incomeList)}">
<section class="regist-item-area">
<p class="total">
<span>총 <strong>[[${#lists.size(incomeList)}]]</strong>건</span>
<button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()">
<i class="ico-reset ico-small" aria-hidden="true"></i>
<span>초기화</span>
</button>
</p>
<div class="item-list">
<div class="list-item"
th:each="item, itemStatus : ${incomeList}">
<div class="item-tit-group">
<p class="item-name">[[${item.categorySelf}]]</p>
<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="edit" th:onclick="krip.daily.createModal([[${item.id}]])"><span class="hide-txt">수정</span></button>
</div>
</div>
<ul class="detail-list">
<li th:if="${item.credit != null}">
<p>외상판매</p>
<span th:text="${item.credit ? '예' : '아니오'}">아니오</span>
</li>
<li th:if="${not #strings.isEmpty(item.cropLabel)}">
<p>재배형태</p>
<span th:text="${item.cropLabel}">재배형태</span>
</li>
<li th:if="${not #strings.isEmpty(item.sourcePurpose)}">
<p>수입원</p>
<span th:text="${item.sourcePurpose}">소비자</span>
</li>
<li th:if="${not #strings.isEmpty(item.quantity)}">
<p>수량</p>
<span th:text="|${item.quantity}${#strings.defaultString(item.unitLabel,'')}|">500g</span>
</li>
<li th:if="${not #strings.isEmpty(item.price)}">
<p>현금 </p>
<span th:text="|${#numbers.formatInteger(item.price, 1, 'COMMA')}원|">302,000원</span>
</li>
<li th:if="${not #strings.isEmpty(item.estimatedValue)}">
<p>현물평가액</p>
<span th:text="|${#numbers.formatInteger(item.estimatedValue, 1, 'COMMA')}원|">302,000원</span>
</li>
</ul>
</div>
</div>
<button type="button" class="btn btn-m btn-secondary btn-full button-modal01" data-testid="button-modal01">
<i class="ico-add ico-small" aria-hidden="true"></i>
<span class="btn-txt">추가 등록</span>
</button>
</section>
</th:block>
</div>
</main>
<!-- 하단 고정 버튼 -->
<div class="component-btns fixed"
th:if="${moveStep}">
<div class="btns-row">
<button type="button" class="btn btn-l btn-secondary" onclick="krip.daily.goToPrev();">
<span class="btn-txt">이전 단계로 이동</span>
</button>
<button type="button" class="btn btn-l btn-primary"
th:disabled="${not #strings.equals(dailyRecord.incomeStatus, 'TODAY_NONE') and #lists.isEmpty(incomeList)}"
th:onclick="krip.daily.goToNext([[${nextStep}]], [[${reqVO.searchMonth}]], [[${reqVO.groupNo}]])">
<span class="btn-txt">다음 단계로 이동</span>
</button>
</div>
</div>
<!-- 모달 팝업 -->
<div class="layer-wrap">
<div class="component-modal acco-wrap formModal" data-props-dimm-click="true">
<div class="modal-dimm"></div>
<div class="modal-frame">
<div class="modal-container">
<div class="modal-header">
<h3 class="modal-tit">동력 사용시간 등록</h3>
</div>
<div class="modal-content">
<!--/* form */-->
</div>
<button type="button" class="modal-close"></button>
</div>
</div>
</div>
</div>
<!-- //모달 팝업 -->
<!-- /* 건의사항 모달 팝업 */ -->
<th:block th:replace="~{/record/comment-modal}"></th:block>
<!-- /* //건의사항 모달 팝업 */ -->
</div>
<section layout:fragment="script">
<script th:src="@{/static/ui/page/daily-record.js}"></script>
<script th:inline="javascript">
$(function() {
formControl.init();
});
let ENV = {
httpUrl: {
root: /*[[|/record/power/${reqVO.searchMonth}/${reqVO.groupNo}|]]*/'rootUrl',
form: /*[[|/record/power/${reqVO.searchMonth}/${reqVO.groupNo}/form/{id}|]]*/'formUrl',
create: /*[[|/api/record/power/${reqVO.searchMonth}/${reqVO.groupNo}/form/{id}|]]*/'createUrl',
remove: /*[[|/api/record/power/${reqVO.searchMonth}/${reqVO.groupNo}/remove|]]*/'removeUrl',
reset: /*[[|/api/record/power/${reqVO.searchMonth}/${reqVO.groupNo}/reset|]]*/'resetUrl',
},
modal: {
// 등록 버튼
selectorId: '.button-modal01',
// 등록 영역
selector: '.formModal',
},
month: /*[[${reqVO.searchMonth}]]*/'month',
groupNo: /*[[${reqVO.groupNo}]]*/'groupNo',
submitted: false,
};
let formControl = {
init() {
krip.daily.baseBindUI();
},
};
let modalControl = {
_bindModelUI() {
const $select1 = document.querySelector('#cropCode');
const selectboxInstance1 = new etUI.components.SelectBox();
selectboxInstance1.core.init($select1, {
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() === '') {
modalControl._priceActive($estimatedValue);
} else {
modalControl._priceDisabled($estimatedValue);
}
});
$estimatedValue.on('keyup', function() {
if ($(this).val() === '') {
modalControl._priceActive($price);
} else {
modalControl._priceDisabled($price);
}
});
// data set
selectboxInstance1.setValue($formWrap.find('input[name="cropCode"]').val());
//selectboxInstance1.update();
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) {
$input.val('').attr('disabled', false);
$input.parent().parent().closest('.component-input').removeClass('input-disabled');
},
_priceDisabled($input) {
$input.val('').attr('disabled', true);
$input.parent().parent().closest('.component-input').addClass('input-disabled');
},
createVaild() {
modalControl.create();
},
create() {
const f = document.reqModalForm;
const obj = $(f).serializeObject();
console.log(obj)
ajaxUtil._ajaxAsync(
ENV.httpUrl.create.replace('{id}', f.id.value ? f.id.value : '0'),
obj,
function (rstData, status) {
location.reload();
},
);
},
};
</script>
</section>
</html>