Parcourir la source

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

vian il y a 5 ans
Parent
commit
154aa253d5

+ 5 - 4
public/web/sheet/sheet_common.js

@@ -292,13 +292,14 @@ var sheetCommonObj = {
             if (setting.header[col].formatter) {
                 sheet.setFormatter(-1, col, setting.header[col].formatter, GC.Spread.Sheets.SheetArea.viewport);
             }
-            if(setting.headRows != 2 &&  setting.header[col].cellType === "checkBox"||setting.header[col].cellType === "button"){//clear and reset   2019 - 11- 11 加入了多行列头的判断情况,排除多行列头时清空操作,先试运行看是否有问题
+            /* 直接在showrowdata时当val为null时返回一个text类型的单元格 
+              if(setting.headRows != 2 &&  setting.header[col].cellType === "checkBox"||setting.header[col].cellType === "button"){//clear and reset   2019 - 11- 11 加入了多行列头的判断情况,排除多行列头时清空操作,先试运行看是否有问题
                 var me = this, header = GC.Spread.Sheets.SheetArea.colHeader;
                 sheet.deleteColumns(col,1);
                 sheet.addColumns(col, 1);
                 sheet.setValue(0, col, setting.header[col].headerName, header);
                 sheet.setColumnWidth(col, setting.header[col].headerWidth?setting.header[col].headerWidth:100);
-            }
+            } */
             if(setting.header[col].visible!==null&&setting.header[col].visible!==undefined){
                 sheet.setColumnVisible(col,setting.header[col].visible);
             }
@@ -350,7 +351,7 @@ var sheetCommonObj = {
                     val =val+'';
                 }
             }
-            if(val!=null&&setting.header[col].cellType === "checkBox"){
+            if(setting.header[col].cellType === "checkBox"){
                 this.setCheckBoxCell(row,col,sheet,val)
             }
             if(setting.header[col].cellType === "comboBox"){
@@ -483,7 +484,7 @@ var sheetCommonObj = {
         }
     },
     setCheckBoxCell(row,col,sheet,val){
-        var c = this.getCheckBox();
+        var c = val==null?new GC.Spread.Sheets.CellTypes.Text():this.getCheckBox();
         sheet.setCellType(row, col,c,GC.Spread.Sheets.SheetArea.viewport);
         sheet.getCell(row, col).value(val);
         sheet.getCell(row, col).hAlign(GC.Spread.Sheets.HorizontalAlign.center);

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

@@ -945,7 +945,7 @@
                                                     子目单价取费(正算):清单综合合价=∑子目综合合价
                                                 </label>
                                             </div>
-                                            <div class="form-check">
+                                            <div class="form-check" style="display:none">
                                                 <label class="form-check-label">
                                                     <input class="form-check-input" name="calcFlag" id="billsPrice" value="3" type="radio">
                                                     清单单价取费

+ 10 - 7
web/building_saas/main/js/models/calc_program.js

@@ -204,20 +204,23 @@ let calcTools = {
         };
         return nodes;
     },
+
+    /* 重要说明:
+    此时得到的GLJList,每条glj都有tenderQuantity = glj的quantity * 定额的quantity * glj的消耗量调整系数coe。
+    与定额的tenderQuantity无关,与定额的子目工程量调整系数coe无关。例如:
+    例:定额AB0003,工程量5,下含工料机“建筑综合工”,消耗量0.202。调价:人材机单价系数4,人工系数3,子目工程量系数2。
+    则GLJList中的建筑综合工:quantity 1.01, tenderQuantity 3.03。marketPrice 115, tenderPrice 460。
+    */
     getGLJList: function (treeNode, needOneBill) {
         delete treeNode.data.gljList;
+
         if (this.isRationCategory(treeNode)) {
             if (!calcTools.isVP_or_GLJR(treeNode)){
                 treeNode.data.gljList = projectObj.project.calcProgram.getGljArrByRation(treeNode.data);
             }
         }
         else if (this.isBill(treeNode)){
-            let nodeQ = this.uiNodeQty(treeNode);
-            let q = nodeQ ? nodeQ : 1;
-            let allNodes = projectObj.project.Ration.getRationNodes(treeNode);
-            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);
+            treeNode.data.gljList = projectObj.project.ration_glj.getGljArrByBill(treeNode, needOneBill);
         };
     },
     getLeafBills: function (treeNode){
@@ -1836,7 +1839,7 @@ class CalcProgram {
             };
         };
 
-        // 父清单汇总子项(子清单或定额)的费用类别
+        // 叶子清单汇总定额、父清单汇总子清单的费用类别
         if (treeNode.calcType == treeNodeCalcType.ctGatherBillsFees || treeNode.calcType == treeNodeCalcType.ctGatherRationsFees){
             treeNode.data.programID = null;
             calcTools.initFees(treeNode);

+ 16 - 3
web/building_saas/main/js/models/ration_glj.js

@@ -45,7 +45,7 @@ let ration_glj = {
         };
 
 
-        ration_glj.prototype.getGatherGljArrByRations = function (rations, needOneBill, billQuantity) {
+        ration_glj.prototype.getGljArrByBill = function (treeNode, needOneBill) {
             let result = [];
             let clone = function (obj) {
                 if (obj === null) return null;
@@ -63,6 +63,13 @@ let ration_glj = {
                 }
                 return null;
             }
+
+            let nodeQ = calcTools.uiNodeQty(treeNode);
+            let q = nodeQ ? nodeQ : 1;
+            let allNodes = projectObj.project.Ration.getRationNodes(treeNode);
+            let rNodes = allNodes.filter(function (node) {return calcTools.isRationItem(node)});
+            let rations = rNodes.map(function (node) {return node.data});
+
             for (let ration of rations) {
                 if (ration.type == rationType.volumePrice || ration.type == rationType.gljRation){
                     let glj = JSON.parse(JSON.stringify(ration));
@@ -77,12 +84,18 @@ let ration_glj = {
                     let rationGljs = projectObj.project.calcProgram.getGljArrByRation(ration);
                     for (let glj of rationGljs) {
                         let sameGlj = findGlj(glj, result);
+                        let coe = calcTools.tenderCoe_GLJQty(treeNode, glj);
                         if (!sameGlj) {
                             sameGlj = clone(glj);
                             sameGlj.quantity = (sameGlj.quantity * ration.quantity).toDecimal(4);
+                            // glj的 tenderQuantity = glj的quantity * 定额的quantity * glj的消耗量调整系数coe。
+                            // 与定额的tenderQuantity无关,与定额的子目工程量调整系数coe无关。下面这里直接取数量即可,因为它在上一句已经乘过定额数量了。
+                            sameGlj.tenderQuantity = (sameGlj.quantity * coe).toDecimal(4);
                             result.push(sameGlj);
                         } else {
                             sameGlj.quantity = sameGlj.quantity + (glj.quantity * ration.quantity).toDecimal(4);
+                            sameGlj.tenderQuantity = sameGlj.tenderQuantity + (glj.quantity * coe).toDecimal(4);
+
                             sameGlj.totalQuantity = (parseFloat(sameGlj.totalQuantity) + parseFloat(glj.totalQuantity)).toDecimal(4);
                         }
                     }
@@ -107,8 +120,8 @@ let ration_glj = {
                     glj.type = glj.subType;
                 };
 
-                // glj.quantity = (glj.quantity / billQuantity).toDecimal(decimalObj.glj.quantity);
-                glj.quantity = (glj.quantity / billQuantity).toDecimal(decimalObj.process);  // 广联达这里没有取舍
+                glj.quantity = (glj.quantity / q).toDecimal(decimalObj.process);  // 广联达这里没有取舍
+                glj.tenderQuantity = (glj.tenderQuantity / q).toDecimal(decimalObj.process);
             };
             return oneBill;
         }