Просмотр исходного кода

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

zhongzewei 6 лет назад
Родитель
Сommit
27de69c1e7

+ 2 - 2
modules/main/facade/ration_facade.js

@@ -620,10 +620,10 @@ async function CalculateQuantity (ration,billsItemID,projectID) {
     let decimalObject =await decimal_facade.getProjectDecimal(projectID,project);
     let quantity_decimal = (decimalObject&&decimalObject.ration&&decimalObject.ration.quantity)?decimalObject.ration.quantity:3;
     let pbill = await bill_model.model.findOne({projectID:projectID,ID:billsItemID});
-    let  t_unit = ration.unit?ration.unit.replace(/^\d+/,""):"";
+   /* let  t_unit = ration.unit?ration.unit.replace(/^\d+/,""):""; 2019-02-01 养护去掉清单与定额单位的这个判断
     if(t_unit!=pbill.unit){//如果定额工程量的单位去除前面的数字后不等于清单单位,定额工程量保持不变
         return ;
-    }
+    }*/
     let billsQuantity = pbill.quantity ? pbill.quantity : 0;
     let bill_decimal = await decimal_facade.getBillsQuantityDecimal(projectID,pbill.unit,project);
     billsQuantity=scMathUtil.roundForObj(billsQuantity,bill_decimal);

+ 2 - 2
web/building_saas/main/js/controllers/block_controller.js

@@ -586,10 +586,10 @@ let BlockController = {
         let EXPString = ration.quantityEXP+"";
         if(EXPString.indexOf("QDL") != -1){
             if(EXPString=="QDL"){//定额的工程量是直接通过清单量填进来的;
-                let  t_unit = ration.unit?ration.unit.replace(/^\d+/,""):"";
+                /*let  t_unit = ration.unit?ration.unit.replace(/^\d+/,""):""; 2019-02-01 养护去掉清单与定额单位的这个判断
                 if(t_unit!=billsUnit){//如果定额的单位去除前面的数字后不等于清单单位,定额工程量保持不变
                     return ;
-                }
+                }*/
                 let times = parseInt(ration.unit);
                 if(isNaN(times)){
                     times = 1;

+ 12 - 1
web/building_saas/main/js/views/fee_rate_view.js

@@ -173,13 +173,24 @@ var feeRateObject={
                     let treeType = sheetCommonObj.getTreeNodeCellType(data,row,parentMap);
                     sheet.getCell(row, 0).cellType(treeType);
                     visibleMap[data[row].ID] = treeType.collapsed;
-                    if(visibleMap[data[row].ParentID] ) sheet.getRange(row , -1, 1, -1).visible(!visibleMap[data[row].ParentID]);//显示或隐藏
+                    feeRateObject.setRowVisible(data,row,visibleMap,sheet);
                 }
             }
         }
         sheet.resumeEvent();
         sheet.resumePaint();
     },
+    setRowVisible:function (data,row,visibleMap,sheet) {
+        sheet.getRange(row , -1, 1, -1).visible(getVisible(data[row].ParentID));//显示或隐藏
+        function getVisible(ParentID) {
+            if(visibleMap[ParentID]) return false //如果父节点是缩起的,那就隐藏本身。
+            if(visibleMap[ParentID] == false){//如果父节点不是缩起的,要再往父节点找看
+                let pnode = _.find(data,{'ID':ParentID});
+                if(pnode) return getVisible(pnode.ParentID);//如果有父节点,递归调用
+                return true;//没有,返回显示
+            }
+        }
+    },
     getFeeRateLevel:function (rate,data) {
         if(rate.ParentID){
          let prate =  _.find(data,{'ID':rate.ParentID});

+ 2 - 2
web/building_saas/main/js/views/glj_col.js

@@ -14,8 +14,8 @@ let gljCol = {
             {headerName: "消耗量", headerWidth: 65, dataCode: "quantity", dataType: "Number", hAlign: "right", decimalField: "glj.quantity"},
             {headerName: "定额价", headerWidth: 65, dataCode: "basePrice", dataType: "Number", hAlign: "right"},//, decimalField: "glj.unitPrice"
             {headerName: "定额消耗", headerWidth: 65, dataCode: "rationItemQuantity", dataType: "Number", hAlign: "right", decimalField: "glj.quantity"},   // dataType: "Number", formatter: "0.00"
-            {headerName: "总消耗量", headerWidth: 80, dataCode: "totalQuantity", dataType: "Number", hAlign: "right", decimalField: "glj.quantity"},
-            {headerName: "暂估", headerWidth: 45, dataCode: "isEstimate", dataType: "String", hAlign: "center", vAlign: "center", cellType: "checkBox"}
+            {headerName: "总消耗量", headerWidth: 80, dataCode: "totalQuantity", dataType: "Number", hAlign: "right", decimalField: "glj.quantity"}
+            //{headerName: "暂估", headerWidth: 45, dataCode: "isEstimate", dataType: "String", hAlign: "center", vAlign: "center", cellType: "checkBox"}
         ],
         view: {
             lockColumns: [ "adjustPrice", "rationItemQuantity", "quantity", "totalQuantity", "isEstimate"],//这里以后改成dataCode好一点

+ 6 - 1
web/building_saas/main/js/views/quantity_edit_view.js

@@ -165,7 +165,12 @@ let quantityEditObj = {
         let evalString = quantityEXP;
         if( node.sourceType == ModuleNames.ration && quantityEXP.indexOf('QDL')!=-1){
             let billNode = node.parent;
-            let bQuantity = billNode.data.quantity?scMathUtil.roundForObj(billNode.data.quantity,getDecimal("quantity",billNode)):0;
+            let bQuantity = 0;
+            if(billNode.updateData.quantity){
+                bQuantity = scMathUtil.roundForObj(billNode.updateData.quantity,getDecimal("quantity",billNode));
+            }else {
+                bQuantity = billNode.data.quantity?scMathUtil.roundForObj(billNode.data.quantity,getDecimal("quantity",billNode)):0;
+            }
             evalString = replaceAll("QDL","("+bQuantity+")",evalString);
         }
         try {