Browse Source

Merge pull request 'dev-wahyu' (#36) from dev-wahyu into staging

Reviewed-on: ordo/adw-gantt#36
pull/1/head
ibnu 1 year ago
parent
commit
a512ee5898
  1. 1
      edit-mode/function/expenseResource.js
  2. 26
      edit-mode/function/function.js
  3. 6
      edit-mode/function/ganttSettings.js
  4. 2
      edit-mode/function/materialResource.js
  5. 2
      edit-mode/function/restActivityLink.js

1
edit-mode/function/expenseResource.js

@ -4,6 +4,7 @@ function resetFormAssignexpense() {
$('#select-expense').val(null).trigger("change"); $('#select-expense').val(null).trigger("change");
$('#select-expense').find('option').remove(); $('#select-expense').find('option').remove();
$('#select-expense').val(""); $('#select-expense').val("");
$('#uom-req-expense').val(null).trigger('change');
$('#form-assign-expense').trigger("reset"); $('#form-assign-expense').trigger("reset");
$('#btn-assign-expense').html('Assign'); $('#btn-assign-expense').html('Assign');
$('#btn-assign-expense').prop("disabled", false); $('#btn-assign-expense').prop("disabled", false);

26
edit-mode/function/function.js

@ -367,6 +367,32 @@ function setGanttOpen() {
localStorage.setItem('ganttOpen', JSON.stringify(ganttOpen)); localStorage.setItem('ganttOpen', JSON.stringify(ganttOpen));
} }
function compareData(data){
expandTask();
var allTasks = [];
var taskCount = gantt.getTaskCount();
for (var i = 0; i < taskCount; i++) {
var task = gantt.getTaskByIndex(i);
allTasks.push(task);
}
allTasks.forEach((task, index) => {
if (task.start_date != data.data[index].start_date) {
gantt.getTask(task.id).start_date = task.start_date;
}
if (task.end_date != data.data[index].end_date) {
gantt.getTask(task.id).end_date = task.end_date;
}
if (task.planned_start != data.data[index].planned_start) {
gantt.getTask(task.id).planned_start = task.planned_start;
}
if (task.planned_end != data.data[index].planned_end) {
gantt.getTask(task.id).planned_end = task.planned_end;
}
gantt.updateTask(task.id);
});
}
function getGanttOpen() { function getGanttOpen() {
let ganttOpen = localStorage.getItem('ganttOpen'); let ganttOpen = localStorage.getItem('ganttOpen');
if (ganttOpen) { if (ganttOpen) {

6
edit-mode/function/ganttSettings.js

@ -350,7 +350,7 @@ function setBaseline() {
}); });
} }
async function setBaselineAPI() { async function importUpdate() {
expandTask(); expandTask();
var allTasks = []; var allTasks = [];
var taskCount = gantt.getTaskCount(); var taskCount = gantt.getTaskCount();
@ -381,6 +381,10 @@ async function setBaselineAPI() {
text: "Update import gagal" text: "Update import gagal"
}); });
}); });
}
async function setBaselineAPI() {
await importUpdate();
const res = await axiosInstance const res = await axiosInstance
.get(ACTIVITY_SET_BASELINE_URL, HEADER) .get(ACTIVITY_SET_BASELINE_URL, HEADER)
.then(res => res) .then(res => res)

2
edit-mode/function/materialResource.js

@ -4,6 +4,8 @@ function resetFormAssignMaterial() {
$('#select-material').val(null).trigger("change"); $('#select-material').val(null).trigger("change");
$('#select-material').find('option').remove(); $('#select-material').find('option').remove();
$('#select-material').val(""); $('#select-material').val("");
$('#uom-req-material').val(null).trigger('change');
$('#select-material-integration').val(null).trigger('change');
$('#form-assign-material').trigger("reset"); $('#form-assign-material').trigger("reset");
$('#btn-assign-material').html('Assign'); $('#btn-assign-material').html('Assign');
$('#btn-assign-material').prop("disabled", false); $('#btn-assign-material').prop("disabled", false);

2
edit-mode/function/restActivityLink.js

@ -40,6 +40,7 @@ gantt.ajax.get({
gantt.silent(function () { gantt.silent(function () {
// updateLinksLag(data); // updateLinksLag(data);
gantt.parse(data); gantt.parse(data);
compareData(data);
getGanttOpen(); getGanttOpen();
gantt.parse(data); gantt.parse(data);
earliest = getEarliestTaskDate(); earliest = getEarliestTaskDate();
@ -93,6 +94,7 @@ function refresData(id) {
gantt.silent(function () { gantt.silent(function () {
// updateLinksLag(data); // updateLinksLag(data);
gantt.parse(data); gantt.parse(data);
compareData(data);
getGanttOpen(); getGanttOpen();
gantt.parse(data); gantt.parse(data);
earliest = getEarliestTaskDate(); earliest = getEarliestTaskDate();

Loading…
Cancel
Save