[FO] 일계부 수입, 지출의 단위 직접입력 추가

This commit is contained in:
김현주
2025-06-17 14:43:56 +09:00
parent 8bd7d758ec
commit 8d91f176ae
11 changed files with 74 additions and 16 deletions

View File

@@ -6,7 +6,7 @@
resultType="app.module.front.usecase.daily.expense.adapters.persistence.model.DailyExpenseDto">
select ds.id, ds.daily_record_seq, ds.input_type, ds.is_credit as credit
, ds.category_self, ds.source_purpose
, ds.quantity, ds.unit_code, ds.price, ds.estimated_value
, ds.quantity, ds.unit_code, ds.unit_self, ds.price, ds.estimated_value
from daily_expense ds
<include refid="app.module.front.usecase.daily.record.adapters.persistence.DailyRecordMapper.InnerJoinByDailyRecord"/>
where ds.is_deleted = false
@@ -30,13 +30,13 @@
<insert id="createDailyExpense" useGeneratedKeys="true" keyProperty="id">
insert into daily_expense (
daily_record_seq, input_type, is_credit, income_mark_code, category_self, source_purpose
, quantity, unit_code, price, estimated_value
, quantity, unit_code, unit_self, price, estimated_value
, is_deleted
, <include refid="common.fields.CreateUpdateBaseColumns"/>
) values (
#{dailyRecordSeq}
, #{inputType}, #{credit}, #{incomeMarkCode}, #{categorySelf}, #{sourcePurpose}
, #{quantity}, #{unitCode}, #{price}, #{estimatedValue}
, #{quantity}, #{unitCode}, #{unitSelf}, #{price}, #{estimatedValue}
, false
, <include refid="common.fields.CreateUpdateBaseValues"/>
)
@@ -50,6 +50,7 @@
, source_purpose = #{sourcePurpose}
, quantity = #{quantity}
, unit_code = #{unitCode}
, unit_self = #{unitSelf}
, price = #{price}
, estimated_value = #{estimatedValue}
where is_deleted = false

View File

@@ -6,7 +6,7 @@
resultType="app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto">
select ds.id, ds.daily_record_seq, ds.input_type, ds.is_credit as credit
, ds.crop_code, ds.category_self, ds.source_purpose
, ds.quantity, ds.unit_code, ds.price, ds.estimated_value
, ds.quantity, ds.unit_code, ds.unit_self, ds.price, ds.estimated_value
from daily_income ds
<include refid="app.module.front.usecase.daily.record.adapters.persistence.DailyRecordMapper.InnerJoinByDailyRecord"/>
where ds.is_deleted = false
@@ -30,13 +30,13 @@
<insert id="createDailyIncome" useGeneratedKeys="true" keyProperty="id">
insert into daily_income (
daily_record_seq, input_type, is_credit, expense_mark_code, crop_code, category_self, source_purpose
, quantity, unit_code, price, estimated_value
, quantity, unit_code, unit_self, price, estimated_value
, is_deleted
, <include refid="common.fields.CreateUpdateBaseColumns"/>
) values (
#{dailyRecordSeq}
, #{inputType}, #{credit}, #{expenseMarkCode}, #{cropCode}, #{categorySelf}, #{sourcePurpose}
, #{quantity}, #{unitCode}, #{price}, #{estimatedValue}
, #{quantity}, #{unitCode}, #{unitSelf}, #{price}, #{estimatedValue}
, false
, <include refid="common.fields.CreateUpdateBaseValues"/>
)
@@ -51,6 +51,7 @@
, source_purpose = #{sourcePurpose}
, quantity = #{quantity}
, unit_code = #{unitCode}
, unit_self = #{unitSelf}
, price = #{price}
, estimated_value = #{estimatedValue}
where is_deleted = false

View File

@@ -8321,6 +8321,9 @@ button.swiper-pagination-bullet {
}
.form-group .input-flex-group .d-flex .component-input {
margin-top: 0;
-webkit-box-flex: 1;
-webkit-flex: 1;
flex: 1;
}
.form-desc {

View File

@@ -92,7 +92,7 @@
</p>
</div>
<div id="unitCode" class="component-select bottom-sheet" data-props-default="단위를 선택해 주세요" data-props-type="bottomSheet">
<input type="hidden1" name="unitCode" th:value="${detail.unitCode}">
<input type="hidden" name="unitCode" th:value="${detail.unitCode}">
<button type="button" class="select-box">
<span class="select-txt"></span>
</button>
@@ -114,6 +114,11 @@
</div>
</div>
</div>
<div class="component-input" data-option="직접 입력">
<div class="input-field">
<input type="text" name="unitSelf" th:value="${detail.unitSelf}" maxlength="30" placeholder="단위를 입력해 주세요">
</div>
</div>
</div>
</section>

View File

@@ -164,6 +164,11 @@
selectItemCallback({selectValue, dataValue}){
console.log('selectItemCallback', selectValue, dataValue)
$('input[name="unitCode"]').val(dataValue)
// TODO : ui js 에서 show 적용유무 파악하기
if (dataValue === 'code.record.unit.self') {
$('#unitCode').parent().find('.component-input').addClass('show');
}
}
});

View File

@@ -144,6 +144,11 @@
</div>
</div>
</div>
<div class="component-input" data-option="직접 입력">
<div class="input-field">
<input type="text" name="unitSelf" th:value="${detail.unitSelf}" maxlength="30" placeholder="단위를 입력해 주세요">
</div>
</div>
</div>
</section>

View File

@@ -177,6 +177,11 @@
selectItemCallback({selectValue, dataValue}){
console.log('selectItemCallback', selectValue, dataValue)
$('input[name="unitCode"]').val(dataValue)
// TODO : ui js 에서 show 적용유무 파악하기
if (dataValue === 'code.record.unit.self') {
$('#unitCode').parent().find('.component-input').addClass('show');
}
}
});
@@ -201,7 +206,11 @@
// 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() === '') {