외사장비 수정이력 열람 방식 변경.

master
강석 최 2023-01-28 11:16:15 +09:00
parent 9330763c2c
commit 44d9f74ca8
4 changed files with 94 additions and 22 deletions

View File

@ -127,7 +127,9 @@ public class EquipController {
@GetMapping("/historyView") @GetMapping("/historyView")
public ModelAndView historyView(Equip equip) { public ModelAndView historyView(Equip equip) {
ModelAndView mav = new ModelAndView("equip/equipHistory"); ModelAndView mav = new ModelAndView("equip/equipHistory");
mav.addObject("equList", equipService.selectHistoryList(equip)); List<Equip> equipHistoryList = equipService.selectHistoryList(equip);
mav.addObject("historyList", equipHistoryList.subList(1, equipHistoryList.size()));
mav.addObject("lastVersion", equipService.selectHistoryDetail(equipHistoryList.get(0)));
return mav; return mav;
} }

View File

@ -298,4 +298,9 @@ $(document).on('click', '.modalCloseBtn', function (){
location.reload(); location.reload();
}) })
$(document).on('click', '.equipTr', function (event){
if(event.target.className !== "equInfoCheckBox"){
const chkBox = $(this).find(".equInfoCheckBox")[0];
chkBox.checked = !chkBox.checked;
}
})

View File

