Selaa lähdekoodia

禁止导出PDF后,excel导出和打印无效的问题

lishihao 2 vuotta sitten
vanhempi
commit
f3a347bb1d
2 muutettua tiedostoa jossa 9 lisäystä ja 1 poistoa
  1. 7 1
      app/controller/report_controller.js
  2. 2 0
      app/public/report/js/rpt_main.js

+ 7 - 1
app/controller/report_controller.js

@@ -501,7 +501,13 @@ module.exports = app => {
             // 原则说明:把所有报表模板集中获取,统一filter,只读一次数据!
             const params = JSON.parse(ctx.request.body.params);
             const pageShow = ctx.session.sessionProject.page_show;
-            if (pageShow !== null && pageShow !== undefined && parseInt(pageShow.closeExportPdf) === 1) {
+            if (pageShow !== null
+                && pageShow !== undefined
+                && params.outputType
+                && ((params.outputType === 'PDF' && parseInt(pageShow.closeExportPdf) === 1)
+                    || (params.outputType === 'Excel' && parseInt(pageShow.closeExportExcel) === 1)
+                )
+            ) {
                 ctx.body = { data: [], signatureRelInfo: [], stageAudit: [] };
                 ctx.status = 201;
                 return;

+ 2 - 0
app/public/report/js/rpt_main.js

@@ -847,6 +847,7 @@ let rptControlObj = {
                 } else {
                     params.needWaterMark = false;
                 }
+                params.outputType = 'Excel';
                 CommonAjax.postXsrfEx("/tender/report_api/getMultiReports", params, WAIT_TIME_EXPORT, true, getCookie('csrfToken_j'),
                     function(result){
                         $.bootstrapLoading.end();
@@ -1006,6 +1007,7 @@ let rptControlObj = {
                 } else {
                     params.needWaterMark = false;
                 }
+                params.outputType = 'PDF';
                 CommonAjax.postXsrfEx("/tender/report_api/getMultiReports", params, WAIT_TIME_EXPORT, true, getCookie('csrfToken_j'),
                     async function(result){
                         // closeWaitingView();