Merge branch 'kangsun' into 'dev'

[BO] 웹자원 반영 + 테이블 colspan 추가, 임산물 현황 작업 중

See merge request korea-research/korea-research!44
This commit is contained in:
이강선 매니저/ST
2025-06-25 04:33:55 +00:00
25 changed files with 605 additions and 31 deletions

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace="app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.adapters.persistence.GetForestProductStatusMapper">
<select id="getForestProductStatus"
resultType="app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.ports.application.domain.GetForestProductStatus">
/* getForestProductStatus : 임산물 현황 상세 조회 */
SELECT id,
street_num,
land_type,
town,
crop_name,
land_area,
main_yield,
main_yield_unit_code,
main_yield_unit,
main_sale_amount,
main_sale_unit_code,
main_sale_unit,
sub_yield,
sub_yield_unit_code,
sub_yield_unit,
sub_sale_amount,
sub_sale_unit_code,
sub_sale_unit
FROM forest_product
WHERE id = #{id}
AND is_deleted = false
</select>
</mapper>

View File

@@ -1356,6 +1356,11 @@ template {
border: 0;
}
@media (max-width: 1620px) {
.component-modal .modal-container .modal-content {
max-height: 520px !important;
}
}
@media (max-width: 1024px) {
a .hide-txt {
font-size: 0;
@@ -6841,7 +6846,7 @@ table:not(.type-form) tr:hover {
}
table.type-form {
border: 1px solid #dee2e6;
table-layout: fixed;
table-layout: auto;
}
table.type-form tbody tr {
height: 100%;
@@ -6889,6 +6894,9 @@ table.type-form tbody th {
color: #212529;
font-weight: 600;
}
table.type-form tbody th[colspan="6"] {
padding: 20px 24px;
}
table.type-form .component-input {
width: 100%;
}
@@ -6945,7 +6953,8 @@ table tbody td:last-of-type {
border-right: none;
}
table tbody th {
width: 16rem;
min-width: 14rem;
max-width: 16rem;
}
.summary-area ul {

File diff suppressed because one or more lines are too long

View File

@@ -7,6 +7,14 @@
<div class="content-inner">
<!-- 테이블 영역 -->
<table class="type-form">
<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>임가번호<i class="ico-required-mark" role="img" aria-label="필수">*</i></th>

View File

@@ -0,0 +1,326 @@
<!DOCTYPE html>
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.thymeleaf.org"
layout:decorate="~{layout/layout}">
<div class="layer-wrap" th:fragment="modalFragment">
<!-- 임산물 현황 등록 모달 폼 -->
<form autocomplete="off" method="get" name="reqForestProductForm">
<input type="hidden" name="forestProductId">
<input type="hidden" name="householdSeq" th:value="${seq}">
<input type="hidden" name="recordMonth" th:value="${recordMonth}">
<div class="component-modal mypage-wrap modal01 modal-forest-product" data-props-dimm-click="true" data-state="close">
<div class="modal-dimm"></div>
<div class="modal-frame">
<div class="modal-container">
<div class="modal-header">
<h3 class="modal-tit">
임산물 현황 등록
</h3>
</div>
<div class="modal-content">
<div class="modal-content-inner">
<!-- <i class="ico-required-mark" role="img" aria-label="필수">*</i><p>필수입력</p>-->
<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>
<div class="component-input">
<div class="input-field">
<input type="text" id="streetNum" name="streetNum">
</div>
</div>
</td>
<th>지목</th>
<td>
<div class="component-input">
<div class="input-field">
<input type="text" id="landType" name="landType">
</div>
</div>
</td>
<th>읍면동</th>
<td>
<div class="component-input">
<div class="input-field">
<input type="text" id="town" name="town">
</div>
</div>
</td>
</tr>
<tr>
<th>재배 작물명<i class="ico-required-mark" role="img" aria-label="필수">*</i></th>
<td>
<div class="component-input">
<div class="input-field">
<input type="text" id="cropName" name="cropName">
</div>
</div>
</td>
<th>면적(평)</th>
<td>
<div class="component-input">
<div class="input-field">
<input type="text" id="landArea" name="landArea">
</div>
</div>
</td>
<th>가능면적(평)</th>
<td>
<div class="component-input">
<div class="input-field">
<input type="text" id="availableArea" name="availableArea">
</div>
</div>
</td>
</tr>
<tr>
<th colspan="6">주생산물</th>
</tr>
<tr>
<th>수확량</th>
<td>
<div class="component-input">
<div class="input-field">
<input type="text" id="mainYield" name="mainYield">
</div>
</div>
</td>
<th>단위</th>
<td>
<div class="component-select">
<select class="select-list" name="mainYieldUnitCode" onchange="selectedUnit(this);" required>
<option value="">선택</option>
<option th:each="item : ${unitCodes}"
th:value="${item.id}"
th:text="${item.codeText}">
</select>
</div>
</td>
<th>직접입력 단위</th>
<td>
<div class="component-input unit-self-input">
<div class="input-field">
<input type="text" id="mainYieldUnit" name="mainYieldUnit" disabled>
</div>
</div>
</td>
</tr>
<tr>
<th>판매량</th>
<td>
<div class="component-input">
<div class="input-field">
<input type="text" id="mainSaleAmount" name="mainSaleAmount">
</div>
</div>
</td>
<th>단위</th>
<td>
<div class="component-select">
<select class="select-list" name="mainSaleUnitCode" onchange="selectedUnit(this);" required>
<option value="">선택</option>
<option th:each="item : ${unitCodes}"
th:value="${item.id}"
th:text="${item.codeText}">
</select>
</div>
</td>
<th>직접입력 단위</th>
<td>
<div class="component-input unit-self-input">
<div class="input-field">
<input type="text" id="mainSaleUnit" name="mainSaleUnit" disabled>
</div>
</div>
</td>
</tr>
<tr>
<th colspan="6">부생산물</th>
</tr>
<tr>
<th>수확량</th>
<td>
<div class="component-input">
<div class="input-field">
<input type="text" id="subYield" name="subYield">
</div>
</div>
</td>
<th>단위</th>
<td>
<div class="component-select">
<select class="select-list" name="subYieldUnitCode" onchange="selectedUnit(this);" required>
<option value="">선택</option>
<option th:each="item : ${unitCodes}"
th:value="${item.id}"
th:text="${item.codeText}">
</select>
</div>
</td>
<th>직접입력 단위</th>
<td>
<div class="component-input unit-self-input">
<div class="input-field">
<input type="text" id="subYieldUnit" name="subYieldUnit" disabled>
</div>
</div>
</td>
</tr>
<tr>
<th>판매량</th>
<td>
<div class="component-input">
<div class="input-field">
<input type="text" id="subSaleAmount" name="subSaleAmount">
</div>
</div>
</td>
<th>단위</th>
<td>
<div class="component-select">
<select class="select-list" name="subSaleUnitCode" onchange="selectedUnit(this);" required>
<option value="">선택</option>
<option th:each="item : ${unitCodes}"
th:value="${item.id}"
th:text="${item.codeText}">
</select>
</div>
</td>
<th>직접입력 단위</th>
<td>
<div class="component-input unit-self-input">
<div class="input-field">
<input type="text" id="subSaleUnit" name="subSaleUnit" disabled>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<div class="component-btns bottom-btn-group">
<div class="btns-row align-right">
<button type="button" class="btn btn-primary">
<span class="btn-txt">등록</span>
</button>
</div>
</div>
</div>
</div>
<button type="button" class="modal-close"></button>
</div>
</div>
</div>
</form>
<script th:inline="javascript">
// 임산물현황등록 모달창 띄우기
const showForestProductModal = (id) => {
const f = document.reqForestProductForm;
resetForestProductForm();
if(id != null) {
f.forestProductId.value = id;
ajaxUtil._ajaxMethod(
`/api/forestProduct/${id}`,
{},
(response) => {
console.log("임산물현황 상세 응답값 : ", response);
// setVisitFormData(response);
},
function (code, rstData) {
console.log("error : ", code);
},
'get',
'json'
);
}
document.querySelector(".modal-forest-product").ui.open();
}
// 임산물현황등록 상세 값 set
const setForestProductFormData = (data) => {
const form = document.reqForestProductForm;
if (!form) return;
}
</script>
<script th:inline="javascript">
// form 초기화
const resetForestProductForm = () => {
const form = document.reqForestProductForm;
if (!form) return;
// 모든 input 초기화
form.querySelectorAll('input').forEach((input) => {
input.value = '';
// 직접입력 단위는 다시 비활성화하고 클래스 추가
if (input.closest('.unit-self-input')) {
input.disabled = true;
input.closest('.unit-self-input').classList.add('input-disabled');
}
});
// 모든 select 초기화
form.querySelectorAll('select').forEach((select) => {
select.selectedIndex = 0;
});
}
</script>
<script>
const selectedUnit = (el) => {
const tr = el.closest('tr');
const unitArea = tr.querySelector('.unit-self-input');
const unitInput = tr.querySelector('.unit-self-input input');
if (el.value === 'code.record.unit.self') {
unitInput.disabled = false;
unitArea.classList.remove('input-disabled');
} else {
unitInput.disabled = true;
unitInput.value = '';
unitArea.classList.add('input-disabled');
}
};
</script>
</div>
</html>

View File

@@ -5,7 +5,7 @@
<div class="layer-wrap" th:fragment="modalFragment">
<form autocomplete="off" method="get" name="reqVisitForm">
<input type="hidden" name="visitInfoId">
<input type="hidden" name="householdSeq">
<input type="hidden" name="householdSeq" th:value="${seq}">
<div class="component-modal mypage-wrap modal01 modal-visit-info" data-props-dimm-click="true" data-state="close">
<div class="modal-dimm"></div>
@@ -19,6 +19,14 @@
<div class="modal-content">
<div class="modal-content-inner">
<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>
@@ -107,7 +115,7 @@
<script th:inline="javascript">
// form 초기화
const resetForm = () => {
const resetVisitForm = () => {
const form = document.reqVisitForm;
if (!form) return;
@@ -125,9 +133,8 @@
// 임가방문정보 모달창 띄우기
const showVisitInfoModal = (id) => {
const f = document.reqVisitForm;
f.householdSeq.value = householdSeq;
resetForm();
resetVisitForm();
if(id != null) {
f.visitInfoId.value = id;
@@ -137,7 +144,7 @@
{},
(response) => {
console.log("임가방문정보 상세 응답값 : ", response);
setFormData(response);
setVisitFormData(response);
},
function (code, rstData) {
console.log("error : ", code);
@@ -151,7 +158,7 @@
}
// 임가방문정보 상세 값 set
const setFormData = (data) => {
const setVisitFormData = (data) => {
const form = document.reqVisitForm;
if (!form) return;
@@ -184,7 +191,7 @@
(response) => { // 성공
alert("등록이 완료되었습니다.");
document.querySelector(".modal-visit-info").ui.close();
getVisitInfo(0);
getVisitInfo();
},
function (code, rstData) {
if(code == 422) alert(rstData.responseText);

View File

@@ -451,7 +451,7 @@
<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}">
<input type="checkbox" id="checkbox_work_${item.id}" name="checkbox_work" value="${item.id}">
</label>
</div>
</td>
@@ -501,7 +501,7 @@
<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}">
<input type="checkbox" id="checkbox_expense_${item.id}" name="checkbox_expense" value="${item.id}">
</label>
</div>
</td>
@@ -542,7 +542,7 @@
<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}">
<input type="checkbox" id="checkbox_power_${item.id}" name="checkbox_power" value="${item.id}">
</label>
</div>
</td>
@@ -579,7 +579,7 @@
<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}">
<input type="checkbox" id="checkbox_forestry_${item.id}" name="checkbox_forestry" value="${item.id}">
</label>
</div>
</td>
@@ -618,7 +618,7 @@
<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}">
<input type="checkbox" id="checkbox_farming_${item.id}" name="checkbox_farming" value="${item.id}">
</label>
</div>
</td>

View File

@@ -16,7 +16,7 @@
<button type="button" class="btn small btn-secondary">
<span class=" btn-txt">삭제</span>
</button>
<button type="button" class="btn small btn-primary">
<button type="button" class="btn small btn-primary" onclick="showForestProductModal();">
<span class="btn-txt">추가</span>
</button>
</div>
@@ -93,7 +93,9 @@
<td>${ifNullHyphen(item.landType)}</td><!-- 지목 -->
<td>${ifNullHyphen(item.town)}</td><!-- 읍면동 -->
<td>${ifNullHyphen(item.availableArea)}</td><!-- 가능면적(평) -->
<td>${ifNullHyphen(item.cropName)}</td><!-- 재배작물명 -->
<td class="underline">
<a href="javascript:void(0);" onclick="showForestProductModal(${item.id});">${ifNullHyphen(item.cropName)}</a>
</td><!-- 재배작물명 -->
<td>${ifNullHyphen(item.landArea)}</td><!-- 면적(평) -->
<td class="align-right">${ifNullHyphen(item.mainYield)}</td><!-- 주생산물 수확량 -->
<td>${ifNullHyphen(item.mainYieldUnitText)}</td><!-- 주생산물 수확량 단위 -->

View File

@@ -68,7 +68,7 @@
<td>
<div class="component-input">
<label class="checkbox-inner">
<input type="checkbox" id="removeIds_${item.id}" name="removeIds" value="${item.id}">
<input type="checkbox" id="visitRemoveIds_${item.id}" name="visitRemoveIds" value="${item.id}">
</label>
</div>
</td>
@@ -96,24 +96,27 @@
// 임가방문정보 삭제
const goDeleteVisitInfo = () => {
const infoIds = $('input[name=removeIds]:checked');
if(infoIds.length <= 0) {
const checkedIds = Array.from(
document.querySelectorAll('input[name="visitRemoveIds"]:checked')
).map(el => Number(el.value));
if(checkedIds.length <= 0) {
alert("임가방문정보를 선택해주세요.");
return
}
if(confirm("선택하신 내용을 삭제하시겠습니까? 삭제한 항목은 복구할 수 없습니다.")) {
const f = document.reqForm;
let dataOj = $(f).serializeObject();
console.log("dataOj", dataOj);
ajaxUtil._ajaxMethod(
'/api/visitInfo/remove',
JSON.stringify(dataOj),
JSON.stringify({
householdSeq: f.householdSeq.value,
visitRemoveIds: checkedIds
}),
(response) => { // 성공
alert("방문정보가 삭제되었습니다.");
getVisitInfo(0);
getVisitInfo();
},
function (code, rstData) {
if(code == 422) alert(rstData.responseText);

View File

@@ -9,6 +9,14 @@
<div class="content-inner">
<!-- 테이블 영역 -->
<table class="type-form">
<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>임가번호<i class="ico-required-mark" role="img" aria-label="필수">*</i></th>

View File

@@ -9,6 +9,14 @@
<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>
@@ -175,13 +183,12 @@
<!-- 임가방문정보 모달 -->
<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 th:inline="javascript">
const householdSeq = document.reqForm.householdSeq.value;
</script>
<script>
// 일계부 완료상태
const statusInfoMap = {

View File

@@ -16,6 +16,14 @@
<form autocomplete="off" method="get" name="householdVisitReqForm" >
<input type="hidden" name="id" id="id" />
<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 id="household-visit-detail">
<tr>
<th>방문일</th>