Bladeren bron

导入重庆接口文件后,“输出最高限价”列应显示为是否打勾,不应是文本TRUE。

zhongzewei 6 jaren geleden
bovenliggende
commit
34ca51b865

+ 9 - 0
public/web/sheet/sheet_common.js

@@ -395,6 +395,15 @@ var sheetCommonObj = {
         c.isThreeState(threeState);
         return c
     },
+    // 无法勾选的复选框
+    getReadOnlyCheckBox () {
+        function ReadOnlyCheckBox() {}
+        ReadOnlyCheckBox.prototype = new GC.Spread.Sheets.CellTypes.CheckBox();
+        ReadOnlyCheckBox.prototype.processMouseUp = function () {
+            return;
+        };
+        return new ReadOnlyCheckBox();
+    },
     setComboBox(row,col,sheet,options,editorValueType,editable,maxDropDownItems){
         //let combo = new GC.Spread.Sheets.CellTypes.ComboBox();
         let dynamicCombo = sheetCommonObj.getDynamicCombo(true);

+ 9 - 0
web/building_saas/main/js/models/main_consts.js

@@ -403,6 +403,15 @@ const filterType = {
     ZYCL:'11',
     AMAE:'12'
 };
+// 文件类型
+const _fileKind = {
+    // 投标
+    tender: 1,
+    // 招标
+    bid: 2,
+    // 控制价
+    control: 3
+};
 const filterTypeArray = ['1','2','3','4','5'];
 
 const installFeeType = ['子目费用','分项费用','措施费用'];

+ 12 - 3
web/building_saas/main/js/views/main_tree_col.js

@@ -304,8 +304,11 @@ let MainTreeCol = {
             return true;
         },
         maxPrice:function (node) {
-            if($("#fileKind").val() == '1') return true;//对于投标项目只读
-            return   node.data.outPutMaxPrice!==true;
+            // 对于投标项目只读
+            if(+$('#fileKind').val() === _fileKind.tender) {
+                return true;
+            }
+            return node.data.outPutMaxPrice !== true;
         }
     },
     cellType: {
@@ -410,7 +413,13 @@ let MainTreeCol = {
             if(MainTreeCol.mainBillsEnable(node)) return sheetCommonObj.getCheckBox(true);
         },
         outPutMaxPrice:function (node) {
-            if(MainTreeCol.mainBillsEnable(node) && $("#fileKind").val() != '1') return sheetCommonObj.getCheckBox(true);
+            if(MainTreeCol.mainBillsEnable(node)) {
+                // 投标项目,复选框不可改变
+                const checkBox = +$('#fileKind').val() === _fileKind.tender
+                    ? sheetCommonObj.getReadOnlyCheckBox()
+                    : sheetCommonObj.getCheckBox(true);
+                return checkBox;
+            }
         }
     },
     mainBillsEnable:function (node) {