|
|
|
@ -14,6 +14,37 @@ function getUrlParameter(sParam) {
|
|
|
|
|
return false; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
function searchReport(id) { |
|
|
|
|
var payload = { |
|
|
|
|
"columns": [ |
|
|
|
|
{ |
|
|
|
|
"name": "assign_material_id", |
|
|
|
|
"logic_operator": "=", |
|
|
|
|
"value": id, |
|
|
|
|
"operator": "AND" |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
// "joins": [{ "name": "m_proyek", "column_join": "proyek_id", "column_results": ["kode_sortname", "nama"] }],
|
|
|
|
|
} |
|
|
|
|
$.ajax({ |
|
|
|
|
data: JSON.stringify(payload), |
|
|
|
|
url: `${base_url}report-activity-material/search`, |
|
|
|
|
type: "POST", |
|
|
|
|
success: function (data) { |
|
|
|
|
data.data.forEach(element => { |
|
|
|
|
let activityId = element.activity_id; |
|
|
|
|
let task = gantt.getTask(activityId); |
|
|
|
|
task.actual_start = null; |
|
|
|
|
task.actual_end = null; |
|
|
|
|
}); |
|
|
|
|
actionHappen = true; |
|
|
|
|
}, |
|
|
|
|
error: function (data) { |
|
|
|
|
// gantt.alert("Failed to get the data.");
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const formatNumber = (angka) => { |
|
|
|
|
var number_string = angka.replace(/[^,\d]/g, '').toString(), |
|
|
|
|
split = number_string.split(','), |
|
|
|
@ -733,27 +764,6 @@ function batchUpdate(){
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function updateSchedule() { |
|
|
|
|
$("body").addClass("loading"); |
|
|
|
|
return gantt.ajax.get({ |
|
|
|
|
headers: { |
|
|
|
|
"Content-Type": "application/json", |
|
|
|
|
"Authorization": `Bearer ${token}` |
|
|
|
|
}, |
|
|
|
|
url: base_url + "activity/update-schedule/" + ganttId |
|
|
|
|
}).then(function (response) { |
|
|
|
|
$("body").removeClass("loading"); |
|
|
|
|
refresData(); |
|
|
|
|
}).catch(function (error) { |
|
|
|
|
$("body").removeClass("loading") |
|
|
|
|
gantt.alert({ |
|
|
|
|
title: "Peringatan", |
|
|
|
|
type: "alert-error", |
|
|
|
|
text: "Update activity gagal" |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$(window).on('beforeunload', function(event) { |
|
|
|
|
let batchEntity = localStorage.getItem('batchEntity'); |
|
|
|
|
sendStorage(); |
|
|
|
|