Files
korea-research/admin/src/main/resources/templates/households/{seq}.html

314 lines
14 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">
<colgroup>
<col width="8%" />
<col width="25.3%" />
<col width="8%" />
<col width="25.3%" />
<col width="8%" />
<col width="25.3%" />
</colgroup>
<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 != '' ? 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 != '' ? householdInfo.industryLargeName : '-'}">40. 수실류재배업</span>
</td>
<th>업종 중분류1</th>
<td>
<span
th:text="${householdInfo.industryMiddleName != null && householdInfo.industryMiddleName != '' ? householdInfo.industryMiddleName : '-'}">42. 대추재배업</span>
</td>
<th>업종 중분류2</th>
<td>
<span
th:text="${householdInfo.industrySubMiddleName != null && householdInfo.industrySubMiddleName != '' ? householdInfo.industrySubMiddleName : '-'}">52_1. 조경수</span>
</td>
</tr>
<tr>
<th>규모/세부품목</th>
<td>
<span
th:text="${householdInfo.industryDetailName != null && householdInfo.industryDetailName != '' ? householdInfo.industryDetailName : '-'}">52_1_1. 조경수</span>
</td>
</tr>
<tr>
<th>담당 조사원</th>
<td>
<span
th:text="${householdInfo.researcherName != null && householdInfo.researcherName != '' ? householdInfo.researcherName : '-'}">김조사</span>
</td>
<th>담당조사원 연락처</th>
<td>
<span
th:text="${householdInfo.researcherPhone != null && householdInfo.researcherPhone != '' ? 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" th:unless="${activeProfile != 'local'}">
<div class="btns-row align-right">
<button type="button" class="btn" th:if="${userRole == 'ROLE_ADMIN'}" onclick="showResearcherModal();">
<span class="btn-txt">조사원 매핑</span>
</button>
<button type="button" class="btn btn-primary" onclick="goUpdateForm();">
<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" th:unless="${activeProfile != 'local'}">임산물 현황</button>
<button type="button" class="tab-label select-tab" data-tab-type="bank-auto-transfer" data-tab-value="tab3" th:unless="${activeProfile != 'local'}">은행자동이체 내역</button>
<button type="button" class="tab-label select-tab" data-tab-type="household-visit" data-tab-value="tab4" th:unless="${activeProfile != 'local'}">임가방문정보</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}"
th:selected="${m.value == recordMonth}">2025년 5월</option>
</select>
</div>
</div>
<div class="tab-body">
<!-- 일계부 등록 현황 탭 -->
<th:block th:replace="households/tab/daily-record :: tabFragment"/>
<!-- 임산물 현황 탭 -->
<th:block th:replace="households/tab/forest-product :: tabFragment"/>
<!-- 은행자동이체내역 탭 -->
<th:block th:replace="households/tab/bank-auto-transfer :: tabFragment"/>
<!-- 임가방문정보 탭 -->
<th:block th:replace="households/tab/household-visit :: tabFragment"/>
</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='/households'">
<span class="btn-txt">목록</span>
</button>
</div>
<div class="btns-col-2 align-right" th:unless="${activeProfile != 'local'}">
<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>
<!-- 조사원 매핑 모달 -->
<th:block th:replace="common/modal-researcher-mapping :: modalFragment"/>
<!-- 임가방문정보 모달 -->
<th:block th:replace="households/modal/modal-visit-info :: modalFragment"/>
<!-- 임산물현황등록 모달 -->
<th:block th:replace="households/modal/modal-forest-product :: modalFragment"/>
</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'
}
};
const managementType = {
VISIT: "방문조사",
CALL: "전화상담",
ETC: "기타"
};
</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': // 일계부 등록 현황
getDailyRecords();
break;
case 'forest-product': // 임산물 현황
getForestProductsStatus();
break;
case 'bank-auto-transfer': // 은행자동이체내역
getBankAutoTransfer();
break;
case 'household-visit': // 임가방문정보
getVisitInfo();
break;
}
}
</script>
<script>
// 조사원 매핑 팝업의 선택된 조사원 가져오기.
const getSelectedResearcher = (data, closeModal) => {
const f = document.reqForm;
ajaxUtil._ajaxMethod(
'/api/household/researcherMapping/create',
JSON.stringify({
adminSeq: data.adminSeq,
householdSeqs: [Number(f.householdSeq.value)]
}),
() => { // 성공
alert("등록이 완료되었습니다.");
closeModal();
// 새로고침이 버벅거려서 일단 setTimeout 처리..
setTimeout(() => {
location.reload();
}, 200);
},
function (code, rstData) {
if(code == 422) alert(rstData.responseText);
if(code == 400) alert(rstData.responseJSON.message); //임가번호 중복체크
},
'post',
'json',
{ handle422Type: 'alert' }
);
}
</script>
<script>
// 수정 폼으로 가기
const goUpdateForm = () => {
const f = document.reqForm;
location.href = '/households/update/' + f.householdSeq.value;
}
</script>
<script>
// 일계부 등록 현황 nodata 처리
const noDataDaily = (target, status, length) => {
const noDataText = status === 'TARGET' ? '등록이 필요합니다.' : '등록없음';
$(target).append(`<tr><td colspan="${length}" style="text-align: center;">${noDataText}</td></tr>`);
}
// 임산물 현황 noData 처리
const noDataMonthly = (target, status, length) => {
const noDataText = status === 'NOTHING' ? '등록없음' : '등록이 필요합니다.';
$(target).append(`<tr><td colspan="${length}" style="text-align: center;">${noDataText}</td></tr>`);
}
</script>
</section>
</html>