|
@@ -29,8 +29,8 @@ let rptTplObj = {
|
|
dynamicLoadJs('/public/jspdf/Arial Narrow-italic.js');
|
|
dynamicLoadJs('/public/jspdf/Arial Narrow-italic.js');
|
|
dynamicLoadJs('/public/jspdf/Arial Narrow-bolditalic.js');
|
|
dynamicLoadJs('/public/jspdf/Arial Narrow-bolditalic.js');
|
|
|
|
|
|
- dynamicLoadJs('/public/jspdf/SmartSimsun-normal.js');
|
|
|
|
- dynamicLoadJs('/public/jspdf/SmartSimsun-bold.js', me.pdfFontSimsunCallBack);
|
|
|
|
|
|
+ // dynamicLoadJs('/public/jspdf/SmartSimsun-normal.js');
|
|
|
|
+ // dynamicLoadJs('/public/jspdf/SmartSimsun-bold.js', me.pdfFontSimsunCallBack);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
pdfFontSimsunCallBack: function() {
|
|
pdfFontSimsunCallBack: function() {
|
|
@@ -530,6 +530,28 @@ let rptControlObj = {
|
|
me.getAllIndividualExcelBook();
|
|
me.getAllIndividualExcelBook();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ getPdfFontCallback: function(fontProperty) {
|
|
|
|
+ let me = rptControlObj;
|
|
|
|
+ rptTplObj.pdfFont['SmartSimsun'].push(fontProperty);
|
|
|
|
+ if (rptTplObj.pdfFont['SmartSimsun'].length === 2) {
|
|
|
|
+ me.getPDFEx();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ getPDFPre: function () {
|
|
|
|
+ let me = rptControlObj;
|
|
|
|
+ // $.bootstrapLoading.start();
|
|
|
|
+ if (rptTplObj.pdfFont['SmartSimsun'].length === 2) {
|
|
|
|
+ me.getPDFEx();
|
|
|
|
+ } else {
|
|
|
|
+ // dynamicLoadJs('/public/jspdf/SmartSimsun-normal.js');
|
|
|
|
+ // dynamicLoadJs('/public/jspdf/SmartSimsun-bold.js', me.pdfFontSimsunCallBack);
|
|
|
|
+
|
|
|
|
+ dynamicLoadJs('/public/jspdf/SmartSimsun-normal.js',"normal", me.getPdfFontCallback);
|
|
|
|
+ dynamicLoadJs('/public/jspdf/SmartSimsun-bold.js',"bold", me.getPdfFontCallback);
|
|
|
|
+ // dynamicLoadJs('http://d2.smartcost.com.cn/cach/SmartSimsun-normal.js', me.getPdfFontCallback('normal'));
|
|
|
|
+ // dynamicLoadJs('http://d2.smartcost.com.cn/cach/SmartSimsun-bold.js', me.getPdfFontCallback('bold'));
|
|
|
|
+ }
|
|
|
|
+ },
|
|
getPDFEx: function () {
|
|
getPDFEx: function () {
|
|
let me = rptControlObj;
|
|
let me = rptControlObj;
|
|
if (zTreeOprObj.checkedRptTplNodes && zTreeOprObj.checkedRptTplNodes.length > 0) {
|
|
if (zTreeOprObj.checkedRptTplNodes && zTreeOprObj.checkedRptTplNodes.length > 0) {
|
|
@@ -542,6 +564,7 @@ let rptControlObj = {
|
|
delete params.orientation; // 打印时有勾选的话,不需要提供方向
|
|
delete params.orientation; // 打印时有勾选的话,不需要提供方向
|
|
CommonAjax.postXsrfEx("/tender/report_api/getMultiReports", params, 60000, true, getCookie('csrfToken'),
|
|
CommonAjax.postXsrfEx("/tender/report_api/getMultiReports", params, 60000, true, getCookie('csrfToken'),
|
|
function(result){
|
|
function(result){
|
|
|
|
+ // $.bootstrapLoading.end();
|
|
let pageSize = rptControlObj.getCurrentPageSize();
|
|
let pageSize = rptControlObj.getCurrentPageSize();
|
|
for (const signatureRel of result.signatureRelInfo) {
|
|
for (const signatureRel of result.signatureRelInfo) {
|
|
signatureRelArr.push(JSON.parse(signatureRel.rel_content));
|
|
signatureRelArr.push(JSON.parse(signatureRel.rel_content));
|
|
@@ -552,9 +575,11 @@ let rptControlObj = {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
function(failRst){
|
|
function(failRst){
|
|
|
|
+ // $.bootstrapLoading.end();
|
|
console.log(failRst);
|
|
console.log(failRst);
|
|
},
|
|
},
|
|
function(exceptionRst){
|
|
function(exceptionRst){
|
|
|
|
+ // $.bootstrapLoading.end();
|
|
console.log(exceptionRst);
|
|
console.log(exceptionRst);
|
|
}
|
|
}
|
|
);
|
|
);
|
|
@@ -563,6 +588,7 @@ let rptControlObj = {
|
|
let pageSize = rptControlObj.getCurrentPageSize();
|
|
let pageSize = rptControlObj.getCurrentPageSize();
|
|
let pageData = zTreeOprObj.currentRptPageRst;
|
|
let pageData = zTreeOprObj.currentRptPageRst;
|
|
signatureRelArr.push(ROLE_REL_LIST);
|
|
signatureRelArr.push(ROLE_REL_LIST);
|
|
|
|
+ // $.bootstrapLoading.end();
|
|
JpcJsPDFHelper.outputAsPdf(pageData, pageSize, rpt_names[0], signatureRelArr);
|
|
JpcJsPDFHelper.outputAsPdf(pageData, pageSize, rpt_names[0], signatureRelArr);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -687,17 +713,31 @@ function downloadReport(urls) {
|
|
private_download();
|
|
private_download();
|
|
}
|
|
}
|
|
|
|
|
|
-function dynamicLoadJs(url, callback) {
|
|
|
|
|
|
+// function dynamicLoadJs(url, callback) {
|
|
|
|
+// let head = document.getElementsByTagName('head')[0];
|
|
|
|
+// let script = document.createElement('script');
|
|
|
|
+// script.type = 'text/javascript';
|
|
|
|
+// script.src = url;
|
|
|
|
+// if(callback) {
|
|
|
|
+// script.onload = script.onreadystatechange = function () {
|
|
|
|
+// if (!this.readyState || this.readyState === "loaded" || this.readyState === "complete"){
|
|
|
|
+// callback();
|
|
|
|
+// script.onload = script.onreadystatechange = null;
|
|
|
|
+// }
|
|
|
|
+// };
|
|
|
|
+// }
|
|
|
|
+// head.appendChild(script);
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+function dynamicLoadJs(url, type, callback) {
|
|
let head = document.getElementsByTagName('head')[0];
|
|
let head = document.getElementsByTagName('head')[0];
|
|
let script = document.createElement('script');
|
|
let script = document.createElement('script');
|
|
script.type = 'text/javascript';
|
|
script.type = 'text/javascript';
|
|
script.src = url;
|
|
script.src = url;
|
|
if(callback) {
|
|
if(callback) {
|
|
- script.onload = script.onreadystatechange = function () {
|
|
|
|
- if (!this.readyState || this.readyState === "loaded" || this.readyState === "complete"){
|
|
|
|
- callback();
|
|
|
|
- script.onload = script.onreadystatechange = null;
|
|
|
|
- }
|
|
|
|
|
|
+ script.onload = script.onreadystatechange = function (event) {
|
|
|
|
+ callback(type);
|
|
|
|
+ script.onload = script.onreadystatechange = null;
|
|
};
|
|
};
|
|
}
|
|
}
|
|
head.appendChild(script);
|
|
head.appendChild(script);
|