ソースを参照

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

vian 5 年 前
コミット
172d4ce8e9

+ 5 - 4
web/building_saas/main/js/models/calc_program.js

@@ -897,7 +897,7 @@ let calcTools = {
     },
 
     // 在项目工料机里检查该工料机是否参与调价
-    isTenderGLJ: function (glj){
+    isTenderProjectGLJ: function (glj){
         let projGLJ = this.getProjectGLJ(glj);
         return !(projGLJ && projGLJ.is_adjust_price == 1);
     },
@@ -921,6 +921,7 @@ let calcTools = {
     tenderCoe_GLJQty: function (treeNode, glj){
         let coe = 1;
         if (!treeNode.data.quantityCoe) return coe;
+        if (!calcTools.isTenderProjectGLJ(glj)) return coe;
 
         if (gljType.LABOUR == glj.type){
             if (treeNode.data.quantityCoe.labour)
@@ -983,7 +984,7 @@ let calcTools = {
         }
         else{
             let coe = 1;
-            if (this.isTenderGLJ(glj))
+            if (this.isTenderProjectGLJ(glj))
                 coe = this.tenderCoe_GLJQty(treeNode, glj);
             glj.tenderQuantity = (glj.quantity * coe).toDecimal(decimalObj.glj.quantity);
         }
@@ -2459,7 +2460,7 @@ class CalcProgram {
                 // 先把会破坏金额比例关系的孩子排除:1.有目标金额的 2.满载的(孙子全满,没有分摊空间,所以实质上该孩子的金额已被锁死无法分摊)
                 for (let i = 0; i < treeNode.children.length; i++) {
                     let child = treeNode.children[i];
-                    if (!child.data.feesIndex['common']) continue;     // 无计算金额的(如空清单)当它不存在
+                    if (!child.data.feesIndex || !child.data.feesIndex['common']) continue;   // 空白行清单、定额
 
                     child.data.tender_activeTotal = child.data.feesIndex['common'].totalFee;
 
@@ -2477,7 +2478,7 @@ class CalcProgram {
 
                     for (let i = 0; i < treeNode.children.length; i++) {
                         let child = treeNode.children[i];
-                        if (!child.data.feesIndex['common']) continue;
+                        if (!child.data.feesIndex || !child.data.feesIndex['common']) continue;   // 空白行清单、定额
                         if (!calcTools.hasTargetTotalFee(child)){
                             child.data.tender_activeTarget = (coe * child.data.tender_activeTotal).toDecimal(decimalObj.decimal('totalPrice', treeNode));
                             child.data.targetTotalFee = child.data.tender_activeTarget;

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

@@ -62,7 +62,7 @@ let gljCol = {
             {headerName: "质量等级", headerWidth: 80, dataCode: "qualityGrace", hAlign: "left", dataType: "String",spanRows: [2]},
             {headerName: "品牌", headerWidth: 80, dataCode: "brand", hAlign: "left", dataType: "String",spanRows: [2]},
             {headerName: "备注", headerWidth: 100, dataCode: "remark", hAlign: "left", dataType: "String",spanRows: [2]},
-            {headerName: "不调价", headerWidth: 55, dataCode: "is_adjust_price", dataType: "String",cellType: "checkBox",spanRows: [2]},
+            {headerName: "不调价", headerWidth: 55, dataCode: "is_adjust_price", dataType: "String",cellType: "checkBox",spanRows: [2], visible: false},
             {headerName: ["调价后","市场价"], headerWidth: 75, dataCode: "tenderPrice", hAlign: "right", dataType: "Number",validator:"number",spanCols: [2,1], visible: false},
             {headerName: ["","总消耗量"], headerWidth: 90, dataCode: "tenderQuantity", hAlign: "right", dataType: "Number",decimalField:'glj.quantity',spanCols: [0,1], visible: false}
         ],

+ 1 - 1
web/building_saas/main/js/views/glj_view.js

@@ -1016,7 +1016,7 @@ var gljOprObj = {
       let [marketPrice,basePrice] = this.getParentPrice(subList,0,ratio,"delete");
       try {
         $.bootstrapLoading.start()
-        projectData = await ajaxPost('/glj/updateRatio', {id: ratio.mixRatioId,type:'delete',pid:ratio.parentGLJ.id,market_price: marketPrice,base_price: basePrice});
+        projectData = await ajaxPost('/glj/updateRatio', {id: ratio.mixRatioId,type:'delete',pid:ratio.parentGLJ.unit_price.id,market_price: marketPrice,base_price: basePrice});
 
         //更新缓存
         let pk = gljUtil.getIndex(ratio.parentGLJ);