zhangweicheng 5 лет назад
Родитель
Сommit
c3a4dc3f15

+ 1 - 0
web/building_saas/main/js/views/glj_view_contextMenu.js

@@ -446,6 +446,7 @@ function getActionUrl(actionType) {
     switch (actionType) {
         case 'add':
         case 'addMix':
+        case 'insert':  
         case 'unitPriceAddMix':
         case 'insertEquipment':
             return `${rootUrl}/0/true`;

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

@@ -1322,6 +1322,26 @@ var projectObj = {
                         return canInsertRationNode(selected);
                     }*/
                 },
+                "insertGLJ": {
+                  name: "插入人材机",
+                  icon: 'fa-sign-in',
+                  disabled: function () {
+                      if (projectReadOnly) {
+                          return true;
+                      }
+                      // var selected = project.mainTree.selected;
+                      // return project.Ration.addRationChecking(selected);  // Vincent, 2018-01-02
+                      return !project.Ration.canAdd(project.mainTree.selected);
+                  },
+                  callback: function (key, opt) {
+                    let selected = project.mainTree.selected;
+                    if(selected.data.calcBase&&selected.data.calcBase!=""){
+                        alert("当前有基数计算,不能插入定额/量价/工料机。");
+                        return;
+                    }
+                    getGLJData('insert');// ProjectController.addRation(project, controller, rationType.volumePrice);
+                  }
+                },
                 "insertLJ": {
                     name: "插入量价",//插入量价不需要自动定位到编号列
                     icon: 'fa-sign-in',
@@ -1360,7 +1380,7 @@ var projectObj = {
                         }
                     }
                 },
-                "insertGLJ": {
+                "insertEquipment": {
                     name: "插入设备",
                     icon: 'fa-sign-in',
                     disabled: function () {