Merge remote-tracking branch 'origin/dev' into bo_daily
This commit is contained in:
@@ -4,6 +4,7 @@ import app.module.admin.config.application.util.AdminUtil;
|
||||
import app.module.admin.config.application.util.DateUiUtil;
|
||||
import app.module.admin.usecase.household.getHouseholdStatus.ports.GetHouseholdStatusPortIn;
|
||||
import app.module.admin.usecase.household.getHouseholdStatus.ports.application.domain.GetHouseholdStatusCmd;
|
||||
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
@@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
@RequiredArgsConstructor
|
||||
class GetHouseholdStatusUIController {
|
||||
private final GetHouseholdStatusPortIn getHouseholdStatusPortIn;
|
||||
private final UICodeListPortIn uiCodeListPortIn;
|
||||
|
||||
@GetMapping(path = "/households/{seq}")
|
||||
String operate(
|
||||
@@ -30,6 +32,8 @@ class GetHouseholdStatusUIController {
|
||||
model.addAttribute("recordMonth", recordMonth);
|
||||
model.addAttribute("userRole", AdminUtil.getLoginUserRole());
|
||||
|
||||
model.addAttribute("unitCodes", uiCodeListPortIn.connect("code.record.unit"));
|
||||
|
||||
// 임가 상세 정보
|
||||
model.addAttribute("householdInfo",
|
||||
getHouseholdStatusPortIn.operate(new GetHouseholdStatusCmd(seq)).orElse(null));
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.adapters.persistence;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.ports.application.domain.GetForestProductStatus;
|
||||
import app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.ports.application.domain.GetForestProductStatusCmd;
|
||||
import app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.ports.GetForestProductStatusPortOut;
|
||||
import java.util.Optional;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class GetForestProductStatusDao implements GetForestProductStatusPortOut {
|
||||
private final GetForestProductStatusMapper mapper;
|
||||
|
||||
@Override
|
||||
public Optional<GetForestProductStatus> operate(GetForestProductStatusCmd cmd) {
|
||||
return mapper.getForestProductStatus(cmd);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.adapters.persistence;
|
||||
|
||||
import app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.ports.application.domain.GetForestProductStatus;
|
||||
import app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.ports.application.domain.GetForestProductStatusCmd;
|
||||
import java.util.Optional;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface GetForestProductStatusMapper {
|
||||
Optional<GetForestProductStatus> getForestProductStatus(GetForestProductStatusCmd cmd);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.adapters.web;
|
||||
|
||||
import app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.ports.GetForestProductStatusPortIn;
|
||||
import app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.ports.application.domain.GetForestProductStatusCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
class GetForestProductStatusController {
|
||||
private final GetForestProductStatusPortIn portIn;
|
||||
|
||||
@GetMapping(path = "/api/forestProduct/{id}")
|
||||
ResponseEntity<?> operate(@PathVariable Long id) {
|
||||
return ResponseEntity.status(HttpStatus.OK)
|
||||
.body(portIn.operate(new GetForestProductStatusCmd(id)).orElse(null));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.adapters.web.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetForestProductStatusReqVO {
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.adapters.web.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetForestProductStatusResVO {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.ports;
|
||||
|
||||
import java.util.Optional;
|
||||
import app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.ports.application.domain.GetForestProductStatus;
|
||||
import app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.ports.application.domain.GetForestProductStatusCmd;
|
||||
|
||||
public interface GetForestProductStatusPortIn {
|
||||
Optional<GetForestProductStatus> operate(GetForestProductStatusCmd cmd);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.ports;
|
||||
|
||||
import java.util.Optional;
|
||||
import app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.ports.application.domain.GetForestProductStatus;
|
||||
import app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.ports.application.domain.GetForestProductStatusCmd;
|
||||
|
||||
public interface GetForestProductStatusPortOut {
|
||||
Optional<GetForestProductStatus> operate(GetForestProductStatusCmd cmd);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.ports.application;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.ports.application.domain.GetForestProductStatus;
|
||||
import app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.ports.application.domain.GetForestProductStatusCmd;
|
||||
import app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.ports.GetForestProductStatusPortIn;
|
||||
import app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.ports.GetForestProductStatusPortOut;
|
||||
import java.util.Optional;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class GetForestProductStatusService implements GetForestProductStatusPortIn {
|
||||
private final GetForestProductStatusPortOut portOut;
|
||||
|
||||
@Override
|
||||
public Optional<GetForestProductStatus> operate(GetForestProductStatusCmd cmd) {
|
||||
return portOut.operate(cmd);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetForestProductStatus {
|
||||
private Long id;
|
||||
private String streetNum;
|
||||
private String landType;
|
||||
private String town;
|
||||
private String cropName;
|
||||
private String landArea;
|
||||
private String mainYield;
|
||||
private String mainYieldUnitCode;
|
||||
private String mainYieldUnit;
|
||||
private String mainSaleAmount;
|
||||
private String mainSaleUnitCode;
|
||||
private String mainSaleUnit;
|
||||
private String subYield;
|
||||
private String subYieldUnitCode;
|
||||
private String subYieldUnit;
|
||||
private String subSaleAmount;
|
||||
private String subSaleUnitCode;
|
||||
private String subSaleUnit;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package app.module.admin.usecase.household.tab.forestProduct.getForestProductStatus.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetForestProductStatusCmd {
|
||||
private Long id;
|
||||
}
|
||||
@@ -30,7 +30,7 @@ class RemoveHouseholdVisitInfosController {
|
||||
}
|
||||
|
||||
portIn.operate(
|
||||
new RemoveHouseholdVisitInfosCmd(reqVO.getHouseholdSeq(), reqVO.getRemoveIds()));
|
||||
new RemoveHouseholdVisitInfosCmd(reqVO.getHouseholdSeq(), reqVO.getVisitRemoveIds()));
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK).body(new RemoveHouseholdVisitInfosResVO(
|
||||
messageUtil.getMessage("operation.common.remove.done")));
|
||||
|
||||
@@ -13,5 +13,5 @@ import lombok.Setter;
|
||||
@EqualsAndHashCode
|
||||
public class RemoveHouseholdVisitInfosReqVO {
|
||||
private Long householdSeq;
|
||||
private List<Long> removeIds;
|
||||
private List<Long> visitRemoveIds;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
@@ -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
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
@@ -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);
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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><!-- 주생산물 수확량 단위 -->
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
</hgroup>
|
||||
|
||||
<section class="form-group">
|
||||
<form method="post" name="reqForm" id="reqForm" onsubmit="event.preventDefault(); formControl.authInfoUser(event);" th:action="@{/}">
|
||||
<form method="post" name="reqForm" id="reqForm" onsubmit="formControl.authInfoUser(event); return false;">
|
||||
<input type="hidden" name="_csrf" th:value="${_csrf.token}" th:if="${_csrf != null}" />
|
||||
<div class="component-input" data-props-toggle-Password="true">
|
||||
<div class="input-label">
|
||||
<label for="password" class="label-txt">비밀번호</label>
|
||||
@@ -56,11 +57,12 @@
|
||||
|
||||
let formControl = {
|
||||
authInfoUser(event) {
|
||||
event.preventDefault();
|
||||
if (event && typeof event.preventDefault === 'function') {
|
||||
event.preventDefault();
|
||||
}
|
||||
const f = document.reqForm;
|
||||
|
||||
const obj = $(f).serializeObject();
|
||||
console.log(obj)
|
||||
|
||||
ajaxUtil._ajaxAsync(
|
||||
ENV.httpUrl.auth,
|
||||
obj,
|
||||
|
||||
Reference in New Issue
Block a user