|
|
|
@ -10,16 +10,12 @@ gantt.ajax.get({
|
|
|
|
|
let obj = JSON.parse(response); |
|
|
|
|
data['data'] = obj.data.data; |
|
|
|
|
data['links'] = obj.data.links; |
|
|
|
|
// console.log("data parse wrong", data);
|
|
|
|
|
// check if baseline has been set
|
|
|
|
|
if (data.data && data.data.length > 0) { |
|
|
|
|
console.log('baseline', data.data[0].planned_start); |
|
|
|
|
if (data.data[0].planned_start !== null && data.data[0].planned_end !== null) { |
|
|
|
|
console.log('baseline set'); |
|
|
|
|
isBaselineSet = true; |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
console.log('baseline has not been set'); |
|
|
|
|
isBaselineSet = false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -42,7 +38,6 @@ function refresData(id){
|
|
|
|
|
let obj = JSON.parse(response); |
|
|
|
|
data['data'] = obj.data.data; |
|
|
|
|
data['links'] = obj.data.links; |
|
|
|
|
// console.log("data parse wrong", data);
|
|
|
|
|
gantt.silent(function () { |
|
|
|
|
gantt.parse(data); |
|
|
|
|
}); |
|
|
|
@ -84,7 +79,6 @@ var dp = gantt.createDataProcessor(function(entity, action, data, id) {
|
|
|
|
|
}).then(function(response){ |
|
|
|
|
let res = response.responseText |
|
|
|
|
res = JSON.parse(res) |
|
|
|
|
console.log("qqqqqqcek response", res) |
|
|
|
|
if(entity=="link"){ |
|
|
|
|
gantt.changeLinkId(id, res.tid); |
|
|
|
|
}else if(entity=="task"){ |
|
|
|
@ -110,7 +104,6 @@ var dp = gantt.createDataProcessor(function(entity, action, data, id) {
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
// console.log("cek data update", data)
|
|
|
|
|
// let dataProgress = parseInt(data.progress)
|
|
|
|
|
// dataProgress = dataProgress/100
|
|
|
|
|
return gantt.ajax.put({ |
|
|
|
@ -125,7 +118,6 @@ var dp = gantt.createDataProcessor(function(entity, action, data, id) {
|
|
|
|
|
let parent = data.parent; |
|
|
|
|
let responseText = JSON.parse(response.responseText) |
|
|
|
|
let resData = responseText |
|
|
|
|
// console.log("dataRes", resData);
|
|
|
|
|
let updateBobot = resData.update_bobot || false |
|
|
|
|
if(updateBobot){ |
|
|
|
|
refresData(id); |
|
|
|
@ -134,25 +126,11 @@ var dp = gantt.createDataProcessor(function(entity, action, data, id) {
|
|
|
|
|
updateActivity(parent); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// console.log("data", data);
|
|
|
|
|
// refresData();
|
|
|
|
|
// if(resData && resData.rencana_biaya){
|
|
|
|
|
// if(data.rencana_biaya != resData.rencana_biaya){
|
|
|
|
|
// // gantt.getTask(id).bobot_planning = resData.bobot_planning;
|
|
|
|
|
// // gantt.updateTask(id);
|
|
|
|
|
|
|
|
|
|
// }else{
|
|
|
|
|
// if(parent && parent > 0){
|
|
|
|
|
// updateActivity(parent);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
case "delete": |
|
|
|
|
// console.log("cek data", data)
|
|
|
|
|
return gantt.ajax.del({ |
|
|
|
|
headers: { |
|
|
|
|
"Authorization": `Bearer ${token}` |
|
|
|
@ -173,13 +151,7 @@ var dp = gantt.createDataProcessor(function(entity, action, data, id) {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// console.log("cek data delete", data)
|
|
|
|
|
} |
|
|
|
|
// let res = response.responseText
|
|
|
|
|
// res = JSON.parse(res)
|
|
|
|
|
// console.log("cek response", res)
|
|
|
|
|
|
|
|
|
|
// refresData();
|
|
|
|
|
}); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|