[BO] 임가 현황 - 임산물 현황 작업 중 (8)

This commit is contained in:
kangsunlee
2025-06-16 22:10:46 +09:00
parent 5203d7000e
commit 75ac1193c5
12 changed files with 308 additions and 2 deletions

View File

@@ -423,8 +423,55 @@
</div>
</div>
<div class="tab-content" data-tab-value="tab2">
<div class="tab-content forest-product" data-tab-value="tab2">
<div class="content-inner">
<section class="table-group">
<div class="table-tit-group">
<h3></h3>
<div class="component-btns bottom-btn-group">
<div class="btns-row align-right">
<button type="button" class="btn small">
<span class="btn-txt">등록여부</span>
</button>
<button type="button" class="btn small btn-secondary">
<span class=" btn-txt">삭제</span>
</button>
<button type="button" class="btn small btn-primary">
<span class="btn-txt">추가</span>
</button>
</div>
</div>
</div>
<table id="forest-product">
<thead>
<tr>
<th colspan="7"></th>
<th colspan="4">주생산물</th>
<th colspan="4">부생산물</th>
</tr>
<tr>
<th>선택</th>
<th>지번</th>
<th>지목</th>
<th>읍면동</th>
<th>가능면적(평)</th>
<th>재배작물명</th>
<th>면적(평)</th>
<th>수확량</th>
<th>단위</th>
<th>판매량</th>
<th>단위</th>
<th>수확량</th>
<th>단위</th>
<th>판매량</th>
<th>단위</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</section>
</div>
</div>
@@ -512,7 +559,7 @@
break;
case 'forest-product': // 임산물 현황
console.log("임산물 현황");
// getForestProductStatus();
getForestProductsStatus();
break;
case 'bank-auto-transfer': // 은행자동이체내역
console.log("은행자동이체내역");
@@ -866,7 +913,66 @@
tbody.append(tmpl);
}
</script>
<script>
const getForestProductsStatus = () => {
const f = document.reqForm;
ajaxUtil._ajaxMethod(
'/api/household/forestProducts',
{
householdSeq: f.householdSeq.value,
month: f.recordMonth.value
},
function(response) { // 성공
console.log("임산물 현황 리스트 조회 : ", response);
const tbody = $('.tab-content.forest-product').find('tbody');
tbody.empty();
let tmpl = '';
$(response).each((idx, item) => {
tmpl +=
`
<tr>
<td>
<div class="component-input">
<label class="checkbox-inner">
<input type="checkbox" id="temp_checkbox_000${item.id}" name="temp_checkbox_000${item.id}" value="${item.id}">
</label>
</div>
</td>
<td>${ifNullDash(item.streetNum)}</td> <!-- 지번 -->
<td>${ifNullDash(item.landType)}</td><!-- 지목 -->
<td>${ifNullDash(item.town)}</td><!-- 읍면동 -->
<td>${ifNullDash(item.availableArea)}</td><!-- 가능면적(평) -->
<td>${ifNullDash(item.cropName)}</td><!-- 재배작물명 -->
<td>${ifNullDash(item.landArea)}</td><!-- 면적(평) -->
<td class="align-right">${ifNullDash(item.mainYield)}</td><!-- 주생산물 수확량 -->
<td>${ifNullDash(item.mainYieldText)}</td><!-- 주생산물 수확량 단위 -->
<td class="align-right">${ifNullDash(item.mainSaleAmount)}</td><!-- 주생산물 판매량 -->
<td>${ifNullDash(item.mainSaleAmountText)}</td><!-- 주생산물 판매량 단위 -->
<td class="align-right">${ifNullDash(item.subYield)}</td><!-- 부생산물 수확량 -->
<td>${ifNullDash(item.subYieldText)}</td><!-- 부생산물 수확량 단위 -->
<td class="align-right">${ifNullDash(item.subSaleAmount)}</td><!-- 부생산물 판매량 -->
<td>${ifNullDash(item.subSaleAmountText)}</td><!-- 부생산물 판매량 단위 -->
</tr>
`;
});
tbody.append(tmpl);
},
function (code, rstData) { // 실패
console.log("error : ", code);
},
'get',
'json'
);
}
</script>
<script>
// nodata 처리
const noData = (target, status, length) => {
const noDataText = status === 'TARGET' ? '등록이 필요합니다.' : '등록없음';