@ -10,7 +10,7 @@
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="row justify-content-start"> <div class="row justify-content-start">
<div class="col-4"> <div class="col-3">
<table class="table table-sm table-hover table-bordered" id="categoryTable"> <table class="table table-sm table-hover table-bordered" id="categoryTable">
<thead> <thead>
<tr class="table-secondary"> <tr class="table-secondary">
@ -20,67 +20,132 @@
</tr> </tr>
</thead> </thead>
<tbody class="table-group-divider overflow-scroll"> <tbody class="table-group-divider overflow-scroll">
<tr class="historyInfoTr" th:each="equInfo:${equList}"> <th:block th:if="${#lists.size(historyList)>0}">
<td><input type="checkbox" class="hisChk"> <tr class="historyInfoTr" th:each="equInfo:${historyList}">
<input type="hidden" class="equKey" th:value="${equInfo.equKey}"> <td><input type="checkbox" class="hisChk">
<input type="hidden" class="verNo" th:value="${equInfo.versionNo}" > <input type="hidden" class="equKey" th:value="${equInfo.equKey}">
</td> <input type="hidden" class="verNo" th:value="${equInfo.versionNo}" >
<td th:text="|${equInfo.wrtTitle} ${equInfo.wrtNm}|"></td> </td>
<td th:text="${#temporals.format(equInfo.wrtDt, 'yyyy-MM-dd')}"></td> <td th:text="|${equInfo.wrtTitle} ${equInfo.wrtNm}|"></td>
</tr> <td th:text="${#temporals.format(equInfo.wrtDt, 'yyyy-MM-dd')}"></td>
</tr>
</th:block>
<th:block th:unless="${#lists.size(historyList)>0}">
<tr>
<td colspan="3">수정 이력이 없습니다.</td>
</tr>
</th:block>
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="col-8" id="valueDiv"> <div class="col-1"></div>
<div class="row mb-3"> <div class="col-4" id="valueDiv">
<div class="row mb-1">
<div class="col-auto">수정이력</div>
</div>
<div class="row mb-1">
<label for="vSosok" class="col-sm-4 col-form-label col-form-label-sm text-center">관리처</label> <label for="vSosok" class="col-sm-4 col-form-label col-form-label-sm text-center">관리처</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input type="text" class="form-control form-control-sm" id="vSosok" readonly> <input type="text" class="form-control form-control-sm" id="vSosok" readonly>
</div> </div>
</div> </div>
<div class="row mb-3"> <div class="row mb-1">
<label for="vEquType" class="col-sm-4 col-form-label col-form-label-sm text-center">분류</label> <label for="vEquType" class="col-sm-4 col-form-label col-form-label-sm text-center">분류</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input type="text" class="form-control form-control-sm" id="vEquType" readonly> <input type="text" class="form-control form-control-sm" id="vEquType" readonly>
</div> </div>
</div> </div>
<div class="row mb-3"> <div class="row mb-1">
<label for="vDetailType" class="col-sm-4 col-form-label col-form-label-sm text-center">세부분류</label> <label for="vDetailType" class="col-sm-4 col-form-label col-form-label-sm text-center">세부분류</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input type="text" class="form-control form-control-sm" id="vDetailType" readonly> <input type="text" class="form-control form-control-sm" id="vDetailType" readonly>
</div> </div>
</div> </div>
<div class="row mb-3"> <div class="row mb-1">
<label for="vStoredYear" class="col-sm-4 col-form-label col-form-label-sm text-center">취득연도</label> <label for="vStoredYear" class="col-sm-4 col-form-label col-form-label-sm text-center">취득연도</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input type="text" class="form-control form-control-sm" id="vStoredYear" readonly> <input type="text" class="form-control form-control-sm" id="vStoredYear" readonly>
</div> </div>
</div> </div>
<div class="row mb-3"> <div class="row mb-1">
<label for="vItemQty" class="col-sm-4 col-form-label col-form-label-sm text-center">보유량</label> <label for="vItemQty" class="col-sm-4 col-form-label col-form-label-sm text-center">보유량</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input type="text" class="form-control form-control-sm" id="vItemQty" readonly> <input type="text" class="form-control form-control-sm" id="vItemQty" readonly>
</div> </div>
</div> </div>
<div class="row mb-3"> <div class="row mb-1">
<label for="vItemCondition" class="col-sm-4 col-form-label col-form-label-sm text-center">상태</label> <label for="vItemCondition" class="col-sm-4 col-form-label col-form-label-sm text-center">상태</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input type="text" class="form-control form-control-sm" id="vItemCondition" readonly> <input type="text" class="form-control form-control-sm" id="vItemCondition" readonly>
</div> </div>
</div> </div>
<div class="row mb-3"> <div class="row mb-1">
<label for="vNote" class="col-sm-4 col-form-label col-form-label-sm text-center">비고</label> <label for="vNote" class="col-sm-4 col-form-label col-form-label-sm text-center">비고</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input type="text" class="form-control form-control-sm" id="vNote" readonly> <input type="text" class="form-control form-control-sm" id="vNote" readonly>
</div> </div>
</div> </div>
<div class="row mb-3"> <div class="row mb-1">
<label for="vImgName" class="col-sm-4 col-form-label col-form-label-sm text-center">장비사진</label> <label for="vImgName" class="col-sm-4 col-form-label col-form-label-sm text-center">장비사진</label>
<div class="col-sm-6"> <div class="col-sm-6">
<img id="vImgName" src="" alt="첨부이미지" style="width: 100%; height: 100%; display: none;" /> <img id="vImgName" src="" alt="첨부이미지" style="width: 100%; height: 100%; display: none;" />
</div> </div>
</div> </div>
</div> </div>
<div class="col-4" id="lastVersionDiv">
<div class="row mb-1">
<div class="col-auto">최신데이터</div>
</div>
<div class="row mb-1">
<label for="vSosok" 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" th:value="${lastVersion.sosok}" readonly>
</div>
</div>
<div class="row mb-1">
<label for="vEquType" 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" th:value="${lastVersion.equType}" readonly>
</div>
</div>
<div class="row mb-1">
<label for="vDetailType" 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" th:value="${lastVersion.detailType}" readonly>
</div>
</div>
<div class="row mb-1">
<label for="vStoredYear" 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" th:value="${lastVersion.storedYear}" readonly>
</div>
</div>
<div class="row mb-1">
<label for="vItemQty" 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" th:value="${lastVersion.itemQty}" readonly>
</div>
</div>
<div class="row mb-1">
<label for="vItemCondition" 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" th:value="${lastVersion.itemCondition}" readonly>
</div>
</div>
<div class="row mb-1">
<label for="vNote" 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" th:value="${lastVersion.note}" readonly>
</div>
</div>
<div class="row mb-1">
<label for="vImgName" class="col-sm-4 col-form-label col-form-label-sm text-center">장비사진</label>
<div class="col-sm-6">
<img th:src="|/equip/getEquipImg?equKey=${lastVersion.equKey}&versionNo=${lastVersion.versionNo}|" alt="첨부이미지" style="width: 100%; height: 100%;" />
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -57,7 +57,7 @@
</tr> </tr>
</thead> </thead>
<tbody class="table-group-divider"> <tbody class="table-group-divider">
<tr th:each="equ:${equipList}"> <tr class="equipTr" th:each="equ:${equipList}">
<td> <td>
<input type="checkbox" name="equChk" class="equInfoCheckBox"> <input type="checkbox" name="equChk" class="equInfoCheckBox">
<input type="hidden" class="equKey" th:value="${equ.equKey}"> <input type="hidden" class="equKey" th:value="${equ.equKey}">
@ -127,7 +127,7 @@
</div> </div>
</div> </div>
<div class="modal fade" id="equipHistoryModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="equipHistoryModalLabel" aria-hidden="true"> <div class="modal fade" id="equipHistoryModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="equipHistoryModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-scrollable"> <div class="modal-dialog modal-xl modal-dialog-scrollable">
<div class="modal-content" id="equipHistoryModalContent"> <div class="modal-content" id="equipHistoryModalContent">
</div> </div>
</div> </div>