Browse Source

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

chenshilong 7 years ago
parent
commit
7c1862eb75

+ 2 - 0
config/gulpConfig.js

@@ -41,6 +41,7 @@ module.exports = {
     main_jspaths:[
         'lib/JSExpressionEval_src/*.js',
         '!lib/JSExpressionEval_src/JsHashMap.js',
+        'lib/jquery-ui/jquery-ui.min.js',
         'lib/jquery-ui/jquery-ui-datepickerCN.js',
         'lib/jquery-contextmenu/*.js',
         'lib/lodash/lodash.js',
@@ -110,6 +111,7 @@ module.exports = {
         'web/building_saas/main/js/views/calc_program_view.js',
         'web/building_saas/main/js/views/confirm_modal.js',
         'web/building_saas/main/js/views/zlfb_view.js',
+        'web/building_saas/main/js/views/installation_fee_view.js',
         'public/web/rpt_tpl_def.js',
         'public/web/treeDataHelper.js',
         'public/web/ztree_common.js',

+ 14 - 5
web/building_saas/main/js/models/quantity_detail.js

@@ -580,10 +580,19 @@ var quantity_detail = {
             if(node.children.length>0){//如果有子项则
                 for(let rationNode of node.children){
                     let EXPString = rationNode.data.quantityEXP+"";
-                    if(EXPString.indexOf("QDL")!=-1){//如果定额的工程量是通过计算出来的,则应该重新计算。
-                        let tem_contain = scMathUtil.roundForObj(rationNode.data.contain,getDecimal("process"));
-                        let tem_quantity = scMathUtil.roundForObj(value*tem_contain,getDecimal("quantity",rationNode));
-                        rationNode.data.quantity = this.autoTransformQuantity(tem_quantity,rationNode);
+                    if(EXPString.indexOf("QDL")!=-1){
+                        if(EXPString=="QDL"){//定额的工程量是直接通过清单量填进来的;
+                            let times = parseInt(rationNode.data.unit);
+                            if(isNaN(times)){
+                                times = 1;
+                            }
+                            rationNode.data.quantity = scMathUtil.roundForObj(value / times,getDecimal("quantity",rationNode));
+                            rationNode.data.contain = scMathUtil.roundForObj(rationNode.data.quantity/value,getDecimal("process"));
+                        }else {//如果定额的工程量是通过计算出来的,则应该重新计算。
+                            let tem_contain = scMathUtil.roundForObj(rationNode.data.contain,getDecimal("process"));
+                            let tem_quantity = scMathUtil.roundForObj(value*tem_contain,getDecimal("quantity",rationNode)); //this.autoTransformQuantity(tem_quantity,rationNode);
+                            rationNode.data.quantity = tem_quantity;
+                        }
                         rationNode.changed = true;
                         needUpdateChildren.push(rationNode);
                         if (rationNode.children.length>0){//如果有子工料机
@@ -593,7 +602,7 @@ var quantity_detail = {
                         let tem_contain=0;
                         if(value&&value!=0){
                            let children_quantity = scMathUtil.roundForObj(rationNode.data.quantity,getDecimal("quantity"),rationNode);
-                           children_quantity = scMathUtil.roundForObj(this.reverseQuantity(children_quantity,rationNode),getDecimal("quantity",rationNode));
+                            // children_quantity = scMathUtil.roundForObj(this.reverseQuantity(children_quantity,rationNode),getDecimal("quantity",rationNode));  原先是要反算的,现在改成不用反算了
                             tem_contain =scMathUtil.roundForObj(children_quantity/value,getDecimal("process"));
                         }
                         rationNode.data.contain = tem_contain;

+ 5 - 1
web/building_saas/main/js/models/ration.js

@@ -437,7 +437,11 @@ var Ration = {
             node.data.contain = contain;
             node.data.quantityEXP="QDL*"+contain;
             node.data.quantity=scMathUtil.roundForObj(billQuantity*contain,getDecimal("quantity"),node);
-            node.data.quantity = projectObj.project.quantity_detail.autoTransformQuantity(node.data.quantity,node);//按单位做转换
+            let times = parseInt(node.data.unit)
+            if (!isNaN(times)) {
+                node.data.quantityEXP+='*'+times;
+            }
+          //  node.data.quantity = projectObj.project.quantity_detail.autoTransformQuantity(node.data.quantity,node);//按单位做转换
             node.changed = true;
             project.calcProgram.calcAndSave(node);
             projectObj.mainController.refreshTreeNode(node.children);//刷新子工料机树节点总消耗量

+ 5 - 2
web/building_saas/main/js/views/main_tree_col.js

@@ -310,6 +310,8 @@ let colSettingObj = {
     settingSpread: null,
     checkBox: new GC.Spread.Sheets.CellTypes.CheckBox(),
     loadSetting: function (sheet, setting) {
+        sheet.suspendPaint();
+        sheet.suspendEvent();
         sheet.setRowCount(setting.cols.length);
         sheet.setColumnCount(setting.headRows, GC.Spread.Sheets.SheetArea.rowHeader);
         sheet.setColumnCount(1);
@@ -329,14 +331,15 @@ let colSettingObj = {
                     sheet.addSpan(index, iCol, col.head.spanRows[i], col.head.spanCols[i], GC.Spread.Sheets.SheetArea.rowHeader);
                 }
                 iCol += col.head.spanRows[i];
-            }
-            ;
+            };
             let colWidth = sheet.getColumnWidth(index, GC.Spread.Sheets.SheetArea.rowHeader);
             colWidth = colWidth > col.width ? colWidth : col.width;
             //sheet.setColumnWidth(index, colWidth, GC.Spread.Sheets.SheetArea.rowHeader);
             cell = sheet.getCell(index, 0).value(col.visible);
             sheet.autoFitRow(index);
         });
+        sheet.resumeEvent();
+        sheet.resumePaint();
     },
     initSettingSpread: function () {
         this.settingSpread = SheetDataHelper.createNewSpread($('#col_setting_spread')[0], {sheetCount: 1});