From 5fb15aad7a958edc1488e3cea8e7f29b3a98796f Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Mon, 11 Nov 2024 15:57:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E8=B4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/demandPlan/child/delivery_batch_list.js | 7 ++----- js/demandPlan/child/view_data_list.js | 1 + js/public.js | 7 +++---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/js/demandPlan/child/delivery_batch_list.js b/js/demandPlan/child/delivery_batch_list.js index 3336e86..9b76d34 100644 --- a/js/demandPlan/child/delivery_batch_list.js +++ b/js/demandPlan/child/delivery_batch_list.js @@ -343,9 +343,6 @@ function viewFile(obj) { // 下载文件 function downLoadFile(obj) { console.log(obj); - let params = { - 'fileId': obj.id, - } - let url = dataUrl + "backstage/export/download"; - downLoadFileUtil(url, obj.fileName, JSON.stringify(params)); + let url = dataUrl + "backstage/export/download?fileId=" + obj.id; + downLoadFileUtil(url, obj.fileName, null); } \ No newline at end of file diff --git a/js/demandPlan/child/view_data_list.js b/js/demandPlan/child/view_data_list.js index 7a051fd..5b02243 100644 --- a/js/demandPlan/child/view_data_list.js +++ b/js/demandPlan/child/view_data_list.js @@ -194,6 +194,7 @@ function initTable() { // 设置字体加粗 function setFontBold(value) { + value = value ? value : '/'; return '' + value + ""; } diff --git a/js/public.js b/js/public.js index 68eef1d..adb0279 100644 --- a/js/public.js +++ b/js/public.js @@ -88,9 +88,8 @@ function exportExcelUtil(url, fileName,params) { function downLoadFileUtil(url, fileName,params) { let loadingMsg = layer.msg("文件导出中,请稍候...", { icon: 16, scrollbar: false, time: 0, }); let xhr = new XMLHttpRequest(); - xhr.open("POST", url, true); + xhr.open("GET", url, true); xhr.responseType = "blob"; // 转换流 - xhr.setRequestHeader('Content-Type','application/json;charset=UTF-8') xhr.setRequestHeader("authorization", sessionStorage.getItem("gz-token")); xhr.onload = function () { layer.close(loadingMsg); @@ -101,12 +100,12 @@ function downLoadFileUtil(url, fileName,params) { a.href = url; a.download = fileName; // 文件名 } else { - layer.msg("文件导出中异常,请稍后重试", { icon: 16, scrollbar: false, time: 2000 }); + layer.msg("文件导出异常,请稍后重试", { icon: 16, scrollbar: false, time: 2000 }); } a.click(); window.URL.revokeObjectURL(url); }; - xhr.send(params); + xhr.send(); } // 格式化日对象