From e1ac98cf3e54d698da695d9d6d9dc33546510115 Mon Sep 17 00:00:00 2001 From: Kevin Martinez Date: Wed, 17 Jan 2024 07:34:43 -0400 Subject: [PATCH] Add route list filter --- src/pages/Route/Card/RouteFilter.vue | 234 ++++++++++++++++++++++++ src/pages/Route/Card/RouteSearchbar.vue | 20 ++ src/pages/Route/RouteList.vue | 114 ++++++------ 3 files changed, 308 insertions(+), 60 deletions(-) create mode 100644 src/pages/Route/Card/RouteFilter.vue create mode 100644 src/pages/Route/Card/RouteSearchbar.vue diff --git a/src/pages/Route/Card/RouteFilter.vue b/src/pages/Route/Card/RouteFilter.vue new file mode 100644 index 000000000..45580d913 --- /dev/null +++ b/src/pages/Route/Card/RouteFilter.vue @@ -0,0 +1,234 @@ + + + + + +en: + params: + warehouseFk: Warehouse + description: Description + m3: m³ + vehicleFk: Vehicle + agencyModeFk: Agency + workerFk: Worker + from: From + to: To +es: + params: + warehouseFk: Almacén + description: Descripción + m3: m³ + vehicleFk: Vehículo + agencyModeFk: Agencia + workerFk: Trabajador + from: Desde + to: Hasta + Warehouse: Almacén + Description: Descripción + Vehicle: Vehículo + Agency: Agencia + Worker: Trabajador + From: Desde + To: Hasta + diff --git a/src/pages/Route/Card/RouteSearchbar.vue b/src/pages/Route/Card/RouteSearchbar.vue new file mode 100644 index 000000000..9ee4a602f --- /dev/null +++ b/src/pages/Route/Card/RouteSearchbar.vue @@ -0,0 +1,20 @@ + + + + + + +es: + Search route: Buscar rutas + You can search by route reference: Puedes buscar por referencia de la ruta + diff --git a/src/pages/Route/RouteList.vue b/src/pages/Route/RouteList.vue index 408119751..ddf3e1a12 100644 --- a/src/pages/Route/RouteList.vue +++ b/src/pages/Route/RouteList.vue @@ -3,14 +3,16 @@ import VnPaginate from 'components/ui/VnPaginate.vue'; import { useStateStore } from 'stores/useStateStore'; import { useI18n } from 'vue-i18n'; import { computed, onMounted, onUnmounted, ref } from 'vue'; -import {dashIfEmpty, toDate, toHour} from 'src/filters'; +import { dashIfEmpty, toDate, toHour } from 'src/filters'; import VnSelectFilter from 'components/common/VnSelectFilter.vue'; import FetchData from 'components/FetchData.vue'; import { useValidator } from 'composables/useValidator'; -import VnInputDate from "components/common/VnInputDate.vue"; -import VnInput from "components/common/VnInput.vue"; -import VnInputTime from "components/common/VnInputTime.vue"; -import axios from "axios"; +import VnInputDate from 'components/common/VnInputDate.vue'; +import VnInput from 'components/common/VnInput.vue'; +import VnInputTime from 'components/common/VnInputTime.vue'; +import axios from 'axios'; +import RouteSearchbar from 'pages/Route/Card/RouteSearchbar.vue'; +import RouteFilter from 'pages/Route/Card/RouteFilter.vue'; const stateStore = useStateStore(); // const router = useRouter(); @@ -98,7 +100,7 @@ const columns = computed(() => [ }, ]); -const refreshKey = ref(0) +const refreshKey = ref(0); const workers = ref([]); const agencyList = ref([]); const vehicleList = ref([]); @@ -108,76 +110,63 @@ const updateRoute = async (route) => { } catch (err) { return err; } -} +}; const updateVehicle = (row, vehicle) => { - row.vehicleFk = vehicle.id - row.vehiclePlateNumber = vehicle.numberPlate - updateRoute(row) -} + row.vehicleFk = vehicle.id; + row.vehiclePlateNumber = vehicle.numberPlate; + updateRoute(row); +}; const updateAgency = (row, agency) => { - row.agencyModeFk = agency.id - row.agencyName = agency.name - updateRoute(row) -} + row.agencyModeFk = agency.id; + row.agencyName = agency.name; + updateRoute(row); +}; const updateWorker = (row, worker) => { - row.workerFk = worker.id - row.workerUserName = worker.name - updateRoute(row) -} + row.workerFk = worker.id; + row.workerUserName = worker.name; + updateRoute(row); +};