瀏覽代碼

code sync

TonyKang 3 年之前
父節點
當前提交
5ae390d9f0
共有 3 個文件被更改,包括 8 次插入7 次删除
  1. 1 1
      app/controller/report_controller.js
  2. 1 0
      app/public/report/js/rpt_print.js
  3. 6 6
      app/view/report/rpt_individual.ejs

+ 1 - 1
app/controller/report_controller.js

@@ -343,7 +343,7 @@ module.exports = app => {
                 const pageSize = ctx.params.size;
                 // console.log('pageSize: ' + pageSize);
                 const renderData = {
-                    size: 'A4',
+                    size: pageSize,
                     // orientation: params.orientation,
                 };
                 await ctx.render('report/rpt_individual.ejs', renderData);

+ 1 - 0
app/public/report/js/rpt_print.js

@@ -125,6 +125,7 @@ let rptPrintHelper = {
         replace_key_params['KEY_桩号及工程部位'] = '现场收方_桩号1';
         replace_key_params['KEY_设计工程数量'] = '168668.88';
         sessionStorage.replace_key_params = JSON.stringify(replace_key_params);
+        sessionStorage.rpt_name = '现场收方表';
         window.open('/individualReport/A4');
     },
     buildSvgArr: function (pagesData, actAreaArr, offsetX, offsetY, closeWaterMark) {

+ 6 - 6
app/view/report/rpt_individual.ejs

@@ -101,6 +101,7 @@
     let currentPageRst = null;
     let currentDownloadUrl = null;
     let currentDownloadIdx = 0;
+    let currentReportName = '奉建项目现场收方单';
 
     dynamicLoadJs('/public/jspdf/Arial Narrow-normal.js');
     dynamicLoadJs('/public/jspdf/Arial Narrow-bold.js');
@@ -109,11 +110,10 @@
 
     function pageLoading() {
         let req_params = JSON.parse(sessionStorage.req_params);
+        currentReportName = sessionStorage.rpt_name;
         let params = {};
-         params.rpt_tpl_id = req_params.rpt_tpl_id;
-//        params.rpt_tpl_id = 1784;
-         params.pageSize = PAGE_SIZE;
-//        params.pageSize = 'A4';
+        params.rpt_tpl_id = req_params.rpt_tpl_id;
+        params.pageSize = PAGE_SIZE;
         params.project_id = req_params.project_id;
         params.tender_id = req_params.tender_id;
         params.stage_id = req_params.stage_id;
@@ -203,7 +203,7 @@
         //导出EXCEL(excel方式在处理二维码时会有问题,不合适,放弃)
         if (currentPageRst) {
             let params = {};
-            params.rptNames = ['奉建项目现场收方单'];
+            params.rptNames = [currentReportName];
             params.pageData = [currentPageRst];
             CommonAjax.postXsrfEx("/tender/report_api/getDirectReport", params, WAIT_TIME_EXPORT, true, getCookie('csrfToken_j'), function(result){
                     if (result) {
@@ -254,7 +254,7 @@
             pdfFont['SmartSimsun'].push(fontProperty);
         }
         if (pdfFont['SmartSimsun'].length === 2) {
-            JpcJsPDFHelper.outputAsPdf(currentPageRst, 'A4', '奉建项目现场收方单', null, null);
+            JpcJsPDFHelper.outputAsPdf(currentPageRst, PAGE_SIZE, currentReportName, null, null);
         }
     }