diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseDoc-main.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseDoc-main.jsp
index cbeace9..53e7626 100644
--- a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseDoc-main.jsp
+++ b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseDoc-main.jsp
@@ -104,8 +104,8 @@
폐기방법 |
업체명 |
폐기건수 |
- 폐기결과보고서 |
- 처리내역및사진 |
+ 폐기결과보고서 |
+ 처리내역및사진 |
처리상태 |
폐기사유 |
폐기구분 |
@@ -373,47 +373,51 @@
return;
}
- $.ajax({
- url: wctx.url("/adds/nims/getHwpForRptDoc.do"),
- data: {
- dscdmngIds : dscdmngIds,
- userId : "${currentUser.account}",
- deptCd: "${currentUser.deptCode}",
- adds12: ADDS12
- },
- xhrFields: { responseType: 'blob' },
- success:(blob, status, xhr) => {
- let disposition = xhr.getResponseHeader('Content-Disposition');
- if(disposition && disposition.indexOf('attachment') !== -1) {
- let filenameRegex = /filename[^;=\n]*=(([']).*?\2|[^;\n]*)/;
- let matches = filenameRegex.exec(disposition);
- if(matches != null && matches[1]) {
- filename = matches[1].replace(/[']/g, '');
- }
- }
- filename = decodeURIComponent(filename);
- if(filename.startsWith("\"")){
- filename = filename.substring(1);
- }
- if(filename.endsWith("\"")){
- filename = filename.substring(0,filename.length - 1);
- }
+ let parameter = toQuery({
+ dscdmngIds : dscdmngIds.join(","),
+ userId : "${currentUser.account}",
+ deptCd: "${currentUser.deptCode}",
+ adds12: ADDS12
+ });
+ fetch(wctx.url("/adds/nims/getHwpForRptDoc.do") + "?" + parameter)
+ .then((response) => {
+ var header = response.headers.get('Content-Disposition');
+ if(!header){
+ response.json().then((responseJson)=>{
+ dialog.alert({
+ content: "파일 생성 중 오류가 발생하였습니다."
+ +"
"
+ +responseJson.description,
+ init: () => { setDialogZindex(); }
+ });
+ });
+ new Error("");
+ }
+ var parts = header.split(';');
+ filename = decodeURIComponent(parts[1].split('=')[1]);
+ if(filename.startsWith("\"")){
+ filename = filename.substring(1);
+ }
+ if(filename.endsWith("\"")){
+ filename = filename.substring(0,filename.length - 1);
+ }
+ return response.blob();
+ })
+ .then((blob) => {
+ let URL0 = (window.URL || window.webkitURL);
+ let downloadUrl = URL0.createObjectURL(blob);
+ let a = document.createElement("a");
+ a.href = downloadUrl;
+ a.download = filename;
+ document.body.appendChild(a);
+ a.click();
+ a.remove();
- let URL0 = (window.URL || window.webkitURL);
- let downloadUrl = URL0.createObjectURL(blob);
- let a = document.createElement("a");
- a.href = downloadUrl;
- a.download = filename;
- document.body.appendChild(a);
- a.click();
- a.remove();
-
- if($("#tbody--${pageName}").find("td input[type='checkbox']:checked").length == 1){
- $P.control.load($P.control.pageNum);
- }
+ if($("#tbody--${pageName}").find("td input[type='checkbox']:checked").length == 1){
+ $P.control.load($P.control.pageNum);
}
-
- });
+ })
+ .catch(()=>{});
};
// 업체 검색 버튼 이벤트