|
@@ -8,6 +8,8 @@ const NEXT_PAGE_OFFSET = 160;
|
|
|
const FIRST_PAGE_OFFSET = 50;
|
|
const FIRST_PAGE_OFFSET = 50;
|
|
|
const LAST_PAGE_OFFSET = 60;
|
|
const LAST_PAGE_OFFSET = 60;
|
|
|
|
|
|
|
|
|
|
+const WAIT_TIME_EXPORT = 12000;
|
|
|
|
|
+
|
|
|
let fontSuffixMapObj = {"表标题": "title", "列标题": "column", "正文内容": "content", "合计": "summary", "表眉/表脚": "header_footer"};
|
|
let fontSuffixMapObj = {"表标题": "title", "列标题": "column", "正文内容": "content", "合计": "summary", "表眉/表脚": "header_footer"};
|
|
|
|
|
|
|
|
let rptTplObj = {
|
|
let rptTplObj = {
|
|
@@ -17,6 +19,7 @@ let rptTplObj = {
|
|
|
if (!me.hasInitialized) {
|
|
if (!me.hasInitialized) {
|
|
|
zTreeOprObj.getCustomerCfg();
|
|
zTreeOprObj.getCustomerCfg();
|
|
|
zTreeOprObj.getReportTemplateTree();
|
|
zTreeOprObj.getReportTemplateTree();
|
|
|
|
|
+ zTreeOprObj.selectedPrjIDs = [];
|
|
|
me.hasInitialized = true;
|
|
me.hasInitialized = true;
|
|
|
let canvas = document.getElementById("rptCanvas");
|
|
let canvas = document.getElementById("rptCanvas");
|
|
|
canvas.onclick = canvasOprObj.canvasOnClick;
|
|
canvas.onclick = canvasOprObj.canvasOnClick;
|
|
@@ -35,6 +38,7 @@ let zTreeOprObj = {
|
|
|
defReportPageCfg: null,
|
|
defReportPageCfg: null,
|
|
|
currentPage: 1,
|
|
currentPage: 1,
|
|
|
maxPages: 0,
|
|
maxPages: 0,
|
|
|
|
|
+ selectedPrjIDs: [],
|
|
|
countChkedRptTpl: function () {
|
|
countChkedRptTpl: function () {
|
|
|
let me = zTreeOprObj;
|
|
let me = zTreeOprObj;
|
|
|
if (me.treeObj) {
|
|
if (me.treeObj) {
|
|
@@ -367,8 +371,10 @@ let zTreeOprObj = {
|
|
|
params.rpt_tpl_id = me.currentNode.refId;
|
|
params.rpt_tpl_id = me.currentNode.refId;
|
|
|
params.custCfg = me.reportPageCfg;
|
|
params.custCfg = me.reportPageCfg;
|
|
|
params.prjIds = [];
|
|
params.prjIds = [];
|
|
|
|
|
+ me.selectedPrjIDs = [];
|
|
|
for (let node of nodes) {
|
|
for (let node of nodes) {
|
|
|
params.prjIds.push(node.ID);
|
|
params.prjIds.push(node.ID);
|
|
|
|
|
+ me.selectedPrjIDs.push(node.ID);
|
|
|
}
|
|
}
|
|
|
CommonAjax.postEx("report_api/getBillsSummaryReport", params, 26000, true,
|
|
CommonAjax.postEx("report_api/getBillsSummaryReport", params, 26000, true,
|
|
|
function(result){
|
|
function(result){
|
|
@@ -412,8 +418,10 @@ let zTreeOprObj = {
|
|
|
params.rpt_tpl_id = me.currentNode.refId;
|
|
params.rpt_tpl_id = me.currentNode.refId;
|
|
|
params.custCfg = me.reportPageCfg;
|
|
params.custCfg = me.reportPageCfg;
|
|
|
params.prjIds = [];
|
|
params.prjIds = [];
|
|
|
|
|
+ zTreeOprObj.selectedPrjIDs = [];
|
|
|
for (let node of nodes) {
|
|
for (let node of nodes) {
|
|
|
params.prjIds.push(node.ID);
|
|
params.prjIds.push(node.ID);
|
|
|
|
|
+ zTreeOprObj.selectedPrjIDs.push(node.ID);
|
|
|
}
|
|
}
|
|
|
CommonAjax.postEx("report_api/getGljSummaryReport", params, 26000, true,
|
|
CommonAjax.postEx("report_api/getGljSummaryReport", params, 26000, true,
|
|
|
function(result){
|
|
function(result){
|
|
@@ -448,41 +456,15 @@ let zTreeOprObj = {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
requestSumAndNormalRptForPDF: function () {
|
|
requestSumAndNormalRptForPDF: function () {
|
|
|
- let me = rptControlObj;
|
|
|
|
|
let rpt_names = [], bill_rpt_names = [], glj_rpt_names = [];
|
|
let rpt_names = [], bill_rpt_names = [], glj_rpt_names = [];
|
|
|
let refRptTplIds = [], refBillSumPrjsIds = [], refGljSumPrjsIds = [];
|
|
let refRptTplIds = [], refBillSumPrjsIds = [], refGljSumPrjsIds = [];
|
|
|
- for (let node of zTreeOprObj.checkedRptTplNodes) {
|
|
|
|
|
- if (node.hasOwnProperty('flags') && node.flags.hasOwnProperty('reportType') && node['flags']['reportType'] !== 'NA') {
|
|
|
|
|
- if (node['flags']['reportType'] === 'billSummary') {
|
|
|
|
|
- refBillSumPrjsIds.push(node.refId);
|
|
|
|
|
- bill_rpt_names.push(node.name);
|
|
|
|
|
- } else if (node['flags']['reportType'] === 'gljSummary') {
|
|
|
|
|
- refGljSumPrjsIds.push(node.refId);
|
|
|
|
|
- glj_rpt_names.push(node.name);
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- refRptTplIds.push(node.refId);
|
|
|
|
|
- rpt_names.push(node.name);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- let nodes = zTreeOprObj.prjFolderTreeObj.getCheckedNodes(true);
|
|
|
|
|
- let params = {};
|
|
|
|
|
- params.prj_id = projectObj.project.projectInfo.ID;
|
|
|
|
|
- params.rpt_ids = refRptTplIds;
|
|
|
|
|
- params.rpt_bill_tpl_ids = refBillSumPrjsIds;
|
|
|
|
|
- params.rpt_glj_tpl_ids = refGljSumPrjsIds;
|
|
|
|
|
- params.prjIds = [];
|
|
|
|
|
- for (let node of nodes) {
|
|
|
|
|
- params.prjIds.push(node.ID);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ rptControlObj.getTplIdsCommon(refRptTplIds, refBillSumPrjsIds, refGljSumPrjsIds, rpt_names, bill_rpt_names, glj_rpt_names);
|
|
|
|
|
+ let params = rptControlObj.creatCommonExportParam(refRptTplIds, refBillSumPrjsIds, refGljSumPrjsIds);
|
|
|
params.sum_rpt_names = bill_rpt_names.concat(glj_rpt_names);
|
|
params.sum_rpt_names = bill_rpt_names.concat(glj_rpt_names);
|
|
|
params.rpt_names = rpt_names;
|
|
params.rpt_names = rpt_names;
|
|
|
params.isOneSheet = true;
|
|
params.isOneSheet = true;
|
|
|
- params.pageSize = me.getCurrentPageSize();
|
|
|
|
|
- params.orientation = ((zTreeOprObj.checkedRptTplNodes.length > 1)?null:me.getCurrentOrientation());
|
|
|
|
|
- params.custCfg = zTreeOprObj.reportPageCfg;
|
|
|
|
|
- params.option = "normal";
|
|
|
|
|
- CommonAjax.postEx("report_api/createPdfFiles", params, 120000, true, function(result){
|
|
|
|
|
|
|
+
|
|
|
|
|
+ CommonAjax.postEx("report_api/createPdfFiles", params, WAIT_TIME_EXPORT, true, function(result){
|
|
|
if (result) {
|
|
if (result) {
|
|
|
let uuIdUrls = [];
|
|
let uuIdUrls = [];
|
|
|
for (let uuIdObj of result) {
|
|
for (let uuIdObj of result) {
|
|
@@ -497,41 +479,15 @@ let zTreeOprObj = {
|
|
|
);
|
|
);
|
|
|
},
|
|
},
|
|
|
requestSumAndNormalRptForMultiExcel: function () {
|
|
requestSumAndNormalRptForMultiExcel: function () {
|
|
|
- let me = rptControlObj;
|
|
|
|
|
let rpt_names = [], bill_rpt_names = [], glj_rpt_names = [];
|
|
let rpt_names = [], bill_rpt_names = [], glj_rpt_names = [];
|
|
|
let refRptTplIds = [], refBillSumPrjsIds = [], refGljSumPrjsIds = [];
|
|
let refRptTplIds = [], refBillSumPrjsIds = [], refGljSumPrjsIds = [];
|
|
|
- for (let node of zTreeOprObj.checkedRptTplNodes) {
|
|
|
|
|
- if (node.hasOwnProperty('flags') && node.flags.hasOwnProperty('reportType') && node['flags']['reportType'] !== 'NA') {
|
|
|
|
|
- if (node['flags']['reportType'] === 'billSummary') {
|
|
|
|
|
- refBillSumPrjsIds.push(node.refId);
|
|
|
|
|
- bill_rpt_names.push(node.name);
|
|
|
|
|
- } else if (node['flags']['reportType'] === 'gljSummary') {
|
|
|
|
|
- refGljSumPrjsIds.push(node.refId);
|
|
|
|
|
- glj_rpt_names.push(node.name);
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- refRptTplIds.push(node.refId);
|
|
|
|
|
- rpt_names.push(node.name);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- let nodes = zTreeOprObj.prjFolderTreeObj.getCheckedNodes(true);
|
|
|
|
|
- let params = {};
|
|
|
|
|
- params.prj_id = projectObj.project.projectInfo.ID;
|
|
|
|
|
- params.rpt_ids = refRptTplIds;
|
|
|
|
|
- params.rpt_bill_tpl_ids = refBillSumPrjsIds;
|
|
|
|
|
- params.rpt_glj_tpl_ids = refGljSumPrjsIds;
|
|
|
|
|
- params.prjIds = [];
|
|
|
|
|
- for (let node of nodes) {
|
|
|
|
|
- params.prjIds.push(node.ID);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ rptControlObj.getTplIdsCommon(refRptTplIds, refBillSumPrjsIds, refGljSumPrjsIds, rpt_names, bill_rpt_names, glj_rpt_names);
|
|
|
|
|
+ let params = rptControlObj.creatCommonExportParam(refRptTplIds, refBillSumPrjsIds, refGljSumPrjsIds);
|
|
|
params.sum_rpt_names = bill_rpt_names.concat(glj_rpt_names);
|
|
params.sum_rpt_names = bill_rpt_names.concat(glj_rpt_names);
|
|
|
params.rpt_names = rpt_names;
|
|
params.rpt_names = rpt_names;
|
|
|
params.isOneSheet = true;
|
|
params.isOneSheet = true;
|
|
|
- params.pageSize = me.getCurrentPageSize();
|
|
|
|
|
- params.orientation = ((zTreeOprObj.checkedRptTplNodes.length > 1)?null:me.getCurrentOrientation());
|
|
|
|
|
- params.custCfg = zTreeOprObj.reportPageCfg;
|
|
|
|
|
- params.option = "normal";
|
|
|
|
|
- CommonAjax.postEx("report_api/createExcelFiles", params, 120000, true, function(result){
|
|
|
|
|
|
|
+
|
|
|
|
|
+ CommonAjax.postEx("report_api/createExcelFiles", params, WAIT_TIME_EXPORT, true, function(result){
|
|
|
if (result) {
|
|
if (result) {
|
|
|
let uuIdUrls = [];
|
|
let uuIdUrls = [];
|
|
|
for (let uuIdObj of result) {
|
|
for (let uuIdObj of result) {
|
|
@@ -546,36 +502,13 @@ let zTreeOprObj = {
|
|
|
);
|
|
);
|
|
|
},
|
|
},
|
|
|
requestSumAndNormalRptForAllInOneExcel: function () {
|
|
requestSumAndNormalRptForAllInOneExcel: function () {
|
|
|
- let me = rptControlObj;
|
|
|
|
|
let orgRptName = projectObj.project.projectInfo.name;
|
|
let orgRptName = projectObj.project.projectInfo.name;
|
|
|
let refRptTplIds = [], refBillSumPrjsIds = [], refGljSumPrjsIds = [];
|
|
let refRptTplIds = [], refBillSumPrjsIds = [], refGljSumPrjsIds = [];
|
|
|
- for (let node of zTreeOprObj.checkedRptTplNodes) {
|
|
|
|
|
- if (node.hasOwnProperty('flags') && node.flags.hasOwnProperty('reportType') && node['flags']['reportType'] !== 'NA') {
|
|
|
|
|
- if (node['flags']['reportType'] === 'billSummary') {
|
|
|
|
|
- refBillSumPrjsIds.push(node.refId);
|
|
|
|
|
- } else if (node['flags']['reportType'] === 'gljSummary') {
|
|
|
|
|
- refGljSumPrjsIds.push(node.refId);
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- refRptTplIds.push(node.refId);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- let nodes = zTreeOprObj.prjFolderTreeObj.getCheckedNodes(true);
|
|
|
|
|
- let params = {};
|
|
|
|
|
- params.prj_id = projectObj.project.projectInfo.ID;
|
|
|
|
|
- params.rpt_ids = refRptTplIds;
|
|
|
|
|
- params.rpt_bill_tpl_ids = refBillSumPrjsIds;
|
|
|
|
|
- params.rpt_glj_tpl_ids = refGljSumPrjsIds;
|
|
|
|
|
- params.prjIds = [];
|
|
|
|
|
- for (let node of nodes) {
|
|
|
|
|
- params.prjIds.push(node.ID);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ rptControlObj.getTplIdsCommon(refRptTplIds, refBillSumPrjsIds, refGljSumPrjsIds, null, null, null);
|
|
|
|
|
+ let params = rptControlObj.creatCommonExportParam(refRptTplIds, refBillSumPrjsIds, refGljSumPrjsIds);
|
|
|
params.rptName = orgRptName;
|
|
params.rptName = orgRptName;
|
|
|
- params.pageSize = me.getCurrentPageSize();
|
|
|
|
|
- params.orientation = ((zTreeOprObj.checkedRptTplNodes.length > 1)?null:me.getCurrentOrientation());
|
|
|
|
|
- params.custCfg = zTreeOprObj.reportPageCfg;
|
|
|
|
|
- params.option = "normal";
|
|
|
|
|
- CommonAjax.postEx("report_api/createExcelFilesInOneBook", params, 120000, true, function(result){
|
|
|
|
|
|
|
+
|
|
|
|
|
+ CommonAjax.postEx("report_api/createExcelFilesInOneBook", params, WAIT_TIME_EXPORT, true, function(result){
|
|
|
if (result) {
|
|
if (result) {
|
|
|
let uuIdUrls = [];
|
|
let uuIdUrls = [];
|
|
|
let uuIdUrl = "/report_api/getFileByUUID/" + result.uuid + "/" + stringUtil.replaceAll(result.reportName, "#", "_") + "/xlsx";
|
|
let uuIdUrl = "/report_api/getFileByUUID/" + result.uuid + "/" + stringUtil.replaceAll(result.reportName, "#", "_") + "/xlsx";
|
|
@@ -682,68 +615,55 @@ let rptControlObj = {
|
|
|
//other types if needed.
|
|
//other types if needed.
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- getAllInOneBook_bk: function () {
|
|
|
|
|
- if (zTreeOprObj.checkedRptTplNodes && zTreeOprObj.checkedRptTplNodes.length > 0) {
|
|
|
|
|
- let me = rptControlObj;
|
|
|
|
|
- let orgRptName = projectObj.project.projectInfo.name;
|
|
|
|
|
- let refRptTplIds = [];
|
|
|
|
|
- for (let node of zTreeOprObj.checkedRptTplNodes) {
|
|
|
|
|
|
|
+ getTplIdsCommon: function (refRptTplIds, refBillSumPrjsIds, refGljSumPrjsIds, rpt_names, bill_rpt_names, glj_rpt_names) {
|
|
|
|
|
+ for (let node of zTreeOprObj.checkedRptTplNodes) {
|
|
|
|
|
+ if (node.hasOwnProperty('flags') && node.flags.hasOwnProperty('reportType') && node['flags']['reportType'] !== 'NA') {
|
|
|
|
|
+ if (node['flags']['reportType'] === 'billSummary') {
|
|
|
|
|
+ refBillSumPrjsIds.push(node.refId);
|
|
|
|
|
+ if (bill_rpt_names) bill_rpt_names.push(node.name);
|
|
|
|
|
+ } else if (node['flags']['reportType'] === 'gljSummary') {
|
|
|
|
|
+ refGljSumPrjsIds.push(node.refId);
|
|
|
|
|
+ if (glj_rpt_names) glj_rpt_names.push(node.name);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
refRptTplIds.push(node.refId);
|
|
refRptTplIds.push(node.refId);
|
|
|
|
|
+ if (rpt_names) rpt_names.push(node.name);
|
|
|
}
|
|
}
|
|
|
- let params = {};
|
|
|
|
|
- params.prj_id = projectObj.project.projectInfo.ID;
|
|
|
|
|
- params.rpt_ids = refRptTplIds;
|
|
|
|
|
- params.rptName = orgRptName;
|
|
|
|
|
- params.pageSize = me.getCurrentPageSize();
|
|
|
|
|
- params.orientation = ((zTreeOprObj.checkedRptTplNodes.length > 1)?null:me.getCurrentOrientation());
|
|
|
|
|
- params.custCfg = zTreeOprObj.reportPageCfg;
|
|
|
|
|
- params.option = "normal";
|
|
|
|
|
- CommonAjax.postEx("report_api/createExcelFilesInOneBook", params, 120000, true, function(result){
|
|
|
|
|
- if (result) {
|
|
|
|
|
- let uuIdUrls = [];
|
|
|
|
|
- let uuIdUrl = "/report_api/getFileByUUID/" + result.uuid + "/" + stringUtil.replaceAll(result.reportName, "#", "_") + "/xlsx";
|
|
|
|
|
- uuIdUrls.push(uuIdUrl);
|
|
|
|
|
- downloadReport(uuIdUrls);
|
|
|
|
|
- } else {
|
|
|
|
|
- //
|
|
|
|
|
- }
|
|
|
|
|
- }, null, null
|
|
|
|
|
- );
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ creatCommonExportParam: function (refRptTplIds, refBillSumPrjsIds, refGljSumPrjsIds) {
|
|
|
|
|
+ let nodes = (zTreeOprObj.prjFolderTreeObj === null)?[]:zTreeOprObj.prjFolderTreeObj.getCheckedNodes(true);
|
|
|
|
|
+ let rst = {};
|
|
|
|
|
+ rst.prj_id = projectObj.project.projectInfo.ID;
|
|
|
|
|
+ rst.rpt_ids = refRptTplIds;
|
|
|
|
|
+ rst.rpt_bill_tpl_ids = refBillSumPrjsIds;
|
|
|
|
|
+ rst.rpt_glj_tpl_ids = refGljSumPrjsIds;
|
|
|
|
|
+ rst.prjIds = [];
|
|
|
|
|
+ zTreeOprObj.selectedPrjIDs = [];
|
|
|
|
|
+ for (let node of nodes) {
|
|
|
|
|
+ rst.prjIds.push(node.ID);
|
|
|
|
|
+ zTreeOprObj.selectedPrjIDs.push(node.ID);
|
|
|
|
|
+ }
|
|
|
|
|
+ // rst.sum_rpt_names = bill_rpt_names.concat(glj_rpt_names);
|
|
|
|
|
+ // rst.rpt_names = rpt_names;
|
|
|
|
|
+ // rst.isOneSheet = true;
|
|
|
|
|
+ rst.pageSize = rptControlObj.getCurrentPageSize();
|
|
|
|
|
+ rst.orientation = ((zTreeOprObj.checkedRptTplNodes.length > 1)?null:rptControlObj.getCurrentOrientation());
|
|
|
|
|
+ rst.custCfg = zTreeOprObj.reportPageCfg;
|
|
|
|
|
+ rst.option = "normal";
|
|
|
|
|
+ return rst;
|
|
|
|
|
+ },
|
|
|
getAllInOneBook: function () {
|
|
getAllInOneBook: function () {
|
|
|
if (zTreeOprObj.checkedRptTplNodes && zTreeOprObj.checkedRptTplNodes.length > 0) {
|
|
if (zTreeOprObj.checkedRptTplNodes && zTreeOprObj.checkedRptTplNodes.length > 0) {
|
|
|
let me = rptControlObj;
|
|
let me = rptControlObj;
|
|
|
let orgRptName = projectObj.project.projectInfo.name;
|
|
let orgRptName = projectObj.project.projectInfo.name;
|
|
|
let refRptTplIds = [], refBillSumPrjsIds = [], refGljSumPrjsIds = [];
|
|
let refRptTplIds = [], refBillSumPrjsIds = [], refGljSumPrjsIds = [];
|
|
|
- for (let node of zTreeOprObj.checkedRptTplNodes) {
|
|
|
|
|
- if (node.hasOwnProperty('flags') && node.flags.hasOwnProperty('reportType') && node['flags']['reportType'] !== 'NA') {
|
|
|
|
|
- if (node['flags']['reportType'] === 'billSummary') {
|
|
|
|
|
- refBillSumPrjsIds.push(node.refId);
|
|
|
|
|
- } else if (node['flags']['reportType'] === 'gljSummary') {
|
|
|
|
|
- refGljSumPrjsIds.push(node.refId);
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- refRptTplIds.push(node.refId);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- if (refBillSumPrjsIds.length > 0 || refGljSumPrjsIds.length > 0) {
|
|
|
|
|
- $("#divReqBillSummary")[0].style.display = "none";
|
|
|
|
|
- $("#divReqGljSummary")[0].style.display = "none";
|
|
|
|
|
- $("#divReqCommonSummaryExcel")[0].style.display = "";
|
|
|
|
|
- $("#divReqCommonSummaryMultiExcel")[0].style.display = "none";
|
|
|
|
|
- $("#divReqCommonSummaryPDF")[0].style.display = "none";
|
|
|
|
|
- zTreeOprObj.requestPrjFolderCommon(); //先处理需要汇总的报表,走另外一个分支
|
|
|
|
|
- } else if (refRptTplIds.length > 0) {
|
|
|
|
|
- let params = {};
|
|
|
|
|
- params.prj_id = projectObj.project.projectInfo.ID;
|
|
|
|
|
- params.rpt_ids = refRptTplIds;
|
|
|
|
|
|
|
+ rptControlObj.getTplIdsCommon(refRptTplIds, refBillSumPrjsIds, refGljSumPrjsIds);
|
|
|
|
|
+ if (zTreeOprObj.selectedPrjIDs.length > 0 && (refBillSumPrjsIds.length > 0 || refGljSumPrjsIds.length > 0)) {
|
|
|
|
|
+ let params = rptControlObj.creatCommonExportParam(refRptTplIds, refBillSumPrjsIds, refGljSumPrjsIds);
|
|
|
params.rptName = orgRptName;
|
|
params.rptName = orgRptName;
|
|
|
- params.pageSize = me.getCurrentPageSize();
|
|
|
|
|
- params.orientation = ((zTreeOprObj.checkedRptTplNodes.length > 1)?null:me.getCurrentOrientation());
|
|
|
|
|
- params.custCfg = zTreeOprObj.reportPageCfg;
|
|
|
|
|
- params.option = "normal";
|
|
|
|
|
- CommonAjax.postEx("report_api/createExcelFilesInOneBook", params, 120000, true, function(result){
|
|
|
|
|
|
|
+
|
|
|
|
|
+ CommonAjax.postEx("report_api/createExcelFilesInOneBook", params, WAIT_TIME_EXPORT, true, function(result){
|
|
|
if (result) {
|
|
if (result) {
|
|
|
let uuIdUrls = [];
|
|
let uuIdUrls = [];
|
|
|
let uuIdUrl = "/report_api/getFileByUUID/" + result.uuid + "/" + stringUtil.replaceAll(result.reportName, "#", "_") + "/xlsx";
|
|
let uuIdUrl = "/report_api/getFileByUUID/" + result.uuid + "/" + stringUtil.replaceAll(result.reportName, "#", "_") + "/xlsx";
|
|
@@ -754,76 +674,52 @@ let rptControlObj = {
|
|
|
}
|
|
}
|
|
|
}, null, null
|
|
}, null, null
|
|
|
);
|
|
);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (refBillSumPrjsIds.length > 0 || refGljSumPrjsIds.length > 0) {
|
|
|
|
|
+ $("#divReqBillSummary")[0].style.display = "none";
|
|
|
|
|
+ $("#divReqGljSummary")[0].style.display = "none";
|
|
|
|
|
+ $("#divReqCommonSummaryExcel")[0].style.display = "";
|
|
|
|
|
+ $("#divReqCommonSummaryMultiExcel")[0].style.display = "none";
|
|
|
|
|
+ $("#divReqCommonSummaryPDF")[0].style.display = "none";
|
|
|
|
|
+ zTreeOprObj.requestPrjFolderCommon(); //先处理需要汇总的报表,走另外一个分支
|
|
|
|
|
+ } else if (refRptTplIds.length > 0) {
|
|
|
|
|
+ let params = {};
|
|
|
|
|
+ params.prj_id = projectObj.project.projectInfo.ID;
|
|
|
|
|
+ params.rpt_ids = refRptTplIds;
|
|
|
|
|
+ params.rptName = orgRptName;
|
|
|
|
|
+ params.pageSize = me.getCurrentPageSize();
|
|
|
|
|
+ params.orientation = ((zTreeOprObj.checkedRptTplNodes.length > 1)?null:me.getCurrentOrientation());
|
|
|
|
|
+ params.custCfg = zTreeOprObj.reportPageCfg;
|
|
|
|
|
+ params.option = "normal";
|
|
|
|
|
+ CommonAjax.postEx("report_api/createExcelFilesInOneBook", params, WAIT_TIME_EXPORT, true, function(result){
|
|
|
|
|
+ if (result) {
|
|
|
|
|
+ let uuIdUrls = [];
|
|
|
|
|
+ let uuIdUrl = "/report_api/getFileByUUID/" + result.uuid + "/" + stringUtil.replaceAll(result.reportName, "#", "_") + "/xlsx";
|
|
|
|
|
+ uuIdUrls.push(uuIdUrl);
|
|
|
|
|
+ downloadReport(uuIdUrls);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ //
|
|
|
|
|
+ }
|
|
|
|
|
+ }, null, null
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- getAllIndividualExcelBook_bk: function () {
|
|
|
|
|
- let me = rptControlObj;
|
|
|
|
|
- if (zTreeOprObj.checkedRptTplNodes && zTreeOprObj.checkedRptTplNodes.length > 0) {
|
|
|
|
|
- let rpt_ids = [], rpt_names = [];
|
|
|
|
|
- for (let tplNode of zTreeOprObj.checkedRptTplNodes) {
|
|
|
|
|
- rpt_ids.push(tplNode.refId);
|
|
|
|
|
- rpt_names.push(tplNode.name)
|
|
|
|
|
- }
|
|
|
|
|
- let params = {};
|
|
|
|
|
- params.prj_id = projectObj.project.projectInfo.ID;
|
|
|
|
|
- params.rpt_ids = rpt_ids;
|
|
|
|
|
- params.rpt_names = rpt_names;
|
|
|
|
|
- params.pageSize = me.getCurrentPageSize();
|
|
|
|
|
- params.orientation = ((zTreeOprObj.checkedRptTplNodes.length > 1)?null:me.getCurrentOrientation());
|
|
|
|
|
- params.isOneSheet = true;
|
|
|
|
|
- params.custCfg = zTreeOprObj.reportPageCfg;
|
|
|
|
|
- params.option = "normal";
|
|
|
|
|
- CommonAjax.postEx("report_api/createExcelFiles", params, 120000, true, function(result){
|
|
|
|
|
- if (result) {
|
|
|
|
|
- let uuIdUrls = [];
|
|
|
|
|
- for (let uuIdObj of result) {
|
|
|
|
|
- let uuIdUrl = "/report_api/getFileByUUID/" + uuIdObj.uuid + "/" + stringUtil.replaceAll(uuIdObj.reportName, "#", "_") + "/xlsx";
|
|
|
|
|
- uuIdUrls.push(uuIdUrl);
|
|
|
|
|
- }
|
|
|
|
|
- downloadReport(uuIdUrls);
|
|
|
|
|
- } else {
|
|
|
|
|
- //
|
|
|
|
|
- }
|
|
|
|
|
- }, null, null
|
|
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
getAllIndividualExcelBook: function () {
|
|
getAllIndividualExcelBook: function () {
|
|
|
let me = rptControlObj;
|
|
let me = rptControlObj;
|
|
|
if (zTreeOprObj.checkedRptTplNodes && zTreeOprObj.checkedRptTplNodes.length > 0) {
|
|
if (zTreeOprObj.checkedRptTplNodes && zTreeOprObj.checkedRptTplNodes.length > 0) {
|
|
|
- let refRptTplIds = [], refBillSumPrjsIds = [], refGljSumPrjsIds = [], rpt_names = [];
|
|
|
|
|
- for (let node of zTreeOprObj.checkedRptTplNodes) {
|
|
|
|
|
- if (node.hasOwnProperty('flags') && node.flags.hasOwnProperty('reportType') && node['flags']['reportType'] !== 'NA') {
|
|
|
|
|
- if (node['flags']['reportType'] === 'billSummary') {
|
|
|
|
|
- refBillSumPrjsIds.push(node.refId);
|
|
|
|
|
- } else if (node['flags']['reportType'] === 'gljSummary') {
|
|
|
|
|
- refGljSumPrjsIds.push(node.refId);
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- refRptTplIds.push(node.refId);
|
|
|
|
|
- rpt_names.push(node.name);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (refBillSumPrjsIds.length > 0 || refGljSumPrjsIds.length > 0) {
|
|
|
|
|
- $("#divReqBillSummary")[0].style.display = "none";
|
|
|
|
|
- $("#divReqGljSummary")[0].style.display = "none";
|
|
|
|
|
- $("#divReqCommonSummaryExcel")[0].style.display = "none";
|
|
|
|
|
- $("#divReqCommonSummaryMultiExcel")[0].style.display = "";
|
|
|
|
|
- $("#divReqCommonSummaryPDF")[0].style.display = "none";
|
|
|
|
|
- zTreeOprObj.requestPrjFolderCommon(); //先处理需要汇总的报表,走另外一个分支
|
|
|
|
|
- } else if (refRptTplIds.length > 0) {
|
|
|
|
|
- let params = {};
|
|
|
|
|
|
|
+ let refRptTplIds = [], refBillSumPrjsIds = [], refGljSumPrjsIds = [];
|
|
|
|
|
+ let rpt_names = [], bill_rpt_names = [], glj_rpt_names = [];
|
|
|
|
|
+ rptControlObj.getTplIdsCommon(refRptTplIds, refBillSumPrjsIds, refGljSumPrjsIds, rpt_names, bill_rpt_names, glj_rpt_names);
|
|
|
|
|
+ if (zTreeOprObj.selectedPrjIDs.length > 0 && (glj_rpt_names.length > 0 || bill_rpt_names.length > 0)) {
|
|
|
|
|
+ let params = rptControlObj.creatCommonExportParam(refRptTplIds, refBillSumPrjsIds, refGljSumPrjsIds);
|
|
|
params.prj_id = projectObj.project.projectInfo.ID;
|
|
params.prj_id = projectObj.project.projectInfo.ID;
|
|
|
- params.rpt_ids = refRptTplIds;
|
|
|
|
|
|
|
+ params.sum_rpt_names = bill_rpt_names.concat(glj_rpt_names);
|
|
|
params.rpt_names = rpt_names;
|
|
params.rpt_names = rpt_names;
|
|
|
- params.pageSize = me.getCurrentPageSize();
|
|
|
|
|
- params.orientation = ((zTreeOprObj.checkedRptTplNodes.length > 1)?null:me.getCurrentOrientation());
|
|
|
|
|
params.isOneSheet = true;
|
|
params.isOneSheet = true;
|
|
|
- params.custCfg = zTreeOprObj.reportPageCfg;
|
|
|
|
|
- params.option = "normal";
|
|
|
|
|
- CommonAjax.postEx("report_api/createExcelFiles", params, 120000, true, function(result){
|
|
|
|
|
|
|
+ params.rptName = projectObj.project.projectInfo.name;
|
|
|
|
|
+ CommonAjax.postEx("report_api/createExcelFiles", params, WAIT_TIME_EXPORT, true, function(result){
|
|
|
if (result) {
|
|
if (result) {
|
|
|
let uuIdUrls = [];
|
|
let uuIdUrls = [];
|
|
|
for (let uuIdObj of result) {
|
|
for (let uuIdObj of result) {
|
|
@@ -836,6 +732,38 @@ let rptControlObj = {
|
|
|
}
|
|
}
|
|
|
}, null, null
|
|
}, null, null
|
|
|
);
|
|
);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (refBillSumPrjsIds.length > 0 || refGljSumPrjsIds.length > 0) {
|
|
|
|
|
+ $("#divReqBillSummary")[0].style.display = "none";
|
|
|
|
|
+ $("#divReqGljSummary")[0].style.display = "none";
|
|
|
|
|
+ $("#divReqCommonSummaryExcel")[0].style.display = "none";
|
|
|
|
|
+ $("#divReqCommonSummaryMultiExcel")[0].style.display = "";
|
|
|
|
|
+ $("#divReqCommonSummaryPDF")[0].style.display = "none";
|
|
|
|
|
+ zTreeOprObj.requestPrjFolderCommon(); //先处理需要汇总的报表,走另外一个分支
|
|
|
|
|
+ } else if (refRptTplIds.length > 0) {
|
|
|
|
|
+ let params = {};
|
|
|
|
|
+ params.prj_id = projectObj.project.projectInfo.ID;
|
|
|
|
|
+ params.rpt_ids = refRptTplIds;
|
|
|
|
|
+ params.rpt_names = rpt_names;
|
|
|
|
|
+ params.pageSize = me.getCurrentPageSize();
|
|
|
|
|
+ params.orientation = ((zTreeOprObj.checkedRptTplNodes.length > 1)?null:me.getCurrentOrientation());
|
|
|
|
|
+ params.isOneSheet = true;
|
|
|
|
|
+ params.custCfg = zTreeOprObj.reportPageCfg;
|
|
|
|
|
+ params.option = "normal";
|
|
|
|
|
+ CommonAjax.postEx("report_api/createExcelFiles", params, WAIT_TIME_EXPORT, true, function(result){
|
|
|
|
|
+ if (result) {
|
|
|
|
|
+ let uuIdUrls = [];
|
|
|
|
|
+ for (let uuIdObj of result) {
|
|
|
|
|
+ let uuIdUrl = "/report_api/getFileByUUID/" + uuIdObj.uuid + "/" + stringUtil.replaceAll(uuIdObj.reportName, "#", "_") + "/xlsx";
|
|
|
|
|
+ uuIdUrls.push(uuIdUrl);
|
|
|
|
|
+ }
|
|
|
|
|
+ downloadReport(uuIdUrls);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ //
|
|
|
|
|
+ }
|
|
|
|
|
+ }, null, null
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -857,71 +785,23 @@ let rptControlObj = {
|
|
|
me.getAllIndividualExcelBook();
|
|
me.getAllIndividualExcelBook();
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- getPDF_bk: function() {
|
|
|
|
|
- let me = rptControlObj;
|
|
|
|
|
- if (zTreeOprObj.checkedRptTplNodes && zTreeOprObj.checkedRptTplNodes.length > 0) {
|
|
|
|
|
- let rpt_ids = [], rpt_names = [];
|
|
|
|
|
- for (let tplNode of zTreeOprObj.checkedRptTplNodes) {
|
|
|
|
|
- rpt_ids.push(tplNode.refId);
|
|
|
|
|
- rpt_names.push(tplNode.name)
|
|
|
|
|
- }
|
|
|
|
|
- let params = {};
|
|
|
|
|
- params.prj_id = projectObj.project.projectInfo.ID;
|
|
|
|
|
- params.rpt_ids = rpt_ids;
|
|
|
|
|
- params.rpt_names = rpt_names;
|
|
|
|
|
- params.pageSize = me.getCurrentPageSize();
|
|
|
|
|
- params.orientation = ((zTreeOprObj.checkedRptTplNodes.length > 1)?null:me.getCurrentOrientation());
|
|
|
|
|
- params.custCfg = zTreeOprObj.reportPageCfg;
|
|
|
|
|
- params.option = "normal";
|
|
|
|
|
- CommonAjax.postEx("report_api/createPdfFiles", params, 120000, true, function(result){
|
|
|
|
|
- if (result) {
|
|
|
|
|
- let uuIdUrls = [];
|
|
|
|
|
- for (let uuIdObj of result) {
|
|
|
|
|
- let uuIdUrl = "/report_api/getFileByUUID/" + uuIdObj.uuid + "/" + stringUtil.replaceAll(uuIdObj.reportName, "#", "_") + "/pdf";
|
|
|
|
|
- uuIdUrls.push(uuIdUrl);
|
|
|
|
|
- }
|
|
|
|
|
- downloadReport(uuIdUrls);
|
|
|
|
|
- } else {
|
|
|
|
|
- //
|
|
|
|
|
- }
|
|
|
|
|
- }, null, null
|
|
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
getPDF: function () {
|
|
getPDF: function () {
|
|
|
let me = rptControlObj;
|
|
let me = rptControlObj;
|
|
|
if (zTreeOprObj.checkedRptTplNodes && zTreeOprObj.checkedRptTplNodes.length > 0) {
|
|
if (zTreeOprObj.checkedRptTplNodes && zTreeOprObj.checkedRptTplNodes.length > 0) {
|
|
|
- let refRptTplIds = [], refBillSumPrjsIds = [], refGljSumPrjsIds = [], rpt_names = [];
|
|
|
|
|
- for (let node of zTreeOprObj.checkedRptTplNodes) {
|
|
|
|
|
- if (node.hasOwnProperty('flags') && node.flags.hasOwnProperty('reportType') && node['flags']['reportType'] !== 'NA') {
|
|
|
|
|
- if (node['flags']['reportType'] === 'billSummary') {
|
|
|
|
|
- refBillSumPrjsIds.push(node.refId);
|
|
|
|
|
- } else if (node['flags']['reportType'] === 'gljSummary') {
|
|
|
|
|
- refGljSumPrjsIds.push(node.refId);
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- refRptTplIds.push(node.refId);
|
|
|
|
|
- rpt_names.push(node.name);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (refBillSumPrjsIds.length > 0 || refGljSumPrjsIds.length > 0) {
|
|
|
|
|
- $("#divReqBillSummary")[0].style.display = "none";
|
|
|
|
|
- $("#divReqGljSummary")[0].style.display = "none";
|
|
|
|
|
- $("#divReqCommonSummaryExcel")[0].style.display = "none";
|
|
|
|
|
- $("#divReqCommonSummaryMultiExcel")[0].style.display = "none";
|
|
|
|
|
- $("#divReqCommonSummaryPDF")[0].style.display = "";
|
|
|
|
|
- zTreeOprObj.requestPrjFolderCommon(); //先处理需要汇总的报表,走另外一个分支
|
|
|
|
|
- } else if (refRptTplIds.length > 0) {
|
|
|
|
|
- let params = {};
|
|
|
|
|
|
|
+ let refRptTplIds = [], refBillSumPrjsIds = [], refGljSumPrjsIds = [];
|
|
|
|
|
+ let rpt_names = [], bill_rpt_names = [], glj_rpt_names = [];
|
|
|
|
|
+ rptControlObj.getTplIdsCommon(refRptTplIds, refBillSumPrjsIds, refGljSumPrjsIds, rpt_names, bill_rpt_names, glj_rpt_names);
|
|
|
|
|
+ if (zTreeOprObj.selectedPrjIDs.length > 0 && (glj_rpt_names.length > 0 || bill_rpt_names.length > 0)) {
|
|
|
|
|
+ let params = rptControlObj.creatCommonExportParam();
|
|
|
params.prj_id = projectObj.project.projectInfo.ID;
|
|
params.prj_id = projectObj.project.projectInfo.ID;
|
|
|
|
|
+ params.sum_rpt_names = bill_rpt_names.concat(glj_rpt_names);
|
|
|
params.rpt_ids = refRptTplIds;
|
|
params.rpt_ids = refRptTplIds;
|
|
|
|
|
+ params.rpt_bill_tpl_ids = refBillSumPrjsIds;
|
|
|
|
|
+ params.rpt_glj_tpl_ids = refGljSumPrjsIds;
|
|
|
params.rpt_names = rpt_names;
|
|
params.rpt_names = rpt_names;
|
|
|
- params.pageSize = me.getCurrentPageSize();
|
|
|
|
|
- params.orientation = ((zTreeOprObj.checkedRptTplNodes.length > 1)?null:me.getCurrentOrientation());
|
|
|
|
|
- params.custCfg = zTreeOprObj.reportPageCfg;
|
|
|
|
|
- params.option = "normal";
|
|
|
|
|
- CommonAjax.postEx("report_api/createPdfFiles", params, 120000, true, function(result){
|
|
|
|
|
|
|
+ params.isOneSheet = true;
|
|
|
|
|
+ params.rptName = projectObj.project.projectInfo.name;
|
|
|
|
|
+ CommonAjax.postEx("report_api/createPdfFiles", params, WAIT_TIME_EXPORT, true, function(result){
|
|
|
if (result) {
|
|
if (result) {
|
|
|
let uuIdUrls = [];
|
|
let uuIdUrls = [];
|
|
|
for (let uuIdObj of result) {
|
|
for (let uuIdObj of result) {
|
|
@@ -934,6 +814,37 @@ let rptControlObj = {
|
|
|
}
|
|
}
|
|
|
}, null, null
|
|
}, null, null
|
|
|
);
|
|
);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (refBillSumPrjsIds.length > 0 || refGljSumPrjsIds.length > 0) {
|
|
|
|
|
+ $("#divReqBillSummary")[0].style.display = "none";
|
|
|
|
|
+ $("#divReqGljSummary")[0].style.display = "none";
|
|
|
|
|
+ $("#divReqCommonSummaryExcel")[0].style.display = "none";
|
|
|
|
|
+ $("#divReqCommonSummaryMultiExcel")[0].style.display = "none";
|
|
|
|
|
+ $("#divReqCommonSummaryPDF")[0].style.display = "";
|
|
|
|
|
+ zTreeOprObj.requestPrjFolderCommon(); //先处理需要汇总的报表,走另外一个分支
|
|
|
|
|
+ } else if (refRptTplIds.length > 0) {
|
|
|
|
|
+ let params = {};
|
|
|
|
|
+ params.prj_id = projectObj.project.projectInfo.ID;
|
|
|
|
|
+ params.rpt_ids = refRptTplIds;
|
|
|
|
|
+ params.rpt_names = rpt_names;
|
|
|
|
|
+ params.pageSize = me.getCurrentPageSize();
|
|
|
|
|
+ params.orientation = ((zTreeOprObj.checkedRptTplNodes.length > 1)?null:me.getCurrentOrientation());
|
|
|
|
|
+ params.custCfg = zTreeOprObj.reportPageCfg;
|
|
|
|
|
+ params.option = "normal";
|
|
|
|
|
+ CommonAjax.postEx("report_api/createPdfFiles", params, WAIT_TIME_EXPORT, true, function(result){
|
|
|
|
|
+ if (result) {
|
|
|
|
|
+ let uuIdUrls = [];
|
|
|
|
|
+ for (let uuIdObj of result) {
|
|
|
|
|
+ let uuIdUrl = "/report_api/getFileByUUID/" + uuIdObj.uuid + "/" + stringUtil.replaceAll(uuIdObj.reportName, "#", "_") + "/pdf";
|
|
|
|
|
+ uuIdUrls.push(uuIdUrl);
|
|
|
|
|
+ }
|
|
|
|
|
+ downloadReport(uuIdUrls);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ //
|
|
|
|
|
+ }
|
|
|
|
|
+ }, null, null
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|