Selaa lähdekoodia

多期汇总表,导出相关

MaiXinRong 4 vuotta sitten
vanhempi
commit
24fae55129

+ 1 - 1
app/const/report.js

@@ -13,10 +13,10 @@ const rptCustomType = {};
 rptCustomType[JV.NODE_CUS_AUDIT_SELECT] = 1;
 rptCustomType[JV.NODE_CUS_GATHER_SELECT] = 2;
 rptCustomType[JV.NODE_CUS_COMPARE_SELECT] = 3;
+rptCustomType[JV.NODE_CUS_STAGE_SELECT] = 4;
 
 const rptDataType = {};
 rptDataType[JV.NODE_CUS_MATERIAL_SELECT] = 1;
-rptDataType[JV.NODE_CUS_STAGE_SELECT] = 2;
 
 module.exports = {
     rptCustomType,

+ 1 - 5
app/controller/report_controller.js

@@ -19,6 +19,7 @@ const RPT_DEF_PROPERTIES = require('../const/report_defined_properties');
 const reportConst = require('../const/report');
 // const stringUtil = require('../public/js/string_util_light');
 const scheduleJob = require('node-schedule');
+const needCustomTables = ['mem_gather_stage_bills', 'mem_gather_deal_bills', 'mem_gather_stage_pay', 'mem_gather_tender_info', 'mem_stage_sum_bills', 'mem_stage_sum_pay'];
 
 module.exports = app => {
     class ReportController extends app.BaseController {
@@ -633,7 +634,6 @@ async function getAllPagesCommon(ctx, rptTpl, params, option, outputType, baseDi
     // console.log(filter.tables);
     const rawDataObj = await ctx.service.report.getReportData(params, filter.tables, filter.memFieldKeys,
         rptTpl[JV.NODE_CUSTOM_DEFINE], customSelect);
-    //await ctx.helper.saveBufferFile(JSON.stringify(rawDataObj, '', '\t'), ctx.app.baseDir + '/mem.json');
     // console.log(rawDataObj);
     try {
         const printCom = JpcEx.createNew();
@@ -679,8 +679,6 @@ async function getAllPagesCommon(ctx, rptTpl, params, option, outputType, baseDi
 }
 
 async function getMultiRptsCommon(ctx, params, outputType, baseDir) {
-    const needCustomTables = ['mem_gather_stage_bills', 'mem_gather_deal_bills', 'mem_gather_stage_pay', 'mem_gather_tender_info'];
-
     for (let idx = 0; idx < params.rpt_ids.length; idx++) {
         params.rpt_ids[idx] = parseInt(params.rpt_ids[idx]); // 转换一下,以防万一
     }
@@ -767,10 +765,8 @@ async function getMultiRptsCommon(ctx, params, outputType, baseDir) {
                         }
                     }
                 }
-                console.log(customSelect);
                 const customRawDataObj = await ctx.service.report.getReportData(params, cfTables, cmFieldKeys,
                     rptTpl[JV.NODE_CUSTOM_DEFINE], customSelect);
-                console.log(customRawDataObj);
                 for (const prop in customRawDataObj) {
                     curRawDataObj[prop] = customRawDataObj[prop];
                 }

+ 0 - 3
app/lib/rpt_data_analysis.js

@@ -1395,9 +1395,7 @@ const stageSelectConverse = {
         const gsDefine = csRela.tplDefine.stage_select;
         if (!gsDefine || !gsDefine.enable || !gsDefine.setting || gsDefine.setting === '') return;
         const gsCustom = csRela.cDefine ? csRela.cDefine.stage_select : null;
-        console.log(gsCustom[0]);
 
-        console.log(data.mem_stage_sum_bills[0]);
         for (const t of options.table) {
             switch (t) {
                 case 'mem_stage_sum_bills':
@@ -1407,7 +1405,6 @@ const stageSelectConverse = {
                     break;
             }
         }
-        console.log(data.mem_stage_sum_bills[0]);
     }
 };
 

+ 12 - 12
app/public/report/js/rpt_custom.js

@@ -533,27 +533,27 @@ const rptCustomObj = (function () {
             const gather_select = customSelects.gather_select.find(function (x) {
                 return x.id === rptId;
             });
+            const stage_select = customSelects.stage_select.find(function (x) {
+                return x.id === rptId;
+            });
             if (gather_select && gather_select.custom_define && gather_select.custom_define[sGatherSelect].enable) {
+                const data = {};
                 if (rptId === currentRptId) {
-                    params.customSelect.push(gather_select[sGatherSelect]);
+                    data[sGatherSelect] = gather_select[sGatherSelect];
                 } else {
                     const chkNode = chkNodes.find(function (x) { return x.refId === rptId});
-                    params.customSelect.push(await comfirmSelectPromise(chkNode ? chkNode.name : '', gather_select));
+                    data[sGatherSelect] = await comfirmSelectPromise(chkNode ? chkNode.name : '', gather_select);
                 }
-            } else {
-                params.customSelect.push(null);
-            }
-
-            const stage_select = customSelects.stage_select.find(function (x) {
-                return x.id === rptId;
-            });
-            if (stage_select && stage_select.custom_define && stage_select.custom_define[sStageSelect].enable) {
+                params.customSelect.push(data);
+            } else if (stage_select && stage_select.custom_define && stage_select.custom_define[sStageSelect].enable) {
+                const data = {};
                 if (rptId === currentRptId) {
-                    params.customSelect.push(stage_select[sStageSelect]);
+                    data[sStageSelect] = stage_select[sStageSelect];
                 } else {
                     const chkNode = chkNodes.find(function (x) { return x.refId === rptId});
-                    params.customSelect.push(await comfirmSelectPromise(chkNode ? chkNode.name : '', stage_select));
+                    data[sStageSelect] = await comfirmSelectPromise(chkNode ? chkNode.name : '', stage_select);
                 }
+                params.customSelect.push(data);
             } else {
                 params.customSelect.push(null);
             }

+ 0 - 1
app/reports/util/rpt_calculation_data_util.js

@@ -221,7 +221,6 @@ class Rpt_Data_Extractor {
 
         // console.log(rawDataObj);
         setupFunc($PROJECT.REPORT, rawDataObj, baseDir);
-
         if (tpl[JV.NODE_MAP_DATA_HANDLE_INFO]) {
             for (const preHandle of tpl[JV.NODE_MAP_DATA_HANDLE_INFO]) {
                 const srcData = getModuleDataByKey(rawDataObj.prjData, preHandle[JV.PROP_DATA_KEY]);