Browse Source

update disable function updatelinkslag

pull/1/head
ibnu 1 year ago
parent
commit
6398ce0420
  1. 10
      edit-mode/function/function.js
  2. 4
      edit-mode/function/restActivityLink.js
  3. 2
      edit-mode/index.html

10
edit-mode/function/function.js

@ -719,22 +719,22 @@ function sendStorage(){
function updateLinksLag(data) { function updateLinksLag(data) {
data.data.forEach(task => { data.data.forEach(task => {
data.links.forEach(link => { data.links.forEach(link => {
if (link.target == task.id) { if (link.target == task.id && task.actual_start != null) {
let predecessor = data.data.find(item => item.id == link.source); let predecessor = data.data.find(item => item.id == link.source);
if (predecessor) { if (predecessor) {
let lag; let lag;
if (isBaselineSet) { if (isBaselineSet) {
switch (link.type) { switch (link.type) {
case "0": case "0": // FS
lag = gantt.calculateDuration(new Date(predecessor.end_date), new Date(task.start_date)); lag = gantt.calculateDuration(new Date(predecessor.end_date), new Date(task.start_date));
break; break;
case "1": case "1": // SS
lag = gantt.calculateDuration(new Date(predecessor.start_date), new Date(task.start_date)); lag = gantt.calculateDuration(new Date(predecessor.start_date), new Date(task.start_date));
break; break;
case "2": case "2": // FF
lag = gantt.calculateDuration(new Date(predecessor.end_date), new Date(task.end_date)); lag = gantt.calculateDuration(new Date(predecessor.end_date), new Date(task.end_date));
break; break;
case "3": case "3": // SF
lag = gantt.calculateDuration(new Date(predecessor.start_date), new Date(task.end_date)); lag = gantt.calculateDuration(new Date(predecessor.start_date), new Date(task.end_date));
break; break;
default: default:

4
edit-mode/function/restActivityLink.js

@ -38,7 +38,7 @@ gantt.ajax.get({
}) })
}); });
gantt.silent(function () { gantt.silent(function () {
updateLinksLag(data); // updateLinksLag(data);
gantt.parse(data); gantt.parse(data);
getGanttOpen(); getGanttOpen();
gantt.parse(data); gantt.parse(data);
@ -91,7 +91,7 @@ function refresData(id) {
}) })
}); });
gantt.silent(function () { gantt.silent(function () {
updateLinksLag(data); // updateLinksLag(data);
gantt.parse(data); gantt.parse(data);
getGanttOpen(); getGanttOpen();
gantt.parse(data); gantt.parse(data);

2
edit-mode/index.html

@ -383,7 +383,7 @@
<th scope="col">QTY</th> <th scope="col">QTY</th>
<th scope="col">UOM</th> <th scope="col">UOM</th>
<th scope="col">Price</th> <th scope="col">Price</th>
<th scope="col">Planning Date</th> <th scope="col">Will Be Used At</th>
<th scope="col">Actions</th> <th scope="col">Actions</th>
</tr> </tr>
</thead> </thead>

Loading…
Cancel
Save