Przeglądaj źródła

计划排期实绩优化

wyh 2 lat temu
rodzic
commit
e87cf71f4c
1 zmienionych plików z 22 dodań i 1 usunięć
  1. 22 1
      itdmWeb/src/components/Gantt.vue

+ 22 - 1
itdmWeb/src/components/Gantt.vue

@@ -278,7 +278,7 @@ export default {
           return gridDateToStr(date);
         }
       }
-      // 右侧项目展示
+      // 右侧任务展示
       gantt.templates.task_text = function (start, end, task) {
         // console.log(task)
         // return "<b>设备:</b> " + task.shebeiId + ",<b> 项目经理:</b> " + task.pm;
@@ -331,6 +331,27 @@ export default {
         focus: function (node) {
           $(node.firstChild).focus();
         }};
+        // 左侧列表任务垂直移动
+      gantt.attachEvent("onBeforeTaskMove", function(id, parent, tindex){
+          const task = gantt.getTask(id);
+          console.log("yidoong",task)
+          if(task.izShiji == "实绩"){
+            return false;
+          }else{
+            return true;
+          }
+      });
+      // 右侧网格任务水平移动+改变长度
+      gantt.attachEvent("onBeforeTaskDrag", function(id, mode, e){
+          console.log("右侧",id, mode, e)
+          const task = gantt.getTask(id);
+          console.log("yidoong",task)
+          if(task.izShiji == "实绩"){
+            return false;
+          }else{
+            return true;
+          }
+      });
       // 重置灯箱
       gantt.attachEvent("onBeforeLightbox", function(task_id) {
         gantt.resetLightbox();