879 lines
44 KiB
HTML
879 lines
44 KiB
HTML
<!DOCTYPE html>
|
|
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.thymeleaf.org"
|
|
layout:decorate="~{layout/layout}">
|
|
|
|
<section layout:fragment="content">
|
|
<form autocomplete="off" method="get" name="reqForm">
|
|
<input type="hidden" name="householdSeq" th:value="${seq}">
|
|
|
|
<div class="content-inner">
|
|
<section>
|
|
<table class="type-form confirm">
|
|
<tbody>
|
|
<tr>
|
|
<th>임가번호</th>
|
|
<td>
|
|
<span th:text="${householdInfo.householdNum}">16750</span>
|
|
</td>
|
|
<th>경영주</th>
|
|
<td>
|
|
<span th:text="${householdInfo.householdName}">홍길동</span>
|
|
</td>
|
|
<th>연령</th>
|
|
<td>
|
|
<span th:text="${householdInfo.householdAge}">75</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>가구 연락처</th>
|
|
<td>
|
|
<span th:text="${householdInfo.householdTel != null ? householdInfo.householdTel : '-'}">031-0000-0000</span>
|
|
</td>
|
|
<th>휴대폰 번호</th>
|
|
<td>
|
|
<span th:text="${householdInfo.householdPhone}">010-0000-0000</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>실사</th>
|
|
<td>
|
|
<span th:text="${householdInfo.regionMainName}">서울</span>
|
|
</td>
|
|
<th>지역</th>
|
|
<td>
|
|
<span th:text="${householdInfo.regionSubName}">31.경기도</span>
|
|
</td>
|
|
<th>세부 지역</th>
|
|
<td>
|
|
<span th:text="${householdInfo.regionDetailName}">9.경기</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>전체 주소</th>
|
|
<td>
|
|
<span th:text="${householdInfo.address}">경기도 성남시 분당구 산성대로 OOOO</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>업종 대분류</th>
|
|
<td>
|
|
<span th:text="${householdInfo.industryLargeName != null ? householdInfo.industryLargeName : '-'}">40. 수실류재배업</span>
|
|
</td>
|
|
<th>업종 중분류1</th>
|
|
<td>
|
|
<span th:text="${householdInfo.industryMiddleName != null ? householdInfo.industryMiddleName : '-'}">42. 대추재배업</span>
|
|
</td>
|
|
<th>업종 중분류2</th>
|
|
<td>
|
|
<span th:text="${householdInfo.industrySubMiddleName != null ? householdInfo.industrySubMiddleName : '-'}">52_1. 조경수</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>규모/세부품목</th>
|
|
<td>
|
|
<span th:text="${householdInfo.industryDetailName != null ? householdInfo.industryDetailName : '-'}">52_1_1. 조경수</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>담당 조사원</th>
|
|
<td>
|
|
<span th:text="${householdInfo.researcherName != null ? householdInfo.researcherName : '-'}">김조사</span>
|
|
</td>
|
|
<th>담당조사원 연락처</th>
|
|
<td>
|
|
<span th:text="${householdInfo.researcherPhone != null ? householdInfo.researcherPhone : '-'}">010-0000-0000</span>
|
|
</td>
|
|
<th>유지여부</th>
|
|
<td class="radio-group">
|
|
<span th:text="${householdInfo.isPanel ? '1. 유지' : '2. 탈락'}">1.유지</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>비고</th>
|
|
<td class="radio-group">
|
|
<span th:text="${householdInfo.memo != null && householdInfo.memo != '' ? householdInfo.memo : '-'}">-</span>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<div class="component-btns bottom-btn-group">
|
|
<div class="btns-row align-right">
|
|
<button type="button" class="btn">
|
|
<span class="btn-txt">조사원 매핑</span>
|
|
</button>
|
|
<button type="button" class="btn btn-primary">
|
|
<span class="btn-txt">수정</span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<section>
|
|
<div class="component-tab" data-active="tab1">
|
|
<div class="tab-head">
|
|
<button type="button" class="tab-label select-tab" data-tab-type="daily-record" data-tab-value="tab1">일계부 등록 현황</button>
|
|
<button type="button" class="tab-label select-tab" data-tab-type="forest-product" data-tab-value="tab2">임산물 현황</button>
|
|
<button type="button" class="tab-label select-tab" data-tab-type="bank-auto-transfer" data-tab-value="tab3">은행자동이체 내역</button>
|
|
<button type="button" class="tab-label select-tab" data-tab-type="household-visit" data-tab-value="tab4">임가방문정보</button>
|
|
|
|
<div class="component-select select-date">
|
|
<select class="select-list" name="recordMonth" required onchange="onRecordMonthChange();">
|
|
<option th:each="m : ${monthList}"
|
|
th:value="${m.value}"
|
|
th:text="${m.label}">2025년 5월</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="tab-body">
|
|
<div class="tab-content daily-record" data-tab-value="tab1">
|
|
<!-- 일계부 등록 현황 리스트 -->
|
|
<div class="daily-record-content daily-record-list">
|
|
<div class="content-inner">
|
|
<article class="summary-area">
|
|
<ul>
|
|
<li>
|
|
<p>작성완료</p>
|
|
<span><strong id="doneCount">6</strong>건</span>
|
|
</li>
|
|
<li>
|
|
<p>미작성</p>
|
|
<span><strong id="emptyCount">6</strong>건</span>
|
|
</li>
|
|
<li>
|
|
<p>미완료</p>
|
|
<span><strong id="incompleteCount">6</strong>건</span>
|
|
</li>
|
|
<li>
|
|
<p>대기</p>
|
|
<span><strong id="waitingCount">6</strong>건</span>
|
|
</li>
|
|
<li>
|
|
<p>완료율</p>
|
|
<span><strong id="progressPercent">56.12</strong>%</span>
|
|
</li>
|
|
</ul>
|
|
</article>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>입력날짜</th>
|
|
<th>완료상태</th>
|
|
<th>수입</th>
|
|
<th>노동투입</th>
|
|
<th>지출</th>
|
|
<th>동력사용시간</th>
|
|
<th>임업 자가소비량</th>
|
|
<th>농업 자가소비량</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 일계부 등록 현황 상세 -->
|
|
<div class="daily-record-content daily-record-detail" style="display: none;">
|
|
|
|
<div class="content-inner">
|
|
<!-- 수입 -->
|
|
<section class="table-group">
|
|
<div class="table-tit-group">
|
|
<h3>수입 <strong>(<span id="incomeCount">0</span>건)</strong></h3>
|
|
<div class="component-btns bottom-btn-group">
|
|
<div class="btns-row align-right">
|
|
<button type="button" class="btn small">
|
|
<span class="btn-txt">영수증 다운로드 <i class="ico-download" aria-hidden="true"></i></span>
|
|
</button>
|
|
<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="table-income">
|
|
<thead>
|
|
<tr>
|
|
<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>
|
|
|
|
<!-- 임업노동 투입 내역 -->
|
|
<section class="table-group">
|
|
<div class="table-tit-group">
|
|
<h3>임업노동 투입 내역 <strong>(<span id="workCount">0</span>건)</strong></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="table-work">
|
|
<thead>
|
|
<tr>
|
|
<th colspan="7"></th>
|
|
<th colspan="10">노동투입시간</th>
|
|
<th colspan="1"></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>
|
|
<th>일손돕기(남)</th>
|
|
<th>일손돕기(여)</th>
|
|
<th>최종 수정자</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
|
|
<!-- 지출 -->
|
|
<section class="table-group">
|
|
<div class="table-tit-group">
|
|
<h3>지출 <strong>(<span id="expenseCount">0</span>건)</strong></h3>
|
|
<div class="component-btns bottom-btn-group">
|
|
<div class="btns-row align-right">
|
|
<button type="button" class="btn small">
|
|
<span class="btn-txt">영수증 다운로드 <i class="ico-download" aria-hidden="true"></i></span>
|
|
</button>
|
|
<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="table-expense">
|
|
<thead>
|
|
<tr>
|
|
<th>선택</th>
|
|
<th>외상 또는 카드구입</th>
|
|
<th>지출의 종류</th>
|
|
<th>용도</th>
|
|
<th>수량</th>
|
|
<th>단위</th>
|
|
<th>현금(원)</th>
|
|
<th>현물평가액</th>
|
|
<th>최종 수정자</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
|
|
<!-- 동력사용시간 -->
|
|
<section class="table-group">
|
|
<div class="table-tit-group">
|
|
<h3>동력사용시간 <strong>(<span id="powerCount">0</span>건)</strong></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="table-power">
|
|
<thead>
|
|
<tr>
|
|
<th>선택</th>
|
|
<th>명칭</th>
|
|
<th>자가 사용시간</th>
|
|
<th>임가 사용시간</th>
|
|
<th>최종 수정자</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
|
|
<!-- 자가임업 -->
|
|
<section class="table-group">
|
|
<div class="table-tit-group">
|
|
<h3>자가임업 생산물 중 자가소비량 <strong>(<span id="forestryCount">0</span>건)</strong></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="table-forestry">
|
|
<thead>
|
|
<tr>
|
|
<th>선택</th>
|
|
<th>생산물</th>
|
|
<th>용도</th>
|
|
<th>수량</th>
|
|
<th>단위</th>
|
|
<th>현물평가액</th>
|
|
<th>최종 수정자</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
|
|
<!-- 자가농업 -->
|
|
<section class="table-group">
|
|
<div class="table-tit-group">
|
|
<h3>자가농업 생산물 중 자가소비량 <strong>(<span id="farmingCount">0</span>건)</strong></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="table-farming">
|
|
<thead>
|
|
<tr>
|
|
<th>선택</th>
|
|
<th>생산물</th>
|
|
<th>용도</th>
|
|
<th>수량</th>
|
|
<th>단위</th>
|
|
<th>현물평가액</th>
|
|
<th>최종 수정자</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="tab-content" data-tab-value="tab2">
|
|
<div class="content-inner">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="tab-content" data-tab-value="tab3">
|
|
<div class="content-inner">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="tab-content" data-tab-value="tab4">
|
|
<div class="content-inner">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="component-btns bottom-btn-group">
|
|
<div class="btns-row two-col">
|
|
<div class="btns-col-1">
|
|
<button type="button" class="btn" onclick="location.href='/household/households'">
|
|
<span class="btn-txt">목록</span>
|
|
</button>
|
|
</div>
|
|
<div class="btns-col-2 align-right">
|
|
<button type="button" class="btn">
|
|
<span class="btn-txt">엑셀 다운로드 <i class="ico-download" aria-hidden="true"></i></span>
|
|
</button>
|
|
<button type="button" class="btn">
|
|
<span class="btn-txt">인쇄 <i class="ico-print" aria-hidden="true"></i></span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</form>
|
|
</section>
|
|
|
|
<section layout:fragment="script">
|
|
<script>
|
|
// 일계부 완료상태
|
|
const statusInfoMap = {
|
|
DONE: {
|
|
label: '작성완료',
|
|
className: 'green'
|
|
},
|
|
INCOMPLETE: {
|
|
label: '미완료',
|
|
className: 'light-green'
|
|
},
|
|
EMPTY: {
|
|
label: '미작성',
|
|
className: 'border'
|
|
},
|
|
WAITING: {
|
|
label: '대기',
|
|
className: 'gray'
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<script>
|
|
$(document).ready(() => {
|
|
getDailyRecords();
|
|
});
|
|
|
|
$('.select-tab').on('click', function () {
|
|
getTabData(this.dataset.tabType);
|
|
});
|
|
</script>
|
|
|
|
<script>
|
|
// 날짜선택
|
|
const onRecordMonthChange = () => {
|
|
const selectedTab = document.querySelector('.tab-label[aria-selected="true"]');
|
|
if (!selectedTab) return;
|
|
|
|
getTabData(selectedTab.dataset.tabType);
|
|
}
|
|
|
|
const getTabData = (tabType) => {
|
|
switch (tabType) {
|
|
case 'daily-record': // 일계부 등록 현황
|
|
console.log("일계부 등록 현황");
|
|
getDailyRecords();
|
|
break;
|
|
case 'forest-product': // 임산물 현황
|
|
console.log("임산물 현황");
|
|
// getForestProductStatus();
|
|
break;
|
|
case 'bank-auto-transfer': // 은행자동이체내역
|
|
console.log("은행자동이체내역");
|
|
// getAutoTransferStatus();
|
|
break;
|
|
case 'household-visit': // 임가방문정보
|
|
console.log("임가방문정보");
|
|
// getVisitStatus();
|
|
break;
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<script th:inline="javascript">
|
|
// 일계부 등록 현황 리스트 조회
|
|
const getDailyRecords = () => {
|
|
const f = document.reqForm;
|
|
|
|
ajaxUtil._ajaxMethod(
|
|
'/api/household/dailyRecordsStatus',
|
|
{
|
|
householdSeq: f.householdSeq.value,
|
|
recordMonth: f.recordMonth.value
|
|
},
|
|
function(response) { // 성공
|
|
console.log("일계부 현황 리스트 조회 : ", response);
|
|
const listArea = $('.tab-content .daily-record-list');
|
|
const detailArea = $('.tab-content .daily-record-detail');
|
|
const tbody = listArea.find('tbody');
|
|
|
|
detailArea.hide();
|
|
listArea.show();
|
|
tbody.empty();
|
|
|
|
$('#doneCount').text(response.summary.doneCount);
|
|
$('#emptyCount').text(response.summary.emptyCount);
|
|
$('#incompleteCount').text(response.summary.incompleteCount);
|
|
$('#waitingCount').text(response.summary.waitingCount);
|
|
$('#progressPercent').text(response.summary.progressPercent);
|
|
|
|
let tmpl = '';
|
|
$(response.dailyRecords).each((idx, item) => {
|
|
tmpl +=
|
|
`
|
|
<tr>
|
|
<td class="underline"><a href="javascript:void(0);" onclick="getDailyRecordsView(${item.id});">${item.dayGroup}</a></td>
|
|
<td>
|
|
<span class="tag ${statusInfoMap[item.allStatusType].className}">
|
|
${statusInfoMap[item.allStatusType].label}
|
|
</span>
|
|
</td> <!-- 완료상태 -->
|
|
<td>${item.incomeStatus}</td><!-- 수입 -->
|
|
<td>${item.workStatus}</td><!-- 노동투입 -->
|
|
<td>${item.expenseStatus}</td><!-- 지출 -->
|
|
<td>${item.powerStatus}</td><!-- 동력사용시간 -->
|
|
<td>${item.forestryStatus}</td><!-- 임업 자가소비량 -->
|
|
<td>${item.farmingStatus}</td><!-- 농업 자가소비량 -->
|
|
</tr>
|
|
`;
|
|
});
|
|
|
|
tbody.append(tmpl);
|
|
},
|
|
function (code, rstData) { // 실패
|
|
console.log("error : ", code);
|
|
},
|
|
'get',
|
|
'json'
|
|
);
|
|
}
|
|
|
|
// 임산물 등록 현황 상세
|
|
const getDailyRecordsView = (id) => {
|
|
if(id == null) {
|
|
alert('등록 내역이 없습니다.');
|
|
return;
|
|
}
|
|
|
|
const f = document.reqForm;
|
|
const listArea = $('.tab-content .daily-record-list');
|
|
const detailArea = $('.tab-content .daily-record-detail');
|
|
|
|
listArea.hide();
|
|
detailArea.show();
|
|
|
|
ajaxUtil._ajaxMethod(
|
|
'/api/household/dailyRecordStatus',
|
|
{ recordSeq: id },
|
|
function(response) { // 성공
|
|
console.log("일계부 등록 상세 데이터~ : ", response);
|
|
gridIncomeTable(response.status.incomeStatus, response.incomes);
|
|
gridWorkTable(response.status.workStatus, response.works);
|
|
gridExpenseTable(response.status.expenseStatus, response.expenses);
|
|
gridPowerTable(response.status.powerStatus, response.powers);
|
|
gridForestryTable(response.status.forestryStatus, response.forestries);
|
|
gridFarmingTable(response.status.farmingStatus, response.farmings);
|
|
},
|
|
function (code, rstData) { // 실패
|
|
console.log("error : ", code);
|
|
},
|
|
'get',
|
|
'json'
|
|
);
|
|
}
|
|
|
|
// 수입 테이블 그리기
|
|
const gridIncomeTable = (status, data) => {
|
|
const tbody = $('#table-income tbody');
|
|
tbody.empty();
|
|
|
|
$('#incomeCount').text(data.length);
|
|
if(data.length === 0) {
|
|
noData(tbody, status, 10);
|
|
return;
|
|
}
|
|
|
|
let tmpl = '';
|
|
$(data).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>${item.isCredit ? "Y" : "N"}</td> <!-- 외상판매 -->
|
|
<td>${ifNullDash(item.cropText)}</td><!-- 재배형태 -->
|
|
<!-- TODO(ks) : 수입의 종류 코드형태로 들어오고 있음, 텍스트형태로 바뀌는 건지 체크!! -->
|
|
<td class="underline">${ifNullDash(item.categorySelf)}</td><!-- 수입의 종류 -->
|
|
<td>${ifNullDash(item.sourcePurpose)}</td><!-- 수입원 -->
|
|
<td class="align-right">${ifNullDash(item.quantity)}</td><!-- 수량 -->
|
|
<td>${ifNullDash(item.unitText)}</td><!-- 단위 -->
|
|
<td class="align-right">${ifNullDash(item.price)}</td><!-- 현금(원) -->
|
|
<td class="align-right">${ifNullDash(item.estimatedValue)}</td><!-- 현물평가액 -->
|
|
<td>
|
|
${item.updatedBy}<br>
|
|
(${item.updatedAt})
|
|
</td><!-- 최종 수정자 -->
|
|
</tr>
|
|
`;
|
|
});
|
|
|
|
tbody.append(tmpl);
|
|
}
|
|
|
|
// 임업노동 테이블 그리기
|
|
const gridWorkTable = (status, data) => {
|
|
const tbody = $('#table-work tbody');
|
|
tbody.empty();
|
|
|
|
$('#workCount').text(data.length);
|
|
if(data.length === 0) {
|
|
noData(tbody, status, 18);
|
|
return;
|
|
}
|
|
|
|
let tmpl = '';
|
|
$(data).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.itemCode)}</td><!-- 품목명 -->
|
|
<td>${ifNullDash(item.workCode)}</td><!-- 작업명 -->
|
|
<td>${ifNullDash(item.workLandArea)}</td><!-- 작업 면적 -->
|
|
<td>${ifNullDash(item.harvestQuantity)}</td><!-- 수확량 -->
|
|
<td>${ifNullDash(item.cropText)}</td><!-- 단위 -->
|
|
<td>${ifNullDash(item.ownerTime)}</td><!-- 경영주 시간 -->
|
|
<td>${ifNullDash(item.spouseTime)}</td><!-- 배우자 시간 -->
|
|
<td>${ifNullDash(item.familyMHours)}</td><!-- 가족노동(남) -->
|
|
<td>${ifNullDash(item.familyFHours)}</td><!-- 가족노동(여) -->
|
|
<td>${ifNullDash(item.hiredMHours)}</td><!-- 고용노동(남) -->
|
|
<td>${ifNullDash(item.hiredFHours)}</td><!-- 고용노동(여) -->
|
|
<td>${ifNullDash(item.sharedMHours)}</td><!-- 품앗이(남) -->
|
|
<td>${ifNullDash(item.sharedFHours)}</td><!-- 품앗이(여) -->
|
|
<td>${ifNullDash(item.volunteerMHours)}</td><!-- 일손돕기(남) -->
|
|
<td>${ifNullDash(item.volunteerFHours)}</td><!-- 일손돕기(여) -->
|
|
<td>
|
|
${item.updatedBy}<br>
|
|
(${item.updatedAt})
|
|
</td><!-- 최종 수정자 -->
|
|
</tr>
|
|
`;
|
|
});
|
|
|
|
tbody.append(tmpl);
|
|
}
|
|
|
|
// 지출 테이블 그리기
|
|
const gridExpenseTable = (status, data) => {
|
|
const tbody = $('#table-expense tbody');
|
|
tbody.empty();
|
|
|
|
$('#expenseCount').text(data.length);
|
|
if(data.length === 0) {
|
|
noData(tbody, status, 9);
|
|
return;
|
|
}
|
|
|
|
let tmpl = '';
|
|
$(data).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>${item.isCredit ? "Y" : "N"}</td> <!-- 외상 또는 카드구입 -->
|
|
<!-- TODO(ks) : 지출의 종류 코드형태로 들어오고 있음, 텍스트형태로 바뀌는 건지 체크!! -->
|
|
<td>${ifNullDash(item.categorySelf)}</td><!-- 지출의 종류 -->
|
|
<td>${ifNullDash(item.sourcePurpose)}</td><!-- 용도 -->
|
|
<td>${ifNullDash(item.quantity)}</td><!-- 수량 -->
|
|
<td>${ifNullDash(item.unitText)}</td><!-- 단위 -->
|
|
<td>${ifNullDash(item.price)}</td><!-- 현금(원) -->
|
|
<td>${ifNullDash(item.estimatedValue)}</td><!-- 현물평가액 -->
|
|
<td>
|
|
${item.updatedBy}<br>
|
|
(${item.updatedAt})
|
|
</td><!-- 최종 수정자 -->
|
|
</tr>
|
|
`;
|
|
});
|
|
|
|
tbody.append(tmpl);
|
|
}
|
|
|
|
// 동력사용시간 테이블 그리기
|
|
const gridPowerTable = (status, data) => {
|
|
const tbody = $('#table-power tbody');
|
|
tbody.empty();
|
|
|
|
$('#powerCount').text(data.length);
|
|
if(data.length === 0) {
|
|
noData(tbody, status, 5);
|
|
return;
|
|
}
|
|
|
|
let tmpl = '';
|
|
$(data).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.equipmentName)}</td> <!-- 명칭 -->
|
|
<td>${ifNullDash(item.ownedHours)}</td><!-- 자가 사용시간 -->
|
|
<td>${ifNullDash(item.leasedHours)}</td><!-- 임가 사용시간 -->
|
|
<td>
|
|
${item.updatedBy}<br>
|
|
(${item.updatedAt})
|
|
</td><!-- 최종 수정자 -->
|
|
</tr>
|
|
`;
|
|
});
|
|
|
|
tbody.append(tmpl);
|
|
}
|
|
|
|
// 자가임업 테이블 그리기
|
|
const gridForestryTable = (status, data) => {
|
|
const tbody = $('#table-forestry tbody');
|
|
tbody.empty();
|
|
|
|
$('#forestryCount').text(data.length);
|
|
if(data.length === 0) {
|
|
noData(tbody, status, 7);
|
|
return;
|
|
}
|
|
|
|
let tmpl = '';
|
|
$(data).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.productName)}</td> <!-- 생산물 -->
|
|
<td>${ifNullDash(item.usage)}</td><!-- 용도 -->
|
|
<td>${ifNullDash(item.quantity)}</td><!-- 수량 -->
|
|
<td>${ifNullDash(item.unitText)}</td><!-- 단위 -->
|
|
<td>${ifNullDash(item.estimatedValue)}</td><!-- 현물평가액 -->
|
|
<td>
|
|
${item.updatedBy}<br>
|
|
(${item.updatedAt})
|
|
</td><!-- 최종 수정자 -->
|
|
</tr>
|
|
`;
|
|
});
|
|
|
|
tbody.append(tmpl);
|
|
}
|
|
|
|
// 자가농업 테이블 그리기
|
|
const gridFarmingTable = (status, data) => {
|
|
const tbody = $('#table-farming tbody');
|
|
tbody.empty();
|
|
|
|
$('#farmingCount').text(data.length);
|
|
if(data.length === 0) {
|
|
noData(tbody, status, 7);
|
|
return;
|
|
}
|
|
|
|
let tmpl = '';
|
|
$(data).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.productName)}</td> <!-- 생산물 -->
|
|
<td>${ifNullDash(item.usage)}</td><!-- 용도 -->
|
|
<td>${ifNullDash(item.quantity)}</td><!-- 수량 -->
|
|
<td>${ifNullDash(item.unitText)}</td><!-- 단위 -->
|
|
<td>${ifNullDash(item.estimatedValue)}</td><!-- 현물평가액 -->
|
|
<td>
|
|
${item.updatedBy}<br>
|
|
(${item.updatedAt})
|
|
</td><!-- 최종 수정자 -->
|
|
</tr>
|
|
`;
|
|
});
|
|
|
|
tbody.append(tmpl);
|
|
}
|
|
|
|
// nodata 처리
|
|
const noData = (target, status, length) => {
|
|
const noDataText = status === 'TARGET' ? '등록이 필요합니다.' : '등록없음';
|
|
|
|
$(target).append(`<tr><td colspan="${length}" style="text-align: center;">${noDataText}</td></tr>`);
|
|
}
|
|
</script>
|
|
</section>
|
|
|
|
</html> |