Explorar o código

Merge branch 'master' of http://smartcost.f3322.net:3000/SmartCost/ConstructionCost

zhangweicheng %!s(int64=7) %!d(string=hai) anos
pai
achega
1fd00d1ea6

+ 37 - 1
public/stringUtil.js

@@ -227,5 +227,41 @@ module.exports = {
     },
     getPinYinCamelChars: function(value) {
         return pinyin.getCamelChars(value);
+    },
+    formatNumber: function(formatStr, val) {
+        let rst = val;
+        if (formatStr) {
+            if (!(isNaN(parseFloat(val)))) {
+                function comdify(numStr){
+                    let re = /\d{1,3}(?=(\d{3})+$)/g;
+                    return numStr.replace(/^(\d+)((\.\d+)?)$/,function(s,s1,s2){return s1.replace(re,"$&,")+s2;});
+                }
+                let dotIdx = formatStr.indexOf(".");
+                if (dotIdx >= 0) {
+                    let tmpStr = parseFloat(val).toFixed(formatStr.length - dotIdx - 1);
+                    let digStr = formatStr.substr(dotIdx + 1, formatStr.length - dotIdx);
+                    for (let sIdx = digStr.length - 1; sIdx >= 0; sIdx--) {
+                        if (digStr[sIdx] === '#') {
+                            if (tmpStr.length > 0 && tmpStr[tmpStr.length - 1] === '0') {
+                                tmpStr = tmpStr.substr(0, tmpStr.length - 1);
+                            } else {
+                                break;
+                            }
+                        } else {
+                            break;
+                        }
+                    }
+                    if (tmpStr[tmpStr.length - 1] === '.') tmpStr = tmpStr.substr(0, tmpStr.length - 1);
+                    rst = tmpStr;
+                } else {
+                    rst = parseFloat(val).toFixed(0);
+                }
+                let commaIdx = formatStr.indexOf(",");
+                if (commaIdx >= 0) {
+                    rst = comdify(val.toString());
+                }
+            }
+        }
+        return rst;
     }
-};
+}

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

@@ -26,7 +26,9 @@ cfgCacheUtil.setupDftCache();
 let fsUtil = require("../../../public/fsUtil");
 
 let demoPrjId = - 1;
-let demoRptId = 279, pagesize = "A4";
+// let demoRptId = 279;
+let demoRptId = 275; //测试模板-流水式
+let pagesize = "A4";
 //288: 11-2表(新)
 //279: 04
 

+ 22 - 9
web/building_saas/main/js/views/glj_view.js

@@ -560,19 +560,28 @@ var gljOprObj = {
             }
             if (node.sourceType == "ration") {
                 if(node.data.type==rationType.gljRation){
-                    this.showMixRatio(node);
+                    if($('#linkGLJ').hasClass('active')){
+                        this.showMixRatio(node);
+                    }
                 }else {
-                    this.showRationGLJData(node);
-                    installationFeeObj.showRationInstallationData(node);
+                    if($('#linkGLJ').hasClass('active')){
+                        this.showRationGLJData(node);
+                    }
+                    if($('#linkAZZJF').hasClass('active')){
+                        installationFeeObj.showRationInstallationData(node);
+                    }
                 }
                 isShow = true;
             }
             if(node.sourceType == ModuleNames.ration_glj){
-                this.showMixRatio(node);
+                if($('#linkGLJ').hasClass('active')) {
+                    this.showMixRatio(node);
+                }
                 isShow = true;
             }
-
-            this.showQuantityDetailData(node);
+            if($('#linkGCLMX').hasClass('active')){
+                this.showQuantityDetailData(node);
+            }
         } else {
             this.selectedNodeId = null;
         }
