Explorar o código

bill tab code sync

TonyKang %!s(int64=7) %!d(string=hai) anos
pai
achega
1453257707

+ 1 - 0
modules/reports/models/rpt_cfg.js

@@ -1,5 +1,6 @@
 /**
  * Created by Tony on 2017/6/14.
+ * 把报表相关的配置(字体、边框、格式等都放在一条记录中,方便整理,毕竟用户的报表格式基本是固定的,无需怎样调整)
  */
 let mongoose = require('mongoose');
 let Schema = mongoose.Schema;

+ 1 - 0
modules/reports/models/rpt_mapping_field.js

@@ -1,5 +1,6 @@
 /**
  * Created by Tony on 2017/7/11.
+ * 为后台报表模板选择指标用
  */
 let mongoose = require('mongoose');
 let MapFieldSchema = new mongoose.Schema({

+ 1 - 0
modules/reports/models/rpt_template.js

@@ -1,5 +1,6 @@
 /**
  * Created by Tony on 2016/12/23.
+ * 仅仅是存放报表模板的地方,由谁来引用是TreeNodeSchema的事情
  */
 let mongoose = require('mongoose');
 let Schema = mongoose.Schema;

+ 1 - 0
modules/reports/models/tpl_tree_node.js

@@ -1,5 +1,6 @@
 /**
  * Created by Tony on 2017/5/31.
+ * 不同的用户会有一套自己的模板结构列表
  */
 let mongoose = require('mongoose');
 let Schema = mongoose.Schema;

+ 8 - 0
modules/reports/rpt_component/jpc_bill_tab.js

@@ -20,6 +20,14 @@ JpcBillTabSrv.prototype.createNew = function(){
         let me = this;
         JpcFieldHelper.findAndPutDataFieldIdx(rptTpl, rptTpl[JV.NODE_BILL_INFO][JV.NODE_BILL_CONTENT][JV.PROP_BILL_FIELDS], null, me.disp_fields_idx);
     };
+    JpcBillTabResult.paging = function(rptTpl) {
+        let me = this, rst = 0;
+        let detail_fields = rptTpl[JV.NODE_FIELD_MAP][JV.NODE_DETAIL_FIELDS];
+        if (detail_fields && detail_fields.length > 0) {
+            rst = detail_fields[0].length;
+        }
+        return rst;
+    };
     JpcBillTabResult.outputAsSimpleJSONPage = function (rptTpl, dataObj, page, bands, controls, $CURRENT_RPT) {
         let me = this, rst = [], tabRstLst = [];
         //1 calculate the band position

+ 1 - 1
modules/reports/rpt_component/jpc_ex.js

@@ -148,7 +148,7 @@ JpcExSrv.prototype.createNew = function(){
         } else if (me.crossTab) {
             me.totalPages = me.crossTab.preSetupPages(rptTpl, defProperties);
         } else if (me.billTab) {
-            //me.totalPages = billTab.paging();
+            me.totalPages = me.billTab.paging();
         }
     };
     JpcResult.executeFormulas = function(runType, $CURRENT_TEMPLATE, $CURRENT_DATA, $CURRENT_RPT) {