Browse Source

implement decimal on actual

pull/1/head
Yusuf 2 years ago
parent
commit
5a5a115835
  1. 17
      src/function/reportActivity.js
  2. 361
      src/index.html

17
src/function/reportActivity.js

@ -12,7 +12,6 @@ function resetFormAddRa() {
$('#form_report_activity').trigger("reset");
$('#btn_add_ra').html('Add');
$('#btn_add_ra').prop("disabled", false);
}
function resetFormAddRaMaterial() {
@ -20,9 +19,13 @@ function resetFormAddRaMaterial() {
$('#form_report_activity_material').trigger("reset");
$('#btn_add_ra_material').html('Add');
$('#btn_add_ra_material').prop("disabled", false);
}
var qty = document.getElementById('volume_pekerjaan_material');
qty.addEventListener('keyup', function (e) {
qty.value = formatRibuanInput(this.value);
});
$(document).ready(function () {
$("#table_report tbody").on("click", ".btn-update-status", function () {
@ -84,7 +87,7 @@ $(document).ready(function () {
{ data: 'material_name', name: 'material_name' },
{
data: 'qty_planning', render: function (data, type) {
return data ? formatRupiah(parseInt(data)) : '-'
return data ? formatRupiah(data) : '-'
}
},
{
@ -145,7 +148,11 @@ $(document).ready(function () {
return data ? formatDate(data) : '-'
}
},
{ data: 'qty', name: 'qty' },
{
data: 'qty', render: function (data, type) {
return data ? formatRupiah(data) : '-'
}
},
{ data: 'description', name: 'description' },
{
data: 'action',
@ -423,6 +430,8 @@ $(document).ready(function () {
}
async function submitRaMaterial(formData) {
let qty_actual = $("#volume_pekerjaan_material").val();
formData.set('qty', qty_actual);
const result = await axiosInstance
.post(`${base_url}report-activity-material/add`, formData)
.then(res => res)

361
src/index.html

@ -181,56 +181,6 @@
</div>
</div>
<!-- Modal resource -->
<!-- <div class="mb-3">
<div class="row">
<div class="col-md-11">
</div>
<div class="col-md-1">
<button id="add-tool-resource" type="button" class="btn btn-primary btn-sm"><i class="fa fa-plus"
aria-hidden="true"></i></button>
</div>
</div>
<table style="padding-top: 5px;" class="table table-sm">
<caption>Tools</caption>
<thead>
<tr>
<th scope="col">Tools Name</th>
<th scope="col">Qty</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody id="table-tool-resource">
</tbody>
</table>
</div> -->
<!-- Modal Material -->
<!-- <div class="mb-3">
<div class="row">
<div class="col-md-11">
</div>
<div class="col-md-1">
<button id="add-material-resource" type="button" class="btn btn-primary btn-sm"><i class="fa fa-plus"
aria-hidden="true"></i></button>
</div>
</div>
<table style="padding-top: 5px;" class="table table-sm">
<caption>Materials</caption>
<thead>
<tr>
<th scope="col">Material Name</th>
<th scope="col">QTY</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody id="table-material-resource">
</tbody>
</table>
</div> -->
<!-- modal comments -->
<div class="modal fade" id="modal_comments" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
@ -282,9 +232,6 @@
<button title="Add Document" type="button" class="btn btn-primary btn-sm modal_add_btn_doc">
<span aria-hidden="true"><i class="fa fa-plus"></i></span>
</button>
<!-- <button title="close" type="button" class="btn btn-xs" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true"><i class="fa fa-times"></i></span>
</button> -->
</div>
</div>
<div class="modal-body">
@ -320,8 +267,6 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">Close</button>
<!-- <button type="button" class="btn btn-primary">Save changes</button> -->
</div>
</div>
</div>
@ -339,7 +284,7 @@
<div class="modal-body">
<form id="form-assign-material">
<div class="form-row">
<div class="col-md-3 form-group">
<div class="col-md-2 form-group">
<label>Description</label>
<input type="text" id="description-req-material" name="descriptionReqMaterial"
class="form-control form-control-sm" />
@ -359,12 +304,12 @@
<input type="text" id="uom-req-material" name="uomReqMaterial" class="form-control form-control-sm" />
</div>
<div class="col-md-2 form-group">
<label>Required Date</label>
<label>Expected arrival date</label>
<input type="date" id="required-date-req-material" name="requiredDateReqMaterial"
class="form-control form-control-sm" />
</div>
<div class="col-md-2 form-group">
<label>Planning Date</label>
<label>Will be used at</label>
<input type="date" id="required-date-plan-material" name="requiredDatePlanMaterial"
class="form-control form-control-sm" />
</div>
@ -372,16 +317,7 @@
<button style="margin-top: 31px;" id="btn-assign-material" type="submit"
class="btn btn-sm btn-primary">Assign</button>
</div>
<!-- <div class="col-md-4 form-group">
<label>Price per-unit</label>
<input type="number" id="select-meterial-budget" name="budget" class="form-control form-control-sm"/>
</div> -->
</div>
<!-- <div class="text-right">
<button id="btn-assign-material" type="submit" class="btn btn-sm btn-primary">Assign</button>
</div> -->
<hr />
</form>
<table id="table-material" class="table table-sm" style="width: 100%;">
@ -436,9 +372,6 @@
class="btn btn-sm btn-primary">Assign</button>
</div>
</div>
<!-- <div class="text-right">
<button id="btn-assign-tools" type="submit" class="btn btn-sm btn-primary">Assign</button>
</div> -->
<hr />
</form>
<table id="table-tools" class="table table-sm" style="width: 100%;">
@ -461,79 +394,6 @@
</div>
</div>
<!-- modal gantt setting old-->
<!-- <div class="modal fade" id="modal_gantt_setting" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Gantt Settings</h5>
<div class="modal-actions">
<button title="close" type="button" class="btn btn-xs" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true"><i class="fa fa-times"></i></span>
</button>
</div>
</div>
<div class="modal-body" id="modal_gantt_setting_body">
<div>
<form id="modal_gantt_setting_form">
<div class="form-group">
<label><b>Set Days Off</b></label>
<select name="select_dayoff[]" id="select_dayoff" class="form-control" placeholder="Select Days" multiple>
<option value="0">Sunday</option>
<option value="1">Monday</option>
<option value="2">Tuesday</option>
<option value="3">Wednesday</option>
<option value="4">Thursday</option>
<option value="5">Friday</option>
<option value="6">Saturday</option>
</select>
</div>
</form>
</div>
<div>
<div class="d-flex justify-content-between pr-1 pl-1 mb-1" style="width: 100%;">
<h6><b>Set Holidays</b></h6>
<button id="add-holiday" class="btn btn-sm btn-primary"><i class="fa fa-plus"></i></button>
<button id="hide-holiday" class="btn btn-sm btn-primary elm-hide"><i class="fa fa-chevron-up"></i></button>
</div>
<form class="mb-1 elm-hide" id="form_holiday">
<div class="form-row">
<div class="col-md-3 form-group">
<label>Date</label>
<input id="date_holiday" required type="date" name="date" class="form-control form-control-sm" />
</div>
<div class="col-md-3 form-group">
<label>Duration</label>
<input id="duration_holiday" required type="number" name="duration" class="form-control form-control-sm" value="1" />
</div>
<div class="col-md-6 form-group">
<label>Description</label>
<textarea id="desc_holiday" type="text" name="description" class="form-control form-control-sm" placeholder="Cuti bersama tahun baru.."></textarea>
</div>
</div>
<div class="text-right">
<button id="btn_add_holiday" type="submit" class="btn btn-sm btn-primary">Add Holiday</button>
</div>
<hr />
</form>
<table style="width: 100%;" class="table table-sm" id="table_holiday">
<thead>
<tr>
<th>Date</th>
<th>Duration</th>
<th>Description</th>
<th>Action</th>
</tr>
</thead>
</table>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-sm btn-primary" id="btn_save_setting">Apply changes</button>
</div>
</div>
</div>
</div> -->
<!-- modal gantt setting -->
<div class="modal fade" id="modal_gantt_setting" tabindex="-1" role="dialog">
@ -649,63 +509,6 @@
</div>
</div>
<!-- test paragraph -->
<!-- <div id="setDayOff" style="display: none">
<form id="modal_gantt_setting_form">
<div class="form-group">
<label><b>Set Days Off</b></label>
<select name="select_dayoff[]" id="select_dayoff" class="form-control" placeholder="Select Days" multiple>
<option value="0">Sunday</option>
<option value="1">Monday</option>
<option value="2">Tuesday</option>
<option value="3">Wednesday</option>
<option value="4">Thursday</option>
<option value="5">Friday</option>
<option value="6">Saturday</option>
</select>
</div>
</form>
</div> -->
<!-- <div id="setHoliday" style="display: none;">
<div class="d-flex justify-content-between pr-1 pl-1 mb-1" style="width: 100%;">
<h6><b>Set Holidays</b></h6>
<button id="add-holiday" class="btn btn-sm btn-primary"><i class="fa fa-plus"></i></button>
<button id="hide-holiday" class="btn btn-sm btn-primary elm-hide"><i class="fa fa-chevron-up"></i></button>
</div>
<form class="mb-1 elm-hide" id="form_holiday">
<div class="form-row">
<div class="col-md-3 form-group">
<label>Date</label>
<input id="date_holiday" required type="date" name="date" class="form-control form-control-sm" />
</div>
<div class="col-md-3 form-group">
<label>Duration</label>
<input id="duration_holiday" required type="number" name="duration" class="form-control form-control-sm" value="1" />
</div>
<div class="col-md-6 form-group">
<label>Description</label>
<textarea id="desc_holiday" type="text" name="description" class="form-control form-control-sm" placeholder="Cuti bersama tahun baru.."></textarea>
</div>
</div>
<div class="text-right">
<button id="btn_add_holiday" type="submit" class="btn btn-sm btn-primary">Add Holiday</button>
</div>
<hr />
</form>
<table style="width: 100%;" class="table table-sm" id="table_holiday">
<thead>
<tr>
<th>Date</th>
<th>Duration</th>
<th>Description</th>
<th>Action</th>
</tr>
</thead>
</table>
</div> -->
<!-- modal gantt milestone -->
<div class="modal fade" id="modal-add-milestone" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
@ -747,74 +550,6 @@
</div>
</div>
<!-- modal gantt laporan activity old-->
<!-- <div class="modal fade" id="modal_report_activity" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header d-flex flex-row justify-content-between" style="width: 100%;">
<h5 class="modal-title" id="report_activity_title">Report Activity</h5>
<div>
<button id="show_form_ra" type="button" class="btn btn-primary btn-sm"><i class="fa fa-plus"
aria-hidden="true"></i></button>
<button id="hide_form_ra" type="button" class="elm-hide btn btn-primary btn-sm"><i class="fa fa-chevron-up"
aria-hidden="true"></i></button>
</div>
</div>
<div class="modal-body" >
<form class="elm-hide" id="form_report_activity">
<input type="hidden" id="id_ra" />
<div class="form-row">
<div class="col-md-6 form-group">
<label>Human Resource</label>
<select id="select_ra_hr" name="user_id" class="form-control form-control-sm" style="width:100%;" required></select>
</div>
<div class="col-md-6 form-group">
<label>Report Date</label>
<input type="date" id="ra_date" name="report_date" class="form-control form-control-sm" required />
</div>
</div>
<div class="form-row">
<div class="col-md-6 form-group">
<label>Volume Pekerjaan</label>
<input type="number" id="volume_pekerjaan" name="job_count_report" class="form-control form-control-sm" style="width:100%;" required></select>
</div>
<div class="col-md-6 form-group">
<label>Foto</label>
<input type="file" id="foto_ra" name="files" class="form-control form-control-sm" />
</div>
</div>
<div class="form-group">
<label>Deskripsi</label>
<textarea id="ra_description" class="form-control form-control-sm" name="description" required></textarea>
</div>
<div class="text-right">
<button id="btn_add_ra" type="submit" class="btn btn-sm btn-primary">Add</button>
</div>
<hr />
</form>
<div class="table-responsive">
<table id="table_report" class="table table-sm" style="width: 100%;">
<thead>
<tr>
<th scope="col">Nama Human Resource</th>
<th scope="col">Tanggal Lapor</th>
<th scope="col">Volume Pekerjaan</th>
<th scope="col">Desckripsi</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal" aria-label="Close">Close</button>
</div>
</div>
</div>
</div> -->
<!-- modal gantt laporan activity new -->
<div class="modal fade" id="modal_report_activity" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
@ -835,31 +570,6 @@
<h6 class="text-update-status"></h6>
<input type="hidden" id="id_ra" />
<div class="form-row">
<!-- <div class="col-md-6 form-group">
<label>Human Resource</label>
<select id="select_ra_hr" name="user_id" class="form-control form-control-sm" style="width:100%;"
required></select>
</div>
<div class="col-md-6 form-group">
<label>Report Date</label>
<input type="date" id="ra_date" name="report_date" class="form-control form-control-sm" required />
</div>
</div>
<div class="form-row">
<div class="col-md-6 form-group">
<label>Volume Pekerjaan</label>
<input type="number" id="volume_pekerjaan" name="job_count_report" class="form-control form-control-sm"
style="width:100%;" required></select>
</div>
<div class="col-md-6 form-group">
<label>Foto</label>
<input type="file" id="foto_ra" name="files" class="form-control form-control-sm" />
</div>
</div>
<div class="form-group">
<label>Deskripsi</label>
<textarea id="ra_description" class="form-control form-control-sm" name="description" required></textarea>
</div> -->
<div class="col-md-4 form-group">
<label>Status</label>
<!-- <input type="date" id="ra_date" name="report_date" class="form-control form-control-sm" required /> -->
@ -890,24 +600,6 @@
</div>
<hr />
</form>
<!-- <div class="table-responsive">
<table id="table_report" class="table table-sm" style="width: 100%;">
<thead>
<tr>
<th scope="col">Material</th>
<th scope="col">Volume Plan</th>
<th scope="col">Volume Kumulatif Aktual</th>
<th scope="col">UOM</th>
<th scope="col">Start Activity</th>
<th scope="col">Finish Activity</th>
<th scope="col">Status</th>
<th scope="col">Input Progress</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div> -->
<div class="table-responsive">
<table id="table_report" class="table table-sm" style="width: 100%;">
@ -942,49 +634,8 @@
<div class="modal-content">
<div class="modal-header d-flex flex-row justify-content-between" style="width: 100%;">
<h5 class="modal-title" id="report_activity_material_title">Report Activity Material</h5>
<!-- <div>
<button id="show_form_ra_material" type="button" class="btn btn-primary btn-sm"><i class="fa fa-plus"
aria-hidden="true"></i></button>
<button id="hide_form_ra_material" type="button" class="elm-hide btn btn-primary btn-sm"><i
class="fa fa-chevron-up" aria-hidden="true"></i></button>
</div> -->
</div>
<div class="modal-body">
<!-- <form class="elm-hide" id="form_report_activity_material">
<input type="hidden" id="id_ra_material" />
<div class="form-row">
<div class="col-md-6 form-group">
<label>Human Resource</label>
<select id="select_ra_hr_material" name="user_id" class="form-control form-control-sm"
style="width:100%;" required></select>
</div>
<div class="col-md-6 form-group">
<label>Report Date</label>
<input type="date" id="ra_date_material" name="report_date" class="form-control form-control-sm"
required />
</div>
</div>
<div class="form-row">
<div class="col-md-6 form-group">
<label>Volume Pekerjaan</label>
<input type="number" id="volume_pekerjaan_material" name="qty" class="form-control form-control-sm"
style="width:100%;" required></select>
</div>
<div class="col-md-6 form-group">
<label>Foto</label>
<input type="file" id="foto_ra_material" name="files" class="form-control form-control-sm" />
</div>
</div>
<div class="form-group">
<label>Deskripsi</label>
<textarea id="ra_description_material" class="form-control form-control-sm" name="description"
required></textarea>
</div>
<div class="text-right">
<button id="btn_add_ra_material" type="submit" class="btn btn-sm btn-primary">Add</button>
</div>
<hr />
</form> -->
<form class="mb-1 elm-hide" id="form_report_activity_material">
<input type="hidden" id="id_ra_material" />
<div class="form-row">
@ -999,9 +650,9 @@
required />
</div>
<div class="col-md-2 form-group">
<label>Volume Pekerjaan</label>
<input type="number" id="volume_pekerjaan_material" name="qty" class="form-control form-control-sm"
style="width:100%;" required></select>
<label>Volume Aktual</label>
<input type="text" id="volume_pekerjaan_material" name="qty"
class="form-control form-control-sm" />
</div>
<div class="col-md-2 form-group">
<label>Foto</label>

Loading…
Cancel
Save