|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
let geom = []; |
|
|
|
|
let latest; |
|
|
|
|
let earliest; |
|
|
|
|
let ganttTask; |
|
|
|
|
$("body").addClass("loading"); |
|
|
|
|
gantt.ajax.get({ |
|
|
|
|
url: `${base_url}activity/${ganttId}/${proyekId}/get`, |
|
|
|
@ -13,8 +14,10 @@ gantt.ajax.get({
|
|
|
|
|
let batchEntity = localStorage.getItem('batchEntity'); |
|
|
|
|
if (!batchEntity || batchEntity == '') { |
|
|
|
|
$("#save-activity").hide(); |
|
|
|
|
$("#save-separator").hide(); |
|
|
|
|
} else { |
|
|
|
|
$("#save-activity").show(); |
|
|
|
|
$("#save-separator").show(); |
|
|
|
|
} |
|
|
|
|
let data = {}; |
|
|
|
|
let response = xhr.responseText; |
|
|
|
@ -39,8 +42,8 @@ gantt.ajax.get({
|
|
|
|
|
}); |
|
|
|
|
gantt.silent(function () { |
|
|
|
|
// updateLinksLag(data);
|
|
|
|
|
ganttTask = data; |
|
|
|
|
gantt.parse(data); |
|
|
|
|
compareData(data); |
|
|
|
|
getGanttOpen(); |
|
|
|
|
gantt.parse(data); |
|
|
|
|
earliest = getEarliestTaskDate(); |
|
|
|
@ -75,8 +78,10 @@ function refresData(id) {
|
|
|
|
|
let batchEntity = localStorage.getItem('batchEntity'); |
|
|
|
|
if (!batchEntity || batchEntity == '') { |
|
|
|
|
$("#save-activity").hide(); |
|
|
|
|
$("#save-separator").hide(); |
|
|
|
|
} else { |
|
|
|
|
$("#save-activity").show(); |
|
|
|
|
$("#save-separator").show(); |
|
|
|
|
} |
|
|
|
|
gantt.clearAll(); |
|
|
|
|
let data = {}; |
|
|
|
@ -93,8 +98,8 @@ function refresData(id) {
|
|
|
|
|
}); |
|
|
|
|
gantt.silent(function () { |
|
|
|
|
// updateLinksLag(data);
|
|
|
|
|
ganttTask = data; |
|
|
|
|
gantt.parse(data); |
|
|
|
|
compareData(data); |
|
|
|
|
getGanttOpen(); |
|
|
|
|
gantt.parse(data); |
|
|
|
|
earliest = getEarliestTaskDate(); |
|
|
|
@ -176,6 +181,11 @@ var dp = gantt.createDataProcessor(function (entity, action, data, id) {
|
|
|
|
|
// data['start_date'] = startDate.format("YYYY-MM-DD")+" 00:00:00+07";
|
|
|
|
|
let endDate = moment(data.end_date, "YYYY-MM-DD"); |
|
|
|
|
|
|
|
|
|
let configStart = moment(gantt.config.start_date); |
|
|
|
|
let configEnd = moment(gantt.config.end_date); |
|
|
|
|
if (startDate >= configEnd || startDate <= configStart || endDate >= configEnd || endDate <= configStart) { |
|
|
|
|
// location.reload();
|
|
|
|
|
} |
|
|
|
|
if (startDate > endDate) { |
|
|
|
|
gantt.alert({ |
|
|
|
|
title: "Peringatan", |
|
|
|
@ -215,6 +225,7 @@ var dp = gantt.createDataProcessor(function (entity, action, data, id) {
|
|
|
|
|
} |
|
|
|
|
localStorage.setItem('batchEntity', JSON.stringify(toBeSet)); |
|
|
|
|
$("#save-activity").show(); |
|
|
|
|
$("#save-separator").show(); |
|
|
|
|
sendStorage(); |
|
|
|
|
// $("body").addClass("loading");
|
|
|
|
|
// return gantt.ajax.put({
|
|
|
|
|