tgl filter 1
This commit is contained in:
@ -1400,11 +1400,11 @@
|
||||
$('#infoJob').addClass('d-none');
|
||||
$('#infoMovement').removeClass('d-none');
|
||||
$('#infoMovement').addClass('d-block');
|
||||
// if (State.inShowVid) {
|
||||
// let cache = !(State.inShowVid != State.loadedLastMoveVid);
|
||||
// Trucks.bundleShowRouteTruck(cache); // jika data yang diload sebelumnya beda, maka tidak mengambil dari cache
|
||||
// }
|
||||
Menu.clearListMovements();
|
||||
if (State.inShowVid) {
|
||||
let cache = !(State.inShowVid != State.loadedLastMoveVid);
|
||||
Trucks.bundleShowRouteTruck(cache, false); // jika data yang diload sebelumnya beda, maka tidak mengambil dari cache
|
||||
}
|
||||
// Menu.clearListMovements();
|
||||
}
|
||||
},
|
||||
eventListVehicle: function() {
|
||||
@ -2633,19 +2633,21 @@
|
||||
// last movement
|
||||
// $('#infoVehicles-infoMove').text('Last 24H from ' + moment.unix(truck?.lst_loc_crt).format('DD MMM YYYY HH:mm'));
|
||||
},
|
||||
bundleShowRouteTruck: async function(cache = false) {
|
||||
bundleShowRouteTruck: async function(cache = false, needUpdate = true) {
|
||||
Menu.clearListMovements();
|
||||
if (State.inShowVid != State.loadedLastMoveVid) $('#historyStartDate').trigger('clearFilterHistoryDate');
|
||||
if (State.inShowVid != State.loadedLastMoveVid)$('#historyStartDate').trigger('clearFilterHistoryDate');
|
||||
|
||||
const getLastMove = await Trucks.getLastMove(State.inShowVid, cache);
|
||||
Trucks.last_move = getLastMove.flat()
|
||||
|
||||
if (Trucks.last_move.length < 1) {
|
||||
Helper.toast('Data Not Found', 'just now', 'There are no last data', 'bg-warning');
|
||||
Trucks.last_move = null;
|
||||
return false;
|
||||
}
|
||||
Trucks.showLastMoveToView(getLastMove);
|
||||
if(needUpdate){
|
||||
const getLastMove = await Trucks.getLastMove(State.inShowVid, cache);
|
||||
Trucks.last_move = getLastMove.flat()
|
||||
|
||||
if (Trucks.last_move.length < 1) {
|
||||
Helper.toast('Data Not Found', 'just now', 'There are no last data', 'bg-warning');
|
||||
Trucks.last_move = null;
|
||||
return false;
|
||||
}
|
||||
Trucks.showLastMoveToView(getLastMove);
|
||||
}
|
||||
},
|
||||
getLastMove: async function(vid, cache = false) {
|
||||
State.loadedLastMoveVid = vid;
|
||||
|
||||
Reference in New Issue
Block a user