fix: disabled false button report #4

Merged
farhantock merged 3 commits from dev-wahyun into master 4 months ago
  1. 1777
      edit-mode/function/ganttConfig.js
  2. 9
      edit-mode/function/reportActivity.js

1777
edit-mode/function/ganttConfig.js

File diff suppressed because it is too large Load Diff

9
edit-mode/function/reportActivity.js

@ -448,7 +448,6 @@ $(document).ready(function () {
imageFormData.append("ref_id", reportId);
imageFormData.append("category", "report_activity");
imageFormData.append("files", image, image.name);
imageFormData.append("company_name", company_name);
if (image.name && image.size) {
await axiosInstanceMultipart.post(`${base_url}image/upload`, imageFormData);
@ -460,10 +459,12 @@ $(document).ready(function () {
tableRaMaterialActual.draw();
} else {
$('#btn_add_ra_material').html('Add');
$('#btn_add_ra_material').prop("disabled", false);
throw new Error("Add report activity material failed.");
}
} catch (error) {
$('#btn_add_ra_material').html('Add');
$('#btn_add_ra_material').prop("disabled", false);
throw new Error("Image upload failed.");
}
} catch (error) {
@ -480,7 +481,8 @@ $(document).ready(function () {
}
});
} else {
resetFormAddRaMaterial();
$('#btn_add_ra_material').html('Add');
$('#btn_add_ra_material').prop("disabled", false);
gantt.alert("Add report activity material failed.");
}
}
@ -493,12 +495,13 @@ $(document).ready(function () {
.catch((error) => error.response);
if (result && result.status == 200) {
gantt.alert("Edit report activity Success!");
resetFormAddRaMaterial();
gantt.alert("Edit report activity Success!");
tableRaMaterialActual.draw();
} else {
resetFormAddRaMaterial();
$('#btn_add_ra_material').html('Add');
$('#btn_add_ra_material').prop("disabled", false);
gantt.alert("Edit report activity failed, try again later!");
}
}

Loading…
Cancel
Save