[BO] 임가현황 - 엑셀 다운로드 작업 중 (3)
This commit is contained in:
@@ -136,6 +136,15 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-btns bottom-btn-group">
|
||||
<div class="btns-row align-right">
|
||||
<div class="btns-col-2">
|
||||
<button type="button" class="btn" onclick="goExcel();">
|
||||
<span class="btn-txt">엑셀 다운로드 <i class="ico-download" aria-hidden="true"></i></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div class="component-input sms-check" th:if="${loginUserRoles.id == 'ROLE_ADMIN'}">
|
||||
<label class="switch-inner">
|
||||
@@ -446,6 +455,11 @@
|
||||
{ handle422Type: 'alert' }
|
||||
);
|
||||
}
|
||||
|
||||
// 엑셀 다운로드
|
||||
const goExcel = () => {
|
||||
excelDownload('/api/dashboard/chart/excel', null);
|
||||
}
|
||||
</script>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -275,7 +275,7 @@
|
||||
<button type="button" class="btn" onclick="showExcelHouseholdModal();">
|
||||
<span class="btn-txt">엑셀 업로드 <i class="ico-download ico-small" aria-hidden="true"></i></span>
|
||||
</button>
|
||||
<button type="button" class="btn" onclick="goExcel();">
|
||||
<button type="button" class="btn" onclick="showExcelDownloadModal();">
|
||||
<span class="btn-txt">엑셀 다운로드 <i class="ico-download ico-small" aria-hidden="true"></i></span>
|
||||
</button>
|
||||
<!-- 관리자만 노출 -->
|
||||
@@ -294,6 +294,7 @@
|
||||
|
||||
<div th:replace="common/modal-researcher-mapping :: modalFragment"></div>
|
||||
<div th:replace="households/modal/modal-excel-household :: modalFragment"></div>
|
||||
<div th:replace="households/modal/modal-excel-download :: modalFragment"></div>
|
||||
</section>
|
||||
|
||||
<section layout:fragment="script">
|
||||
@@ -484,24 +485,6 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// 엑셀 다운로드
|
||||
const goExcel = () => {
|
||||
const url = '/api/excel/household';
|
||||
const f = document.reqForm;
|
||||
const data = $(f).serializeObject();
|
||||
|
||||
// 선택된 엑셀 템플릿 파일 항목
|
||||
data.templateType = '';
|
||||
|
||||
if (url !== '') {
|
||||
excelDownload(url, data);
|
||||
} else {
|
||||
console.warn('엑셀 다운르도 경로 없음.');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// 체크박스 전체 선택
|
||||
document.getElementById('checkedAll').addEventListener('change', function () {
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.thymeleaf.org"
|
||||
layout:decorate="~{layout/layout}">
|
||||
|
||||
<div class="layer-wrap" th:fragment="modalFragment">
|
||||
<div class="component-modal mypage-wrap modal01 modal-excel-download" data-props-dimm-click="true" data-state="close">
|
||||
<div class="modal-dimm"></div>
|
||||
<div class="modal-frame">
|
||||
<div class="modal-container type-small">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-tit">
|
||||
엑셀 다운로드
|
||||
</h3>
|
||||
</div>
|
||||
<div class="modal-content">
|
||||
<div class="modal-content-inner">
|
||||
<div class="form-area">
|
||||
<!-- 파일선택 -->
|
||||
<div class="input-group">
|
||||
<div class="input-label">
|
||||
<p class="label-txt">
|
||||
파일선택
|
||||
</p>
|
||||
</div>
|
||||
<div class="component-select">
|
||||
<select class="select-list" name="templateType" required>
|
||||
<option value="" disabled hidden selected>선택</option>
|
||||
<option value="HOUSEHOLD">임가목록</option>
|
||||
<option value="DAILY_STATUS">일계부 등록 현황</option>
|
||||
<option value="VISIT">임가방문정보</option>
|
||||
<option value="DAILY_RECORD">일계부 등록 데이터</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="component-btns bottom-btn-group">
|
||||
<div class="btns-row align-right">
|
||||
<button type="button" class="btn btn-primary" onclick="goExcel();">
|
||||
<span class="btn-txt">다운로드</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<button class="modal-close"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// 엑셀 다운로드 팝업 띄우기
|
||||
const showExcelDownloadModal= () => {
|
||||
document.querySelector(".modal-excel-download").ui.open();
|
||||
}
|
||||
|
||||
// 엑셀 다운로드
|
||||
const goExcel = () => {
|
||||
const templateType = $('select[name=templateType]').val();
|
||||
console.log("templateType", templateType);
|
||||
const url = '/api/excel/household';
|
||||
const f = document.reqForm;
|
||||
const data = $(f).serializeObject();
|
||||
|
||||
if(templateType === null) {
|
||||
alert('파일을 선택해주세요.');
|
||||
return;
|
||||
}
|
||||
|
||||
// 선택된 엑셀 템플릿 파일 항목
|
||||
data.templateType = templateType;
|
||||
|
||||
if (url !== '') {
|
||||
excelDownload(url, data);
|
||||
} else {
|
||||
console.warn('엑셀 다운르도 경로 없음.');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</html>
|
||||
@@ -8,7 +8,7 @@
|
||||
<div class="component-modal mypage-wrap modal01 modal-excel-household" data-props-dimm-click="true" data-state="close">
|
||||
<div class="modal-dimm"></div>
|
||||
<div class="modal-frame">
|
||||
<div class="modal-container">
|
||||
<div class="modal-container type-small">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-tit">
|
||||
임가 등록 엑셀업로드
|
||||
|
||||
@@ -603,7 +603,7 @@
|
||||
|
||||
$('#expenseCount').text(data.length);
|
||||
if(data.length === 0) {
|
||||
noDataDaily(tbody, status, 9);
|
||||
noDataDaily(tbody, status, 10);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -158,26 +158,26 @@
|
||||
</div>
|
||||
|
||||
<div class="component-btns bottom-btn-group">
|
||||
<div class="btns-row two-col">
|
||||
<div class="btns-row align-right">
|
||||
<div class="btns-col-1">
|
||||
<button type="button" class="btn" onclick="location.href='/households'">
|
||||
<span class="btn-txt">목록</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="btns-col-2 align-right _excelDownload" th:unless="${activeProfile != 'local'}">
|
||||
<button type="button" class="btn" data-tab-type="daily-record" data-tab-value="tab1" onclick="goExcel(this)">
|
||||
<span class="btn-txt">엑셀 다운로드 <i class="ico-download" aria-hidden="true"></i></span>
|
||||
</button>
|
||||
<button type="button" class="btn" data-tab-type="forest-product" data-tab-value="tab2" onclick="goExcel(this)">
|
||||
<span class="btn-txt">엑셀 다운로드 <i class="ico-download" aria-hidden="true"></i></span>
|
||||
</button>
|
||||
<button type="button" class="btn" data-tab-type="bank-auto-transfer" data-tab-value="tab3" onclick="goExcel(this)">
|
||||
<span class="btn-txt">엑셀 다운로드 <i class="ico-download" aria-hidden="true"></i></span>
|
||||
</button>
|
||||
<button type="button" class="btn" data-tab-type="household-visit" data-tab-value="tab4" onclick="goExcel(this)">
|
||||
<span class="btn-txt">엑셀 다운로드 <i class="ico-download" aria-hidden="true"></i></span>
|
||||
</button>
|
||||
</div>
|
||||
<!-- <div class="btns-col-2 align-right _excelDownload" th:unless="${activeProfile != 'local'}">-->
|
||||
<!-- <button type="button" class="btn" data-tab-type="daily-record" data-tab-value="tab1" onclick="goExcel(this)">-->
|
||||
<!-- <span class="btn-txt">엑셀 다운로드 <i class="ico-download" aria-hidden="true"></i></span>-->
|
||||
<!-- </button>-->
|
||||
<!-- <button type="button" class="btn" data-tab-type="forest-product" data-tab-value="tab2" onclick="goExcel(this)">-->
|
||||
<!-- <span class="btn-txt">엑셀 다운로드 <i class="ico-download" aria-hidden="true"></i></span>-->
|
||||
<!-- </button>-->
|
||||
<!-- <button type="button" class="btn" data-tab-type="bank-auto-transfer" data-tab-value="tab3" onclick="goExcel(this)">-->
|
||||
<!-- <span class="btn-txt">엑셀 다운로드 <i class="ico-download" aria-hidden="true"></i></span>-->
|
||||
<!-- </button>-->
|
||||
<!-- <button type="button" class="btn" data-tab-type="household-visit" data-tab-value="tab4" onclick="goExcel(this)">-->
|
||||
<!-- <span class="btn-txt">엑셀 다운로드 <i class="ico-download" aria-hidden="true"></i></span>-->
|
||||
<!-- </button>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -161,17 +161,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-btns bottom-btn-group">
|
||||
<div class="btns-row two-col">
|
||||
<div class="btns-row align-right">
|
||||
<div class="btns-col-1">
|
||||
<button type="button" class="btn" onclick="location.href='/researcher/researchers'">
|
||||
<span class="btn-txt">목록</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="btns-col-2 align-right" th:unless="${activeProfile != 'local'}">
|
||||
<button type="button" class="btn" onclick="goExcel();">
|
||||
<span class="btn-txt">엑셀 다운로드 <i class="ico-download" aria-hidden="true"></i></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user