사용대장 페이지 리팩토링

master
강석 최 2023-03-31 14:06:46 +09:00
parent f6c4914d77
commit 776212f497
8 changed files with 269 additions and 296 deletions

View File

@ -322,8 +322,8 @@ public class EquipController {
mav.addObject("useList", equipService.selectUseInfoList(useInfo));
useInfo.setContentCnt(equipService.selectUseInfoListCnt(useInfo));
useInfo.setPaginationInfo();
mav.addObject("organList", equipService.selectOrganList(useInfo));
mav.addObject("searchParams", useInfo);
mav.addObject("downOrganList", loginUser.getDownOrganCdList());
return mav;
}
@ -333,15 +333,20 @@ public class EquipController {
useInfo.setDownOrganCdList(loginUser.getDownOrganCdList());
mav.addObject("downOrganList", loginUser.getDownOrganCdList());
mav.addObject("useType", useInfo.getUseType());
if(useInfo.getUseKey()!=null){
mav.addObject("useInfo", equipService.selectUseInfo(useInfo));
}else{
mav.addObject("useInfo", new UseInfo());
}
mav.addObject("historyInfo", useInfo.getUseKey()==null?null:equipService.selectUseHistoryList(useInfo));
//메뉴권한 확인
String accessAuth;
String accessAuth = null;
if(useInfo.getUseType().equals("PVRE")) {
accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/pvreUseList").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
}else if(useInfo.getUseType().equals("QIR")) {
accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/qirUseList").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
}
mav.addObject("accessAuth", accessAuth);
return mav;
}
@ -357,50 +362,6 @@ public class EquipController {
equipService.saveUseInfo(useInfo);
}
@GetMapping("/useModifyModal")
public ModelAndView useModifyModal(@AuthenticationPrincipal UserInfo loginUser, UseInfo useInfo) {
ModelAndView mav = new ModelAndView("equip/useModifyModal");
useInfo.setDownOrganCdList(loginUser.getDownOrganCdList());
mav.addObject("organList", equipService.selectOrganList(useInfo));
mav.addObject("info", equipService.selectUseInfo(useInfo));
mav.addObject("userSeq", loginUser.getUserSeq());
//메뉴권한 확인
String accessAuth;
if(useInfo.getUseType().equals("PVRE")) {
accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/pvreUseList").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
}else if(useInfo.getUseType().equals("QIR")) {
accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/equip/qirUseList").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);
}
return mav;
}
@PostMapping("/updateUse")
public UseInfo uadateUse(@AuthenticationPrincipal UserInfo loginUser, UseInfo useInfo){
useInfo.setWrtOrgan(loginUser.getOgCd());
useInfo.setWrtPart(loginUser.getOfcCd());
useInfo.setWrtUserGrd(loginUser.getTitleCd());
useInfo.setWrtUserSeq(loginUser.getUserSeq());
useInfo.setWrtUserNm(loginUser.getUserNm());
useInfo.setWrtDt(LocalDateTime.now());
return equipService.updateUse(useInfo);
}
@GetMapping("/useHistory")
public ModelAndView useHistory(@AuthenticationPrincipal UserInfo loginUser, UseInfo useInfo) {
ModelAndView mav = new ModelAndView("equip/useHistory");
mav.addObject("infoList", equipService.selectUseHistoryList(useInfo));
return mav;
}
@GetMapping("/HistoryView")
@ResponseBody
public UseInfo HistoryView(UseInfo useInfo){
return equipService.selectUseInfo(useInfo);
}
@PostMapping("/useDelete")
public void useDelete(@RequestBody List<UseInfo> useInfo){
equipService.useDelete(useInfo);

View File

@ -3,10 +3,13 @@ package com.dbnt.faisp.main.equip.repository;
import com.dbnt.faisp.main.equip.model.UseInfoVersion;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
import java.util.Optional;
public interface UseInfoVersionRepository extends JpaRepository<UseInfoVersion, UseInfoVersion.UseInfoVersionId> {
Optional<UseInfoVersion> findByUseKey(Integer useKey);
Optional<UseInfoVersion> findTop1ByUseKeyOrderByVersionNoDesc(Integer useKey);
List<UseInfoVersion> findByUseKey(Integer useKey);
}

View File

@ -303,6 +303,7 @@ public class EquipService extends BaseService {
@Transactional
public void saveUseInfo(UseInfo useInfo) {
if(useInfo.getUseKey()==null){
String year = ((Integer) useInfo.getUseDt().getYear()).toString();
useInfo.setYear(year);
Integer useNo = equipMapper.selectLastUseNo(useInfo);
@ -311,19 +312,13 @@ public class EquipService extends BaseService {
} else {
useInfo.setUseNo(year+"-"+String.format("%03d", useNo+1));
}
useInfoRepository.save(useInfo);
saveUseInfoVersion(useInfo);
}
@Transactional
public UseInfo updateUse(UseInfo useInfo) {
useInfoRepository.save(useInfo);
saveUseInfoVersion(useInfo);
return useInfo;
}
private void saveUseInfoVersion(UseInfo useInfo){
UseInfoVersion savedInfo = useInfoVersionRepository.findByUseKey(useInfo.getUseKey()).orElse(null);
UseInfoVersion savedInfo = useInfoVersionRepository.findTop1ByUseKeyOrderByVersionNoDesc(useInfo.getUseKey()).orElse(null);
UseInfoVersion versionInfo = new UseInfoVersion();
BeanUtils.copyProperties(useInfo, versionInfo);
versionInfo.setVersionNo(savedInfo==null?1:(savedInfo.getVersionNo()+1));
@ -343,8 +338,8 @@ public class EquipService extends BaseService {
}
public List<UseInfo> selectUseHistoryList(UseInfo useInfo) {
return equipMapper.selectUseHistoryList(useInfo);
public List<UseInfoVersion> selectUseHistoryList(UseInfo useInfo) {
return useInfoVersionRepository.findByUseKey(useInfo.getUseKey());
}
@Transactional

View File

@ -8,12 +8,12 @@ $(function(){
$(document).on('click', '#addPvre', function (){
const useType = "PVRE";
showEditModal(useType);
showEditModal(null, useType);
})
$(document).on('click', '#addQir', function (){
const useType = "QIR";
showEditModal(useType);
showEditModal(null, useType);
})
$(document).on('change', '#mgtOrgan', function (){
@ -22,10 +22,10 @@ $(document).on('change', '#mgtOrgan', function (){
partSelector.find('.'+this.value).show();
})
function showEditModal(useType){
function showEditModal(useKey, useType){
$.ajax({
url: '/equip/useEditModal',
data: {useType: useType},
data: {useKey: useKey, useType: useType},
type: 'GET',
dataType:"html",
success: function(html){
@ -36,7 +36,6 @@ function showEditModal(useType){
language: "ko",
autoclose: true
});
$('#detailSelf').hide();
},
error:function(e){
ajaxErrorAction(e);
@ -85,36 +84,11 @@ $(document).on('change', '#detailType', function (){
$(document).on('click', '.useTr', function (event){
const target = event.target;
if(!(target.className === "useChk" ||$(target).parents("td").length>0)){
showModifyModal($(target).parent('tr').attr("data-usekey"));
const tr = $(target).parent('tr')
showEditModal(tr.attr("data-usekey"), tr.attr("data-usetype"));
}
});
function showModifyModal(useKey){
$.ajax({
url: '/equip/useModifyModal',
data: {useKey: useKey},
type: 'GET',
dataType:"html",
success: function(html){
$("#useEditModalContent").empty().append(html);
$("#useEditModal").modal('show');
$("#mUseDt").datepicker({
format: "yyyy-mm-dd",
language: "ko",
autoclose: true
});
if($('#mDetailType').val() != 'PVREUSE007' && $('#mDetailType').val() != 'QIRUSE006'){
$('#mDetailSelf').hide();
}else{
$('#mDetailSelf').show();
}
},
error:function(e){
ajaxErrorAction(e);
}
});
}
$(document).on('change', '#mDetailType', function (){
if($(this).val() == 'PVREUSE007' || $(this).val() == 'QIRUSE006'){
$('#mDetailSelf').show();
@ -139,7 +113,7 @@ $(document).on('click', '#updateUse', function (){
success : function(data) {
alert("수정되었습니다.");
contentFade("out");
showModifyModal(data.useNo,data.useType,data.mgtOrgan);
showEditModal(data.useKey,data.useType);
},
error : function(xhr, status) {
alert("수정에 실패하였습니다.")
@ -180,41 +154,28 @@ $(document).on('click', '#historyBtn', function (){
});
})
$(document).on('click', '.historyTr', function (event){
const target = event.target;
$(this).find('.hisChk').prop('checked',true)
if($(this).find('.hisChk').prop('checked')){
$('.hisChk').prop('checked',false);
$(this).find('.hisChk').prop('checked',true)
}
$.ajax({
url: '/equip/HistoryView',
data: {
useNo: $(target).parents('tr').data("useno"),
versionNo : Number($(target).parents('tr').data("verno")),
useType : $(target).parents('tr').data("usetype"),
mgtOrgan : $(target).parents('tr').data("mgtorgan")
},
type: 'GET',
dataType:"json",
success: function(data){
$('#vSosok').val(data.sosok);
$('#vUseDt').val(data.useDt);
$('#vDetailType').val(data.detailTypeName);
if(data.detailType != 'PVREUSE007' && data.detailType != 'QIRUSE006'){
$('#vDetailSelf').hide();
$('#vDetailSelf').val('');
$(document).on('click', '.historyTr', function (){
$(".historyCheckBox").prop('checked', false);
const selectedTr = $(this);
selectedTr.find(".historyCheckBox").prop('checked', true);
const historyDiv = $('#historyDiv');
historyDiv.find('input,select').removeAttr('disabled')
$("#historyMgtOrgan").val(selectedTr.find(".mgtOrgan").val());
$("#historyMgtPart").val(selectedTr.find(".mgtPart").val());
$("#historyUseDt").val(selectedTr.find(".useDt").val());
const detailTypeVal = selectedTr.find(".detailType").val()
$("#historyDetailType").val(detailTypeVal);
if(detailTypeVal === "PVREUSE007" || detailTypeVal === "QIRUSE006"){
$("#historyDetailSelf").show().val(selectedTr.find(".detailSelf").val());
}else{
$('#vDetailSelf').show();
$('#vDetailSelf').val(data.detailSelf);
$("#historyDetailSelf").hide();
}
$('#vCnt').val(data.peopleCnt);
$('#vDescription').val(data.description);
},
error:function(e){
ajaxErrorAction(e);
}
});
$("#historyPeopleCnt").val(selectedTr.find(".peopleCnt").val());
$("#historyDescription").val(selectedTr.find(".description").val());
historyDiv.find('input,select').attr('disabled', 'disabled')
})
$(document).on('click', '#deleteUse', function (){
@ -227,9 +188,7 @@ $(document).on('click', '#deleteUse', function (){
$('input:checkbox[name=useChk]:checked').each(function (idx, el){
checkArr.push({});
const target = $(el);
checkArr[idx].useNo = target.parents('tr').data("useno");
checkArr[idx].mgtOrgan = target.parents('tr').data("mgtorgan");
checkArr[idx].useType = target.parents('tr').data("usetype");
checkArr[idx].useKey = target.parents('tr').attr("data-usekey");
})
deleteUse(checkArr);
}

View File

@ -39,8 +39,10 @@
<div class="col-1" th:if="${accessAuth eq 'ACC003'}">
<select class="form-select form-select-sm" name="mgtOrgan">
<option value="">경찰서</option>
<th:block th:each="organList:${organList}">
<option th:value="${organList.item_cd}" th:text="${organList.item_value}" th:selected="${organList.item_cd eq searchParams.mgtOrgan}"></option>
<th:block th:each="organ:${session.commonCode.get('OG')}">
<th:block th:if="${organ.useChk eq 'T' and #lists.contains(downOrganList, organ.itemCd)}">
<option th:value="${organ.itemCd}" th:text="${organ.itemValue}" th:selected="${organ.itemCd eq searchParams.mgtOrgan}"></option>
</th:block>
</th:block>
</select>
</div>
@ -50,8 +52,8 @@
<div class="col-1">
<select class="form-select form-select-sm" name="detailType">
<option value="">사용사유</option>
<th:block th:each="commonCode:${session.commonCode.get('PVREUSE')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd eq searchParams.detailType}"></option>
<th:block th:each="code:${session.commonCode.get('PVREUSE')}">
<option th:value="${code.itemCd}" th:text="${code.itemValue}" th:selected="${code.itemCd eq searchParams.detailType}"></option>
</th:block>
</select>
</div>
@ -78,7 +80,7 @@
<table class="table table-sm table-hover table-bordered">
<thead>
<tr class="table-secondary">
<th> <input type="checkbox" id="chk-all" class="useCheckBox"></th>
<th th:if="${accessAuth eq 'ACC003'}"> <input type="checkbox" id="chk-all" class="useCheckBox"></th>
<th>연번</th>
<th>경찰서</th>
<th>사용일시</th>
@ -89,16 +91,18 @@
</tr>
</thead>
<tbody class="table-group-divider">
<tr class="useTr" th:each="list:${useInfo}" th:data-useNo="${list.useNo}" th:data-mgtOrgan="${list.mgtOrgan}" th:data-useType="${list.useType}">
<td class="useChk"><input type="checkbox" name="useChk" class="useCheckBox"></td>
<td th:text="${list.useNo}"></td>
<td th:text="${list.sosok}"></td>
<td th:text="${list.useDt}"></td>
<td th:text="${list.detailTypeName}" th:if="${list.detailType != 'PVREUSE007'}"></td>
<td th:text="${list.detailSelf}" th:unless="${list.detailType != 'PVREUSE007'}"></td>
<td th:text="${list.peopleCnt}"></td>
<td th:text="${list.description}"></td>
<td th:text="${#temporals.format(list.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
<tr class="useTr" th:each="info:${useList}" th:data-usekey="${info.useKey}" th:data-useType="${info.useType}">
<td th:if="${accessAuth eq 'ACC003'}" class="useChk"><input type="checkbox" name="useChk" class="useCheckBox"></td>
<td th:text="${info.useNo}"></td>
<td th:text="${info.sosok}"></td>
<td th:text="${info.useDt}"></td>
<td>
<th:block th:if="${info.detailType != 'PVREUSE007'}" th:text="${info.detailTypeName}"></th:block>
<th:block th:unless="${info.detailType != 'PVREUSE007'}" th:text="${info.detailSelf}"></th:block>
</td>
<td th:text="${info.peopleCnt}"></td>
<td th:text="${info.description}"></td>
<td th:text="${#temporals.format(info.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
</tr>
</tbody>
</table>
@ -106,7 +110,6 @@
</div>
<div class="row justify-content-between">
<div class="col-auto">
<button type="button" class="btn btn-warning" id="historyBtn">수정이력</button>
<button type="button" class="btn btn-danger" id="deleteUse" th:if="${accessAuth eq 'ACC003'}">삭제</button>
</div>
<div class="col-auto">

View File

@ -40,7 +40,9 @@
<select class="form-select form-select-sm" name="mgtOrgan">
<option value="">경찰서</option>
<th:block th:each="organ:${session.commonCode.get('OG')}">
<option th:if="${organ.useChk eq 'T' and #lists.contains(downOrganList, organ.itemCd)}" th:value="${organ.itemCd}" th:text="${organ.itemValue}" th:selected="${organ.itemCd eq searchParams.mgtOrgan}"></option>
<th:block th:if="${organ.useChk eq 'T' and #lists.contains(downOrganList, organ.itemCd)}">
<option th:value="${organ.itemCd}" th:text="${organ.itemValue}" th:selected="${organ.itemCd eq searchParams.mgtOrgan}"></option>
</th:block>
</th:block>
</select>
</div>
@ -90,7 +92,7 @@
</tr>
</thead>
<tbody class="table-group-divider">
<tr class="useTr" th:each="info:${useList}" th:data-usekey="${info.useKey}">
<tr class="useTr" th:each="info:${useList}" th:data-usekey="${info.useKey}" th:data-usetype="${info.useType}">
<td th:if="${accessAuth eq 'ACC003'}" class="useChk"><input type="checkbox" name="useChk" class="useCheckBox"></td>
<td th:text="${info.useNo}"></td>
<td th:text="${info.sosok}"></td>

View File

@ -2,33 +2,157 @@
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="modal-header bg-dark">
<h5 class="modal-title text-white" id="menuEditModalLabel" th:text="${useType eq 'PVRE'?'휴대용 녹화장비 사용대장 등록':'방역조사실 사용대장 등록'}"></h5>
<h5 class="modal-title text-white" id="menuEditModalLabel">
<th:block th:text="${useType eq 'PVRE'?'휴대용 녹화장비 사용대장':'방역조사실 사용대장'}"></th:block>
<th:block th:text="${useInfo.useKey eq null?' 등록':' 수정'}"></th:block>
</h5>
<button type="button" class="btn-close f-invert" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<ul class="nav nav-tabs" id="useTab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="useInfoTab" data-bs-toggle="tab" data-bs-target="#useInfoTabPanel" type="button"
role="tab" aria-controls="useInfoTabPanel" aria-selected="true">사용대장
</button>
</li>
<li class="nav-item" role="presentation" th:if="${historyInfo ne null}">
<button class="nav-link" id="historyTab" data-bs-toggle="tab" data-bs-target="#historyTabPanel" type="button" role="tab"
aria-controls="historyTabPanel" aria-selected="false">수정이력
</button>
</li>
</ul>
<div class="tab-content bg-white border border-top-0 p-2">
<div class="tab-pane fade p-2 show active" id="useInfoTabPanel" role="tabpanel" tabindex="0">
<form id="useFm" method="post">
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<input type="hidden" name="useKey" th:value="${useInfo.useKey}">
<input type="hidden" name="useType" th:value="${useType}">
<div class="row mb-1">
<label for="mgtOrgan" class="col-sm-4 col-form-label col-form-label-sm text-center">관서</label>
<div class="col-sm-6">
<input type="hidden" name="useNo" th:value="${useInfo.useNo}">
<div class="row mb-1 justify-content-center">
<label for="mgtOrgan" class="col-sm-2 col-form-label col-form-label-sm text-center">관서</label>
<div class="col-sm-4">
<select class="form-select form-select-sm" id="mgtOrgan" name="mgtOrgan">
<option value="">선택</option>
<th:block th:each="organ:${session.commonCode.get('OG')}">
<option th:if="${organ.useChk eq 'T' and #lists.contains(downOrganList, organ.itemCd)}" th:value="${organ.itemCd}" th:text="${organ.itemValue}"></option>
<th:block th:if="${organ.useChk eq 'T' and #lists.contains(downOrganList, organ.itemCd)}">
<option th:value="${organ.itemCd}" th:text="${organ.itemValue}" th:selected="${organ.itemCd eq useInfo.mgtOrgan}"></option>
</th:block>
</th:block>
</select>
</div>
</div>
<div class="row mb-1 justify-content-center">
<label for="mgtOrgan" class="col-sm-2 col-form-label col-form-label-sm text-center">부서</label>
<div class="col-sm-4">
<select class="form-select form-select-sm" id="mgtPart" name="mgtPart">
<option value="">선택</option>
<th:block th:each="organ:${session.commonCode.get('OG')}">
<th:block th:if="${organ.useChk eq 'T' and #lists.contains(downOrganList, organ.itemCd)}">
<th:block th:each="part:${session.commonCode.get(organ.itemCd)}">
<option th:if="${part.useChk eq 'T'}" class="partOption" th:classappend="${organ.itemCd}"
th:value="${part.itemCd}" th:text="${part.itemValue}" th:selected="${part.itemCd eq useInfo.mgtPart}"
th:style="${organ.itemCd eq useInfo.mgtOrgan?'':'display: none;'}"></option>
</th:block>
</th:block>
</th:block>
</select>
</div>
</div>
<div class="row mb-1 justify-content-center">
<label for="useDt" class="col-sm-2 col-form-label col-form-label-sm text-center">사용일시</label>
<div class="col-sm-4">
<input type="text" class="form-control form-control-sm" id="useDt" name="useDt" readonly th:value="${useInfo.useDt}">
</div>
</div>
<div class="row mb-1 justify-content-center">
<label for="detailType" class="col-sm-2 col-form-label col-form-label-sm text-center">사용사유</label>
<div class="col-sm-4">
<select class="form-select form-select-sm" id="detailType" name="detailType">
<option value="">선택</option>
<th:block th:if="${useType eq 'PVRE'}">
<th:block th:each="code:${session.commonCode.get('PVREUSE')}">
<option th:value="${code.itemCd}" th:text="${code.itemValue}" th:selected="${code.itemCd eq useInfo.detailType}"></option>
</th:block>
</th:block>
<th:block th:if="${useType eq 'QIR'}">
<th:block th:each="code:${session.commonCode.get('QIRUSE')}">
<option th:value="${code.itemCd}" th:text="${code.itemValue}" th:selected="${code.itemCd eq useInfo.detailType}"></option>
</th:block>
</th:block>
</select>
<input type="text" class="form-control form-control-sm" id="detailSelf" name="detailSelf"
th:style="${useInfo.detailType eq 'PVREUSE007' or useInfo.detailType eq 'QIRUSE006'?'':'display: none;'}"
th:value="${useInfo.detailSelf}">
</div>
</div>
<div class="row mb-1 justify-content-center">
<label for="peopleCnt" class="col-sm-2 col-form-label col-form-label-sm text-center">사용인원</label>
<div class="col-sm-4">
<input type="number" class="form-control form-control-sm" id="peopleCnt" name="peopleCnt" th:value="${useInfo.peopleCnt}">
</div>
</div>
<div class="row mb-1 justify-content-center">
<label for="description" class="col-sm-2 col-form-label col-form-label-sm text-center">비고</label>
<div class="col-sm-4">
<input type="text" class="form-control form-control-sm" id="description" name="description" th:value="${useInfo.description}">
</div>
</div>
</form>
</div>
<div class="tab-pane fade p-2" id="historyTabPanel" role="tabpanel" tabindex="0">
<div class="row">
<div class="col-5">
<table class="table table-hover">
<thead>
<tr>
<th></th>
<th>수정자</th>
<th>수정일시</th>
</tr>
</thead>
<tbody>
<tr class="historyTr" th:each="useInfo:${historyInfo}">
<input type="hidden" class="mgtOrgan" th:value="${useInfo.mgtOrgan}">
<input type="hidden" class="mgtPart" th:value="${useInfo.mgtPart}">
<input type="hidden" class="useDt" th:value="${useInfo.useDt}">
<input type="hidden" class="detailType" th:value="${useInfo.detailType}">
<input type="hidden" class="detailSelf" th:value="${useInfo.detailSelf}">
<input type="hidden" class="peopleCnt" th:value="${useInfo.peopleCnt}">
<input type="hidden" class="description" th:value="${useInfo.description}">
<td><input type="checkbox" class="historyCheckBox"></td>
<td>
<th:block th:each="code:${session.commonCode.get('JT')}">
<th:block th:if="${code.itemCd eq useInfo.wrtUserGrd}" th:text="${code.itemValue}"></th:block>
</th:block>
<th:block th:text="${useInfo.wrtUserNm}"></th:block>
</td>
<td th:text="${#temporals.format(useInfo.wrtDt, 'yyyy-MM-dd')}"></td>
</tr>
</tbody>
</table>
</div>
<div class="col-7" id="historyDiv">
<div class="row mb-1">
<label for="mgtOrgan" class="col-sm-4 col-form-label col-form-label-sm text-center">관서</label>
<div class="col-sm-8">
<select class="form-select form-select-sm" id="historyMgtOrgan" disabled>
<option value="">선택</option>
<th:block th:each="organ:${session.commonCode.get('OG')}">
<option th:value="${organ.itemCd}" th:text="${organ.itemValue}"></option>
</th:block>
</select>
</div>
</div>
<div class="row mb-1">
<label for="mgtOrgan" class="col-sm-4 col-form-label col-form-label-sm text-center">부서</label>
<div class="col-sm-6">
<select class="form-select form-select-sm" id="mgtPart" name="mgtPart">
<div class="col-sm-8">
<select class="form-select form-select-sm" id="historyMgtPart" disabled>
<option value="">선택</option>
<th:block th:each="organ:${session.commonCode.get('OG')}">
<th:block th:if="${organ.useChk eq 'T' and #lists.contains(downOrganList, organ.itemCd)}" th:each="part:${session.commonCode.get(organ.itemCd)}">
<option th:if="${part.useChk eq 'T'}" class="partOption" th:classappend="${organ.itemCd}" th:value="${part.itemCd}" th:text="${part.itemValue}" style="display: none"></option>
<th:block th:each="part:${session.commonCode.get(organ.itemCd)}">
<option class="partOption" th:classappend="${organ.itemCd}"
th:value="${part.itemCd}" th:text="${part.itemValue}" style="display: none"></option>
</th:block>
</th:block>
</select>
@ -36,42 +160,45 @@
</div>
<div class="row mb-1">
<label for="useDt" class="col-sm-4 col-form-label col-form-label-sm text-center">사용일시</label>
<div class="col-sm-6">
<input type="text" class="form-control form-control-sm" id="useDt" name="useDt" readonly>
<div class="col-sm-8">
<input type="text" class="form-control form-control-sm" id="historyUseDt" disabled>
</div>
</div>
<div class="row mb-1">
<label for="detailType" class="col-sm-4 col-form-label col-form-label-sm text-center">사용사유</label>
<div class="col-sm-6">
<select class="form-select form-select-sm" id="detailType" name="detailType">
<div class="col-sm-8">
<select class="form-select form-select-sm" id="historyDetailType" disabled>
<option value="">선택</option>
<th:block th:if="${useType eq 'PVRE'}">
<th:block th:each="commonCode:${session.commonCode.get('PVREUSE')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
<th:block th:each="code:${session.commonCode.get('PVREUSE')}">
<option th:value="${code.itemCd}" th:text="${code.itemValue}"></option>
</th:block>
</th:block>
<th:block th:if="${useType eq 'QIR'}">
<th:block th:each="commonCode:${session.commonCode.get('QIRUSE')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
<th:block th:each="code:${session.commonCode.get('QIRUSE')}">
<option th:value="${code.itemCd}" th:text="${code.itemValue}"></option>
</th:block>
</th:block>
</select>
<input type="text" class="form-control form-control-sm" id="detailSelf" name="detailSelf">
<input type="text" class="form-control form-control-sm" id="historyDetailSelf" style="display: none" disabled>
</div>
</div>
<div class="row mb-1">
<label for="peopleCnt" class="col-sm-4 col-form-label col-form-label-sm text-center">사용인원</label>
<div class="col-sm-6">
<input type="number" class="form-control form-control-sm" id="peopleCnt" name="peopleCnt">
<div class="col-sm-8">
<input type="number" class="form-control form-control-sm" id="historyPeopleCnt" disabled>
</div>
</div>
<div class="row mb-1">
<label for="description" class="col-sm-4 col-form-label col-form-label-sm text-center">비고</label>
<div class="col-sm-6">
<input type="text" class="form-control form-control-sm" id="description" name="description">
<div class="col-sm-8">
<input type="text" class="form-control form-control-sm" id="historyDescription" disabled>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer justify-content-between bg-light">
<div class="col-auto">

View File

@ -1,77 +0,0 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="modal-header bg-dark">
<h5 class="modal-title text-white" id="menuEditModalLabel">
<th:block th:if="${info.useType eq 'PVRE'}">휴대용 녹화장비 사용대장 수정</th:block>
<th:block th:if="${info.useType eq 'QIR'}">방역조사실 사용대장 수정</th:block>
</h5>
<button type="button" class="btn-close f-invert" id="closeModal" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form id="useUpdateFm" method="post">
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<input type="hidden" name="useNo" th:value="${info.useNo}">
<input type="hidden" name="useType" th:value="${info.useType}">
<input type="hidden" name="versionNo" th:value="${info.versionNo}">
<div class="row mb-1">
<label for="mMgtOrgan" class="col-sm-4 col-form-label col-form-label-sm text-center">관서</label>
<div class="col-sm-6 ">
<select class="form-select form-select-sm" id="mMgtOrgan" name="mgtOrgan" disabled>
<option value="">선택</option>
<th:block th:each="organList:${organList}">
<option th:value="${organList.item_cd}" th:text="${organList.item_value}" th:selected="${organList.item_cd eq info.mgtOrgan}"></option>
</th:block>
</select>
</div>
</div>
<div class="row mb-1">
<label for="mUseDt" class="col-sm-4 col-form-label col-form-label-sm text-center">사용일시</label>
<div class="col-sm-6 ">
<input type="text" class="form-control form-control-sm" id="mUseDt" name="useDt" th:value="${info.useDt}" readonly>
</div>
</div>
<div class="row mb-1">
<label for="mDetailType" class="col-sm-4 col-form-label col-form-label-sm text-center">사용사유</label>
<div class="col-sm-6 ">
<select class="form-select form-select-sm" id="mDetailType" name="detailType">
<option value="">선택</option>
<th:block th:if="${info.useType eq 'PVRE'}">
<th:block th:each="commonCode:${session.commonCode.get('PVREUSE')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd eq info.detailType}"></option>
</th:block>
</th:block>
<th:block th:if="${info.useType eq 'QIR'}">
<th:block th:each="commonCode:${session.commonCode.get('QIRUSE')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd eq info.detailType}"></option>
</th:block>
</th:block>
</select>
<input type="text" class="form-control form-control-sm" id="mDetailSelf" name="detailSelf" th:value="${info.detailSelf}">
</div>
</div>
<div class="row mb-1">
<label for="mPeopleCnt" class="col-sm-4 col-form-label col-form-label-sm text-center">사용인원</label>
<div class="col-sm-6 ">
<input type="number" class="form-control form-control-sm" id="mPeopleCnt" name="peopleCnt" th:value="${info.peopleCnt}">
</div>
</div>
<div class="row mb-1">
<label for="mDescription" class="col-sm-4 col-form-label col-form-label-sm text-center">비고</label>
<div class="col-sm-6 ">
<input type="text" class="form-control form-control-sm" id="mDescription" name="description" th:value="${info.description}">
</div>
</div>
</form>
</div>
<div class="modal-footer justify-content-between bg-light">
<div class="col-auto">
<!--
<button type="button" class="btn btn-secondary" id="closeModal" data-bs-dismiss="modal">닫기</button>
-->
</div>
<div class="col-auto">
<button type="button" class="btn btn-warning" id="updateUse" th:if="${accessAuth eq 'ACC003'} or ${info.wrtUserSeq eq userSeq}">수정</button>
</div>
</div>
</html>