|
|
@ -21,9 +21,9 @@ function resetFormAddRaMaterial() { |
|
|
|
$('#btn_add_ra_material').prop("disabled", false); |
|
|
|
$('#btn_add_ra_material').prop("disabled", false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var qtyActual = document.getElementById('volume_pekerjaan_material');
|
|
|
|
var qtyActual = document.getElementById('volume_pekerjaan_material'); |
|
|
|
qtyActual.addEventListener('keyup', function (e) {
|
|
|
|
qtyActual.addEventListener('keyup', function (e) { |
|
|
|
qtyActual.value = formatRibuanInput(this.value);
|
|
|
|
qtyActual.value = formatRibuanInput(this.value); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
$(document).ready(function () { |
|
|
|
$(document).ready(function () { |
|
|
@ -74,7 +74,38 @@ $(document).ready(function () { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
var tableRa = $("#table_report").DataTable({ |
|
|
|
var tableRa = $("#table_report").on('xhr.dt', function(e, settings, json, xhr){ |
|
|
|
|
|
|
|
$('#report-activity-information-status').attr("class", ""); |
|
|
|
|
|
|
|
if(json?.data?.length > 0) { |
|
|
|
|
|
|
|
let firstData = json.data[0]; |
|
|
|
|
|
|
|
const statusReport = firstData.status_activity; |
|
|
|
|
|
|
|
let reportStartDate = firstData.start_activity ?? "-"; |
|
|
|
|
|
|
|
reportStartDate = reportStartDate.split(" ")[0]; |
|
|
|
|
|
|
|
let reportFinishDate = firstData.finish_activity ?? "-"; |
|
|
|
|
|
|
|
reportFinishDate = reportFinishDate.split(" ")[0]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(statusReport == 'on-progress') { |
|
|
|
|
|
|
|
$('#report-activity-information-status').attr("class", "badge badge-warning"); |
|
|
|
|
|
|
|
} else if(statusReport == 'done') { |
|
|
|
|
|
|
|
$('#report-activity-information-status').attr("class", "badge badge-success"); |
|
|
|
|
|
|
|
} else if(statusReport == 'open') { |
|
|
|
|
|
|
|
$('#report-activity-information-status').attr("class", "badge badge-primary"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(moment(reportStartDate, "YYYY-MM-DD",true).isValid()){ |
|
|
|
|
|
|
|
reportStartDate = moment(reportStartDate, "YYYY-MM-DD").format("DD-MM-YYYY"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(moment(reportFinishDate, "YYYY-MM-DD",true).isValid()){ |
|
|
|
|
|
|
|
reportFinishDate = moment(reportFinishDate, "YYYY-MM-DD").format("DD-MM-YYYY"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#report-activity-information-status").text(statusReport ?? "-"); |
|
|
|
|
|
|
|
$("#report-activity-information-start").text(reportStartDate); |
|
|
|
|
|
|
|
$("#report-activity-information-end").text(reportFinishDate); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}).DataTable({ |
|
|
|
"processing": true, |
|
|
|
"processing": true, |
|
|
|
"serverSide": true, |
|
|
|
"serverSide": true, |
|
|
|
"ajax": { |
|
|
|
"ajax": { |
|
|
@ -87,6 +118,7 @@ $(document).ready(function () { |
|
|
|
{ data: 'material_name', name: 'material_name' }, |
|
|
|
{ data: 'material_name', name: 'material_name' }, |
|
|
|
{ |
|
|
|
{ |
|
|
|
data: 'qty_planning', render: function (data, type) { |
|
|
|
data: 'qty_planning', render: function (data, type) { |
|
|
|
|
|
|
|
console.log("render", [data, type]); |
|
|
|
return data ? formatRupiah(data) : '-' |
|
|
|
return data ? formatRupiah(data) : '-' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
@ -99,28 +131,22 @@ $(document).ready(function () { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ data: 'uom', name: 'uom' }, |
|
|
|
{ data: 'uom', name: 'uom' }, |
|
|
|
{ |
|
|
|
// {
|
|
|
|
data: 'start_activity', render: function (data, type) { |
|
|
|
// data: 'start_activity', render: function (data, type) {
|
|
|
|
console.log("start", data) |
|
|
|
// return data ? formatDate(data) : '-'
|
|
|
|
return data ? formatDate(data) : '-' |
|
|
|
// }
|
|
|
|
} |
|
|
|
// },
|
|
|
|
}, |
|
|
|
// {
|
|
|
|
{ |
|
|
|
// data: 'finish_activity', render: function (data, type) {
|
|
|
|
data: 'finish_activity', render: function (data, type) { |
|
|
|
// return data ? formatDate(data) : '-'
|
|
|
|
console.log("finish", data) |
|
|
|
// }
|
|
|
|
return data ? formatDate(data) : '-' |
|
|
|
// },
|
|
|
|
} |
|
|
|
// {
|
|
|
|
}, |
|
|
|
// data: 'status_activity', render: function (data, type) {
|
|
|
|
{ |
|
|
|
// console.log("status", data)
|
|
|
|
data: 'status_activity', render: function (data, type) { |
|
|
|
// return val
|
|
|
|
console.log("status", data) |
|
|
|
// }
|
|
|
|
const val = !data ? '-' : |
|
|
|
// },
|
|
|
|
data == "done" ? `<span class="badge badge-success">${data}</span>` : |
|
|
|
|
|
|
|
data == "open" ? `<span class="badge badge-primary">${data}</span>` : |
|
|
|
|
|
|
|
`<span class="badge badge-warning">${data}</span>` |
|
|
|
|
|
|
|
return val |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
data: 'action', |
|
|
|
data: 'action', |
|
|
|
name: 'action', |
|
|
|
name: 'action', |
|
|
@ -130,6 +156,7 @@ $(document).ready(function () { |
|
|
|
] |
|
|
|
] |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var tableRaMaterialActual = $("#table_activity_material_actual").DataTable({ |
|
|
|
var tableRaMaterialActual = $("#table_activity_material_actual").DataTable({ |
|
|
|
"processing": true, |
|
|
|
"processing": true, |
|
|
|
"serverSide": true, |
|
|
|
"serverSide": true, |
|
|
@ -142,9 +169,9 @@ $(document).ready(function () { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
"columns": [ |
|
|
|
"columns": [ |
|
|
|
{ data: 'human_resource', name: 'human_resource' },
|
|
|
|
{ data: 'human_resource', name: 'human_resource' }, |
|
|
|
{ |
|
|
|
{ |
|
|
|
data: 'report_date', render: function (data, type) {
|
|
|
|
data: 'report_date', render: function (data, type) { |
|
|
|
return data ? formatDate(data) : '-' |
|
|
|
return data ? formatDate(data) : '-' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
@ -184,13 +211,13 @@ $(document).ready(function () { |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ data: 'uom', name: 'uom' }, |
|
|
|
{ data: 'uom', name: 'uom' }, |
|
|
|
{ |
|
|
|
{ |
|
|
|
data: 'plan_date', render: function (data, type) {
|
|
|
|
data: 'plan_date', render: function (data, type) { |
|
|
|
return data ? formatDate(data) : '-' |
|
|
|
return data ? formatDate(data) : '-' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
] |
|
|
|
] |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('#select_ra_hr').select2({ |
|
|
|
$('#select_ra_hr').select2({ |
|
|
|
dropdownParent: rAModal, |
|
|
|
dropdownParent: rAModal, |
|
|
@ -520,7 +547,7 @@ $(document).ready(function () { |
|
|
|
// console.log(" okeee ",{ assignMaterialId, activityId, materialName });
|
|
|
|
// console.log(" okeee ",{ assignMaterialId, activityId, materialName });
|
|
|
|
$("#report_activity_material_title").html(`Report Activity Actual Material ${materialName}`) |
|
|
|
$("#report_activity_material_title").html(`Report Activity Actual Material ${materialName}`) |
|
|
|
$("#modal_report_activity").hide(); |
|
|
|
$("#modal_report_activity").hide(); |
|
|
|
|
|
|
|
|
|
|
|
$("#form_report_activity_material").show(); |
|
|
|
$("#form_report_activity_material").show(); |
|
|
|
$("#activity_material_plan").hide(); |
|
|
|
$("#activity_material_plan").hide(); |
|
|
|
$("#activity_material_actual").show(); |
|
|
|
$("#activity_material_actual").show(); |
|
|
@ -642,4 +669,4 @@ $(document).ready(function () { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|