Browse Source

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

Reviewed-on: ordo/adw-gantt#42
pull/1/head
ibnu 1 year ago
parent
commit
bb5221f9a4
  1. 3
      edit-mode/function/function.js
  2. 20
      edit-mode/function/reportActivity.js

3
edit-mode/function/function.js

@ -378,7 +378,8 @@ function compareData(data){
} }
allTasks.forEach((task, index) => { allTasks.forEach((task, index) => {
if (task.progress > 0 && task.progress < 1) { if (task.progress > 0 && task.progress < 1) {
task.end_date = moment().format('YYYY-MM-DD HH:mm:ss'); // task.end_date = moment().format('YYYY-MM-DD HH:mm:ss');
// task.end_date = new Date();
} }
if (task.start_date != data.data[index].start_date) { if (task.start_date != data.data[index].start_date) {
gantt.getTask(task.id).start_date = task.start_date; gantt.getTask(task.id).start_date = task.start_date;

20
edit-mode/function/reportActivity.js

@ -430,8 +430,11 @@ $(document).ready(function () {
} }
} }
async function submitRaMaterial(formData, id) { async function submitRaMaterial(formData, force) {
try { try {
if (force) {
formData.append("force", force);
}
const qty_actual = $("#volume_pekerjaan_material").val(); const qty_actual = $("#volume_pekerjaan_material").val();
formData.set('qty', qty_actual); formData.set('qty', qty_actual);
const result = await axiosInstance const result = await axiosInstance
@ -460,11 +463,24 @@ $(document).ready(function () {
throw new Error("Image upload failed."); throw new Error("Image upload failed.");
} }
} catch (error) { } catch (error) {
resetFormAddRaMaterial();
$("body").removeClass("loading"); $("body").removeClass("loading");
if (error.response.status == 400) {
gantt.confirm({
text: error.response.data.message,
ok: "Add",
cancel: "Cancel",
callback: function (result) {
if (result) {
submitRaMaterial(formData, true);
}
}
});
} else {
resetFormAddRaMaterial();
gantt.alert("Add report activity material failed."); gantt.alert("Add report activity material failed.");
} }
} }
}
async function updateRaMaterial(formData, id) { async function updateRaMaterial(formData, id) {
const result = await axiosInstance const result = await axiosInstance

Loading…
Cancel
Save