외사경찰 경력 등록, 수정 후 새로고침

sri 시,분 선택 ui 추가.
master
강석 최 2023-03-29 10:41:56 +09:00
parent e11fd1e133
commit 0a19e843bd
6 changed files with 30 additions and 11 deletions

View File

@ -216,7 +216,7 @@ public class PoliceController {
@GetMapping("/careerModal")
public ModelAndView careerModal(@AuthenticationPrincipal UserInfo loginUser, UserCareer career){
ModelAndView mav = new ModelAndView("police/career/careerModal");
mav.addObject("updateStatus", career.getUpdateStatus());
//메뉴권한 확인
String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/police/careerMgt").get(0).getAccessAuth();
mav.addObject("accessAuth", accessAuth);

View File

@ -70,7 +70,9 @@ public class UserCareer{
@Transient
List<UserCareer> careerList;
private List<UserCareer> careerList;
@Transient
private String updateStatus;
@Embeddable
@Data

View File

@ -32,6 +32,11 @@ function getSriEditModal(faSriKey){
autoclose: true,
startDate: "now"
});
$("#faSriETime").datetimepicker({
datepicker: false,
format: 'H:i',
step:10
});
setEditor('editor', '500');
setUploadDiv();
$("#sriEditModal").modal('show');

View File

@ -13,7 +13,7 @@ $(document).on('click', '#notPoliceTab', function (){
})
$(document).on('click', '.policeTr', function (){
getCareerModal($(this).find(".userSeq").val(), "CRC001")
getCareerModal($(this).find(".userSeq").val(), "CRC001", null)
});
$(document).on('click', '.careerAddBtn', function (){
@ -30,7 +30,8 @@ $(document).on('click', '.careerAddBtn', function (){
$("#dateSelectorDiv").datepicker({
format: "yyyy-mm-dd",
language: "ko",
autoclose: true
autoclose: true,
endDate: "now"
});
$("#careerFormModal").modal('show');
},
@ -79,7 +80,7 @@ $(document).on('click', '#kwmsModalSelectBtn', function (){
success : function(result) {
alert("저장되었습니다.");
$("#kwmsCareerModal").modal('hide');
getCareerModal($("#mngModelUserSeq").val(), "CRC001");
getCareerModal($("#mngModelUserSeq").val(), "CRC001", 'updated');
contentFade("out");
},
error : function(xhr, status) {
@ -125,7 +126,7 @@ $(document).on('click', '#saveBtn', function (){
success : function(result) {
alert("저장되었습니다.");
$("#careerFormModal").modal('hide');
getCareerModal($("#mngModelUserSeq").val(), $("#careerForm").find("#careerCd").val());
getCareerModal($("#mngModelUserSeq").val(), $("#careerForm").find("#careerCd").val(), 'updated');
contentFade("out");
},
error : function(xhr, status) {
@ -152,7 +153,7 @@ $(document).on('click', '.deleteCareerBtn', function (){
},
success : function(data) {
alert("삭제 되었습니다.");
getCareerModal(userSeq, tabCd);
getCareerModal(userSeq, tabCd, 'updated');
contentFade("out");
},
error : function(xhr, status) {
@ -163,10 +164,20 @@ $(document).on('click', '.deleteCareerBtn', function (){
}
})
function getCareerModal(userSeq, careerCd){
$(document).on('hidden.bs.modal', '#careerModal', function (){
if($("#updateStatus").val()==='updated'){
$("#searchBtn").click();
}
})
function getCareerModal(userSeq, careerCd, updateStatus){
$.ajax({
url: '/police/careerModal',
data: {userSeq: userSeq, careerCd: careerCd},
data: {
userSeq: userSeq,
careerCd: careerCd,
updateStatus: updateStatus
},
type: 'GET',
dataType:"html",
success: function(html){

View File

@ -18,6 +18,7 @@
<div class="modal-body">
<input type="hidden" id="mngModelUserSeq" th:value="${userInfo.userSeq}">
<input type="hidden" id="mngModelDicCode" th:value="${userInfo.dicCode}">
<input type="hidden" id="updateStatus" th:value="${updateStatus}">
<div class="card">
<div class="card-body text-center">
<ul class="nav nav-tabs" id="userTab" role="tablist">

View File

@ -42,8 +42,8 @@
<div class="col-sm-4" th:with="faSriEdate=${#temporals.format(sri.faSriEdate, 'yyyy-MM-dd HH:mm')}">
<input type="hidden" id="faSriEdateTime" name="faSriEdate" th:value="${faSriEdate}">
<div class="input-group">
<input type="text" class="form-control form-control-sm faSriEdate" id="faSriEdate" th:value="${#strings.substringBefore(faSriEdate, ' ')}" readonly>
<input type="text" class="form-control form-control-sm faSriEdate timeInputer" id="faSriETime" th:value="${#strings.substringAfter(faSriEdate, ' ')}" placeholder="00:00~24:00">
<input type="text" class="form-control form-control-sm faSriEdate w-60" id="faSriEdate" th:value="${#strings.substringBefore(faSriEdate, ' ')}" readonly>
<input type="text" class="form-control form-control-sm faSriEdate w-40" id="faSriETime" th:value="${#strings.substringAfter(faSriEdate, ' ')}" readonly>
</div>
</div>
</div>