[BO] 임가현황 - 임가방문정보 작업 중
This commit is contained in:
@@ -380,7 +380,8 @@
|
||||
|
||||
// 현재 로그인한 유저의 역할
|
||||
const isResearcher = f.userRole.value === 'ROLE_RESEARCHER';
|
||||
const colspanLength = isResearcher ? 13 : 15;
|
||||
// const colspanLength = isResearcher ? 13 : 15; <!-- TODO : 2차 오픈 -->
|
||||
const colspanLength = isResearcher ? 10 : 12;
|
||||
|
||||
// 조사원일 경우 조사원이름, 번호 칼럼 hide
|
||||
$('.hide-role-researcher').toggle(!isResearcher);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</div>
|
||||
<div class="modal-content">
|
||||
<div class="modal-content-inner">
|
||||
<table class="type-form">
|
||||
<table class="type-form confirm">
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
@@ -125,6 +125,7 @@
|
||||
// 임가방문정보 모달창 띄우기
|
||||
const showVisitInfoModal = (id) => {
|
||||
const f = document.reqVisitForm;
|
||||
f.householdSeq.value = householdSeq;
|
||||
|
||||
resetForm();
|
||||
|
||||
@@ -177,21 +178,22 @@
|
||||
|
||||
console.log("dataOj", dataOj);
|
||||
|
||||
// ajaxUtil._ajaxMethod(
|
||||
// '/api/visitInfo/create',
|
||||
// JSON.stringify(dataOj),
|
||||
// (response) => { // 성공
|
||||
// alert("등록이 완료되었습니다.");
|
||||
// location.href = '/households';
|
||||
// },
|
||||
// function (code, rstData) {
|
||||
// if(code == 422) alert(rstData.responseText);
|
||||
// if(code == 400) alert(rstData.responseJSON.message); //임가번호 중복체크
|
||||
// },
|
||||
// 'post',
|
||||
// 'json',
|
||||
// { handle422Type: 'alert' }
|
||||
// );
|
||||
ajaxUtil._ajaxMethod(
|
||||
'/api/visitInfo/save',
|
||||
JSON.stringify(dataOj),
|
||||
(response) => { // 성공
|
||||
alert("등록이 완료되었습니다.");
|
||||
document.querySelector(".modal-visit-info").ui.close();
|
||||
getVisitInfo(0);
|
||||
},
|
||||
function (code, rstData) {
|
||||
if(code == 422) alert(rstData.responseText);
|
||||
if(code == 400) alert(rstData.responseJSON.message); //임가번호 중복체크
|
||||
},
|
||||
'post',
|
||||
'json',
|
||||
{ handle422Type: 'alert' }
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -215,11 +217,6 @@
|
||||
datepickerInstance.setDate(new Date(), { render: true });
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(() => {
|
||||
const reqForm = document.reqForm;
|
||||
document.reqVisitForm.householdSeq.value = reqForm.householdSeq.value;
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</html>
|
||||
@@ -10,7 +10,7 @@
|
||||
<h3></h3>
|
||||
<div class="component-btns bottom-btn-group">
|
||||
<div class="btns-row align-right">
|
||||
<button type="button" class="btn small btn-secondary">
|
||||
<button type="button" class="btn small btn-secondary" onclick="goDeleteVisitInfo();">
|
||||
<span class=" btn-txt">삭제</span>
|
||||
</button>
|
||||
<button type="button" class="btn small btn-primary" onclick="showVisitInfoModal();">
|
||||
@@ -68,7 +68,7 @@
|
||||
<td>
|
||||
<div class="component-input">
|
||||
<label class="checkbox-inner">
|
||||
<input type="checkbox" id="temp_checkbox_000${item.id}" name="temp_checkbox_000${item.id}" value="${item.id}">
|
||||
<input type="checkbox" id="removeIds_${item.id}" name="removeIds" value="${item.id}">
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
@@ -93,6 +93,37 @@
|
||||
'json'
|
||||
);
|
||||
}
|
||||
|
||||
// 임가방문정보 삭제
|
||||
const goDeleteVisitInfo = () => {
|
||||
const infoIds = $('input[name=removeIds]:checked');
|
||||
if(infoIds.length <= 0) {
|
||||
alert("임가방문정보를 선택해주세요.");
|
||||
return
|
||||
}
|
||||
|
||||
if(confirm("선택하신 내용을 삭제하시겠습니까? 삭제한 항목은 복구할 수 없습니다.")) {
|
||||
const f = document.reqForm;
|
||||
let dataOj = $(f).serializeObject();
|
||||
|
||||
console.log("dataOj", dataOj);
|
||||
|
||||
ajaxUtil._ajaxMethod(
|
||||
'/api/visitInfo/remove',
|
||||
JSON.stringify(dataOj),
|
||||
(response) => { // 성공
|
||||
alert("방문정보가 삭제되었습니다.");
|
||||
getVisitInfo(0);
|
||||
},
|
||||
function (code, rstData) {
|
||||
if(code == 422) alert(rstData.responseText);
|
||||
},
|
||||
'delete',
|
||||
'json',
|
||||
{ handle422Type: 'alert' }
|
||||
);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</html>
|
||||
@@ -178,6 +178,10 @@
|
||||
</section>
|
||||
|
||||
<section layout:fragment="script">
|
||||
<script th:inline="javascript">
|
||||
const householdSeq = document.reqForm.householdSeq.value;
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// 일계부 완료상태
|
||||
const statusInfoMap = {
|
||||
|
||||
Reference in New Issue
Block a user