TonyKang 4 年之前
父節點
當前提交
bb3025387e

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

@@ -2842,7 +2842,7 @@ $('#property_ok').click(function () {
     if (diffBillsPriceFeatureDatas.length > 0) {
         //刷新指标基价
         if (billsGuidance.bills.tree) {
-            chkAndResetBills(billsGuidance.bills.workBook.getActiveSheet());
+            chkAndResetBills(billsGuidance.bills.workBook.getActiveSheet(), billsGuidance.bills.tree.items);
             billsGuidance.bills.workBook.refresh();
         } else {
             chkAndResetBills(null);

+ 17 - 10
web/building_saas/main/js/views/std_bills_unit_price_feature.js

@@ -40,7 +40,7 @@ function chkAndSetBillsUnitPrice(billsNodes) {
     }
 }
 
-function chkAndResetBills(adHocSheet) {
+function chkAndResetBills(adHocSheet, adHocNodes) {
     //用户调整了工程特征后调用
     for (let key in projectObj.project.mainTree.nodes) {
         const node = projectObj.project.mainTree.nodes[key];
@@ -62,15 +62,22 @@ function chkAndResetBills(adHocSheet) {
             }
             if (adHocSheet) {
                 let rCount = adHocSheet.getRowCount();
-                for (let idx = 0; idx < rCount; idx++) {
-                    let cell1 = adHocSheet.getCell(idx, 1);
-                    let cell2 = adHocSheet.getCell(idx, 2);
-                    let cell3 = adHocSheet.getCell(idx, 3);
-                    if (_chkIfEquals(node.data.code, cell1.value()) && _chkIfEquals(node.data.name, cell2.value()) && _chkIfEquals(node.data.unit, cell3.value())) {
-                        let cell4 = adHocSheet.getCell(idx, 4);
-                        unitFeeVal = unitFeeVal.toFixed(2);
-                        if (unitFeeVal === '0.00') unitFeeVal = '';
-                        cell4.value(unitFeeVal);
+                for (let aNode of adHocNodes) {
+                    unitFeeVal = _commonChkAndSetPrice(aNode.data, false);
+                    if (unitFeeVal !== 0) {
+                        for (let idx = 0; idx < rCount; idx++) {
+                            let cell1 = adHocSheet.getCell(idx, 1);
+                            let cell2 = adHocSheet.getCell(idx, 2);
+                            let cell3 = adHocSheet.getCell(idx, 3);
+                            if (_chkIfEquals(aNode.data.code, cell1.value()) && _chkIfEquals(aNode.data.name, cell2.value()) && _chkIfEquals(aNode.data.unit, cell3.value())) {
+                                let cell4 = adHocSheet.getCell(idx, 4);
+                                unitFeeVal = unitFeeVal + 0.0000001; //前端四舍五入补偿用
+                                unitFeeVal = unitFeeVal.toFixed(2);
+                                if (unitFeeVal === '0.00') unitFeeVal = '';
+                                cell4.value(unitFeeVal);
+                                break;
+                            }
+                        }
                     }
                 }
             }