Forráskód Böngészése

报表,新增指标

MaiXinRong 5 éve
szülő
commit
3f8457ea7c
2 módosított fájl, 9 hozzáadás és 1 törlés
  1. 3 1
      app/lib/rpt_data_analysis.js
  2. 6 0
      builder_report_index_define.js

+ 3 - 1
app/lib/rpt_data_analysis.js

@@ -371,6 +371,7 @@ const gatherChapter = {
         return [gclChapter, otherChapter, customChapter];
     },
     _getGclChapter: function (chapter, data, field) {
+        console.log(chapter, data, field);
         for (const c of chapter) {
             if (c.filter) {
                 const reg = new RegExp(c.filter);
@@ -394,6 +395,7 @@ const gatherChapter = {
         const gatherRelaFields = function (chapter, source, field) {
             const fields = field instanceof Array ? field : [field];
             for (const f of fields) {
+                console.log(chapter, source);
                 chapter[f.target] = ctx.helper.add(chapter[f.target], source[f.target]);
             }
         };
@@ -417,7 +419,7 @@ const gatherChapter = {
                 }
                 if (rd[rb.key]) {
                     const c = this._getGclChapter(gclChapter, rd, rb.key);
-                    gatherRelaFields(c, rd, rb.fields);
+                    if (c) gatherRelaFields(c, rd, rb.fields);
                 }
             }
         }

+ 6 - 0
builder_report_index_define.js

@@ -779,6 +779,12 @@ const gather_stage_bills = {
         { name: '(特殊3-需替换key3)台账-金额', field: 'ts_key3_tp', type: dataType.currency },
 
         { name: '交叉排序', field: 'cross_index', type: dataType.int },
+
+        { name: '树结构-id', fields: 'id', type: dataType.int },
+        { name: '树结构-父项id', fields: 'pid', type: dataType.int },
+        { name: '树结构-层次', fields: 'level', type: dataType.int },
+        { name: '树结构-排序', fields: 'order', type: dataType.int },
+        { name: '树结构-完整路径', fields: 'full_path', type: dataType.str },
     ],
 };
 const gather_tender_info = {