|
|
|
@ -430,8 +430,11 @@ $(document).ready(function () {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async function submitRaMaterial(formData, id) { |
|
|
|
|
async function submitRaMaterial(formData, force) { |
|
|
|
|
try { |
|
|
|
|
if (force) { |
|
|
|
|
formData.append("force", force); |
|
|
|
|
} |
|
|
|
|
const qty_actual = $("#volume_pekerjaan_material").val(); |
|
|
|
|
formData.set('qty', qty_actual); |
|
|
|
|
const result = await axiosInstance |
|
|
|
@ -460,9 +463,22 @@ $(document).ready(function () {
|
|
|
|
|
throw new Error("Image upload failed."); |
|
|
|
|
} |
|
|
|
|
} catch (error) { |
|
|
|
|
resetFormAddRaMaterial(); |
|
|
|
|
$("body").removeClass("loading"); |
|
|
|
|
gantt.alert("Add report activity material failed."); |
|
|
|
|
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."); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|