Explorar o código

审核导不出PDF问题

Tony Kang %!s(int64=2) %!d(string=hai) anos
pai
achega
9f9a3c6690
Modificáronse 1 ficheiros con 15 adicións e 3 borrados
  1. 15 3
      app/view/payment/detail.ejs

+ 15 - 3
app/view/payment/detail.ejs

@@ -166,12 +166,24 @@
             sessionStorage.pageSize = 'A4';
             window.open('/printReport/A4');
         },
+        
+        _getPdfFontCallback: function(fontProperty) {
+            let me = auditRptPrintHelper;
+            if (rptTplObj.pdfFont['SmartSimsun'].indexOf(fontProperty) < 0) {
+                rptTplObj.pdfFont['SmartSimsun'].push(fontProperty);
+            }
+            if (rptTplObj.pdfFont['SmartSimsun'].length >= 2) {
+                $.bootstrapLoading.end();
+                downloadPDFReport([tesRpttData], 'A4', ['测试审核表'], [], [], [-1], []);
+            }
+        },
+
         directPDF: function() {
-            if (rptTplObj.pdfFont['SmartSimsun'].length === 2) {
+            if (rptTplObj.pdfFont['SmartSimsun'].length >= 2) {
                 downloadPDFReport([tesRpttData], 'A4', ['测试审核表'], [], [], [-1], []);
             } else {
-                dynamicLoadJs('https://d2.smartcost.com.cn/cach/SmartSimsun-normal2.js', 'normal', getPdfFontCallback);
-                dynamicLoadJs('https://d2.smartcost.com.cn/cach/SmartSimsun-bold.js', 'bold', getPdfFontCallback);
+                dynamicLoadJs('https://d2.smartcost.com.cn/cach/SmartSimsun-normal2.js', 'normal', this._getPdfFontCallback);
+                dynamicLoadJs('https://d2.smartcost.com.cn/cach/SmartSimsun-bold.js', 'bold', this._getPdfFontCallback);
             }
         },
     };