@@ -845,9 +854,13 @@ var gljOprObj = {
         }
     },
     clearSheetData: function () {
-        sheetCommonObj.showData(this.sheet, this.setting, []);
-        installationFeeObj.rationInstallSheet.setRowCount(0);//清除combobox cell
-        sheetCommonObj.showData(installationFeeObj.rationInstallSheet, installationFeeObj.rationInstallSetting, []);
+        if($('#linkGLJ').hasClass('active')){
+            sheetCommonObj.showData(this.sheet, this.setting, []);
+        }
+        if($('#linkAZZJF').hasClass('active')){
+            installationFeeObj.rationInstallSheet.setRowCount(0);//清除combobox cell
+            sheetCommonObj.showData(installationFeeObj.rationInstallSheet, installationFeeObj.rationInstallSetting, []);
+        }
         //  sheetCommonObj.showData(this.detailSheet,this.detailSetting,[]);
         this.sheetData = [];
         installationFeeObj.rationInstallData = [];

+ 5 - 3
web/building_saas/main/js/views/project_view.js

@@ -7,7 +7,7 @@ var projectObj = {
     mainSpread: null,
     mainController: null,
     gljSpreed:null,
-    beforeMainTreeSelectedChange: function (node) {
+    beforeMainTreeSelectedChange: function (pre,) {
         /*if (node) {
             subViewObj.saveComments(node);
         }*/
@@ -32,14 +32,16 @@ var projectObj = {
         }
         project.mainTree.preSelected = node;
         projectObj.setNodesStyle(projectObj.mainController.sheet, refreshNodes);
-
-        subViewObj.loadComments(node);
+        if($('#linkComments').hasClass('active')){
+            subViewObj.loadComments(node);
+        }
         gljOprObj.showDataIfRationSelect(node);
         if (activeSubSheetIs(subSheetIndex.ssiCalcProgram)) {
             calcProgramObj.showData(node);
         }
         //zhong 2017-9-1 特征及内容
         if(pageCCOprObj.active){
+            console.log('enterCC');
             pageCCOprObj.mainActiveCell = projectObj.mainSpread.getActiveSheet().getSelections()[0];//mainSpread焦点单元格
             pageCCOprObj.setCacheAndShow(node);
         }

+ 25 - 2
web/building_saas/main/js/views/sub_view.js

@@ -88,7 +88,6 @@ $("#linkZMHS").click(function(){        // 子目换算
     pageCCOprObj.active = false;
     refreshSubSpread();
 
-
     gljOprObj.activeTab='#linkZMHS';
 });
 
@@ -361,4 +360,28 @@ let subViewObj = {
     }
 }
 
-$("#linkComments").click(subViewObj.linkTabClick);
+$("#linkComments").click(subViewObj.linkTabClick);
+
+$('#linkGLJ').on('shown.bs.tab', function () {
+    gljOprObj.showDataIfRationSelect(projectObj.project.mainTree.selected, '111111');
+});
+
+$('#linkZMHS').on('shown.bs.tab', function (e) {
+    if(zmhs_obj.coeSpread == null || zmhs_obj.assSpread == null){
+        zmhs_obj.initSpread();
+    }
+    zmhs_obj.refresh();
+    zmhs_obj.showZMHSData();
+});
+
+$('#linkComments').on('shown.bs.tab', function () {
+    subViewObj.loadComments(projectObj.project.mainTree.selected);
+});
+
+$('#linkGCLMX').on('shown.bs.tab', function () {
+    gljOprObj.showDataIfRationSelect(projectObj.project.mainTree.selected, '111111');
+});
+
+$('#linkAZZJF').on('shown.bs.tab', function () {
+    gljOprObj.showDataIfRationSelect(projectObj.project.mainTree.selected, '111111');
+});

+ 5 - 12
web/building_saas/main/js/views/zmhs_view.js

@@ -70,12 +70,16 @@ let zmhs_obj = {
 
     },
     showAssData:function (node) {
+        this.assSheet.suspendPaint();
+        this.assSheet.suspendEvent();
         let selected = node?node:projectObj.project.mainTree.selected;
         let assList = selected&&selected.data.rationAssList ? selected.data.rationAssList : [];
         this.assSheet.setRowCount(0);
         sheetCommonObj.showData(this.assSheet, this.assSetting, assList);
         this.assSheetData = assList;
         this.assSheet.getRange(assList.length,-1,this.assSheet.getRowCount()-assList.length, -1, GC.Spread.Sheets.SheetArea.viewport).locked(true);
+        this.assSheet.resumePaint();
+        this.assSheet.resumeEvent();
 
     },
     refresh:function () {
@@ -83,7 +87,7 @@ let zmhs_obj = {
         this.assSpread?this.assSpread.refresh():'';
     },
     showZMHSData:function (node) {
-        if(this.coeSpread&& this.assSpread){
+        if(this.coeSpread&& this.assSpread && $('#linkZMHS').hasClass('active')){
             this.showCoeData(node);
             this.showAssData(node);
             //hide floatingObject
@@ -381,14 +385,3 @@ let zmhs_obj = {
     }
 
 };
-
-
-$(function () {
-    $('#linkZMHS').on('shown.bs.tab', function (e) {
-        if(zmhs_obj.coeSpread == null || zmhs_obj.assSpread == null){
-            zmhs_obj.initSpread();
-        }
-        zmhs_obj.refresh();
-        zmhs_obj.showZMHSData();
-    })
-});

+ 4 - 1
web/building_saas/pm/js/pm_newMain.js

@@ -1186,7 +1186,10 @@ $(document).ready(function() {
 
     // 新增单位工程
     $("#add-tender-confirm").click(function() {
-        AddTender();
+        let suc = AddTender();
+        if(suc === false){
+            $('#add-tender-confirm').removeClass('disabled');
+        }
     });
 
     // 新增文件夹按钮点击