[BO] 임가현황, 조사원현황 엑셀 다운로드 작업 중 (1)
This commit is contained in:
@@ -51,6 +51,7 @@
|
||||
<section>
|
||||
<form autocomplete="off" method="get" name="householdReqForm" th:object="${reqVO}">
|
||||
<input type="hidden" name="currentMonth" th:value="${currentMonth}">
|
||||
<input type="hidden" name="isPaging">
|
||||
|
||||
<div class="component-tab" data-active="tab1">
|
||||
<div class="tab-head">
|
||||
@@ -167,12 +168,9 @@
|
||||
</button>
|
||||
</div>
|
||||
<div class="btns-col-2 align-right" th:unless="${activeProfile != 'local'}">
|
||||
<button type="button" class="btn">
|
||||
<button type="button" class="btn" onclick="goExcel();">
|
||||
<span class="btn-txt">엑셀 다운로드 <i class="ico-download" aria-hidden="true"></i></span>
|
||||
</button>
|
||||
<button type="button" class="btn">
|
||||
<span class="btn-txt">인쇄 <i class="ico-print" aria-hidden="true"></i></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -210,6 +208,7 @@
|
||||
const getHouseholdList = (pageNo) => {
|
||||
const f = document.householdReqForm;
|
||||
f.page.value = pageNo;
|
||||
f.isPaging.value = true;
|
||||
let dataOj = $(f).serializeObject();
|
||||
ajaxUtil._ajaxMethod(
|
||||
'/api/researcher/mappingHouseholdList',
|
||||
@@ -356,15 +355,29 @@
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
function goExcel() {
|
||||
const selectedTab = document.querySelector('.tab-label[aria-selected="true"]');
|
||||
|
||||
let url = '';
|
||||
if (selectedTab.dataset.tabValue === 'tab1') {
|
||||
url = '/api/researcher/mappingHouseholdList/excel';
|
||||
} else if (selectedTab.dataset.tabValue === 'tab2') {
|
||||
url = ''; // 임가방문정보
|
||||
}
|
||||
|
||||
const f = document.householdReqForm;
|
||||
f.isPaging.value = false;
|
||||
|
||||
const data = $(f).serializeObject();
|
||||
|
||||
// size 를 제거하면 전체 목록을 가져온다.
|
||||
delete data.size;
|
||||
|
||||
location.href = '/admin/researchers/excel?' + new URLSearchParams(data).toString();
|
||||
if (url !== '') {
|
||||
location.href = url + '?' + new URLSearchParams(data).toString();
|
||||
} else {
|
||||
console.warn('엑셀 다운르도 경로 없음.')
|
||||
}
|
||||
}
|
||||
|
||||
// 체크박스 선택/해제
|
||||
|
||||
Reference in New Issue
Block a user