Browse Source

update indicativeInfo

zhongzewei 7 years ago
parent
commit
588aac63b3
1 changed files with 10 additions and 5 deletions
  1. 10 5
      web/building_saas/main/js/views/project_property_indicativeInfo.js

+ 10 - 5
web/building_saas/main/js/views/project_property_indicativeInfo.js

@@ -106,6 +106,7 @@ let indicativeInfoObj = {
         return null;
         return null;
     },
     },
     getDXFY: function (node) {
     getDXFY: function (node) {
+        if(!node) return null;
         let dxfy = Object.create(null);
         let dxfy = Object.create(null);
         let engCostFee = this.fee(this.getFixedBill(fixedFlag.ENGINEERINGCOST), this.feeType.common);
         let engCostFee = this.fee(this.getFixedBill(fixedFlag.ENGINEERINGCOST), this.feeType.common);
         let commonFee = this.fee(node, this.feeType.common);
         let commonFee = this.fee(node, this.feeType.common);
@@ -121,8 +122,10 @@ let indicativeInfoObj = {
         let rst = [];
         let rst = [];
         for(let node of projectObj.project.mainTree.items){
         for(let node of projectObj.project.mainTree.items){
             if(this.isDXFY(node)){
             if(this.isDXFY(node)){
+                let dxfy = this.getDXFY(node);
+                if(!dxfy) continue;
                 if(this.isFBFX(node)){
                 if(this.isFBFX(node)){
-                    rst.push(this.getDXFY(node));
+                    rst.push(dxfy);
                     rst.push({name: '其中:', price: '', rate: '', perCentiare: ''});
                     rst.push({name: '其中:', price: '', rate: '', perCentiare: ''});
                     rst.push({name: '       人工费', price: parseFloat(this.fee(node, this.feeType.labour)).toDecimal(decimalObj.bills.totalPrice), rate: '', perCentiare: ''});
                     rst.push({name: '       人工费', price: parseFloat(this.fee(node, this.feeType.labour)).toDecimal(decimalObj.bills.totalPrice), rate: '', perCentiare: ''});
                     rst.push({name: '       材料费', price: parseFloat(this.fee(node, this.feeType.material)).toDecimal(decimalObj.bills.totalPrice), rate: '', perCentiare: ''});
                     rst.push({name: '       材料费', price: parseFloat(this.fee(node, this.feeType.material)).toDecimal(decimalObj.bills.totalPrice), rate: '', perCentiare: ''});
@@ -138,14 +141,16 @@ let indicativeInfoObj = {
                     rst.push({name: '利润', price: parseFloat(this.fee(node, this.feeType.profit)).toDecimal(decimalObj.bills.totalPrice), rate: '', perCentiare: ''});
                     rst.push({name: '利润', price: parseFloat(this.fee(node, this.feeType.profit)).toDecimal(decimalObj.bills.totalPrice), rate: '', perCentiare: ''});
                 }
                 }
                 else if(this.isCSXM(node)){
                 else if(this.isCSXM(node)){
-                    rst.push(this.getDXFY(node));
+                    rst.push(dxfy);
                     rst.push({name: '其中:', price: '', rate: '', perCentiare: ''});
                     rst.push({name: '其中:', price: '', rate: '', perCentiare: ''});
                     let safeConst = this.getDXFY(this.getFixedBill(fixedFlag.SAFETY_CONSTRUCTION));
                     let safeConst = this.getDXFY(this.getFixedBill(fixedFlag.SAFETY_CONSTRUCTION));
-                    safeConst.name = `      ${safeConst.name}`;
-                    rst.push(safeConst);
+                    if(safeConst){
+                        safeConst.name = `      ${safeConst.name}`;
+                        rst.push(safeConst);
+                    }
                 }
                 }
                 else{
                 else{
-                    rst.push(this.getDXFY(node));
+                    rst.push(dxfy);
                 }
                 }
             }
             }
         }
         }