Browse Source

支付审批调整

Tony Kang 1 year ago
parent
commit
f6bc6c2407
1 changed files with 7 additions and 2 deletions
  1. 7 2
      app/service/jpc_report.js

+ 7 - 2
app/service/jpc_report.js

@@ -237,9 +237,14 @@ module.exports = app => {
                 setupSomeDftCustomizeCfg(rptTpl);
                 printCom.initialize(rptTpl);
                 printCom.analyzeData(ctx.helper, rptTpl, tplData, defProperties, JV.PAGING_OPTION_NORMAL, JV.OUTPUT_TYPE_NORMAL, customSelect, []);
-                //
+                const maxPages = printCom.totalPages;
                 let pageRst = null;
-                pageRst = printCom.outputAsSimpleJSONPageArray(ctx.helper, rptTpl, tplData, 1, 1, defProperties, params.custCfg, customSelect);
+                //
+                if (maxPages > 0) {
+                    pageRst = printCom.outputAsSimpleJSONPageArray(ctx.helper, rptTpl, tplData, 1, 1, defProperties, params.custCfg, customSelect);
+                } else {
+                    pageRst = printCom.outputAsPreviewPage(rptTpl, defProperties);
+                }
                 return pageRst;
             } catch (ex) {
                 console.log('报表数据异常, tender id: ' + params.tender_id);