detail trip
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -94,8 +94,8 @@
|
||||
<th class="">Duration</th>
|
||||
<th class="">Start (km)</th>
|
||||
<th class="">Finish (km)</th>
|
||||
<th class="">Mileage (km)</th>
|
||||
<th class="" hidden>Detail</th>
|
||||
<th class="">Distance (km)</th>
|
||||
<th class="">Detail</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<!-- <tbody>
|
||||
@ -246,9 +246,10 @@
|
||||
const vid = $(this).data('vid');
|
||||
const tgl0 = $(this).data('tgl0');
|
||||
const tgl1 = $(this).data('tgl1');
|
||||
const nopol1 = $(this).data('nopol1');
|
||||
|
||||
// $("#mdlDetailTrip").load("{{ route('view_report_trip_detail') }}");
|
||||
$('#mdlDetailTrip').empty().load("{{ route('view_report_trip_detail') }}", `vid=${vid}&tgl0=${tgl0}&tgl1=${tgl1}`, () => {
|
||||
$('#mdlDetailTrip').empty().load("{{ route('view_report_trip_detail') }}", `vid=${vid}&tgl0=${tgl0}&tgl1=${tgl1}&nopol1=${nopol1}`, () => {
|
||||
$('#mdlDetailTrip').modal('show')
|
||||
})
|
||||
|
||||
@ -293,7 +294,8 @@
|
||||
cptid=${AppState.current_company}
|
||||
&from_date=${moment($('#tgl0').val(), "DD-MM-YYYY HH:mm").unix()}
|
||||
&to_date=${moment($('#tgl1').val(), "DD-MM-YYYY HH:mm").unix()}
|
||||
&vid=${$('#filterNopol').val() || ''}`,
|
||||
&vid=${$('#filterNopol').val() || ''}
|
||||
`,
|
||||
type: 'GET',
|
||||
success: function(json) {
|
||||
callback(json);
|
||||
@ -359,8 +361,6 @@
|
||||
{
|
||||
data: 'startMileage',
|
||||
className: 'text-end', render: function(data, type, row, meta) {
|
||||
console.log(data);
|
||||
|
||||
return (data === null) ? '0' : parseFloat(data).toFixed(0);
|
||||
}
|
||||
},
|
||||
@ -373,16 +373,18 @@
|
||||
{
|
||||
data: 'mileage',
|
||||
className: 'text-end', render: function(data, type, row, meta) {
|
||||
return (data === null) ? '0' : parseFloat(data).toFixed(2);
|
||||
const mileage = (row.finishMileage !== null && row.startMileage !== null) ? (row.finishMileage - row.startMileage) : row.mileage;
|
||||
return (parseFloat(mileage).toFixed(2));
|
||||
}
|
||||
},
|
||||
{
|
||||
visible: false,
|
||||
data: 'id',
|
||||
// visible: false,
|
||||
data: 'vhc_id',
|
||||
className: 'text-center',
|
||||
render: function(data, type, row, meta) {
|
||||
let action = `
|
||||
<a href="#" class="text-decoration-none me-1 btnDetailTrip" data-vid="${data}" data-tgl0="${row.start}" data-tgl1="${row.finish}">
|
||||
<a href="#" class="text-decoration-none me-1 btnDetailTrip"
|
||||
data-vid="${data}" data-tgl0="${row.start}" data-tgl1="${row.finish}" data-nopol1="${row.nopol1}">
|
||||
<span class="icon ion-eye fz-16"></span>
|
||||
</a>
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user