Explorar el Código

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

vian hace 5 años
padre
commit
a59905fa66

+ 13 - 9
web/building_saas/main/js/models/calc_program.js

@@ -156,6 +156,10 @@ let calcTools = {
     isGljRation: function (treeNode) {
         return this.isRationCategory(treeNode) && treeNode.data.type === rationType.gljRation;
     },
+    isVP_or_GLJR: function (treeNode) {       // 是量价或工料机类型的定额
+        return this.isRationCategory(treeNode) &&
+            (treeNode.data.type == rationType.volumePrice || treeNode.data.type == rationType.gljRation);
+    },
     isSameTypeNode: function (node1, node2) {
         if (node1.parent && node2.parent && (node1.parent === node2.parent) && (node1.sourceType === node1.sourceType)
             && (node1.data && node2.data && node1.data.type === node2.data.type)){
@@ -203,7 +207,7 @@ let calcTools = {
     getGLJList: function (treeNode, needOneBill) {
         delete treeNode.data.gljList;
         if (this.isRationCategory(treeNode)) {
-            if (treeNode.data.type != rationType.volumePrice) {
+            if (!calcTools.isVP_or_GLJR(treeNode)){
                 treeNode.data.gljList = projectObj.project.calcProgram.getGljArrByRation(treeNode.data);
             }
         }
@@ -211,7 +215,7 @@ let calcTools = {
             let nodeQ = this.uiNodeQty(treeNode);
             let q = nodeQ ? nodeQ : 1;
             let allNodes = projectObj.project.Ration.getRationNodes(treeNode);
-            let rNodes = allNodes.filter(function (node) {return node.data.type != rationType.volumePrice});
+            let rNodes = allNodes.filter(function (node) {return calcTools.isRationItem(node)});
             let rations = rNodes.map(function (node) {return node.data});
             treeNode.data.gljList = projectObj.project.ration_glj.getGatherGljArrByRations(rations, needOneBill, q);
         };
@@ -662,7 +666,7 @@ let calcTools = {
             'tenderUnitFee': sumTU, 'tenderTotalFee': sumTT});
     },
     marketPriceToBase: function (treeNode, baseName, isTender) {
-        if (treeNode.data.type != rationType.volumePrice && treeNode.data.type != rationType.gljRation) return;
+        if (!calcTools.isVP_or_GLJR(treeNode)) return;
         let result = 0, me = this;
 
         function isRCJZC(treeNode, baseName) {         // 基数名称中是否包含人材机主设,且树结点类型要匹配一致
@@ -701,7 +705,7 @@ let calcTools = {
         }
         else {
             if (isRCJZC(treeNode, baseName)) {
-                if (treeNode.data.type == rationType.volumePrice){
+                if (calcTools.isVolumePrice(treeNode)){
                     if (isTender){
                         let coe = this.tenderCoe_GLJPrice();
                         if (treeNode.data.marketUnitFee)
@@ -712,7 +716,7 @@ let calcTools = {
                     else
                         result = treeNode.data.marketUnitFee ? parseFloat(treeNode.data.marketUnitFee).toDecimal(decimalObj.ration.unitPrice) : 0
                 }
-                else if (treeNode.data.type == rationType.gljRation)
+                else if (calcTools.isGljRation(treeNode))
                 // result = treeNode.data.basePrice ? parseFloat(treeNode.data.basePrice).toDecimal(decimalObj.ration.unitPrice) : 0;
                 // 这里因为是算基数所以要取基价,但不能直接取basePrice,受限于项目属性的三个选项。
                     result = gljOprObj.getBasePrice(treeNode);
@@ -954,7 +958,7 @@ let calcTools = {
             2020-04-05 注: 以上是老黄历。新思路是量价只作为定额调整,不作为工料机调整。两种反调模式下,统一都只调子目消耗量系数。
             为避免歧义,量价的工料机调整系数不允许输入。
             */
-            // if (treeNode.data.type == rationType.volumePrice || treeNode.data.type == rationType.gljRation){
+            // if (calcTools.isVP_or_GLJR(treeNode)){
             //     if (treeNode.data.rationQuantityCoe)
             //         qCoe = treeNode.data.rationQuantityCoe
             //     else if (treeNode.data.quantityCoe && treeNode.data.quantityCoe.labour)
@@ -1566,7 +1570,7 @@ let executeObj = {
         let me = executeObj;
 
         // 量价、工料机形式的定额, 要把自己的市场单价用于计算程序中的基数。
-        if (calcTools.isVolumePrice(me.treeNode) || calcTools.isGljRation(me.treeNode))
+        if (calcTools.isVP_or_GLJR(me.treeNode))
             return calcTools.marketPriceToBase(me.treeNode, baseName, isTender)
         else{
             if (!rationCalcBases[baseName]){
@@ -2000,7 +2004,7 @@ class CalcProgram {
 
             if (treeNode.calcType == treeNodeCalcType.ctRationCalcProgram) {
                 // 量价、工料机类型的定额要求市场合价
-                if (treeNode.data.type == rationType.volumePrice || treeNode.data.type == rationType.gljRation){
+                if (calcTools.isVP_or_GLJR(treeNode)){
                     let muf = treeNode.data.marketUnitFee ? treeNode.data.marketUnitFee : 0;
                     let mtf = (muf * nQ).toDecimal(decimalObj.ration.totalPrice);
                     if (treeNode.data.marketTotalFee != mtf){
@@ -2335,7 +2339,7 @@ class CalcProgram {
             coe = (treeNode.data.targetUnitFee / treeNode.data.feesIndex.common.unitFee).toDecimal(decimalObj.process);
 
         // 调价情况之————量价反调工料机(量价无工料机可调,还是按定额来调,即直接调树结点的消耗量)
-        let isVP_RevGLJ =(tender == tenderTypes.ttReverseGLJ) && (treeNode.data.type == rationType.volumePrice || treeNode.data.type == rationType.gljRation);
+        let isVP_RevGLJ =(tender == tenderTypes.ttReverseGLJ) && calcTools.isVP_or_GLJR(treeNode);
 
         if ((tender == tenderTypes.ttReverseRation) || isVP_RevGLJ){
             treeNode.data.tenderQuantity = (treeNode.data.quantity * coe).toDecimal(decimalObj.decimal("quantity", treeNode));

+ 13 - 12
web/building_saas/main/js/views/tender_price_view.js

@@ -15,12 +15,12 @@ let tender_obj={
             {headerName: "计量\n单位", headerWidth: 60, dataCode: "unit", hAlign: "center", dataType: "String",spanRows: [2]},
             {headerName: "工程量", headerWidth: 70, dataCode: "quantity", hAlign: "right", dataType: "Number",validator:"number",spanRows: [2],getText:'getText.quantity'},
             // {headerName: "不调价", headerWidth: 55, dataCode: "is_adjust_price", hAlign: "center", cellType : "checkBox",dataType: "Number",spanRows: [2]},
-            {headerName: ["初始报价","综合单价"], headerWidth: 80, dataCode: "feesIndex.common.unitFee", hAlign: "right", dataType: "Number",validator:"number",spanCols : [2,1]},
-            {headerName: ["","综合合价"], headerWidth: 80, dataCode: "feesIndex.common.totalFee", hAlign: "right", dataType: "Number",validator:"number",spanCols : [0,1]},
-            {headerName: ["目标造价","综合单价"], headerWidth: 80, dataCode: "targetUnitFee", hAlign: "right", dataType: "Number",validator:"number",spanCols : [2,1]},
-            {headerName: ["","综合合价"], headerWidth: 80, dataCode: "targetTotalFee", hAlign: "right", dataType: "Number",validator:"number",spanCols : [0,1]},
-            {headerName: ["调整后报价","综合单价"], headerWidth: 80, dataCode: "feesIndex.common.tenderUnitFee", hAlign: "right", dataType: "Number",validator:"number",spanCols : [2,1]},
-            {headerName: ["","综合合价"], headerWidth: 80, dataCode: "feesIndex.common.tenderTotalFee", hAlign: "right", dataType: "Number",validator:"number",spanCols : [0,1]},
+            {headerName: ["初始报价","综合单价"], headerWidth: 100, dataCode: "feesIndex.common.unitFee", hAlign: "right", dataType: "Number",validator:"number",spanCols : [2,1]},
+            {headerName: ["","综合合价"], headerWidth: 100, dataCode: "feesIndex.common.totalFee", hAlign: "right", dataType: "Number",validator:"number",spanCols : [0,1]},
+            {headerName: ["目标造价","综合单价"], headerWidth: 100, dataCode: "targetUnitFee", hAlign: "right", dataType: "Number",validator:"number",spanCols : [2,1]},
+            {headerName: ["","综合合价"], headerWidth: 100, dataCode: "targetTotalFee", hAlign: "right", dataType: "Number",validator:"number",spanCols : [0,1]},
+            {headerName: ["调整后报价","综合单价"], headerWidth: 100, dataCode: "feesIndex.common.tenderUnitFee", hAlign: "right", dataType: "Number",validator:"number",spanCols : [2,1]},
+            {headerName: ["","综合合价"], headerWidth: 100, dataCode: "feesIndex.common.tenderTotalFee", hAlign: "right", dataType: "Number",validator:"number",spanCols : [0,1]},
             {headerName: ["消耗量调整系数","人工"], headerWidth: 80, dataCode: "quantityCoe.labour", hAlign: "right", dataType: "Number",validator:"number",spanCols : [5,1]},
             {headerName: ["","材料"], headerWidth: 80, dataCode: "quantityCoe.material", hAlign: "right", dataType: "Number",validator:"number",spanCols : [0,1]},
             {headerName: ["","机械"], headerWidth: 80, dataCode: "quantityCoe.machine", hAlign: "right", dataType: "Number",validator:"number",spanCols : [0,1]},
@@ -224,12 +224,13 @@ let tender_obj={
     updateChildrenValue:function (node,dataCode,value,datas,nodes) {
          if(node.children.length > 0){
             for(let c of node.children){
-                if ((dataCode.indexOf("quantityCoe.") != -1) && (c.data.type == rationType.volumePrice || c.data.type == rationType.gljRation))
-                    value = 0;
-                this.updateChildrenValue(c,dataCode,value,datas,nodes);
+                let v = value;
+                if ((dataCode.indexOf("quantityCoe.") != -1) && (calcTools.isVolumePrice(c) || calcTools.isGljRation(c)))
+                    v = 0;
+                this.updateChildrenValue(c,dataCode,v,datas,nodes);
                 let updateData = {type:c.sourceType,data:{'ID' : c.data.ID}};
-                updateData.data[dataCode] = value;
-                if(dataCode == 'is_adjust_price' && value == 1){
+                updateData.data[dataCode] = v;
+                if(dataCode == 'is_adjust_price' && v == 1){
                     updateData = this.cleanTenderCoe(updateData,c);
                 }else if(dataCode.indexOf("Coe")!= -1 && c.data.is_adjust_price == 1){//更新调整系数时忽略不调价的行
                     continue;
@@ -393,7 +394,7 @@ let tender_obj={
         }
         // 量价类,工料机消耗量调整系数不允许输入
         let treeNode = me.tenderTree.items[row];
-        if (treeNode.data.type == rationType.volumePrice || treeNode.data.type == rationType.gljRation){
+        if (calcTools.isVolumePrice(treeNode) || calcTools.isGljRation(treeNode)){
             if ([11,12,13,14,15].includes(col))
                 return false;
         };