Browse Source

fix actual dates

pull/1/head
wahyu 1 year ago
parent
commit
1e772fd47e
  1. 32
      edit-mode/function/expenseResource.js
  2. 7
      edit-mode/function/reportActivity.js

32
edit-mode/function/expenseResource.js

@ -60,6 +60,7 @@ $(document).ready(function () {
});
function deleteexpenseAssign(id) {
searchReport(id);
$.ajax({
url: `${base_url}assign-material/delete/${id}`,
type: "DELETE",
@ -74,6 +75,37 @@ $(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 () {
$(this).hide();
$("#hide-form-expense").show();

7
edit-mode/function/reportActivity.js

@ -375,6 +375,13 @@ $(document).ready(function () {
});
async function submitStatus(formData) {
let activityId = formData.get("activity_id");
let statusActivity = formData.get("status_activity");
let task = gantt.getTask(activityId);
if (statusActivity != "done") {
task.actual_start = null;
task.actual_end = null;
}
const result = await axiosInstance
.post(`${base_url}report-activity-material/update-status`, formData)
.then(res => res)

Loading…
Cancel
Save