Procházet zdrojové kódy

TASK #2493 + 02表组成物提取逻辑调整

TonyKang před 6 roky
rodič
revize
a678844e36

+ 47 - 16
modules/reports/rpt_component/jpc_cross_tab.js

@@ -306,32 +306,63 @@ JpcCrossTabSrv.prototype.createNew = function(){
                 if (hasAdHocRow) rowSplitCnt++;
                 if (hasAdHocCol) colSplitCnt++;
                 //2.2
-                for (let colIdx = 0; colIdx < colSplitCnt; colIdx++) {
-                    pageStatus[JV.STATUS_CROSS_COL_END] = (colIdx === (colSplitCnt - 1));
-                    private_resetBandArea();
-                    counterColRec = orgMaxColRec * colIdx;
-                    let currentSortedContentSequence = me.sortedContentSequence;
-                    let currentSortedColSequence = me.sortedColSequence;
-                    if (hasAdHocCol && colIdx === (colSplitCnt - 1)) {
-                        currentSortedColSequence = null;
-                        currentSortedContentSequence = null;
-                        counterColRec = 0;
-                    }
+                if (rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_CROSS_DISPLAY_ORDER] === JV.PAGE_ORIENTATION_H_FIRST) {
                     for (let rowIdx = 0; rowIdx < rowSplitCnt; rowIdx++) {
                         pageStatus[JV.STATUS_CROSS_ROW_END] = (rowIdx === (rowSplitCnt - 1));
                         private_resetBandArea();
-                        me.pageStatusLst.push(pageStatus.slice(0));
-                        pageIdx++;
                         counterRowRec = orgMaxRowRec * rowIdx;
                         let currentSortedRowSequence = me.sortedRowSequence;
+                        let currentSortedContentSequence = me.sortedContentSequence;
                         if (hasAdHocRow && rowIdx === (rowSplitCnt - 1)) {
                             currentSortedRowSequence = null;
                             currentSortedContentSequence = null;
                             counterRowRec = 0;
                         }
-                        private_addTabValue(me.dispValueIdxLst_Row, currentSortedRowSequence, segIdx, counterRowRec, maxRowRec, me.dispSerialIdxLst_Row, me.col_sum_fields_value_total, me.dispSumValueLst_Col);
-                        private_addTabValue(me.dispValueIdxLst_Col, currentSortedColSequence, segIdx, counterColRec, maxColRec, null, null, null);
-                        private_addContentValue(me.dispValueIdxLst_Content, currentSortedContentSequence, segIdx, counterRowRec, maxRowRec, counterColRec, maxColRec, me.page_seg_map, pageIdx);
+                        for (let colIdx = 0; colIdx < colSplitCnt; colIdx++) {
+                            pageStatus[JV.STATUS_CROSS_COL_END] = (colIdx === (colSplitCnt - 1));
+                            private_resetBandArea();
+                            counterColRec = orgMaxColRec * colIdx;
+                            let currentSortedColSequence = me.sortedColSequence;
+                            if (hasAdHocCol && colIdx === (colSplitCnt - 1)) {
+                                currentSortedColSequence = null;
+                                currentSortedContentSequence = null;
+                                counterColRec = 0;
+                            }
+                            me.pageStatusLst.push(pageStatus.slice(0));
+                            pageIdx++;
+                            private_addTabValue(me.dispValueIdxLst_Row, currentSortedRowSequence, segIdx, counterRowRec, maxRowRec, me.dispSerialIdxLst_Row, me.col_sum_fields_value_total, me.dispSumValueLst_Col);
+                            private_addTabValue(me.dispValueIdxLst_Col, currentSortedColSequence, segIdx, counterColRec, maxColRec, null, null, null);
+                            private_addContentValue(me.dispValueIdxLst_Content, currentSortedContentSequence, segIdx, counterRowRec, maxRowRec, counterColRec, maxColRec, me.page_seg_map, pageIdx);
+                        }
+                    }
+                } else {
+                    for (let colIdx = 0; colIdx < colSplitCnt; colIdx++) {
+                        pageStatus[JV.STATUS_CROSS_COL_END] = (colIdx === (colSplitCnt - 1));
+                        private_resetBandArea();
+                        counterColRec = orgMaxColRec * colIdx;
+                        let currentSortedContentSequence = me.sortedContentSequence;
+                        let currentSortedColSequence = me.sortedColSequence;
+                        if (hasAdHocCol && colIdx === (colSplitCnt - 1)) {
+                            currentSortedColSequence = null;
+                            currentSortedContentSequence = null;
+                            counterColRec = 0;
+                        }
+                        for (let rowIdx = 0; rowIdx < rowSplitCnt; rowIdx++) {
+                            pageStatus[JV.STATUS_CROSS_ROW_END] = (rowIdx === (rowSplitCnt - 1));
+                            private_resetBandArea();
+                            me.pageStatusLst.push(pageStatus.slice(0));
+                            pageIdx++;
+                            counterRowRec = orgMaxRowRec * rowIdx;
+                            let currentSortedRowSequence = me.sortedRowSequence;
+                            if (hasAdHocRow && rowIdx === (rowSplitCnt - 1)) {
+                                currentSortedRowSequence = null;
+                                currentSortedContentSequence = null;
+                                counterRowRec = 0;
+                            }
+                            private_addTabValue(me.dispValueIdxLst_Row, currentSortedRowSequence, segIdx, counterRowRec, maxRowRec, me.dispSerialIdxLst_Row, me.col_sum_fields_value_total, me.dispSumValueLst_Col);
+                            private_addTabValue(me.dispValueIdxLst_Col, currentSortedColSequence, segIdx, counterColRec, maxColRec, null, null, null);
+                            private_addContentValue(me.dispValueIdxLst_Content, currentSortedContentSequence, segIdx, counterRowRec, maxRowRec, counterColRec, maxColRec, me.page_seg_map, pageIdx);
+                        }
                     }
                 }
                 JpcCrossTabHelper.initialPageStatus(pageStatus);

+ 1 - 1
modules/reports/util/rpt_yanghu_data_util.js

@@ -875,7 +875,7 @@ function moveRationData(rationData, rawDataObj) {
         for (let rationGljItem of getActDataArr(rationGljData)) {
             for (let prjGljItem of prjGljData.data.gljList) {
                 if (prjGljItem.id === rationGljItem.projectGLJID) {
-                    if (prjGljItem.ratio_data && prjGljItem.ratio_data.length > 0) {
+                    if (prjGljItem.ratio_data && prjGljItem.ratio_data.length > 0 && !gljUtil.isConcreteType(prjGljItem.type)) {
                         //有组成物
                         for (let comItem of prjGljItem.ratio_data) {
                             let copyItem = {};

+ 1 - 5
public/web/rpt_value_define.js

@@ -21,7 +21,6 @@ const JV = {
     NODE_DETAIL_FIELDS_EX: "从数据指标_拓展集合",
     NODE_BAND_COLLECTION: "布局框_集合",
     NODE_FORMULAS: "计算式_集合",
-    NODE_EVENTS: "事件_集合",
     NODE_DISCRETE_INFO: "离散信息",
     NODE_BILL_INFO: "账单式表_信息",
     NODE_BILL_CONTENT : "账单式表_数据",
@@ -135,6 +134,7 @@ const JV = {
     PROP_FLOW_FIELDS: "flow_field_s",
     PROP_BILL_FIELDS: "bill_field_s",
     PROP_CROSS_FIELDS: "cross_field_s",
+    PROP_CROSS_DISPLAY_ORDER: "cross_display_order",
     PROP_GROUP_FIELDS: "group_field_s", //用来分组的指标(如按清单、定额etc...)
     PROP_GROUP_LINES: "group_lines",    //显示分组行,因分组的特殊性,分组的数据当成流水数据一样(行高相同),group_lines里的每一条数据占用流水的一整行,里面再细分(指标/text)
     PROP_GROUP_SUM_KEYS: "SumKey_S",
@@ -262,10 +262,6 @@ const JV = {
     CAL_TYPE_PERCENTAGE: 0,
     CAL_TYPE_ABSTRACT: 1,
 
-    EVENT_TYPE: ["GRP_ON_CREATE", "FLOW_CONTENT_ON_CREATE"],
-    EVENT_IDX_GRP_ON_CREATE: 0,
-    EVENT_IDX_FLOW_CONTENT_ON_CREATE: 1,
-
     PAGE_ORIENTATION_V_FIRST: 0,
     PAGE_ORIENTATION_H_FIRST: 1,
 

+ 1 - 1
test/unit/reports/test_rpt_test_template.js

@@ -47,7 +47,7 @@ let demoPrjId = - 1;
 // let demoRptId = 68; //01-2
 // let demoRptId = 71; //21-2
 // let demoRptId = 74; //22
-let demoRptId = 81; //02
+let demoRptId = 83; //02
 
 let pagesize = "A4";
 //288: 11-2表(新)