|
@@ -166,6 +166,7 @@ module.exports = app => {
|
|
|
rptTpl = JSON.parse(rptTpl[0].rpt_content);
|
|
|
// console.log('get the template!');
|
|
|
const customSelect = await ctx.service.rptCustomDefine.getCustomDefine(params.tender_id, params.stage_id, params.rpt_tpl_id);
|
|
|
+ console.log(customSelect);
|
|
|
const pageRst = await getAllPagesCommon(ctx, rptTpl, params, JV.PAGING_OPTION_NORMAL, JV.OUTPUT_TYPE_NORMAL, this.app.baseDir, customSelect);
|
|
|
// console.log(pageRst);
|
|
|
// const roleRel = (params.stage_status === 3) ? (await ctx.service.roleRptRel.getRoleRptRelByDetailIds(params.tender_id, params.rpt_tpl_id)) : [];
|
|
@@ -556,16 +557,13 @@ async function getAllPagesCommon(ctx, rptTpl, params, option, outputType, baseDi
|
|
|
}
|
|
|
const dftOption = params.option || JV.PAGING_OPTION_NORMAL;
|
|
|
printCom.initialize(rptTpl);
|
|
|
- const customDefine = await ctx.service.rptCustomDefine.getDataByCondition({
|
|
|
- tid: params.tender_id, sid: params.stage_id, rid: params.rpt_tpl_id
|
|
|
- });
|
|
|
// ctx.helper
|
|
|
- printCom.analyzeData(ctx.helper, rptTpl, tplData, defProperties, dftOption, outputType, customDefine);
|
|
|
+ printCom.analyzeData(ctx.helper, rptTpl, tplData, defProperties, dftOption, outputType, customSelect);
|
|
|
// console.log(JSON.stringify(rptTpl));
|
|
|
const maxPages = printCom.totalPages;
|
|
|
let pageRst = null;
|
|
|
if (maxPages > 0) {
|
|
|
- pageRst = printCom.outputAsSimpleJSONPageArray(ctx.helper, rptTpl, tplData, 1, maxPages, defProperties, params.custCfg, customDefine);
|
|
|
+ pageRst = printCom.outputAsSimpleJSONPageArray(ctx.helper, rptTpl, tplData, 1, maxPages, defProperties, params.custCfg, customSelect);
|
|
|
} else {
|
|
|
pageRst = printCom.outputAsPreviewPage(rptTpl, defProperties);
|
|
|
}
|
|
@@ -658,11 +656,8 @@ async function getMultiRptsCommon(ctx, params, outputType, baseDir) {
|
|
|
const maxPages = printCom.totalPages;
|
|
|
let pageRst = null;
|
|
|
// console.log(maxPages);
|
|
|
- const customDefine = await ctx.service.rptCustomDefine.getDataByCondition({
|
|
|
- tid: params.tender_id, sid: params.stage_id, rid: params.rpt_tpl_id
|
|
|
- });
|
|
|
if (maxPages > 0) {
|
|
|
- pageRst = printCom.outputAsSimpleJSONPageArray(ctx.helper, rptTpl, tplData, 1, maxPages, defProperties, params.custCfg, customDefine);
|
|
|
+ pageRst = printCom.outputAsSimpleJSONPageArray(ctx.helper, rptTpl, tplData, 1, maxPages, defProperties, params.custCfg, customSelect);
|
|
|
} else {
|
|
|
pageRst = printCom.outputAsPreviewPage(rptTpl, defProperties);
|
|
|
}
|