add: pagination of users

This commit is contained in:
Alexandro Uc Santos
2024-02-05 21:26:57 -06:00
parent 1933603692
commit 2df3bcfcfb
10 changed files with 139 additions and 39 deletions

View File

@@ -208,7 +208,7 @@
<option disabled value="">-- Seleccionar rol --</option>
<option value="owner">Dueño</option>
<option value="manager">Gerente</option>
<option value="driver">Conductor</option>
<option v-if="authStore.user?.permissions.includes('role_carrier')" value="driver">Conductor</option>
</select>
</div>
<div class="mb-4 mt-3">

View File

@@ -23,7 +23,7 @@
const loading = ref(false);
onMounted(() => {
drivers.value = companyStore.users?.filter((u) => u.job_role == 'driver');
drivers.value = companyStore.drivers;
if(props?.vehicle?.driver) {
const index = drivers.value.findIndex((d) => d._id === props.vehicle.driver?._id);
driverSelected.value = drivers.value[index];

View File

@@ -70,7 +70,7 @@
zoom.value = 4;
heightMap.value = 420;
}
if(companyStore.locations.length <= 0) {
if(companyStore.locationsLoads.length <= 0) {
getLocations();
}
formLoad.owner = auth.user?.first_name + ' ' + auth.user?.last_name;
@@ -144,8 +144,8 @@
const getLocations = async() => {
loadingLocations.value = true;
filterQueryVehicles.value.company = "company="+ localStorage.getItem('id');
await companyStore.getLocationsCompany(filterQueryVehicles.value, false)
// filterQueryVehicles.value.company = "company="+ localStorage.getItem('id');
await companyStore.getLocationsLoads()
loadingLocations.value = false;
}
@@ -440,7 +440,7 @@
v-model="locationLoadSelected"
>
<option disabled value="">-- Seleccionar locación --</option>
<option v-for="loc in companyStore.locations" :value="loc">{{ loc.branch_name }}</option>
<option v-for="loc in companyStore.locationsLoads" :value="loc">{{ loc.branch_name }}</option>
</select>
</div>
<Custominput