diff --git a/src/pages/Route/RouteList.vue b/src/pages/Route/RouteList.vue index 4b3c63dca..95b876be1 100644 --- a/src/pages/Route/RouteList.vue +++ b/src/pages/Route/RouteList.vue @@ -2,8 +2,9 @@ import VnPaginate from 'components/ui/VnPaginate.vue'; import { useStateStore } from 'stores/useStateStore'; import { useI18n } from 'vue-i18n'; +import { useQuasar } from 'quasar'; import { computed, onMounted, onUnmounted, ref } from 'vue'; -import { dashIfEmpty, 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'; @@ -17,13 +18,10 @@ import RouteSummary from 'pages/Route/Card/RouteSummary.vue'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; import { useSession } from 'composables/useSession'; import { useSummaryDialog } from 'src/composables/useSummaryDialog'; -import RouteListTicketsDialog from 'pages/Route/Card/RouteListTicketsDialog.vue'; -import { useQuasar } from 'quasar'; const stateStore = useStateStore(); const { t } = useI18n(); const { validate } = useValidator(); -const quasar = useQuasar(); const session = useSession(); const { viewSummary } = useSummaryDialog(); @@ -37,7 +35,7 @@ const columns = computed(() => [ label: t('ID'), field: (row) => row.id, sortable: true, - align: 'center', + align: 'left', }, { name: 'worker', @@ -72,7 +70,7 @@ const columns = computed(() => [ label: 'm³', field: (row) => dashIfEmpty(row.m3), sortable: true, - align: 'center', + align: 'left', }, { name: 'description', @@ -115,6 +113,24 @@ const updateRoute = async (route) => { } }; +const updateVehicle = (row, vehicle) => { + row.vehicleFk = vehicle.id; + row.vehiclePlateNumber = vehicle.numberPlate; + updateRoute(row); +}; + +const updateAgency = (row, agency) => { + row.agencyModeFk = agency.id; + row.agencyName = agency.name; + updateRoute(row); +}; + +const updateWorker = (row, worker) => { + row.workerFk = worker.id; + row.workerUserName = worker.name; + updateRoute(row); +}; + const confirmationDialog = ref(false); const startingDate = ref(null); @@ -133,7 +149,7 @@ const showRouteReport = () => { let url; if (selectedRows.value.length <= 1) { - url = `api/Routes/${idString}/driver-route-pdf?access_token=${session.getTokenMultimedia()}`; + url = `api/Routes/${idString}/driver-route-pdf?access_token=${session.getToken()}`; } else { const params = new URLSearchParams({ access_token: session.getToken(), @@ -153,20 +169,6 @@ const markAsServed = () => { refreshKey.value++; startingDate.value = null; }; - -const openTicketsDialog = (id) => { - if (!id) { - return; - } - quasar - .dialog({ - component: RouteListTicketsDialog, - componentProps: { - id, - }, - }) - .onOk(() => refreshKey.value++); -}; -