Sfoglia il codice sorgente

Merge branch 'master' of http://192.168.1.41:3000/SmartCost/YangHuCost

vian 5 anni fa
parent
commit
79d8f7a170

+ 6 - 2
modules/main/facade/project_facade.js

@@ -342,13 +342,14 @@ function getReportData(nameList,items,prjTypeNames,compilationScopes,decimal,isP
     }
     }
     setChildrenDatas(items,datas);
     setChildrenDatas(items,datas);
     let totalExp = totalItem.calcBase;
     let totalExp = totalItem.calcBase;
-    if(isProgressiveType&&progressiveInterval){
+    if(isProgressiveType&&progressiveInterval){//有累进的要重新计算总金额和技术经济综合指标
       for(let t of datas){
       for(let t of datas){
         totalExp = totalExp.replace(t.ID,t.billsTtlPrice+"");
         totalExp = totalExp.replace(t.ID,t.billsTtlPrice+"");
       }
       }
       totalExp = totalExp.replace(/@/g,"");
       totalExp = totalExp.replace(/@/g,"");
       let nTotal = eval(totalExp);
       let nTotal = eval(totalExp);
       totalItem.billsTtlPrice = scMathUtil.roundForObj(nTotal,decimal.bills.totalPrice);
       totalItem.billsTtlPrice = scMathUtil.roundForObj(nTotal,decimal.bills.totalPrice);
+      totalItem['技术经济综合指标'] = (totalItem.billsTtlAmt && parseFloat(totalItem.billsTtlAmt) !== 0)?scMathUtil.roundForObj(totalItem.billsTtlPrice/totalItem.billsTtlAmt,2):scMathUtil.roundForObj(totalItem.billsTtlPrice,2);
     }
     }
 
 
     for(let d of datas){
     for(let d of datas){
@@ -373,8 +374,11 @@ function getReportData(nameList,items,prjTypeNames,compilationScopes,decimal,isP
             arr.push(tbill);
             arr.push(tbill);
             let sumChildren = setChildrenDatas(c.children,arr,level+1,rootFlag);  
             let sumChildren = setChildrenDatas(c.children,arr,level+1,rootFlag);  
             if(isProgressiveType && progressiveInterval && rootFlag == fixedFlag.MAINTENANCE_EXPENSES){//如果要累进的,父节点要重新汇总
             if(isProgressiveType && progressiveInterval && rootFlag == fixedFlag.MAINTENANCE_EXPENSES){//如果要累进的,父节点要重新汇总
+              if(c.children.length > 0){
+                tbill.billsTtlPrice = sumChildren;
+                tbill['技术经济综合指标'] = (tbill.billsTtlAmt && parseFloat(tbill.billsTtlAmt) !== 0)?scMathUtil.roundForObj(tbill.billsTtlPrice/tbill.billsTtlAmt,2):scMathUtil.roundForObj(tbill.billsTtlPrice,2);
+              } 
               if(level>0) temTotalPrice = scMathUtil.roundForObj(tbill.billsTtlPrice + temTotalPrice,decimal.bills.totalPrice); 
               if(level>0) temTotalPrice = scMathUtil.roundForObj(tbill.billsTtlPrice + temTotalPrice,decimal.bills.totalPrice); 
-              if(c.children.length > 0) tbill.billsTtlPrice = sumChildren;
             }
             }
         }
         }
         return temTotalPrice;
         return temTotalPrice;

+ 2 - 2
web/building_saas/main/html/main.html

@@ -42,8 +42,8 @@
         let projectReadOnly = JSON.parse('<%- projectReadOnly %>');
         let projectReadOnly = JSON.parse('<%- projectReadOnly %>');
         let projectCooperate = JSON.parse('<%- projectCooperate %>');
         let projectCooperate = JSON.parse('<%- projectCooperate %>');
         let projectOptins =  JSON.parse('<%- options %>');
         let projectOptins =  JSON.parse('<%- options %>');
-        const G_SHOW_BLOCK_LIB = true;
-//        const G_SHOW_BLOCK_LIB = false;
+        // const G_SHOW_BLOCK_LIB = true;
+       const G_SHOW_BLOCK_LIB = false;
     </script>
     </script>
 </head>
 </head>
 
 

+ 1 - 0
web/building_saas/main/js/models/project_glj.js

@@ -956,6 +956,7 @@ ProjectGLJ.prototype.calcEachFreightOrPrice = function (temp,type,priceMap) {//
           let ndoc = {};
           let ndoc = {};
           if(temp.unitFreight != sum) ndoc['unitFreight'] = sum;
           if(temp.unitFreight != sum) ndoc['unitFreight'] = sum;
           if(temp.exp != exp) ndoc['exp'] = exp;
           if(temp.exp != exp) ndoc['exp'] = exp;
+          if(temp.heightFee != heightFee) ndoc['heightFee'] = heightFee;
           if(!_.isEmpty(ndoc)) return {ID:temp.ID,doc:ndoc};
           if(!_.isEmpty(ndoc)) return {ID:temp.ID,doc:ndoc};
         }
         }
         if(type == "price" && temp.supplyPrice !=sum) return {ID:temp.ID,doc:{supplyPrice:sum,heightFee:heightFee}}
         if(type == "price" && temp.supplyPrice !=sum) return {ID:temp.ID,doc:{supplyPrice:sum,heightFee:heightFee}}

+ 1 - 0
web/building_saas/main/js/views/glj_view_contextMenu.js

