Browse Source

综合单价、综合合价只读控制

MaiXinRong 7 years ago
parent
commit
90e4302c3f

+ 7 - 1
web/building_saas/main/js/views/main_tree_col.js

@@ -38,12 +38,18 @@ let MainTreeCol = {
         billsParent: function (node) {
             return node.sourceType === projectObj.project.Bills.getSourceType() && node.source.children.length > 0;
         },
+        leafBillsWithDetail: function (node) {
+            return (!MainTreeCol.readOnly.billsParent(node)) && (node.children.length > 0);
+        },
         forCalcBase: function (node) {
             // to do according to billsParentType
             return MainTreeCol.readOnly.billsParent(node) || MainTreeCol.readOnly.non_bills(node);
         },
         forUnitFee: function (node) {
-            return MainTreeCol.readOnly.ration(node) || MainTreeCol.readOnly.billsParent(node);
+            return MainTreeCol.readOnly.ration(node) || MainTreeCol.readOnly.billsParent(node) || MainTreeCol.readOnly.leafBillsWithDetail(node);
+        },
+        forTotalFee: function (node) {
+            return MainTreeCol.readOnly.non_bills(node) || MainTreeCol.readOnly.billsParent(node) || (MainTreeCol.readOnly.leafBillsWithDetail(node));
         }
     },
     cellType: {

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

@@ -112,7 +112,7 @@ var projectObj = {
         }
         if (value) {
             value = value.toDecimal(colSetting.data.decimal);
-        } else {
+        } else if (editingText && editingText !== '') {
             value = null;
             alert('当前输入的数据类型不正确,请重新输入。');
         }
@@ -176,6 +176,8 @@ var projectObj = {
 
             } else if (fieldName === 'quantity' && project.quantity_detail.quantityEditChecking(value,node,fieldName)) {
                 projectObj.updateAndReCalculate(node, fieldName, value);
+            } else if (fieldName === 'feesIndex.common.unitFee') {
+                projectObj.updateAndReCalculate(node, fieldName, value);
             } else {
                 if (node.sourceType === project.Bills.getSourceType()) {
                     project.Bills.updateField(node.source, fieldName, value, true);