Browse Source

fix: disabled false button report

pull/4/head
wahyun 4 months ago
parent
commit
e06fda69ef
  1. 8
      edit-mode/function/reportActivity.js

8
edit-mode/function/reportActivity.js

@ -460,10 +460,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 +482,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 +496,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!");
} }
} }

Loading…
Cancel
Save