|
|
@@ -8,6 +8,8 @@ const NEXT_PAGE_OFFSET = 160;
|
|
|
const FIRST_PAGE_OFFSET = 50;
|
|
|
const LAST_PAGE_OFFSET = 60;
|
|
|
|
|
|
+const WAIT_TIME_EXPORT = 12000;
|
|
|
+
|
|
|
let fontSuffixMapObj = {"表标题": "title", "列标题": "column", "正文内容": "content", "合计": "summary", "表眉/表脚": "header_footer"};
|
|
|
|
|
|
let rptTplObj = {
|
|
|
@@ -17,6 +19,7 @@ let rptTplObj = {
|
|
|
if (!me.hasInitialized) {
|
|
|
zTreeOprObj.getCustomerCfg();
|
|
|
zTreeOprObj.getReportTemplateTree();
|
|
|
+ zTreeOprObj.selectedPrjIDs = [];
|
|
|
me.hasInitialized = true;
|
|
|
let canvas = document.getElementById("rptCanvas");
|
|
|
canvas.onclick = canvasOprObj.canvasOnClick;
|
|
|
@@ -35,6 +38,7 @@ let zTreeOprObj = {
|
|
|
defReportPageCfg: null,
|
|
|
currentPage: 1,
|
|
|
maxPages: 0,
|
|
|
+ selectedPrjIDs: [],
|
|
|
countChkedRptTpl: function () {
|
|
|
let me = zTreeOprObj;
|
|
|
if (me.treeObj) {
|
|
|
@@ -229,7 +233,7 @@ let zTreeOprObj = {
|
|
|
params.rpt_tpl_id = treeNode.refId;
|
|
|
params.prj_id = projectObj.project.projectInfo.ID;
|
|
|
params.custCfg = me.reportPageCfg;
|
|
|
- me.requestReport(params);
|
|
|
+ me.requestNormalReport(params);
|
|
|
}
|
|
|
me.countChkedRptTpl();
|
|
|
}
|
|
|
@@ -253,13 +257,70 @@ let zTreeOprObj = {
|
|
|
},
|
|
|
changeCfg: function() {
|
|
|
let me = zTreeOprObj;
|
|
|
- let params = {};
|
|
|
- params.pageSize = rptControlObj.getCurrentPageSize();
|
|
|
- params.orientation = rptControlObj.getCurrentOrientation();
|
|
|
- params.rpt_tpl_id = me.currentNode.refId;
|
|
|
- params.prj_id = projectObj.project.projectInfo.ID;
|
|
|
- params.custCfg = me.reportPageCfg;
|
|
|
- me.requestReport(params);
|
|
|
+
|
|
|
+ if (me.currentNode) {
|
|
|
+ if (me.currentNode.hasOwnProperty('flags') && me.currentNode.flags.hasOwnProperty('reportType') && me.currentNode['flags']['reportType'] !== 'NA') {
|
|
|
+ let refRptTplIds = [], refBillSumPrjsIds = [], refGljSumPrjsIds = [];
|
|
|
+ if (me.currentNode['flags']['reportType'] === 'billSummary') {
|
|
|
+ refBillSumPrjsIds.push(me.currentNode.refId);
|
|
|
+ } else if (me.currentNode['flags']['reportType'] === 'gljSummary') {
|
|
|
+ refGljSumPrjsIds.push(me.currentNode.refId);
|
|
|
+ }
|
|
|
+ if (zTreeOprObj.selectedPrjIDs.length > 0) {
|
|
|
+ let params = rptControlObj.creatCommonExportParam(refRptTplIds, refBillSumPrjsIds, refGljSumPrjsIds);
|
|
|
+ params.pageSize = rptControlObj.getCurrentPageSize();
|
|
|
+ params.orientation = rptControlObj.getCurrentOrientation();
|
|
|
+ params.rpt_ids = refRptTplIds;
|
|
|
+ params.rpt_bill_tpl_ids = refBillSumPrjsIds;
|
|
|
+ params.rpt_glj_tpl_ids = refGljSumPrjsIds;
|
|
|
+ params.custCfg = me.reportPageCfg;
|
|
|
+ CommonAjax.postEx("report_api/getMultiReports", params, 10000, true,
|
|
|
+ function(result){
|
|
|
+ hintBox.unWaitBox();
|
|
|
+ let pageRst = result[0];
|
|
|
+ let canvas = document.getElementById("rptCanvas");
|
|
|
+ if (pageRst && pageRst.items && pageRst.items.length > 0) {
|
|
|
+ me.resetAfter(pageRst);
|
|
|
+ me.currentRptPageRst = pageRst;
|
|
|
+ me.maxPages = pageRst.items.length;
|
|
|
+ me.currentPage = 1;
|
|
|
+ me.displayPageValue();
|
|
|
+ let size = JpcCanvasOutput.getReportSizeInPixel(me.currentRptPageRst, getScreenDPI());
|
|
|
+ canvas.width = size[0] + 20;
|
|
|
+ if (size[1] > size[0]) {
|
|
|
+ canvas.height = size[1] + 100;
|
|
|
+ } else {
|
|
|
+ canvas.height = size[1] + 50;
|
|
|
+ }
|
|
|
+ me.showPage(1, canvas);
|
|
|
+ } else {
|
|
|
+ //返回了无数据表
|
|
|
+ JpcCanvasOutput.cleanCanvas(canvas);
|
|
|
+ JpcCanvasOutput.drawPageBorder(me.currentRptPageRst, canvas, getScreenDPI());
|
|
|
+ }
|
|
|
+ }, function(err){
|
|
|
+ hintBox.unWaitBox();
|
|
|
+ }, function(ex){
|
|
|
+ hintBox.unWaitBox();
|
|
|
+ }
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ if (me.currentNode['flags']['reportType'] === 'billSummary') {
|
|
|
+ me.requestPrjFolderForBillsSummary();
|
|
|
+ } else if (me.currentNode['flags']['reportType'] === 'gljSummary') {
|
|
|
+ me.requestPrjFolderForGljSummary();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ let params = {};
|
|
|
+ params.pageSize = rptControlObj.getCurrentPageSize();
|
|
|
+ params.orientation = rptControlObj.getCurrentOrientation();
|
|
|
+ params.rpt_tpl_id = me.currentNode.refId;
|
|
|
+ params.prj_id = projectObj.project.projectInfo.ID;
|
|
|
+ params.custCfg = me.reportPageCfg;
|
|
|
+ me.requestNormalReport(params);
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
resetAfter: function (pageRst) {
|
|
|
let size = pageRst[JV.NODE_PAGE_INFO][JV.NODE_PAGE_SIZE].slice(0);
|
|
|
@@ -271,7 +332,7 @@ let zTreeOprObj = {
|
|
|
document.getElementById("hrefRptOrientation").innerHTML = "横向";
|
|
|
}
|
|
|
},
|
|
|
- requestReport: function (params) {
|
|
|
+ requestNormalReport: function (params) {
|
|
|
let me = zTreeOprObj;
|
|
|
hintBox.waitBox();
|
|
|
CommonAjax.postEx("report_api/getReport", params, 60000, true,
|
|
|
@@ -367,8 +428,10 @@ let zTreeOprObj = {
|
|
|
params.rpt_tpl_id = me.currentNode.refId;
|
|
|
params.custCfg = me.reportPageCfg;
|
|
|
params.prjIds = [];
|
|
|
+ me.selectedPrjIDs = [];
|
|
|
for (let node of nodes) {
|
|
|
params.prjIds.push(node.ID);
|
|
|
+ me.selectedPrjIDs.push(node.ID);
|
|
|
}
|
|
|
CommonAjax.postEx("report_api/getBillsSummaryReport", params, 26000, true,
|
|
|
function(result){
|
|
|
@@ -412,8 +475,10 @@ let zTreeOprObj = {
|
|
|
params.rpt_tpl_id = me.currentNode.refId;
|
|
|
params.custCfg = me.reportPageCfg;
|
|
|
params.prjIds = [];
|
|
|
+ zTreeOprObj.selectedPrjIDs = [];
|
|
|
for (let node of nodes) {
|
|
|
params.prjIds.push(node.ID);
|
|
|
+ zTreeOprObj.selectedPrjIDs.push(node.ID);
|
|
|
}
|
|
|
CommonAjax.postEx("report_api/getGljSummaryReport", params, 26000, true,
|
|
|
function(result){
|
|
|
@@ -448,41 +513,15 @@ let zTreeOprObj = {
|
|
|
}
|
|
|
},
|
|
|
requestSumAndNormalRptForPDF: function () {
|
|
|
- let me = rptControlObj;
|
|
|
let rpt_names = [], bill_rpt_names = [], glj_rpt_names = [];
|
|
|
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.rpt_names = rpt_names;
|
|
|
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) {
|
|
|
let uuIdUrls = [];
|
|
|
for (let uuIdObj of result) {
|
|
|
@@ -497,41 +536,15 @@ let zTreeOprObj = {
|
|
|
);
|
|
|
},
|
|
|
requestSumAndNormalRptForMultiExcel: function () {
|
|
|
- let me = rptControlObj;
|
|
|
let rpt_names = [], bill_rpt_names = [], glj_rpt_names = [];
|
|
|
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.rpt_names = rpt_names;
|
|
|
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) {
|
|
|
let uuIdUrls = [];
|
|
|
for (let uuIdObj of result) {
|
|
|
@@ -546,36 +559,13 @@ let zTreeOprObj = {
|
|
|
);
|
|
|
},
|
|
|
requestSumAndNormalRptForAllInOneExcel: function () {
|
|
|
- let me = rptControlObj;
|
|
|
let orgRptName = projectObj.project.projectInfo.name;
|
|
|
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.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) {
|
|
|
let uuIdUrls = [];
|
|
|
let uuIdUrl = "/report_api/getFileByUUID/" + result.uuid + "/" + stringUtil.replaceAll(result.reportName, "#", "_") + "/xlsx";
|
|
|
@@ -682,68 +672,55 @@ let rptControlObj = {
|
|
|
//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);
|
|
|
+ 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 () {
|
|
|
if (zTreeOprObj.checkedRptTplNodes && zTreeOprObj.checkedRptTplNodes.length > 0) {
|
|
|
let me = rptControlObj;
|
|
|
let orgRptName = projectObj.project.projectInfo.name;
|
|
|
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.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) {
|
|
|
let uuIdUrls = [];
|
|
|
let uuIdUrl = "/report_api/getFileByUUID/" + result.uuid + "/" + stringUtil.replaceAll(result.reportName, "#", "_") + "/xlsx";
|
|
|
@@ -754,76 +731,52 @@ let rptControlObj = {
|
|
|
}
|
|
|
}, 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 () {
|
|
|
let me = rptControlObj;
|
|
|
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.rpt_ids = refRptTplIds;
|
|
|
+ params.sum_rpt_names = bill_rpt_names.concat(glj_rpt_names);
|
|
|
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){
|
|
|
+ params.rptName = projectObj.project.projectInfo.name;
|
|
|
+ CommonAjax.postEx("report_api/createExcelFiles", params, WAIT_TIME_EXPORT, true, function(result){
|
|
|
if (result) {
|
|
|
let uuIdUrls = [];
|
|
|
for (let uuIdObj of result) {
|
|
|
@@ -836,6 +789,38 @@ let rptControlObj = {
|
|
|
}
|
|
|
}, 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 +842,23 @@ let rptControlObj = {
|
|
|
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 () {
|
|
|
let me = rptControlObj;
|
|
|
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.sum_rpt_names = bill_rpt_names.concat(glj_rpt_names);
|
|
|
params.rpt_ids = refRptTplIds;
|
|
|
+ params.rpt_bill_tpl_ids = refBillSumPrjsIds;
|
|
|
+ params.rpt_glj_tpl_ids = refGljSumPrjsIds;
|
|
|
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) {
|
|
|
let uuIdUrls = [];
|
|
|
for (let uuIdObj of result) {
|
|
|
@@ -934,6 +871,37 @@ let rptControlObj = {
|
|
|
}
|
|
|
}, 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
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -1032,16 +1000,7 @@ let rptControlObj = {
|
|
|
);
|
|
|
},
|
|
|
confirmCfgChange: function() {
|
|
|
- let treeNode = zTreeOprObj.currentNode;
|
|
|
- if (treeNode.nodeType === TPL_TYPE_TEMPLATE && treeNode.refId > 0) {
|
|
|
- let params = {};
|
|
|
- params.pageSize = rptControlObj.getCurrentPageSize();
|
|
|
- params.rpt_tpl_id = treeNode.refId;
|
|
|
- params.prj_id = projectObj.project.projectInfo.ID;
|
|
|
- params.custCfg = zTreeOprObj.reportPageCfg;
|
|
|
- zTreeOprObj.requestReport(params);
|
|
|
- }
|
|
|
-
|
|
|
+ zTreeOprObj.changeCfg();
|
|
|
}
|
|
|
};
|
|
|
|