diff --git a/src/main/java/com/dbnt/faisp/main/userInfo/model/UserCareer.java b/src/main/java/com/dbnt/faisp/main/userInfo/model/UserCareer.java index 95013370..4e2630f1 100644 --- a/src/main/java/com/dbnt/faisp/main/userInfo/model/UserCareer.java +++ b/src/main/java/com/dbnt/faisp/main/userInfo/model/UserCareer.java @@ -65,6 +65,8 @@ public class UserCareer{ @Column(name = "wrt_dt") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") private LocalDateTime wrtDt; + @Column(name = "in_office_yn") + private String inOfficeYn; @Transient diff --git a/src/main/resources/static/js/police/careerMgt.js b/src/main/resources/static/js/police/careerMgt.js index 85f15886..d92f6536 100644 --- a/src/main/resources/static/js/police/careerMgt.js +++ b/src/main/resources/static/js/police/careerMgt.js @@ -111,6 +111,7 @@ $(document).on('change', '#positionCheckBox', function (){ $(document).on('click', '#saveBtn', function (){ if(checkValue()){ contentFade("in"); + document.getElementById("endDate").disabled = false; const formData = new FormData($("#careerForm")[0]); $.ajax({ type : 'POST', @@ -205,3 +206,30 @@ function checkValue(){ } return flag; } + +$(document).on('change', '#inOfficeYn', function (){ + const today = new Date(); + const year = today.getFullYear(); + const month = ('0' + (today.getMonth() + 1)).slice(-2); + const day = ('0' + today.getDate()).slice(-2); + const dateString = year + '-' + month + '-' + day; + if($("#startDate").val() == ""){ + alert("근무시작일을 입력해주세요"); + $('#startDate').focus(); + this.checked = false; + } + + if(this.checked){ + $(this).attr('value', 'Y'); + $("#endDate").val(dateString); + $("#endDate").attr("disabled",true); + }else{ + $(this).attr('value', 'N'); + $("#endDate").val(''); + $("#endDate").removeAttr("disabled"); + } + console.log($("#inOfficeYn").val()); + + + +}) diff --git a/src/main/resources/templates/police/career/careerFormModal.html b/src/main/resources/templates/police/career/careerFormModal.html index 43b906a1..34ed28b9 100644 --- a/src/main/resources/templates/police/career/careerFormModal.html +++ b/src/main/resources/templates/police/career/careerFormModal.html @@ -67,15 +67,25 @@ +