[BO] 임가현황 리스트, 상세 작업 중 (4)
This commit is contained in:
@@ -3,120 +3,609 @@
|
||||
layout:decorate="~{layout/layout}">
|
||||
|
||||
<section layout:fragment="content">
|
||||
<!-- 1. 상단 정보 -->
|
||||
<form autocomplete="off" method="get" name="reqForm">
|
||||
<div>
|
||||
<table>
|
||||
<tr>
|
||||
<th>임가번호</th>
|
||||
<td th:text="${householdInfo.householdNum}">16750</td>
|
||||
<th>경영주</th>
|
||||
<td th:text="${householdInfo.householdName}">홍길동</td>
|
||||
<th>연령</th>
|
||||
<td th:text="${householdInfo.householdAge}">75</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>가구 연락처</th>
|
||||
<td th:text="${householdInfo.householdTel}">031-0000-0000</td>
|
||||
<th>휴대전화</th>
|
||||
<td th:text="${householdInfo.householdPhone}">010-0000-0000</td>
|
||||
<th>실사</th>
|
||||
<td th:text="${householdInfo.regionMainName}">서울</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>지역</th>
|
||||
<td th:text="${householdInfo.regionSubName}">31. 경기도</td>
|
||||
<th>세부지역</th>
|
||||
<td th:text="${householdInfo.regionDetailName}">9. 경기</td>
|
||||
<th>주소</th>
|
||||
<td th:text="${householdInfo.address}">경기 성남시 분당구 삼평대로...</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>업종 대분류</th>
|
||||
<td th:text="${householdInfo.industryLargeName}">40. 수실류재배업</td>
|
||||
<th>업종 중분류1</th>
|
||||
<td th:text="${householdInfo.industryMiddleName}">42. 대추재배업</td>
|
||||
<th>업종 중분류2</th>
|
||||
<td th:text="${householdInfo.industrySubMiddleName != null ? householdInfo.industrySubMiddleName : ''}">42. 대추재배업</td>
|
||||
<th>규모/세부품목</th>
|
||||
<td th:text="${householdInfo.industryDetailName != null ? householdInfo.industryDetailName : ''}">52_1. 조경수</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>조사원</th>
|
||||
<td th:text="${householdInfo.researcherName}">김조사</td>
|
||||
<th>조사원 연락처</th>
|
||||
<td th:text="${householdInfo.researcherPhone}">010-1111-1111</td>
|
||||
<th>유지여부</th>
|
||||
<td th:text="${householdInfo.isPanel ? '1. 유지' : '2. 탈락'}">1. 유지</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>비고</th>
|
||||
<td colspan="5" th:text="${householdInfo.memo}">비고 텍스트</td>
|
||||
</tr>
|
||||
</table>
|
||||
<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}">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}">40. 수실류재배업</span>
|
||||
</td>
|
||||
<th>업종 중분류1</th>
|
||||
<td>
|
||||
<span th:text="${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 : '-'}">-</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>
|
||||
<span>작성완료: <span id="doneCount">0</span></span>
|
||||
<span>미작성: <span id="emptyCount">0</span></span>
|
||||
<span>미완료: <span id="incompleteCount">0</span></span>
|
||||
<span>대기: <span id="waitingCount">0</span></span>
|
||||
<span> 현황: <span id="progressPercent">0</span>%</span>
|
||||
</div>
|
||||
<div class="content-inner">
|
||||
<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">
|
||||
<table id="table-income">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="10">수입 (<span id="incomeCount">0</span>건)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<thead>
|
||||
<!-- <tr>-->
|
||||
<!-- <th colspan="10">수입</th>-->
|
||||
<!-- </tr>-->
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<!-- 지출 -->
|
||||
<div class="content-inner">
|
||||
<table id="table-expense">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="9">지출 (<span id="expenseCount">0</span>건)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<!-- 동력사용시간 -->
|
||||
<div class="content-inner">
|
||||
<table id="table-power">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="5">동력사용시간 (<span id="powerCount">0</span>건)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>선택</th>
|
||||
<th>명칭</th>
|
||||
<th>자가 사용시간</th>
|
||||
<th>임가 사용시간</th>
|
||||
<th>최종 수정자</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 자가임업 -->
|
||||
<div class="content-inner">
|
||||
<table id="table-forestry">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="7">자가임업 생산물 중 자가소비량 (<span id="forestryCount">0</span>건)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>선택</th>
|
||||
<th>생산물</th>
|
||||
<th>용도</th>
|
||||
<th>수량</th>
|
||||
<th>단위</th>
|
||||
<th>현물평가액</th>
|
||||
<th>최종 수정자</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</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>
|
||||
|
||||
<!-- 2. 버튼 -->
|
||||
<div style="">
|
||||
<button>수정</button>
|
||||
<button>조사원 매핑</button>
|
||||
</div>
|
||||
|
||||
<!-- 3. 탭 -->
|
||||
<div style="margin-top: 50px;">
|
||||
<button class="tab daily-record">일계부 등록 현황</button>
|
||||
<button class="tab forest-product">임산물 현황</button>
|
||||
<button class="tab bank-auto-transfer">은행자동이체 내역</button>
|
||||
<button class="tab household-visit">임가방문정보</button>
|
||||
|
||||
<select name="recordMonth">
|
||||
<option
|
||||
th:each="m : ${monthList}" th:value="${m.value}" th:text="${m.label}">2025년 5월</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- 4. 테이블 -->
|
||||
<div class="table daily-record">
|
||||
<span>
|
||||
<span>작성완료: <span>0</span></span>
|
||||
<span>미작성: <span>0</span></span>
|
||||
<span>미완료: <span>0</span></span>
|
||||
<span>대기: <span>0</span></span>
|
||||
<span> 현황: <span>0</span>%</span>
|
||||
</span>
|
||||
<table border="1" style="margin-top: 50px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>입력날짜</th>
|
||||
<th>완료상태</th>
|
||||
<th>수입</th>
|
||||
<th>노동투입</th>
|
||||
<th>지출</th>
|
||||
<th>동력사용시간</th>
|
||||
<th>입업자가소비량</th>
|
||||
<!-- <th>농업자가소비량</th>-->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>1-2</td>
|
||||
<td>작성완료</td>
|
||||
<td>4건</td>
|
||||
<td>등록없음</td>
|
||||
<td>등록없음</td>
|
||||
<td>2건</td>
|
||||
<td>2건</td>
|
||||
<!-- <td>대상아님</td>-->
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section layout:fragment="script">
|
||||
<script th:inline="javascript">
|
||||
<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;
|
||||
|
||||
$.ajax({
|
||||
method: 'GET',
|
||||
url: '/api/household/dailyRecordsStatus',
|
||||
data: {
|
||||
householdSeq: f.householdSeq.value,
|
||||
recordMonth: f.recordMonth.value
|
||||
},
|
||||
success(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.forestryStatus}</td><!– 농업 자가소비량 –>-->
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
|
||||
tbody.append(tmpl);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 임산물 등록 현황 상세
|
||||
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();
|
||||
|
||||
$.ajax({
|
||||
method: 'GET',
|
||||
url: '/api/household/dailyRecordStatus',
|
||||
data: {
|
||||
householdSeq: f.householdSeq.value,
|
||||
recordSeq: id,
|
||||
recordMonth: f.recordMonth.value
|
||||
},
|
||||
success(response) {
|
||||
console.log("일계부 등록 상세 데이터~ : ", response);
|
||||
gridIncomeTable(response.incomes);
|
||||
gridExpenseTable(response.expenses);
|
||||
gridPowerTable(response.powers);
|
||||
gridForestryTable(response.forestries);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 수입 테이블 그리기
|
||||
const gridIncomeTable = (data) => {
|
||||
const tbody = $('#table-income tbody');
|
||||
tbody.empty();
|
||||
|
||||
$('#incomeCount').text(data.length);
|
||||
if(data.length === 0) {
|
||||
noData(tbody, 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>외상판매</td> <!-- 외상판매 -->
|
||||
<td>재배형태</td><!-- 재배형태 -->
|
||||
<td>수입의 종류</td><!-- 수입의 종류 -->
|
||||
<td>수입원</td><!-- 수입원 -->
|
||||
<td>수량</td><!-- 수량 -->
|
||||
<td>단위</td><!-- 단위 -->
|
||||
<td>현금(원)</td><!-- 현금(원) -->
|
||||
<td>현물평가액</td><!-- 현물평가액 -->
|
||||
<td>최종 수정자</td><!-- 최종 수정자 -->
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
|
||||
tbody.append(tmpl);
|
||||
}
|
||||
|
||||
// 지출 테이블 그리기
|
||||
const gridExpenseTable = (data) => {
|
||||
const tbody = $('#table-expense tbody');
|
||||
tbody.empty();
|
||||
|
||||
$('#expenseCount').text(data.length);
|
||||
if(data.length === 0) {
|
||||
noData(tbody, 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>외상 또는 카드구입</td> <!-- 외상 또는 카드구입 -->
|
||||
<td>지출의 종류</td><!-- 지출의 종류 -->
|
||||
<td>용도</td><!-- 용도 -->
|
||||
<td>수량</td><!-- 수량 -->
|
||||
<td>단위</td><!-- 단위 -->
|
||||
<td>현금(원)</td><!-- 현금(원) -->
|
||||
<td>현물평가액</td><!-- 현물평가액 -->
|
||||
<td>최종 수정자</td><!-- 최종 수정자 -->
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
|
||||
tbody.append(tmpl);
|
||||
}
|
||||
|
||||
// 동력사용시간 테이블 그리기
|
||||
const gridPowerTable = (data) => {
|
||||
const tbody = $('#table-power tbody');
|
||||
tbody.empty();
|
||||
|
||||
$('#powerCount').text(data.length);
|
||||
if(data.length === 0) {
|
||||
noData(tbody, 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>명칭</td> <!-- 명칭 -->
|
||||
<td>자가 사용시간</td><!-- 자가 사용시간 -->
|
||||
<td>임가 사용시간</td><!-- 임가 사용시간 -->
|
||||
<td>최종 수정자</td><!-- 최종 수정자 -->
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
|
||||
tbody.append(tmpl);
|
||||
}
|
||||
|
||||
// 자가임업 테이블 그리기
|
||||
const gridForestryTable = (data) => {
|
||||
const tbody = $('#table-forestry tbody');
|
||||
tbody.empty();
|
||||
|
||||
$('#forestryCount').text(data.length);
|
||||
if(data.length === 0) {
|
||||
noData(tbody, 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>생산물</td> <!-- 생산물 -->
|
||||
<td>용도</td><!-- 용도 -->
|
||||
<td>수량</td><!-- 수량 -->
|
||||
<td>단위</td><!-- 단위 -->
|
||||
<td>현물평가액</td><!-- 현물평가액 -->
|
||||
<td>최종 수정자</td><!-- 최종 수정자 -->
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
|
||||
tbody.append(tmpl);
|
||||
}
|
||||
|
||||
const noData = (target, length) => {
|
||||
$(target).append(`<tr><td colspan="${length}" style="text-align: center;">등록없음</td></tr>`);
|
||||
}
|
||||
</script>
|
||||
</section>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user