Merge branch 'dev' into susu

This commit is contained in:
주수현
2025-06-19 08:27:19 +09:00
206 changed files with 6796 additions and 1100 deletions

View File

@@ -5,6 +5,7 @@
<div class="layer-wrap" th:fragment="modalFragment">
<form autocomplete="off" method="get" name="reqResearcherForm">
<input name="page" value="0" type="hidden"/>
<input name="size" value="10" type="hidden">
<div class="component-modal mypage-wrap modal01" data-props-dimm-click="true" data-state="close">
<div class="modal-dimm"></div>
@@ -51,9 +52,7 @@
실사
</p>
</div>
<select class="select-list" name="searchArea" id="regionMainCodeSelect" required>
<option value="" disabled hidden>선택해주세요.</option>
<option value="" selected>전체</option>
<select class="select-list" name="regionMainCode" id="regionMainCodeSelect" required>
<!-- ajax 호출 -->
</select>
</div>
@@ -64,10 +63,10 @@
<!-- 버튼 그룹 -->
<div class="component-btns">
<div class="btns-row">
<button type="button" class="btn">
<button type="button" class="btn" onclick="goReset();">
<span class="btn-txt">초기화</span>
</button>
<button type="button" class="btn btn-primary">
<button type="button" class="btn btn-primary" onclick="getResearchers(0);">
<span class="btn-txt">검색</span>
</button>
</div>
@@ -75,6 +74,7 @@
</section>
<section>
<p class="input-label" style="font-size: 16px;">총 <span id="researcherTotal">0</span>건</p>
<!-- 테이블 영역 -->
<table>
<thead>
@@ -88,46 +88,8 @@
<th>담당임가 수</th>
</tr>
</thead>
<tbody id="listTBody">
<tr>
<td>
<div class="component-input">
<label class="radio-inner">
<input type="radio" id="temp_radio_0001" name="temp_radio_0001">
</label>
</div>
</td>
<td>홍길동</td>
<td>010-0000-0000</td>
<td>서울</td>
<td>40</td>
</tr>
<tr>
<td>
<div class="component-input">
<label class="radio-inner">
<input type="radio" id="temp_radio_0002" name="temp_radio_0002">
</label>
</div>
</td>
<td>홍길동</td>
<td>010-0000-0000</td>
<td>서울</td>
<td>40</td>
</tr>
<tr>
<td>
<div class="component-input">
<label class="radio-inner">
<input type="radio" id="temp_radio_0003" name="temp_radio_0003">
</label>
</div>
</td>
<td>홍길동</td>
<td>010-0000-0000</td>
<td>서울</td>
<td>40</td>
</tr>
<tbody id="researcherListTbody">
</tbody>
</table>
@@ -136,7 +98,7 @@
<div class="component-btns bottom-btn-group">
<div class="btns-row align-right">
<button type="button" class="btn btn-primary">
<button type="button" class="btn btn-primary" onclick="setResearcher();">
<span class="btn-txt">등록</span>
</button>
</div>
@@ -151,6 +113,8 @@
</form>
<script th:inline="javascript">
let researcherList = [];
const showResearcherModal = () => {
document.querySelector(".modal01").ui.open();
@@ -160,7 +124,7 @@
{},
(response) => {
const select = document.getElementById('regionMainCodeSelect');
select.innerHTML = '<option value="" selected>전체</option>';
response.forEach(item => {
const option = document.createElement('option');
option.value = item.id;
@@ -174,8 +138,11 @@
'get',
'json'
);
getResearchers(document.reqResearcherForm.page.value);
}
// 조사원 리스트 가져오기
const getResearchers = (pageNo) => {
const f = document.reqResearcherForm;
f.page.value = pageNo;
@@ -183,31 +150,33 @@
let dataOj = $(f).serializeObject();
ajaxUtil._ajaxMethod(
'/api/mapping/researchers',
'/api/popupResearchers',
dataOj,
function (response) {
$('#totalElements').text(response.totalElements);
$('#researcherTotal').text(response.totalElements);
researcherList = response.content;
// List 구성하기
const tbody = $('#listTBody');
const tbody = $('#researcherListTbody');
tbody.empty();
$(response.content).each((idx, ct) => {
tbody.append(
`
<!-- <tr>-->
<!-- <td>-->
<!-- <div class="component-input">-->
<!-- <label class="radio-inner">-->
<!-- <input type="radio" id="temp_radio_0003" name="temp_radio_0003">-->
<!-- </label>-->
<!-- </div>-->
<!-- </td>-->
<!-- <td>홍길동</td>-->
<!-- <td>010-0000-0000</td>-->
<!-- <td>서울</td>-->
<!-- <td>40</td>-->
<!-- </tr>-->
<tr>
<td>
<div class="component-input">
<label class="radio-inner">
<input type="radio" id="temp_radio_000${ct.adminSeq}" name="adminSeq" value="${ct.adminSeq}">
</label>
</div>
</td>
<td>${ct.name}</td>
<td>${ifNullHyphen(ct.phone)}</td>
<td>${ct.regionMainName}</td>
<td>${ct.householdCount}</td>
</tr>
`
);
});
@@ -227,7 +196,7 @@
uiUtil.getPagingUI(pageNo, f.size.value, response.totalPages,
(movePageNo) => {
f.page.value = movePageNo;
goSearch();
getResearchers();
}));
},
@@ -240,5 +209,37 @@
);
}
</script>
<script>
const setResearcher = () => {
const selectedAdminSeq = $('input[name="adminSeq"]:checked').val();
if (!selectedAdminSeq) {
alert("조사원을 선택해주세요.");
return;
}
const selectedResearcher = researcherList.find(r => r.adminSeq == selectedAdminSeq);
console.log("선택된 조사원 : ", selectedResearcher);
// import 해준 html 에서 아래 함수를 선언해주면 selectedResearcher 값을 사용할 수 있음.
getSelectedResearcher(selectedResearcher, () => {
document.querySelector(".modal01").ui.close();
});
}
</script>
<script>
const goReset = () => {
const f = document.reqResearcherForm;
f.searchField.value = "";
f.searchValue.value = "";
f.regionMainCode.value = "";
getResearchers(0);
}
</script>
</div>
</html>

View File

@@ -0,0 +1,182 @@
<!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"
th:action="@{/communication/notices/create}"
method="post" class="fw-bold" name="reqForm">
<div class="content-inner">
<!-- 테이블 영역 -->
<table class="type-form">
<tbody>
<tr>
<th>제목<i class="ico-required-mark" role="img" aria-label="필수">*</i></th>
<td colspan="3">
<div class="component-input">
<div class="input-field">
<input type="text" name="title" id="title" placeholder="">
</div>
</div>
</td>
</tr>
<tr>
<th>내용<i class="ico-required-mark" role="img" aria-label="필수">*</i></th>
<td colspan="3">
<textarea class="form-control" id="noticeContent" rows="10" name="content"></textarea>
</td>
</tr>
<tr>
<th>첨부파일<i class="ico-required-mark" role="img" aria-label="필수">*</i></th>
<td colspan="3">
<div class="btns-row align-left publicFileInputs">
<button type="button" class="btn btn-secondary" onclick="addFileInput();">
<span class="btn-txt">다건 파일 첨부</span>
</button>
</div>
</td>
</tr>
<tr>
<th>게시기간<i class="ico-required-mark" role="img" aria-label="필수">*</i></th>
<td colspan="2">
<div class="d-flex">
<div class="component-input">
<div class="input-field">
<input id="boardStartDate" class="form-control flatpickr" name="startDate" type="text" placeholder="시작일을 선택하세요"/>
</div>
</div>-
<div class="component-input">
<div class="input-field">
<input id="boardEndDate" class="form-control flatpickr" name="endDate" type="text" placeholder="종료일을 선택하세요"/>
</div>
</div>
</div>
</td>
<td></td>
</tr>
<tr>
<th>노출여부<i class="ico-required-mark" role="img" aria-label="필수">*</i></th>
<td>
<div class="component-select">
<select class="select-list" name="visible" id="open">
<option value="true">Y</option>
<option value="false">N</option>
</select>
</div>
</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<div class="component-btns bottom-btn-group">
<div class="btns-row align-right">
<button type="button" class="btn btn-secondary" onclick="location.href='/household/households'">
<span class="btn-txt">취소</span>
</button>
<button type="button" class="btn btn-primary" onclick="goSave();">
<span class="btn-txt">등록</span>
</button>
</div>
</div>
</div>
</form>
</section>
<section layout:fragment="script">
<script src="/static/library/tinymce/6.0.3/tinymce.min.js" referrerpolicy="origin"></script>
<script src="/static/ui/editorImageUpload.js"></script>
<script th:inline="javascript">
initEditor('#noticeContent');
$(".flatpickr").flatpickr({
dateFormat: "Y-m-d\\TH:i",
// altInput: true,
// altFormat: "Y-m-d H:i",
monthSelectorType: 'static',
enableTime: true,
time_24hr: true
});
</script>
<script th:inline="javascript">
function addFileInput() {
$('.publicFileInputs').append(`
<div class="input-group w-50">
<input class="form-control mb-2" type="file" name="multipartAttachments"
onchange="uiUtil.uploadFile('NOTICE', this);">
<div class="invalid-feedback fw-bold">
에러 메세지
</div>
</div>
`);
}
const goSave = () => {
const f = document.reqForm;
// tinymce 는 사용자 입력을 받는 순간 몇몇 문자(&)를 escaping 한다.
// xss 방지를 위한 html escape 는 필터를 통해 자동처리되니 전달시에는 원문 그대로를 던진다.
f.content.value = uiUtil.unescapeHtml(tinymce.get('noticeContent').getContent());
const obj = $(f).serializeObject();
if(obj.fileMappingId) {
if (!Array.isArray(obj.fileMappingId)) {
obj.fileMappingId = [obj.fileMappingId];
}
}
const csrfToken = $('meta[name="_csrf"]').attr('content');
const csrfHeader = $('meta[name="_csrf_header"]').attr('content');
$.ajax({
'method': 'POST',
'url': '/api/communication/notices/create',
contentType: 'application/json',
data: JSON.stringify(obj),
beforeSend: function(xhr) {
xhr.setRequestHeader(csrfHeader, csrfToken);
},
// 'data': obj,
success: (res) => {
alert(`'${f.title.value}' 게시물이 생성되었습니다.\n이전 화면으로 이동합니다.`);
history.back();
},
statusCode: {
// error
400: function (res) {
const resJson = res.responseJSON;
alert(resJson.message);
},
// validation fail
422: function (res) {
alert("error");
// $(res.responseJSON).each((idx, oj) => {
// let target = $(f).find('[name=' + oj.field + ']');
// target.addClass('is-invalid');
//
// target.parent().find('.invalid-feedback').text(oj.defaultMessage);
// });
}
}
});
}
</script>
</section>
</html>

View File

@@ -0,0 +1,237 @@
<!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" th:action="@{/communication/notices}"
th:object="${reqVO}">
<input name="page" th:field="*{page}" type="hidden"/>
<input name="size" th:field="*{size}" type="hidden"/>
<input name="userRole" th:value="${userRole}" type="hidden"/>
<input name="userRegionMainCode" th:value="${userRegionMainCode}" type="hidden"/>
<div class="content-inner">
<!-- 필터 영역 -->
<section class="filter-wrap">
<div class="form-area">
<!-- 검색필드 -->
<div class="input-group">
<div class="input-label">
<p class="label-txt">
검색필드
</p>
</div>
<div class="component-select">
<select class="select-list" th:field="*{searchField}" id="searchField">
<option value="all" selected>전체</option>
<option value="title">제목</option>
<option value="updatedBy">작성자</option>
</select>
</div>
</div>
<div class="input-group">
<div class="input-label">
<p class="label-txt">
검색필드
</p>
</div>
<div class="component-input">
<div class="input-field">
<input type="text" id="searchValue" th:field="*{searchValue}" placeholder="검색어를 입력하세요.">
</div>
</div>
</div>
<div class="input-group">
<div class="input-label">
<p class="label-txt">
검색필드
</p>
</div>
<div class="component-select">
<select class="select-list" th:field="*{searchOpen}" id="searchOpen">
<option value="" selected>전체</option>
<option value="true">Y</option>
<option value="false">N</option>
</select>
</div>
</div>
</div>
<!-- 버튼 그룹 -->
<div class="component-btns">
<div class="btns-row">
<button type="button" class="btn" onclick="location.href = location.pathname">
<span class="btn-txt">초기화</span>
</button>
<button type="submit" class="btn btn-primary">
<span class="btn-txt">검색</span>
</button>
</div>
</div>
</section>
<section>
<p class="input-label" style="font-size: 16px;">총 <span id="totalElements">0</span>건</p>
<!-- 테이블 영역 -->
<table>
<thead>
<tr>
<th style="width:50px">
<div class="component-input">
<label class="checkbox-inner">
<input type="checkbox" id="temp_checkbox_0003" name="temp_checkbox_0001">
</label>
</div>
</th>
<th>제목</th>
<th style="width:120px">게시일</th>
<th>게시기간</th>
<th style="width:80px">노출<br>여부</th>
<th style="width:250px">최종수정자</th>
</tr>
</thead>
<tbody id="listTBody">
</tbody>
</table>
</section>
<!-- 페이지네이션 -->
<div class="row paging"></div>
<div class="component-btns bottom-btn-group">
<div class="btns-row align-right">
<!-- 관리자만 노출 -->
<button type="button" class="btn btn-danger" th:if="${userRole == 'ROLE_ADMIN'}" onclick="goRemove()">
<span class="btn-txt">삭제 </span>
</button>
<button type="button" class="btn" th:if="${userRole == 'ROLE_ADMIN'}"
onclick="location.href='/communication/notices/create'">
<span class="btn-txt">등록 </span>
</button>
</div>
</div>
</div>
</form>
</section>
<section layout:fragment="script">
<script th:inline="javascript">
// 임가 목록 조회
const getHouseholds = (pageNo) => {
const f = document.reqForm;
f.page.value = pageNo;
let dataOj = $(f).serializeObject();
ajaxUtil._ajaxMethod(
'/api/communication/notices',
dataOj,
function(response) { // 성공
console.log("response", response);
$('#totalElements').text(response.totalElements);
const tbody = $('#listTBody');
tbody.empty();
$(response.content).each((idx, ct) => {
tbody.append(
`
<tr>
<td>
<div class="component-input">
<label class="checkbox-inner">
<input type="checkbox" name="selectIds" value="${ct.id}">
</label>
</div>
</td>
<td class="underline"><a href="/communication/notices/${ct.id}">${ct.title}</a></td>
<td>${uiUtil.isoStrToDateOnly(ct.createdAt)}</td>
<td>${uiUtil.isoStrToReadable(ct.startDate)} ~ ${uiUtil.isoStrToReadable(ct.endDate)}</td>
<td>${ct.visible ? 'Y' : 'N'}</td>
<td>${ct.updatedBy}(${uiUtil.isoStrToReadable(ct.updatedAt)})</td>
</tr>
`
);
});
// nodata 처리
if (!$(response.content).length) {
tbody.append(`
<tr>
<td colspan="6" class="text-center text-muted">공지사항이 존재하지 않습니다.</td>
</tr>
`);
}
// Pagination 구성하기
const paging = $('.paging');
paging.empty();
paging.append(
uiUtil.getPagingUI(pageNo, f.size.value, response.totalPages,
(movePageNo) => {
f.page.value = movePageNo;
goSearch();
}));
},
function (code, rstData) { // 실패
console.log("error : ", code);
},
'get',
'json'
);
}
// 최초 리스트 로드
getHouseholds(document.reqForm.page.value);
</script>
<script th:inline="javascript">
const goSearch = () => {
const f = document.reqForm;
f.method = 'GET';
f.submit();
}
function goRemove() {
if (!$('input[name=selectIds]').is(':checked')) {
alert(/*[[#{operation.common.remove.choose}]]*/);
return;
}
if (confirm(/*[[#{operation.common.remove.ask}]]*/)) {
const f = document.reqForm;
const data = $(f).serializeObject();
$.ajax({
'method': 'DELETE',
'url': '/api/communication/notices/remove',
'data': {
'selectIds': data.selectIds
},
beforeSend: function (xhr) {
xhr.setRequestHeader(
$("meta[name='_csrf_header']").attr("content"),
$("meta[name='_csrf']").attr("content"));
},
success(res){
alert('선택한 아이템이 삭제되었습니다.');
f.method = 'GET';
f.submit();
}
});
}
}
</script>
</section>
</html>

View File

@@ -0,0 +1,239 @@
<!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"
th:action="@{/communication/notices/create}"
method="post" class="fw-bold" name="reqForm">
<input type="hidden" name="id" th:value="${id}">
<div class="content-inner">
<!-- 테이블 영역 -->
<table class="type-form">
<tbody>
<tr>
<th>제목<i class="ico-required-mark" role="img" aria-label="필수">*</i></th>
<td colspan="3">
<div class="component-input">
<div class="input-field">
<input type="text" name="title" id="title" placeholder="">
</div>
</div>
</td>
</tr>
<tr>
<th>내용<i class="ico-required-mark" role="img" aria-label="필수">*</i></th>
<td colspan="3">
<textarea class="form-control" id="noticeContent" rows="10" name="content"></textarea>
</td>
</tr>
<tr>
<th>첨부파일<i class="ico-required-mark" role="img" aria-label="필수">*</i></th>
<td colspan="3">
<div class="btns-row align-left publicFileInputs">
<button type="button" class="btn btn-secondary" onclick="addFileInput();">
<span class="btn-txt">다건 파일 첨부</span>
</button>
</div>
</td>
</tr>
<tr>
<th>게시기간<i class="ico-required-mark" role="img" aria-label="필수">*</i></th>
<td colspan="2">
<div class="d-flex">
<div class="component-input">
<div class="input-field">
<input id="boardStartDate" class="form-control flatpickr" name="startDate" type="text" placeholder="시작일을 선택하세요"/>
</div>
</div>-
<div class="component-input">
<div class="input-field">
<input id="boardEndDate" class="form-control flatpickr" name="endDate" type="text" placeholder="종료일을 선택하세요"/>
</div>
</div>
</div>
</td>
<td></td>
</tr>
<tr>
<th>노출여부<i class="ico-required-mark" role="img" aria-label="필수">*</i></th>
<td>
<div class="component-select">
<select class="select-list" name="visible" id="open">
<option value="true">Y</option>
<option value="false">N</option>
</select>
</div>
</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<div class="component-btns bottom-btn-group">
<div class="btns-row align-right">
<button type="button" class="btn btn-secondary" onclick="gotoList();">
<span class="btn-txt">취소</span>
</button>
<button type="button" class="btn btn-primary" onclick="goSave();">
<span class="btn-txt">등록</span>
</button>
</div>
</div>
</div>
</form>
</section>
<section layout:fragment="script">
<script src="/static/library/tinymce/6.0.3/tinymce.min.js" referrerpolicy="origin"></script>
<script src="/static/ui/editorImageUpload.js"></script>
<script th:inline="javascript">
$(".flatpickr").flatpickr({
dateFormat: "Y-m-d\\TH:i",
// altInput: true,
// altFormat: "Y-m-d H:i",
monthSelectorType: 'static',
enableTime: true,
time_24hr: true
});
</script>
<script th:inline="javascript">
const goPrev = () => {
history.back();
}
const gotoList = () => {
location.href = '/communication/notices';
}
function addFileInput() {
const inputGroup = $(`
<div class="input-group w-50">
<input class="form-control mb-2" type="file" name="multipartAttachments"
onchange="uiUtil.uploadFile('NOTICE', this);">
<div class="invalid-feedback fw-bold">
에러 메세지
</div>
</div>
`);
$('.publicFileInputs').append(inputGroup);
return inputGroup;
}
const getNotice = () => {
const f = document.reqForm;
$.ajax({
method: 'GET',
url: '/api/communication/notices/' + f.id.value,
success(res) {
console.log(res);
initEditor('#noticeContent', (editor) => {
editor.on('init', function () {
setTimeout(() => {
tinymce.get('noticeContent').setContent(uiUtil.unescapeHtml(res.content));
}, 0);
});
});
f.title.value = uiUtil.unescapeHtml(res.title);
f.startDate.value = res.startDate.substring(0, 16);
f.endDate.value = res.endDate.substring(0, 16);
f.visible.value = res.visible;
res.uploadFiles.forEach((uploadFile) => {
let inputGroup = addFileInput();
inputGroup.append(`<input type="hidden" name="fileMappingId" value="${uploadFile.id}"/>`);
uiUtil.showFileInfo(inputGroup.find('input[type=file]'), uploadFile, false);
});
}
});
}
// 상세정보 얻기
getNotice();
const goSave = () => {
const f = document.reqForm;
// tinymce 는 사용자 입력을 받는 순간 몇몇 문자(&)를 escaping 한다.
// xss 방지를 위한 html escape 는 필터를 통해 자동처리되니 전달시에는 원문 그대로를 던진다.
f.content.value = uiUtil.unescapeHtml(tinymce.get('noticeContent').getContent());
const obj = $(f).serializeObject();
if(obj.fileMappingId) {
if (!Array.isArray(obj.fileMappingId)) {
obj.fileMappingId = [obj.fileMappingId];
}
}
const csrfToken = $('meta[name="_csrf"]').attr('content');
const csrfHeader = $('meta[name="_csrf_header"]').attr('content');
$.ajax({
'method': 'PUT',
'url': '/api/communication/notices/update',
contentType: 'application/json',
data: JSON.stringify(obj),
beforeSend: function(xhr) {
xhr.setRequestHeader(csrfHeader, csrfToken);
},
success: (res) => {
if (confirm(`'${uiUtil.unescapeHtml(res.title)}' 게시물이 수정되었습니다.\n이전 화면으로 이동하시겠습니까?`)) {
history.back();
}
},
statusCode: {
// error
400: function (res) {
const resJson = res.responseJSON;
alert(resJson.message);
},
// validation fail
422: function (res) {
alert('error');
// $(res.responseJSON).each((idx, oj) => {
// let target = $(f).find('[name=' + oj.field + ']');
// target.addClass('is-invalid');
//
// target.parent().find('.invalid-feedback').text(oj.defaultMessage);
// });
}
}
});
}
</script>
</section>
</html>

View File

@@ -1,9 +0,0 @@
<!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">
<h1>/communication/notices</h1>
</section>
</html>

View File

@@ -252,7 +252,7 @@
<th>
<div class="component-input">
<label class="checkbox-inner">
<input type="checkbox" id="temp_checkbox_0003" name="temp_checkbox_0001">
<input type="checkbox" id="checkedAll" name="checkedAll">
</label>
</div>
</th>
@@ -265,8 +265,8 @@
<th>업종(대분류)</th>
<th>업종(중분류)</th>
<th>당월 일계부 현황</th>
<th>당월 1차 일가방문</th>
<th>당월 2차 일가방문</th>
<th>당월 1차 임가방문</th>
<th>당월 2차 임가방문</th>
<th>답례품 전달</th>
<th class="hide-role-researcher">조사원</th>
<th class="hide-role-researcher">조사원 휴대전화</th>
@@ -292,7 +292,7 @@
<span class="btn-txt">임가 등록</span>
</button>
<!-- 관리자, 지방실사만 노출 -->
<button type="button" class="btn" th:if="${userRole != 'ROLE_RESEARCHER'}">
<button type="button" class="btn" th:if="${userRole != 'ROLE_RESEARCHER'}" onclick="showResearcherModal();">
<span class="btn-txt">조사원 매핑</span>
</button>
</div>
@@ -300,7 +300,7 @@
</div>
</form>
<div th:replace="common/modal-researcher-mapping :: modalFragment"></div>
</section>
<section layout:fragment="script">
@@ -330,7 +330,7 @@
<td>
<div class="component-input">
<label class="checkbox-inner">
<input type="checkbox" id="temp_checkbox_000${ct.householdSeq}" name="temp_checkbox_000${ct.householdSeq}">
<input type="checkbox" id="chkBox_${ct.householdSeq}" name="chkBox" value="${ct.householdSeq}">
</label>
</div>
</td>
@@ -340,14 +340,14 @@
<td>${ct.regionMainName}</td><!-- 실사 -->
<td>${ct.regionSubName}</td><!-- 지역 -->
<td>${ct.regionDetailName}</td><!-- 세부지역 -->
<td>${ifNullDash(ct.industryLargeName)}</td><!-- 업종 대분류 -->
<td>${ifNullDash(ct.industryMiddleName)}</td><!-- 업종 중분류1 -->
<td>${ifNullHyphen(ct.industryLargeName)}</td><!-- 업종 대분류 -->
<td>${ifNullHyphen(ct.industryMiddleName)}</td><!-- 업종 중분류1 -->
<td>${ct.progressPercent}%</td><!-- 임가 진행 상황 -->
<td>${ifNullDash(ct.firstVisitDate)}</td><!-- 1차방문날짜 -->
<td>${ifNullDash(ct.secondVisitDate)}</td><!-- 2차방문날짜 -->
<td>${ifNullHyphen(ct.firstVisitDate)}</td><!-- 1차방문날짜 -->
<td>${ifNullHyphen(ct.secondVisitDate)}</td><!-- 2차방문날짜 -->
<td>${ct.isGiftSent ? "전달" : "미전달"}</td> <!-- 답례품 -->
<td class="hide-role-researcher">${ifNullDash(ct.researcherName)}</td> <!-- 조사원이름 -->
<td class="hide-role-researcher">${ifNullDash(ct.researcherPhone)}</td> <!-- 조사원번호 -->
<td class="hide-role-researcher">${ifNullHyphen(ct.researcherName)}</td> <!-- 조사원이름 -->
<td class="hide-role-researcher">${ifNullHyphen(ct.researcherPhone)}</td> <!-- 조사원번호 -->
</tr>
`
);
@@ -398,6 +398,55 @@
f.submit();
}
</script>
<script>
// 조사원 매핑 팝업의 선택된 조사원 가져오기.
const getSelectedResearcher = (data, closeModal) => {
const checked = document.querySelectorAll('input[name="chkBox"]:checked');
const householdSeqs = Array.from(checked).map(el => el.value);
if(checked.length == 0) {
alert("임가를 선택해주세요.");
return;
}
ajaxUtil._ajaxMethod(
'/api/household/researcherMapping/create',
JSON.stringify({
adminSeq: data.adminSeq,
householdSeqs: householdSeqs
}),
() => { // 성공
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>
// 체크박스 전체 선택
document.getElementById('checkedAll').addEventListener('change', function () {
const isChecked = this.checked;
const checkboxes = document.querySelectorAll('input[name="chkBox"]');
checkboxes.forEach(cb => {
cb.checked = isChecked;
});
});
</script>
</section>
</html>

View File

@@ -201,7 +201,7 @@
<div class="d-flex">
<div class="component-input">
<div class="input-field">
<input type="text" name="researcherSeq" id="researcherSeq" placeholder="">
<input type="text" name="researcherName" id="researcherName" placeholder="">
</div>
</div>
<button type="button" class="btn" onclick="showResearcherModal();">
@@ -306,7 +306,8 @@
'/api/household/households/create',
JSON.stringify(dataOj),
function(response) { // 성공
console.log("임가저장 결과 : ", response);
alert("등록이 완료되었습니다.");
location.href = '/household/households';
},
function (code, rstData) {
if(code == 422) alert(rstData.responseText);
@@ -319,6 +320,28 @@
}
</script>
<script>
// 조사원 매핑 팝업의 선택된 조사원 가져오기.
const getSelectedResearcher = (data, closeModal) => {
document.getElementById('researcherName').value = `${data.name}`;
const form = document.reqForm;
let input = form.querySelector('input[name="adminSeq"]');
if (!input) {
input = document.createElement('input');
input.type = 'hidden';
input.name = 'adminSeq';
form.appendChild(input);
}
// adminSeq 값 세팅
input.value = data.adminSeq;
closeModal();
}
</script>
<script>
// 휴대폰번호 길이 체크
const numberMaxLengthChk = (el, number) => {

View File

@@ -741,7 +741,6 @@
return;
}
const f = document.reqForm;
const listArea = $('.tab-content .daily-record-list');
const detailArea = $('.tab-content .daily-record-detail');
@@ -792,11 +791,11 @@
</div>
</td>
<td>${item.isCredit ? "Y" : "N"}</td> <!-- 외상판매 -->
<td>${ifNullDash(item.cropText)}</td><!-- 재배형태 -->
<td class="underline">${ifNullDash(item.categorySelf)}</td><!-- 수입의 종류 -->
<td>${ifNullDash(item.sourcePurpose)}</td><!-- 수입원 -->
<td class="align-right">${ifNullDash(item.quantity)}</td><!-- 수량 -->
<td>${item.unitSelf != null && item.unitSelf !== '' ? item.unitSelf : ifNullDash(item.unitText)}</td><!-- 단위 -->
<td>${ifNullHyphen(item.cropText)}</td><!-- 재배형태 -->
<td class="underline">${ifNullHyphen(item.categorySelf)}</td><!-- 수입의 종류 -->
<td>${ifNullHyphen(item.sourcePurpose)}</td><!-- 수입원 -->
<td class="align-right">${ifNullHyphen(item.quantity)}</td><!-- 수량 -->
<td>${item.unitSelf != null && item.unitSelf !== '' ? item.unitSelf : ifNullHyphen(item.unitText)}</td><!-- 단위 -->
<td class="align-right">${formatNumberWithComma(item.price)}</td><!-- 현금(원) -->
<td class="align-right">${formatNumberWithComma(item.estimatedValue)}</td><!-- 현물평가액 -->
<td>
@@ -833,21 +832,21 @@
</label>
</div>
</td>
<td class="underline">${ifNullDash(item.itemCode)}</td><!-- 품목명 -->
<td>${ifNullDash(item.workCode)}</td><!-- 작업명 -->
<td class="align-right">${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 class="underline">${ifNullHyphen(item.itemCode)}</td><!-- 품목명 -->
<td>${ifNullHyphen(item.workCode)}</td><!-- 작업명 -->
<td class="align-right">${ifNullHyphen(item.workLandArea)}</td><!-- 작업 면적 -->
<td>${ifNullHyphen(item.harvestQuantity)}</td><!-- 수확량 -->
<td>${ifNullHyphen(item.cropText)}</td><!-- 단위 -->
<td>${ifNullHyphen(item.ownerTime)}</td><!-- 경영주 시간 -->
<td>${ifNullHyphen(item.spouseTime)}</td><!-- 배우자 시간 -->
<td>${ifNullHyphen(item.familyMHours)}</td><!-- 가족노동(남) -->
<td>${ifNullHyphen(item.familyFHours)}</td><!-- 가족노동(여) -->
<td>${ifNullHyphen(item.hiredMHours)}</td><!-- 고용노동(남) -->
<td>${ifNullHyphen(item.hiredFHours)}</td><!-- 고용노동(여) -->
<td>${ifNullHyphen(item.sharedMHours)}</td><!-- 품앗이(남) -->
<td>${ifNullHyphen(item.sharedFHours)}</td><!-- 품앗이(여) -->
<td>${ifNullHyphen(item.volunteerMHours)}</td><!-- 일손돕기(남) -->
<td>${ifNullHyphen(item.volunteerFHours)}</td><!-- 일손돕기(여) -->
<td>
${item.updatedBy}<br>
(${item.updatedAt})
@@ -883,10 +882,10 @@
</div>
</td>
<td>${item.isCredit ? "Y" : "N"}</td> <!-- 외상 또는 카드구입 -->
<td class="underline">${ifNullDash(item.categorySelf)}</td><!-- 지출의 종류 -->
<td>${ifNullDash(item.sourcePurpose)}</td><!-- 용도 -->
<td>${ifNullDash(item.quantity)}</td><!-- 수량 -->
<td>${item.unitSelf != null && item.unitSelf !== '' ? item.unitSelf : ifNullDash(item.unitText)}</td><!-- 단위 -->
<td class="underline">${ifNullHyphen(item.categorySelf)}</td><!-- 지출의 종류 -->
<td>${ifNullHyphen(item.sourcePurpose)}</td><!-- 용도 -->
<td>${ifNullHyphen(item.quantity)}</td><!-- 수량 -->
<td>${item.unitSelf != null && item.unitSelf !== '' ? item.unitSelf : ifNullHyphen(item.unitText)}</td><!-- 단위 -->
<td class="align-right">${formatNumberWithComma(item.price)}</td><!-- 현금(원) -->
<td class="align-right">${formatNumberWithComma(item.estimatedValue)}</td><!-- 현물평가액 -->
<td>
@@ -923,9 +922,9 @@
</label>
</div>
</td>
<td class="underline">${ifNullDash(item.equipmentName)}</td> <!-- 명칭 -->
<td>${ifNullDash(item.ownedHours)}</td><!-- 자가 사용시간 -->
<td>${ifNullDash(item.leasedHours)}</td><!-- 임가 사용시간 -->
<td class="underline">${ifNullHyphen(item.equipmentName)}</td> <!-- 명칭 -->
<td>${ifNullHyphen(item.ownedHours)}</td><!-- 자가 사용시간 -->
<td>${ifNullHyphen(item.leasedHours)}</td><!-- 임가 사용시간 -->
<td>
${item.updatedBy}<br>
(${item.updatedAt})
@@ -960,10 +959,10 @@
</label>
</div>
</td>
<td class="underline">${ifNullDash(item.productName)}</td> <!-- 생산물 -->
<td>${ifNullDash(item.usage)}</td><!-- 용도 -->
<td class="align-right">${ifNullDash(item.quantity)}</td><!-- 수량 -->
<td>${ifNullDash(item.unitText)}</td><!-- 단위 -->
<td class="underline">${ifNullHyphen(item.productName)}</td> <!-- 생산물 -->
<td>${ifNullHyphen(item.usage)}</td><!-- 용도 -->
<td class="align-right">${ifNullHyphen(item.quantity)}</td><!-- 수량 -->
<td>${ifNullHyphen(item.unitText)}</td><!-- 단위 -->
<td class="align-right">${formatNumberWithComma(item.estimatedValue)}</td><!-- 현물평가액 -->
<td>
${item.updatedBy}<br>
@@ -999,10 +998,10 @@
</label>
</div>
</td>
<td class="underline">${ifNullDash(item.productName)}</td> <!-- 생산물 -->
<td>${ifNullDash(item.usage)}</td><!-- 용도 -->
<td class="align-right">${ifNullDash(item.quantity)}</td><!-- 수량 -->
<td>${ifNullDash(item.unitText)}</td><!-- 단위 -->
<td class="underline">${ifNullHyphen(item.productName)}</td> <!-- 생산물 -->
<td>${ifNullHyphen(item.usage)}</td><!-- 용도 -->
<td class="align-right">${ifNullHyphen(item.quantity)}</td><!-- 수량 -->
<td>${ifNullHyphen(item.unitText)}</td><!-- 단위 -->
<td class="align-right">${formatNumberWithComma(item.estimatedValue)}</td><!-- 현물평가액 -->
<td>
${item.updatedBy}<br>
@@ -1050,20 +1049,20 @@
</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><!-- 부생산물 판매량 단위 -->
<td>${ifNullHyphen(item.streetNum)}</td> <!-- 지번 -->
<td>${ifNullHyphen(item.landType)}</td><!-- 지목 -->
<td>${ifNullHyphen(item.town)}</td><!-- 읍면동 -->
<td>${ifNullHyphen(item.availableArea)}</td><!-- 가능면적(평) -->
<td>${ifNullHyphen(item.cropName)}</td><!-- 재배작물명 -->
<td>${ifNullHyphen(item.landArea)}</td><!-- 면적(평) -->
<td class="align-right">${ifNullHyphen(item.mainYield)}</td><!-- 주생산물 수확량 -->
<td>${ifNullHyphen(item.mainYieldUnitText)}</td><!-- 주생산물 수확량 단위 -->
<td class="align-right">${ifNullHyphen(item.mainSaleAmount)}</td><!-- 주생산물 판매량 -->
<td>${ifNullHyphen(item.mainSaleAmountUnitText)}</td><!-- 주생산물 판매량 단위 -->
<td class="align-right">${ifNullHyphen(item.subYield)}</td><!-- 부생산물 수확량 -->
<td>${ifNullHyphen(item.subYieldUnitText)}</td><!-- 부생산물 수확량 단위 -->
<td class="align-right">${ifNullHyphen(item.subSaleAmount)}</td><!-- 부생산물 판매량 -->
<td>${ifNullHyphen(item.subSaleAmountUnitText)}</td><!-- 부생산물 판매량 단위 -->
</tr>
`;
});
@@ -1097,7 +1096,7 @@
tbody.empty();
if(response.length === 0) {
tbody.append(`<tr><td colspan="6" style="text-align: center;">등록된 내용이 없습니다.</td></tr>`);
tbody.append(`<tr><td colspan="6" style="text-align: center;">등록이 필요합니다.</td></tr>`);
return;
}
@@ -1113,9 +1112,9 @@
</label>
</div>
</td>
<td>${ifNullDash(item.visitDate)}</td> <!-- 방문일 -->
<td>${ifNullDash(managementType[item.managementType])}</td> <!-- 관리분야 -->
<td>${ifNullDash(item.content)}</td> <!-- 내용 -->
<td>${ifNullHyphen(item.visitDate)}</td> <!-- 방문일 -->
<td>${ifNullHyphen(managementType[item.managementType])}</td> <!-- 관리분야 -->
<td>${ifNullHyphen(item.content)}</td> <!-- 내용 -->
<td>
${item.updatedBy}<br>
(${item.updatedAt})
@@ -1182,12 +1181,12 @@
</label>
</div>
</td>
<td>${ifNullDash(item.cropText)}</td> <!-- 재배형태 -->
<td class="underline">${ifNullDash(item.categoryText)}</td> <!-- 수입의 종류 -->
<td>${ifNullDash(item.categorySelf)}</td><!-- 대상 -->
<td>${ifNullDash(item.sourcePurpose)}</td><!-- 수입원 -->
<td>${ifNullDash(item.count)}</td><!-- 수량 -->
<td>${ifNullDash(item.unitText)}</td><!-- 단위 -->
<td>${ifNullHyphen(item.cropText)}</td> <!-- 재배형태 -->
<td class="underline">${ifNullHyphen(item.categoryText)}</td> <!-- 수입의 종류 -->
<td>${ifNullHyphen(item.target)}</td><!-- 대상 -->
<td>${ifNullHyphen(item.sourcePurpose)}</td><!-- 수입원 -->
<td>${ifNullHyphen(item.count)}</td><!-- 수량 -->
<td>${ifNullHyphen(item.unitText)}</td><!-- 단위 -->
<td class="align-right">${formatNumberWithComma(item.price)}</td><!-- 현금(원) -->
</tr>
`;
@@ -1218,11 +1217,10 @@
</label>
</div>
</td>
<td class="underline">${item.categorySelf != null && item.categorySelf !== '' ?
item.categorySelf : ifNullDash(item.categoryText)}</td> <!-- 지출의 종류 -->
<td>${ifNullDash(item.sourcePurpose)}</td><!-- 용도 -->
<td>${ifNullDash(item.count)}</td><!-- 수량 -->
<td>${ifNullDash(item.unitText)}</td><!-- 단위 -->
<td class="underline">${ifNullHyphen(item.categoryText)}</td> <!-- 지출의 종류 -->
<td>${ifNullHyphen(item.sourcePurpose)}</td><!-- 용도 -->
<td>${ifNullHyphen(item.count)}</td><!-- 수량 -->
<td>${ifNullHyphen(item.unitText)}</td><!-- 단위 -->
<td class="align-right">${formatNumberWithComma(item.price)}</td><!-- 현금(원) -->
</tr>
`;