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