소스 검색

bug fixed

zhangweicheng 7 년 전
부모
커밋
c805055a4d
2개의 변경된 파일34개의 추가작업 그리고 15개의 파일을 삭제
  1. 27 11
      web/building_saas/main/js/views/main_tree_col.js
  2. 7 4
      web/building_saas/main/js/views/project_view.js

+ 27 - 11
web/building_saas/main/js/views/main_tree_col.js

@@ -41,9 +41,20 @@ let MainTreeCol = {
         }
     },
     readOnly: {
-        // CSL, 2017-11-28
+        // Vincent, 2018-01-09
         subType: function (node) {
-            return MainTreeCol.readOnly.bills(node)||(node.data.type != 2 && node.data.type != 3 && !MainTreeCol.readOnly.glj(node)) || (node.data.type == rationType.gljRation && MainTreeCol.readOnly.non_editSubType(node));
+            if(MainTreeCol.readOnly.bills(node)){
+                return true;
+            }
+            if(MainTreeCol.readOnly.ration(node)){
+                return true;
+            }
+            if(MainTreeCol.readOnly.non_editSubType(node)){
+                return true;
+            }else if(gljOprObj.hasComposition(node.data,node.sourceType === ModuleNames.ration)){
+                return true;
+            }
+            return false;
         },
         calcProgramName: function (node) {
             if (
@@ -173,20 +184,25 @@ let MainTreeCol = {
             }
         },
 
-        // CSL, 2017-11-28
+        // Vincent, 2018-01-09
         subType: function (node) {
             if(node.sourceType!=projectObj.project.Bills.getSourceType()){
-                if (node.data.type == rationType.volumePrice || node.data.type == rationType.gljRation || node.sourceType === projectObj.project.ration_glj.getSourceType()) {
-                    let VPType = sheetCommonObj.getDynamicCombo();
-                    if (node.data.type == rationType.volumePrice)
+                let VPType = sheetCommonObj.getDynamicCombo();
+                if(node.sourceType == projectObj.project.Ration.getSourceType()){//是定额类型
+                    if(node.data.type == rationType.volumePrice){
                         VPType.itemHeight(5).items(["人工", "材料", "机械", "主材", "设备"])
-                    else if (node.data.type == rationType.gljRation || node.sourceType === projectObj.project.ration_glj.getSourceType())
-                        if (!MainTreeCol.readOnly.non_editSubType(node)) {
+                        return VPType;
+                    }else if(node.data.type == rationType.gljRation){
+                        if(!MainTreeCol.readOnly.non_editSubType(node)&&gljOprObj.hasComposition(node.data,true)==false){
                             VPType.itemHeight(3).items(["材料", "主材", "设备"]);
-                        } else {
-                            return null;
+                            return VPType;
                         }
-                    return VPType;
+                    }
+                }else if(node.sourceType === projectObj.project.ration_glj.getSourceType()){//是工料机类型
+                    if(!MainTreeCol.readOnly.non_editSubType(node)&&gljOprObj.hasComposition(node.data)==false){
+                        VPType.itemHeight(3).items(["材料", "主材", "设备"]);
+                        return VPType;
+                    }
                 }
             }
         },

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

@@ -66,10 +66,11 @@ var projectObj = {
         let canDelete = function (node) {
             if (selected) {
                 if (selected.sourceType === that.project.Bills.getSourceType()) {
-                    return !(selected.data.flagsIndex && selected.data.flagsIndex.fixed && selected.data.flagsIndex.fixed.flag > 0);
-                } else {
-                    return true;
+                    if(selected.data.type == billType.DXFY&&selected.data.isAdd!=1){
+                        return false;
+                    }
                 }
+                return true;
             } else {
                 return false;
             }
@@ -851,7 +852,9 @@ $('#delete').click(function () {
         }else if(selected.sourceType==ModuleNames.ration_glj){
             project.ration_glj.updataOrdelete(selected.source);
         };
-        projectObj.converseCalculateBills(parent);
+        if(parent){
+            projectObj.converseCalculateBills(parent);
+        }
     };
 
     cbTools.refreshFormulaNodes();