Browse Source

fix today marker

pull/1/head
wahyu 1 year ago
parent
commit
b6fa148aac
  1. 31
      edit-mode/function/expenseResource.js
  2. 52
      edit-mode/function/function.js
  3. 21
      edit-mode/function/ganttSettings.js

31
edit-mode/function/expenseResource.js

@ -75,37 +75,6 @@ $(document).ready(function () {
}); });
} }
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.");
}
});
}
$("#modal-expense").on("click", "#show-form-expense", function () { $("#modal-expense").on("click", "#show-form-expense", function () {
$(this).hide(); $(this).hide();
$("#hide-form-expense").show(); $("#hide-form-expense").show();

52
edit-mode/function/function.js

@ -14,6 +14,37 @@ function getUrlParameter(sParam) {
return false; 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) => { const formatNumber = (angka) => {
var number_string = angka.replace(/[^,\d]/g, '').toString(), var number_string = angka.replace(/[^,\d]/g, '').toString(),
split = number_string.split(','), 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) { $(window).on('beforeunload', function(event) {
let batchEntity = localStorage.getItem('batchEntity'); let batchEntity = localStorage.getItem('batchEntity');
sendStorage(); sendStorage();

21
edit-mode/function/ganttSettings.js

@ -447,6 +447,27 @@ function setSynchronize() {
}); });
} }
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");
window.location.reload();
}).catch(function (error) {
$("body").removeClass("loading")
gantt.alert({
title: "Peringatan",
type: "alert-error",
text: "Update activity gagal"
});
});
}
async function setSynchronizeAPI() { async function setSynchronizeAPI() {
const res = await axiosInstance const res = await axiosInstance
.get(ACTIVITY_SYNCHRONIZE_REPORT_URL, HEADER) .get(ACTIVITY_SYNCHRONIZE_REPORT_URL, HEADER)

Loading…
Cancel
Save