[FO] 일계부 수입 Form 에 영수증 등록 html 추가

This commit is contained in:
김현주
2025-07-01 09:19:12 +09:00
parent e7523e9e08
commit efe9787f64
3 changed files with 235 additions and 167 deletions

View File

@@ -7,9 +7,10 @@
<div class="component-btns type-tab"
th:if="not ${detail.updated}">
<div class="btns-row">
<button type="button" class="btn active">수기 등록</button>
<!--/* TODO : 2차 오픈 */-->
<!--<button type="button" class="btn">영수증 등록</button>-->
<button type="button" class="btn active" onclick="modalControl.changeModal('self')">수기 등록</button>
<th:block th:if="${@systemProperties['spring.profiles.active'] eq 'local'}">
<button type="button" class="btn" onclick="modalControl.changeModal('ocr')">영수증 등록</button>
</th:block>
</div>
</div>
@@ -17,187 +18,241 @@
<form name="reqModalForm">
<input type="hidden" name="inputType" th:value="${#strings.defaultString(detail.inputType, 'SELF')}">
<input type="hidden" name="id" th:value="${detail.id}">
<section class="form-group">
<div class="segment-label">
<p class="label-txt">
외상판매 여부
</p>
</div>
<div class="component-segment">
<div class="component-radio">
<label class="radio-inner">
<input type="radio" name="credit" value="true" th:checked="${detail.credit}">
<span class="radio-item">
<span class="radio-txt">예</span>
</span>
</label>
</div>
<div class="component-radio">
<label class="radio-inner">
<input type="radio" name="credit" value="false" th:checked="not ${detail.credit}">
<span class="radio-item">
<span class="radio-txt">아니오</span>
</span>
</label>
</div>
</div>
<div class="select-group">
<div class="select-label">
<!--/* 수기 등록 s */-->
<div id="modelSelf">
<section class="form-group">
<div class="segment-label">
<p class="label-txt">
재배형태
외상판매 여부
</p>
<span class="select-sub-txt">임산물 수입이 있는 경우, 등록해 주세요.</span>
</div>
<div id="cropCode" class="component-select bottom-sheet" data-props-default="재배형태를 선택해 주세요" data-props-type="bottomSheet">
<input type="hidden" name="cropCode" th:value="${detail.cropCode}" data-type="select">
<button type="button" class="select-box">
<span class="select-txt"></span>
</button>
<div class="select-options">
<div class="select-header">
<p>재배형태</p>
<button type="button" class="select-close">
<span class="hide-txt">닫기</span>
</button>
</div>
<div class="select-scroll">
<ul class="">
<li class="option"
th:each="uiCode : ${recordCrop}"
th:data-value="${uiCode.id}"
th:text="${uiCode.codeText}"></li>
</ul>
<div class="component-segment">
<div class="component-radio">
<label class="radio-inner">
<input type="radio" name="credit" value="true" th:checked="${detail.credit}">
<span class="radio-item">
<span class="radio-txt">예</span>
</span>
</label>
</div>
<div class="component-radio">
<label class="radio-inner">
<input type="radio" name="credit" value="false" th:checked="not ${detail.credit}">
<span class="radio-item">
<span class="radio-txt">아니오</span>
</span>
</label>
</div>
</div>
<div class="select-group">
<div class="select-label">
<p class="label-txt">
재배형태
</p>
<span class="select-sub-txt">임산물 수입이 있는 경우, 등록해 주세요.</span>
</div>
<div id="cropCode" class="component-select bottom-sheet" data-props-default="재배형태를 선택해 주세요" data-props-type="bottomSheet">
<input type="hidden" name="cropCode" th:value="${detail.cropCode}" data-type="select">
<button type="button" class="select-box">
<span class="select-txt"></span>
</button>
<div class="select-options">
<div class="select-header">
<p>재배형태</p>
<button type="button" class="select-close">
<span class="hide-txt">닫기</span>
</button>
</div>
<div class="select-scroll">
<ul class="">
<li class="option"
th:each="uiCode : ${recordCrop}"
th:data-value="${uiCode.id}"
th:text="${uiCode.codeText}"></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
</section>
<hr>
<hr>
<section class="form-group">
<div class="component-input">
<div class="input-label">
<label for="incomeKind" class="label-txt">
수입의 종류<i class="ico-required-mark" role="img" aria-label="필수">*</i>
</label>
</div>
<div class="input-field">
<input type="text" id="incomeKind" name="incomeKind" th:value="${detail.incomeKind}" maxlength="30" placeholder="수입의 종류를 입력해 주세요">
</div>
</div>
<div class="component-input">
<div class="input-label">
<label for="sourcePurpose" class="label-txt">
수입원
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
</label>
</div>
<div class="input-field">
<input type="text" id="sourcePurpose" name="sourcePurpose" th:value="${detail.sourcePurpose}" maxlength="30" placeholder="수입원을 입력해 주세요">
</div>
</div>
</section>
<hr>
<section class="form-group">
<div class="component-input">
<div class="input-label">
<label for="quantity" class="label-txt">
수량
</label>
</div>
<div class="input-field">
<input type="number" inputmode="decimal" pattern="[0-9]*" id="quantity" name="quantity" min="1" max="9999999999"
th:value="${detail.quantity}" maxlength="10" placeholder="수량을 입력해 주세요">
</div>
<ul class="guide-info">
<li>예 : 2, 2.5</li>
</ul>
</div>
<div class="select-group">
<div class="select-label">
<p class="label-txt">
단위
</p>
</div>
<div id="unitCode" class="component-select bottom-sheet" data-props-default="단위를 선택해 주세요" data-props-type="bottomSheet">
<input type="hidden" name="unitCode" data-type="select" th:value="${detail.unitCode}">
<button type="button" class="select-box">
<span class="select-txt"></span>
</button>
<div class="select-options">
<div class="select-header">
<p>단위</p>
<button type="button" class="select-close">
<span class="hide-txt">닫기</span>
</button>
</div>
<div class="select-scroll">
<ul class="">
<li class="option" th:each="uiCode : ${recordUnit}"
th:data-value="${uiCode.id}"
th:text="${uiCode.codeText}"
th:selected="${uiCode.id eq detail.unitCode ? 'current' : ''}"
></li>
</ul>
</div>
<section class="form-group">
<div class="component-input">
<div class="input-label">
<label for="incomeKind" class="label-txt">
수입의 종류<i class="ico-required-mark" role="img" aria-label="필수">*</i>
</label>
</div>
</div>
<div class="component-input" data-option="직접 입력">
<div class="input-field">
<input type="text" name="unitSelf" th:value="${detail.unitSelf}" maxlength="30" placeholder="단위를 입력해 주세요">
<input type="text" id="incomeKind" name="incomeKind" th:value="${detail.incomeKind}" maxlength="30" placeholder="수입의 종류를 입력해 주세요">
</div>
</div>
</div>
</section>
<hr>
<section class="form-group">
<div class="component-input">
<div class="input-label">
<label for="price" class="label-txt">
현금
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
</label>
<div class="component-input">
<div class="input-label">
<label for="sourcePurpose" class="label-txt">
수입원
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
</label>
</div>
<div class="input-field">
<input type="text" id="sourcePurpose" name="sourcePurpose" th:value="${detail.sourcePurpose}" maxlength="30" placeholder="수입원을 입력해 주세요">
</div>
</div>
<div class="input-field type-price">
<input type="number" inputmode="numeric" pattern="[0-9]*" id="price" name="price" step="0" min="1" max="9999999999"
th:value="${detail.price}" maxlength="10" placeholder="금액을 입력해 주세요">
<span class="input-field-txt">원</span>
</div>
<ul class="guide-info">
<li>예 : 30000</li>
</ul>
</div>
</section>
<div class="component-input">
<div class="input-label">
<label for="estimatedValue" class="label-txt">
현물평가액
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
</label>
</div>
<div class="input-field type-price">
<input type="number" inputmode="numeric" pattern="[0-9]*" id="estimatedValue" name="estimatedValue" step="0" min="1" max="9999999999"
th:value="${detail.estimatedValue}" maxlength="10" placeholder="금액을 입력해 주세요">
<span class="input-field-txt">원</span>
</div>
<ul class="guide-info">
<li>예 : 30000</li>
</ul>
</div>
</section>
<hr>
<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>
<section class="form-group">
<div class="component-input">
<div class="input-label">
<label for="quantity" class="label-txt">
수량
</label>
</div>
<div class="input-field">
<input type="number" inputmode="decimal" pattern="[0-9]*" id="quantity" name="quantity" min="1" max="9999999999"
th:value="${detail.quantity}" maxlength="10" placeholder="수량을 입력해 주세요">
</div>
<ul class="guide-info">
<li>예 : 2, 2.5</li>
</ul>
</div>
<div class="select-group">
<div class="select-label">
<p class="label-txt">
단위
</p>
</div>
<div id="unitCode" class="component-select bottom-sheet" data-props-default="단위를 선택해 주세요" data-props-type="bottomSheet">
<input type="hidden" name="unitCode" data-type="select" th:value="${detail.unitCode}">
<button type="button" class="select-box">
<span class="select-txt"></span>
</button>
<div class="select-options">
<div class="select-header">
<p>단위</p>
<button type="button" class="select-close">
<span class="hide-txt">닫기</span>
</button>
</div>
<div class="select-scroll">
<ul class="">
<li class="option" th:each="uiCode : ${recordUnit}"
th:data-value="${uiCode.id}"
th:text="${uiCode.codeText}"
th:selected="${uiCode.id eq detail.unitCode ? 'current' : ''}"
></li>
</ul>
</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>
<hr>
<section class="form-group">
<div class="component-input">
<div class="input-label">
<label for="price" class="label-txt">
현금
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
</label>
</div>
<div class="input-field type-price">
<input type="number" inputmode="numeric" pattern="[0-9]*" id="price" name="price" step="0" min="1" max="9999999999"
th:value="${detail.price}" maxlength="10" placeholder="금액을 입력해 주세요">
<span class="input-field-txt">원</span>
</div>
<ul class="guide-info">
<li>예 : 30000</li>
</ul>
</div>
<div class="component-input">
<div class="input-label">
<label for="estimatedValue" class="label-txt">
현물평가액
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
</label>
</div>
<div class="input-field type-price">
<input type="number" inputmode="numeric" pattern="[0-9]*" id="estimatedValue" name="estimatedValue" step="0" min="1" max="9999999999"
th:value="${detail.estimatedValue}" maxlength="10" placeholder="금액을 입력해 주세요">
<span class="input-field-txt">원</span>
</div>
<ul class="guide-info">
<li>예 : 30000</li>
</ul>
</div>
</section>
<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>
<!--/* 수기 등록 e */-->
<!--/* 영수증 등록 s */-->
<div id="modelOcr" style="display: none;">
<section class="form-group">
<div class="segment-label">
<p class="label-txt">
영수증 첨부
<i class="ico-required-mark" role="img" aria-label="필수">*</i>
</p>
</div>
<div class="component-segment">
<div class="component-file">
<div class="file-list">
<div class="file-item">
<img class="profile-image-add" src="../../assets/images/acco/file_sample.png" alt="이미지샘플" />
<button type="button" class="btn-delete"><span class="hide-txt">삭제</span></button>
</div>
<div class="file-item">
<img class="profile-image-add" src="../../assets/images/acco/file_sample.png" alt="이미지샘플" />
<button type="button" class="btn-delete"><span class="hide-txt">삭제</span></button>
</div>
<div class="file-item">
<img class="profile-image-add" src="../../assets/images/acco/file_sample.png" alt="이미지샘플" />
<button type="button" class="btn-delete"><span class="hide-txt">삭제</span></button>
</div>
</div>
<button type="button" class="btn btn-m btn-link btn-full">
<i class="ico-add ico-small" aria-hidden="true"></i>
<span class="btn-txt">사진 첨부</span>
</button>
<ul class="guide-info">
<li>영수증은 일일 최대 3개 등록하실 수 있습니다.</li>
<li>
최대 갯수 등록 후에는 수기 입력만 가능합니다. <br>
(사진 1개당 5MB 이하)
</li>
</ul>
</div>
</div>
</section>
<div class="component-btns">
<div class="btns-row">
<!-- 버튼비활성 스타일 속성에 disabled 추가 -->
<button type="button" class="btn btn-full btn-l btn-primary">
<span class="btn-txt">등록</span>
</button>
</div>
</div>
</div>
<!--/* 영수증 등록 e */-->
</form>
</div>
</th:block>

View File

@@ -239,6 +239,15 @@
$input.val('').attr('disabled', true);
$input.parent().parent().closest('.component-input').addClass('input-disabled');
},
changeModal(type) {
if (type === 'self') {
$('#modelSelf').show();
$('#modelOcr').hide();
} else {
$('#modelSelf').hide();
$('#modelOcr').show();
}
},
createVaild() {
modalControl.create();
},