浏览代码

1. 调整右键菜单
2. 修改项目属性--取费方式,点击确定后重算

MaiXinRong 7 年之前
父节点
当前提交
fc465f1d45

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

@@ -444,25 +444,25 @@
                                         <fieldset class="form-group">
                                             <div class="form-check">
                                                 <label class="form-check-label">
-                                                    <input class="form-check-input" name="optionsRadios" id="optionsRadios1" value="option1" checked="" type="radio">
+                                                    <input class="form-check-input" name="calcFlag" id="rationContent" value="0" checked="" type="radio">
                                                     子目含量取费
                                                 </label>
                                             </div>
                                             <div class="form-check">
                                                 <label class="form-check-label">
-                                                    <input class="form-check-input" name="optionsRadios" id="optionsRadios2" value="option2" type="radio">
+                                                    <input class="form-check-input" name="calcFlag" id="rationPrice" value="1" type="radio">
                                                     子目单价取费(反算):清单综合合价=清单综合单价*清单工程量
                                                 </label>
                                             </div>
                                             <div class="form-check">
                                                 <label class="form-check-label">
-                                                    <input class="form-check-input" name="optionsRadios" id="optionsRadios3" value="option3" type="radio">
+                                                    <input class="form-check-input" name="calcFlag" id="rationPriceConverse" value="2" type="radio">
                                                     子目单价取费(正算):清单综合合价=∑子目综合合价
                                                 </label>
                                             </div>
                                             <div class="form-check">
                                                 <label class="form-check-label">
-                                                    <input class="form-check-input" name="optionsRadios" id="optionsRadios4" value="option4" type="radio">
+                                                    <input class="form-check-input" name="calcFlag" id="billsPrice" value="3" type="radio">
                                                     清单单价取费
                                                 </label>
                                             </div>
@@ -489,7 +489,7 @@
                 </div>
                 <div class="modal-footer">
                     <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                    <a href="" class="btn btn-primary">确定</a>
+                    <a href="javascript:void(0);" class="btn btn-primary" id="property_ok" data-dismiss="modal">确定</a>
                 </div>
             </div>
         </div>

+ 1 - 1
web/building_saas/main/js/calc/bills_calc.js

@@ -326,7 +326,7 @@ class BillsCalcHelper {
             if (node.source.children.length > 0) {
                 this.calcNodes(node.children);
             }
-            calcNode(node);
+            this.calcNode(node);
         }
     };
     converseCalc (node) {

+ 20 - 22
web/building_saas/main/js/views/project_view.js

@@ -305,32 +305,13 @@ var projectObj = {
                 },
                 "spr2":'--------',
                 "calculateAll_RationContent": {
-                    name: '造价计算(子目含量取费)',
-                    callback: function () {
-                        ProjectController.calculateAll(project, controller, rationContent);
-                    }
-                },
-                "calculateAll_RationPrice": {
-                    name: '造价计算(子目单价取费)',
-                    callback: function () {
-                        ProjectController.calculateAll(project, controller, rationPrice);
-                    }
-                },
-                "calculateAll_RationPriceConverse": {
-                    name: '造价计算(子目单价取费-反算)',
-                    callback: function () {
-                        ProjectController.calculateAll(project, controller, rationPriceConverse);
-                    }
-                },
-                "calculateAll_BillsPrice": {
-                    name: '造价计算(清单单价取费)',
-                    callback: function () {
-                        ProjectController.calculateAll(project, controller, billsPrice);
-                    }
+                    name: '造价计算',
+                    callback: projectObj.calculateAll
                 }
             }
         });
     },
+    // 计算node及node的所有父项
     converseCalculateBills: function (node) {
         let calc = new BillsCalcHelper(this.project);
         calc.converseCalc(node, this.project.calcFields);
@@ -341,6 +322,14 @@ var projectObj = {
         }
         this.mainController.refreshTreeNode(nodes, false);
         calc = null;
+    },
+    // 计算全部清单
+    calculateAll: function () {
+        let calc = new BillsCalcHelper(this.project);
+        calc.calcAll();
+        this.mainController.showTreeData();
+        this.project.Bills.updateAll();
+        calc = null;
     }
 };
 
@@ -421,3 +410,12 @@ $('#downMove').click(function () {
     }
 });
 
+$('#rationContent').val(rationContent);
+$('#rationPrice').val(rationPrice);
+$('#rationPriceConverse').val(rationPriceConverse);
+$('#billsPrice').val(billsPrice);
+$('#property_ok').click(function () {
+    projectObj.project.setCalcFlag(parseInt($("input[name='calcFlag']:checked").val()));
+    projectObj.calculateAll();
+});
+