From 32eaa08b2f9afd201ba2fdd41598b75bb350b777 Mon Sep 17 00:00:00 2001 From: TaehunPark Date: Sat, 28 Jan 2023 10:47:44 +0900 Subject: [PATCH] =?UTF-8?q?fix=20:=20=EC=99=B8=EC=82=AC=EA=B2=BD=EC=B0=B0?= =?UTF-8?q?=20=EA=B2=BD=EB=A0=A5=20=ED=98=84=EC=9E=AC=EC=9E=AC=EC=A7=81?= =?UTF-8?q?=EC=A4=91=20=EC=B6=94=EA=B0=80=20=EC=88=98=EC=A0=95=EC=82=AC?= =?UTF-8?q?=ED=95=AD=2060=EB=B2=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../faisp/main/userInfo/model/UserCareer.java | 2 ++ .../resources/static/js/police/careerMgt.js | 28 +++++++++++++++++++ .../police/career/careerFormModal.html | 20 +++++++++---- 3 files changed, 45 insertions(+), 5 deletions(-) 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 @@ +
- -
-
- - + +
+
+
+ + +
+
+
+ + +
+
+