@@ -446,6 +446,7 @@ function getActionUrl(actionType) {
     switch (actionType) {
     switch (actionType) {
         case 'add':
         case 'add':
         case 'addMix':
         case 'addMix':
+        case 'insert':  
         case 'unitPriceAddMix':
         case 'unitPriceAddMix':
         case 'insertEquipment':
         case 'insertEquipment':
             return `${rootUrl}/0/true`;
             return `${rootUrl}/0/true`;

+ 18 - 22
web/building_saas/main/js/views/locate_view.js

@@ -358,6 +358,7 @@ let locateObject={
         }
         }
         setBgColour(datas,priceMap);
         setBgColour(datas,priceMap);
         datas =  _.sortByAll(datas,['code']);
         datas =  _.sortByAll(datas,['code']);
+        
         return datas;
         return datas;
 
 
 
 
@@ -365,31 +366,26 @@ let locateObject={
             let outStd = $("#outstanding").prop("checked");
             let outStd = $("#outstanding").prop("checked");
             let outInp = $("#outInp").val();
             let outInp = $("#outInp").val();
             if(outStd == true && outInp && outInp!=""){
             if(outStd == true && outInp && outInp!=""){
-                for(let b of bills){
-                    if(b.code && b.code.length >= 9){
-                        let key = b.code.substr(0,9);
-                        if(map[key] && map[key].count > 1){
-                            let avg = map[key].total/map[key].count;
-                            let unitPrice = b.unitPrice?parseFloat(b.unitPrice):0;
-                            if(unitPrice ==0 ) continue;
-                            if(Math.abs(unitPrice - avg)/avg * 100  >= parseFloat(outInp)) b.bgColour = "#FFFACD"
-                        }
-                    }
+              let key = "smartcost";// 2020-06-02  养护与建筑不同,养护是把所有结果相加取平均
+              if(map[key] && map[key].count > 1){
+                let avg = map[key].total/map[key].count;
+                for(let b of bills){ 
+                  let unitPrice = b.unitPrice?parseFloat(b.unitPrice):0;
+                  if(unitPrice ==0 ) continue;
+                  if(Math.abs(unitPrice - avg)/avg * 100  >= parseFloat(outInp)) b.bgColour = "#FFFACD"
                 }
                 }
+              }
             }
             }
         }
         }
-        function setPriceMap (bills,map) {
-            if(bills.code && bills.code.length >= 9){
-                let key = bills.code.substr(0,9);
-                let unitPrice = bills.unitPrice?parseFloat(bills.unitPrice):0;
-                if(map[key]){
-                    map[key].total += unitPrice;
-                    map[key].count ++;
-                }else {
-                    map[key] = {total:unitPrice,count:1}
-                }
-
-            }
+        function setPriceMap (bills,map) { // 2020-06-02  养护与建筑不同,养护是把所有结果相加取平均
+          let key = "smartcost";
+          let unitPrice = bills.unitPrice?parseFloat(bills.unitPrice):0;
+          if(map[key]){
+              map[key].total += unitPrice;
+              map[key].count ++;
+          }else {
+              map[key] = {total:unitPrice,count:1}
+          }
 
 
             return map;
             return map;
         }
         }

+ 21 - 1
web/building_saas/main/js/views/project_view.js

@@ -1314,6 +1314,26 @@ var projectObj = {
                         return canInsertRationNode(selected);
                         return canInsertRationNode(selected);
                     }*/
                     }*/
                 },
                 },
+                "insertGLJ": {
+                  name: "插入人材机",
+                  icon: 'fa-sign-in',
+                  disabled: function () {
+                      if (projectReadOnly) {
+                          return true;
+                      }
+                      // var selected = project.mainTree.selected;
+                      // return project.Ration.addRationChecking(selected);  // Vincent, 2018-01-02
+                      return !project.Ration.canAdd(project.mainTree.selected);
+                  },
+                  callback: function (key, opt) {
+                    let selected = project.mainTree.selected;
+                    if(selected.data.calcBase&&selected.data.calcBase!=""){
+                        alert("当前有基数计算,不能插入定额/量价/工料机。");
+                        return;
+                    }
+                    getGLJData('insert');// ProjectController.addRation(project, controller, rationType.volumePrice);
+                  }
+                },
                 "insertLJ": {
                 "insertLJ": {
                     name: "插入量价",//插入量价不需要自动定位到编号列
                     name: "插入量价",//插入量价不需要自动定位到编号列
                     icon: 'fa-sign-in',
                     icon: 'fa-sign-in',
@@ -1352,7 +1372,7 @@ var projectObj = {
                         }
                         }
                     }
                     }
                 },
                 },
-                "insertGLJ": {
+                "insertEquipment": {
                     name: "插入设备",
                     name: "插入设备",
                     icon: 'fa-sign-in',
                     icon: 'fa-sign-in',
                     disabled: function () {
                     disabled: function () {

+ 7 - 0
web/over_write/js/shandong_2016.js

@@ -0,0 +1,7 @@
+if (typeof module !== 'undefined') {
+  module.exports = { 
+      getDefalutAssistProductionFeeRate: function () {
+          return 5
+      }
+  };
+}

+ 7 - 0
web/over_write/js/sichuan_2013.js

@@ -0,0 +1,7 @@
+if (typeof module !== 'undefined') {
+  module.exports = { 
+      getDefalutAssistProductionFeeRate: function () {
+          return 5
+      }
+  };
+}