엑셀 업로드 오류 분기처리
This commit is contained in:
@@ -215,7 +215,11 @@
|
||||
// }
|
||||
|
||||
function showAdminExcelUploadModal() {
|
||||
const modal = document.querySelector(".modal02");
|
||||
const modal = document.querySelector(".modal-admin-excel");
|
||||
const fileInput = document.getElementById("file");
|
||||
if (fileInput) {
|
||||
fileInput.value = '';
|
||||
}
|
||||
modal.ui.open();
|
||||
|
||||
}
|
||||
@@ -248,17 +252,22 @@
|
||||
alert("총 "+res.total+"건 중에 "+res.success+"건 등록되었습니다.");
|
||||
},
|
||||
statusCode: {
|
||||
422: (res) => {
|
||||
const resJson = res.responseJSON;
|
||||
$(input).parent().find('.invalid-feedback').text(resJson.message);
|
||||
$(input).addClass('is-invalid');
|
||||
400:() => {
|
||||
ajaxUtil._hideWaiting();
|
||||
alert("잘못된 엑셀파일입니다.");
|
||||
document.querySelector(".modal-admin-excel").ui.close();
|
||||
},
|
||||
500: () => {
|
||||
ajaxUtil._hideWaiting();
|
||||
alert("엑셀 업로드에 실패하였습니다.");
|
||||
document.querySelector(".modal-admin-excel").ui.close();
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const closeModal = () => {
|
||||
document.querySelector(".modal02").ui.close();
|
||||
document.querySelector(".modal-admin-excel").ui.close();
|
||||
};
|
||||
</script>
|
||||
</section>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
layout:decorate="~{layout/layout}">
|
||||
|
||||
<div class="layer-wrap" th:fragment="modalFragment">
|
||||
<div class="component-modal modal02" id="test" data-props-dimm-click="true" data-state="close">
|
||||
<div class="component-modal modal01 modal-admin-excel" id="test" data-props-dimm-click="true" data-state="close">
|
||||
<div class="modal-dimm"></div>
|
||||
<div class="modal-frame">
|
||||
<div class="modal-container type-small">
|
||||
|
||||
@@ -40,6 +40,10 @@
|
||||
// 임가방문정보 모달창 띄우기
|
||||
const showExcelHouseholdModal = () => {
|
||||
document.querySelector(".modal-excel-household").ui.open();
|
||||
const fileInput = document.getElementById("householdFile");
|
||||
if (fileInput) {
|
||||
fileInput.value = '';
|
||||
}
|
||||
}
|
||||
|
||||
// 임가방문정보 등록
|
||||
@@ -72,15 +76,19 @@
|
||||
},
|
||||
success(res) {
|
||||
ajaxUtil._hideWaiting(); // 로딩바 hide
|
||||
|
||||
alert("총 "+res.total+"건 중에 "+res.success+"건 등록되었습니다.");
|
||||
document.querySelector(".modal-excel-household").ui.close();
|
||||
},
|
||||
statusCode: {
|
||||
422: (res) => {
|
||||
const resJson = res.responseJSON;
|
||||
$(input).parent().find('.invalid-feedback').text(resJson.message);
|
||||
$(input).addClass('is-invalid');
|
||||
400: () => {
|
||||
ajaxUtil._hideWaiting();
|
||||
alert("잘못된 엑셀파일입니다.");
|
||||
document.querySelector(".modal-excel-household").ui.close();
|
||||
},
|
||||
500: () => {
|
||||
ajaxUtil._hideWaiting();
|
||||
alert("엑셀 업로드에 실패하였습니다.");
|
||||
document.querySelector(".modal-excel-household").ui.close();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user