Преглед изворни кода

1. mainTree: ration, fees readOnly
2. mainTree: quantity, check Expression

MaiXinRong пре 8 година
родитељ
комит
eff5a96e8b

+ 2 - 2
test/tmp_data/bills_grid_setting.js

@@ -437,7 +437,7 @@ var BillsGridSetting ={
         },
         {
             "width":80,
-            "readOnly":false,
+            "readOnly":'readOnly.ration',
             "head":{
                 "titleNames":[
                     "综合单价"
@@ -468,7 +468,7 @@ var BillsGridSetting ={
         },
         {
             "width":80,
-            "readOnly":false,
+            "readOnly":'readOnly.ration',
             "head":{
                 "titleNames":[
                     "综合合价"

+ 6 - 0
web/building_saas/main/js/views/main_tree_col.js

@@ -17,6 +17,12 @@ let MainTreeCol = {
         }
     },
     readOnly: {
+        bills: function (node) {
+            return node.sourceType === projectObj.project.Bills.getSourceType();
+        },
+        ration: function (node) {
+            return node.sourceType === projectObj.project.Ration.getSourceType();
+        },
         volumePrice: function (node) {
             return node.sourceType === projectObj.project.VolumePrice.getSourceType();
         },

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

@@ -25,9 +25,13 @@ var projectObj = {
     checkQuantityField: function (editingText, colSetting) {
         let value = Number(editingText);
         if (!value) {
-            let exp = new Expression('');
-            exp.Expression(editingText);
-            value = exp.Evaluate();
+            try {
+                let exp = new Expression('');
+                exp.Expression(editingText);
+                value = Number(exp.Evaluate());
+            } catch (error) {
+                value = null;
+            }
         }
         if (value) {
             value = value.toDecimal(colSetting.data.decimal);