[BO] 임가현황 작업 중 (10)
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
<div class="layer-wrap" th:fragment="modalFragment">
|
||||
<form autocomplete="off" method="get" name="reqResearcherForm">
|
||||
<input name="page" value="0" type="hidden"/>
|
||||
<input name="size" value="10" type="hidden">
|
||||
|
||||
<div class="component-modal mypage-wrap modal01" data-props-dimm-click="true" data-state="close">
|
||||
<div class="modal-dimm"></div>
|
||||
@@ -51,9 +52,7 @@
|
||||
실사
|
||||
</p>
|
||||
</div>
|
||||
<select class="select-list" name="searchArea" id="regionMainCodeSelect" required>
|
||||
<option value="" disabled hidden>선택해주세요.</option>
|
||||
<option value="" selected>전체</option>
|
||||
<select class="select-list" name="regionMainCode" id="regionMainCodeSelect" required>
|
||||
<!-- ajax 호출 -->
|
||||
</select>
|
||||
</div>
|
||||
@@ -64,10 +63,10 @@
|
||||
<!-- 버튼 그룹 -->
|
||||
<div class="component-btns">
|
||||
<div class="btns-row">
|
||||
<button type="button" class="btn">
|
||||
<button type="button" class="btn" onclick="goReset();">
|
||||
<span class="btn-txt">초기화</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary">
|
||||
<button type="button" class="btn btn-primary" onclick="getResearchers(0);">
|
||||
<span class="btn-txt">검색</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -75,6 +74,7 @@
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<p class="input-label" style="font-size: 16px;">총 <span id="researcherTotal">0</span>건</p>
|
||||
<!-- 테이블 영역 -->
|
||||
<table>
|
||||
<thead>
|
||||
@@ -88,46 +88,8 @@
|
||||
<th>담당임가 수</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="listTBody">
|
||||
<tr>
|
||||
<td>
|
||||
<div class="component-input">
|
||||
<label class="radio-inner">
|
||||
<input type="radio" id="temp_radio_0001" name="temp_radio_0001">
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
<td>홍길동</td>
|
||||
<td>010-0000-0000</td>
|
||||
<td>서울</td>
|
||||
<td>40</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="component-input">
|
||||
<label class="radio-inner">
|
||||
<input type="radio" id="temp_radio_0002" name="temp_radio_0002">
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
<td>홍길동</td>
|
||||
<td>010-0000-0000</td>
|
||||
<td>서울</td>
|
||||
<td>40</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="component-input">
|
||||
<label class="radio-inner">
|
||||
<input type="radio" id="temp_radio_0003" name="temp_radio_0003">
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
<td>홍길동</td>
|
||||
<td>010-0000-0000</td>
|
||||
<td>서울</td>
|
||||
<td>40</td>
|
||||
</tr>
|
||||
<tbody id="researcherListTbody">
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -136,7 +98,7 @@
|
||||
|
||||
<div class="component-btns bottom-btn-group">
|
||||
<div class="btns-row align-right">
|
||||
<button type="button" class="btn btn-primary">
|
||||
<button type="button" class="btn btn-primary" onclick="setResearcher();">
|
||||
<span class="btn-txt">등록</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -151,6 +113,8 @@
|
||||
</form>
|
||||
|
||||
<script th:inline="javascript">
|
||||
let researcherList = [];
|
||||
|
||||
const showResearcherModal = () => {
|
||||
document.querySelector(".modal01").ui.open();
|
||||
|
||||
@@ -160,7 +124,7 @@
|
||||
{},
|
||||
(response) => {
|
||||
const select = document.getElementById('regionMainCodeSelect');
|
||||
|
||||
select.innerHTML = '<option value="" selected>전체</option>';
|
||||
response.forEach(item => {
|
||||
const option = document.createElement('option');
|
||||
option.value = item.id;
|
||||
@@ -174,8 +138,11 @@
|
||||
'get',
|
||||
'json'
|
||||
);
|
||||
|
||||
getResearchers(document.reqResearcherForm.page.value);
|
||||
}
|
||||
|
||||
// 조사원 리스트 가져오기
|
||||
const getResearchers = (pageNo) => {
|
||||
const f = document.reqResearcherForm;
|
||||
f.page.value = pageNo;
|
||||
@@ -183,31 +150,33 @@
|
||||
let dataOj = $(f).serializeObject();
|
||||
|
||||
ajaxUtil._ajaxMethod(
|
||||
'/api/mapping/researchers',
|
||||
'/api/popupResearchers',
|
||||
dataOj,
|
||||
function (response) {
|
||||
$('#totalElements').text(response.totalElements);
|
||||
$('#researcherTotal').text(response.totalElements);
|
||||
|
||||
researcherList = response.content;
|
||||
|
||||
// List 구성하기
|
||||
const tbody = $('#listTBody');
|
||||
const tbody = $('#researcherListTbody');
|
||||
tbody.empty();
|
||||
|
||||
$(response.content).each((idx, ct) => {
|
||||
tbody.append(
|
||||
`
|
||||
<!-- <tr>-->
|
||||
<!-- <td>-->
|
||||
<!-- <div class="component-input">-->
|
||||
<!-- <label class="radio-inner">-->
|
||||
<!-- <input type="radio" id="temp_radio_0003" name="temp_radio_0003">-->
|
||||
<!-- </label>-->
|
||||
<!-- </div>-->
|
||||
<!-- </td>-->
|
||||
<!-- <td>홍길동</td>-->
|
||||
<!-- <td>010-0000-0000</td>-->
|
||||
<!-- <td>서울</td>-->
|
||||
<!-- <td>40</td>-->
|
||||
<!-- </tr>-->
|
||||
<tr>
|
||||
<td>
|
||||
<div class="component-input">
|
||||
<label class="radio-inner">
|
||||
<input type="radio" id="temp_radio_000${ct.adminSeq}" name="adminSeq" value="${ct.adminSeq}">
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
<td>${ct.name}</td>
|
||||
<td>${ifNullHyphen(ct.phone)}</td>
|
||||
<td>${ct.regionMainName}</td>
|
||||
<td>${ct.householdCount}</td>
|
||||
</tr>
|
||||
`
|
||||
);
|
||||
});
|
||||
@@ -227,7 +196,7 @@
|
||||
uiUtil.getPagingUI(pageNo, f.size.value, response.totalPages,
|
||||
(movePageNo) => {
|
||||
f.page.value = movePageNo;
|
||||
goSearch();
|
||||
getResearchers();
|
||||
}));
|
||||
|
||||
},
|
||||
@@ -240,5 +209,37 @@
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
const setResearcher = () => {
|
||||
const selectedAdminSeq = $('input[name="adminSeq"]:checked').val();
|
||||
|
||||
if (!selectedAdminSeq) {
|
||||
alert("조사원을 선택해주세요.");
|
||||
return;
|
||||
}
|
||||
|
||||
const selectedResearcher = researcherList.find(r => r.adminSeq == selectedAdminSeq);
|
||||
|
||||
console.log("선택된 조사원 : ", selectedResearcher);
|
||||
|
||||
// import 해준 html 에서 아래 함수를 선언해주면 selectedResearcher 값을 사용할 수 있음.
|
||||
getSelectedResearcher(selectedResearcher, () => {
|
||||
document.querySelector(".modal01").ui.close();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
const goReset = () => {
|
||||
const f = document.reqResearcherForm;
|
||||
|
||||
f.searchField.value = "";
|
||||
f.searchValue.value = "";
|
||||
f.regionMainCode.value = "";
|
||||
|
||||
getResearchers(0);
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</html>
|
||||
Reference in New Issue
Block a user