0
0
Fork 0

Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7874-addObservationType

This commit is contained in:
Jorge Penadés 2024-09-26 16:01:40 +02:00
commit 11c135e8c4
15 changed files with 502 additions and 333 deletions

View File

@ -10,7 +10,7 @@ import FormModelPopup from 'components/FormModelPopup.vue';
import VnFilterPanel from 'components/ui/VnFilterPanel.vue'; import VnFilterPanel from 'components/ui/VnFilterPanel.vue';
import VnTableColumn from 'components/VnTable/VnColumn.vue'; import VnTableColumn from 'components/VnTable/VnColumn.vue';
import VnTableFilter from 'components/VnTable/VnFilter.vue'; import VnFilter from 'components/VnTable/VnFilter.vue';
import VnTableChip from 'components/VnTable/VnChip.vue'; import VnTableChip from 'components/VnTable/VnChip.vue';
import VnVisibleColumn from 'src/components/VnTable/VnVisibleColumn.vue'; import VnVisibleColumn from 'src/components/VnTable/VnVisibleColumn.vue';
import VnLv from 'components/ui/VnLv.vue'; import VnLv from 'components/ui/VnLv.vue';
@ -355,7 +355,7 @@ function handleOnDataSaved(_) {
)" )"
:key="col.id" :key="col.id"
> >
<VnTableFilter <VnFilter
ref="tableFilterRef" ref="tableFilterRef"
:column="col" :column="col"
:data-key="$attrs['data-key']" :data-key="$attrs['data-key']"
@ -468,7 +468,7 @@ function handleOnDataSaved(_) {
:search-url="searchUrl" :search-url="searchUrl"
/> />
</div> </div>
<VnTableFilter <VnFilter
v-if="$props.columnSearch" v-if="$props.columnSearch"
:column="col" :column="col"
:show-title="true" :show-title="true"

View File

@ -4,7 +4,7 @@ export default function toHour(date) {
if (!isValidDate(date)) { if (!isValidDate(date)) {
return '--:--'; return '--:--';
} }
return (new Date(date || '')).toLocaleTimeString([], { return new Date(date || '').toLocaleTimeString([], {
hour: '2-digit', hour: '2-digit',
minute: '2-digit', minute: '2-digit',
}); });

View File

@ -111,7 +111,7 @@ globals:
basicData: Basic data basicData: Basic data
log: Logs log: Logs
parkingList: Parkings list parkingList: Parkings list
agencyList: Agencies list agencyList: Agencies
agency: Agency agency: Agency
workCenters: Work centers workCenters: Work centers
modes: Modes modes: Modes
@ -135,7 +135,7 @@ globals:
fiscalData: Fiscal data fiscalData: Fiscal data
billingData: Billing data billingData: Billing data
consignees: Consignees consignees: Consignees
'address-create': New address address-create: New address
notes: Notes notes: Notes
credits: Credits credits: Credits
greuges: Greuges greuges: Greuges
@ -207,7 +207,7 @@ globals:
roadmap: Roadmap roadmap: Roadmap
stops: Stops stops: Stops
routes: Routes routes: Routes
cmrsList: CMRs list cmrsList: CMRs
RouteList: List RouteList: List
routeCreate: New route routeCreate: New route
RouteRoadmap: Roadmaps RouteRoadmap: Roadmaps
@ -273,6 +273,7 @@ globals:
clientsActionsMonitor: Clients and actions clientsActionsMonitor: Clients and actions
serial: Serial serial: Serial
medical: Mutual medical: Mutual
RouteExtendedList: Router
supplier: Supplier supplier: Supplier
created: Created created: Created
worker: Worker worker: Worker
@ -881,6 +882,7 @@ route:
tickets: Tickets tickets: Tickets
log: Log log: Log
autonomous: Autonomous autonomous: Autonomous
RouteExtendedList: Router
cmr: cmr:
list: list:
results: results results: results

View File

@ -113,7 +113,7 @@ globals:
basicData: Datos básicos basicData: Datos básicos
log: Historial log: Historial
parkingList: Listado de parkings parkingList: Listado de parkings
agencyList: Listado de agencias agencyList: Agencias
agency: Agencia agency: Agencia
workCenters: Centros de trabajo workCenters: Centros de trabajo
modes: Modos modes: Modos
@ -211,12 +211,13 @@ globals:
roadmap: Troncales roadmap: Troncales
stops: Paradas stops: Paradas
routes: Rutas routes: Rutas
cmrsList: Listado de CMRs cmrsList: CMRs
RouteList: Listado RouteList: Listado
routeCreate: Nueva ruta routeCreate: Nueva ruta
RouteRoadmap: Troncales RouteRoadmap: Troncales
RouteRoadmapCreate: Crear troncal RouteRoadmapCreate: Crear troncal
autonomous: Autónomos autonomous: Autónomos
RouteExtendedList: Enrutador
suppliers: Proveedores suppliers: Proveedores
supplier: Proveedor supplier: Proveedor
supplierCreate: Nuevo proveedor supplierCreate: Nuevo proveedor

View File

@ -600,11 +600,9 @@ function handleOnDataSave({ CrudModelRef }) {
.q-table th, .q-table th,
.q-table td { .q-table td {
padding-inline: 5px !important; padding-inline: 5px !important;
// text-align: -webkit-right;
} }
.q-table tbody td { .q-table tbody td {
max-width: none; max-width: none;
.q-td.col { .q-td.col {
& .vnInputDate { & .vnInputDate {
min-width: 90px; min-width: 90px;

View File

@ -27,12 +27,15 @@ const columns = computed(() => [
condition: () => true, condition: () => true,
}, },
isId: true, isId: true,
columnFilter: false,
}, },
{ {
align: 'left', align: 'left',
label: t('globals.name'), label: t('globals.name'),
name: 'name', name: 'name',
isTitle: true, isTitle: true,
columnFilter: false,
columnClass: 'expand',
}, },
{ {
align: 'left', align: 'left',
@ -70,18 +73,33 @@ const columns = computed(() => [
data-key="AgencyList" data-key="AgencyList"
:expr-builder="exprBuilder" :expr-builder="exprBuilder"
/> />
<VnTable <div class="list-container">
ref="tableRef" <div class="list">
data-key="AgencyList" <VnTable
url="Agencies" data-key="AgencyList"
order="name" url="Agencies"
:columns="columns" order="name"
:right-search="false" :columns="columns"
:use-model="true" :right-search="false"
redirect="agency" :use-model="true"
default-mode="card" redirect="agency"
/> default-mode="card"
/>
</div>
</div>
</template> </template>
<style lang="scss" scoped>
.list {
display: flex;
flex-direction: column;
align-items: center;
width: 55%;
}
.list-container {
display: flex;
justify-content: center;
}
</style>
<i18n> <i18n>
es: es:
isOwn: Tiene propietario isOwn: Tiene propietario

View File

@ -167,8 +167,8 @@ const setTicketsRoute = async () => {
<QTd :props="props"> <QTd :props="props">
<span class="link"> <span class="link">
{{ props.value }} {{ props.value }}
<TicketDescriptorProxy :id="props?.row?.id" />
</span> </span>
<TicketDescriptorProxy :id="props?.row?.id" />
</QTd> </QTd>
</template> </template>
<template #body-cell-client="props"> <template #body-cell-client="props">

View File

@ -0,0 +1,360 @@
<script setup>
import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import { useQuasar } from 'quasar';
import { toDate } from 'src/filters';
import { useRouter } from 'vue-router';
import { usePrintService } from 'src/composables/usePrintService';
import axios from 'axios';
import RouteSearchbar from 'pages/Route/Card/RouteSearchbar.vue';
import RouteListTicketsDialog from 'pages/Route/Card/RouteListTicketsDialog.vue';
import RouteSummary from 'pages/Route/Card/RouteSummary.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
import RouteFilter from 'pages/Route/Card/RouteFilter.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import VnTable from 'components/VnTable/VnTable.vue';
const { openReport } = usePrintService();
const { t } = useI18n();
const { viewSummary } = useSummaryDialog();
const quasar = useQuasar();
const selectedRows = ref([]);
const tableRef = ref([]);
const confirmationDialog = ref(false);
const startingDate = ref(null);
const router = useRouter();
const routeFilter = {
include: [
{
relation: 'workers',
scope: {
fields: ['id', 'firstName'],
},
},
],
};
const columns = computed(() => [
{
align: 'left',
name: 'id',
label: 'Id',
chip: {
condition: () => true,
},
isId: true,
columnFilter: false,
},
{
align: 'left',
name: 'workerFk',
label: t('route.Worker'),
create: true,
component: 'select',
attrs: {
url: 'Workers/activeWithInheritedRole',
fields: ['id', 'name'],
useLike: false,
optionFilter: 'firstName',
find: {
value: 'workerFk',
label: 'workerUserName',
},
},
columnFilter: {
inWhere: true,
},
useLike: false,
cardVisible: true,
format: (row, dashIfEmpty) => dashIfEmpty(row.travelRef),
},
{
align: 'left',
name: 'agencyModeFk',
label: t('route.Agency'),
isTitle: true,
cardVisible: true,
create: true,
component: 'select',
attrs: {
url: 'agencyModes',
fields: ['id', 'name'],
find: {
value: 'agencyModeFk',
label: 'agencyName',
},
},
columnClass: 'expand',
},
{
align: 'left',
name: 'vehicleFk',
label: t('route.Vehicle'),
cardVisible: true,
create: true,
component: 'select',
attrs: {
url: 'vehicles',
fields: ['id', 'numberPlate'],
optionLabel: 'numberPlate',
optionFilterValue: 'numberPlate',
find: {
value: 'vehicleFk',
label: 'vehiclePlateNumber',
},
},
columnFilter: {
inWhere: true,
},
},
{
align: 'left',
name: 'created',
label: t('route.Date'),
columnFilter: false,
cardVisible: true,
create: true,
component: 'date',
format: ({ date }) => toDate(date),
},
{
align: 'left',
name: 'from',
label: t('route.From'),
visible: false,
cardVisible: true,
create: true,
component: 'date',
format: ({ date }) => toDate(date),
},
{
align: 'left',
name: 'to',
label: t('route.To'),
visible: false,
cardVisible: true,
create: true,
component: 'date',
format: ({ date }) => toDate(date),
},
{
align: 'center',
name: 'm3',
label: 'm3',
cardVisible: true,
columnClass: 'shrink',
},
{
align: 'left',
name: 'started',
label: t('route.hourStarted'),
component: 'time',
columnFilter: false,
},
{
align: 'left',
name: 'finished',
label: t('route.hourFinished'),
component: 'time',
columnFilter: false,
},
{
align: 'center',
name: 'kmStart',
label: t('route.KmStart'),
columnClass: 'shrink',
create: true,
visible: false,
},
{
align: 'center',
name: 'kmEnd',
label: t('route.KmEnd'),
columnClass: 'shrink',
create: true,
visible: false,
},
{
align: 'left',
name: 'description',
label: t('route.Description'),
isTitle: true,
create: true,
component: 'input',
field: 'description',
},
{
align: 'left',
name: 'isOk',
label: t('route.Served'),
component: 'checkbox',
columnFilter: false,
columnClass: 'shrink',
},
{
align: 'right',
name: 'tableActions',
actions: [
{
title: t('route.Add tickets'),
icon: 'vn:ticketAdd',
action: (row) => openTicketsDialog(row?.id),
isPrimary: true,
},
{
title: t('route.components.smartCard.viewSummary'),
icon: 'preview',
action: (row) => viewSummary(row?.id, RouteSummary),
isPrimary: true,
},
{
title: t('route.Route summary'),
icon: 'arrow_forward',
action: (row) => navigate(row?.id),
isPrimary: true,
},
],
},
]);
function navigate(id) {
router.push({ path: `/route/${id}` });
}
const cloneRoutes = () => {
if (!selectedRows.value.length || !startingDate.value) return;
axios.post('Routes/clone', {
created: startingDate.value,
ids: selectedRows.value.map((row) => row?.id),
});
startingDate.value = null;
tableRef.value.reload();
};
const showRouteReport = () => {
const ids = selectedRows.value.map((row) => row?.id);
const idString = ids.join(',');
let url = `Routes/${idString}/driver-route-pdf`;
let params = {};
if (selectedRows.value.length >= 1) {
params = {
id: idString,
};
url = `Routes/downloadZip`;
}
openReport(url, params, '_blank');
};
function markAsServed() {
selectedRows.value.forEach(async (row) => {
await axios.patch(`Routes/${row?.id}`, { isOk: true });
});
tableRef.value.reload();
startingDate.value = null;
}
const openTicketsDialog = (id) => {
quasar
.dialog({
component: RouteListTicketsDialog,
componentProps: {
id,
},
})
.onOk(() => tableRef.value.reload());
};
</script>
<template>
<RouteSearchbar />
<QDialog v-model="confirmationDialog">
<QCard style="min-width: 350px">
<QCardSection>
<p class="text-h6 q-ma-none">{{ t('route.Select the starting date') }}</p>
</QCardSection>
<QCardSection class="q-pt-none">
<VnInputDate
:label="t('route.Stating date')"
v-model="startingDate"
autofocus
/>
</QCardSection>
<QCardActions align="right">
<QBtn
flat
:label="t('route.Cancel')"
v-close-popup
class="text-primary"
/>
<QBtn color="primary" v-close-popup @click="cloneRoutes">
{{ t('globals.clone') }}
</QBtn>
</QCardActions>
</QCard>
</QDialog>
<VnSubToolbar />
<RightMenu>
<template #right-panel>
<RouteFilter data-key="RouteList" />
</template>
</RightMenu>
<VnTable
class="route-list"
ref="tableRef"
data-key="RouteList"
url="Routes/filter"
:columns="columns"
:right-search="false"
:is-editable="true"
:filter="routeFilter"
redirect="route"
:row-click="false"
:create="{
urlCreate: 'Routes',
title: t('route.createRoute'),
onDataSaved: ({ id }) => tableRef.redirect(id),
formInitialData: {},
}"
save-url="Routes/crud"
:disable-option="{ card: true }"
table-height="85vh"
v-model:selected="selectedRows"
:table="{
'row-key': 'id',
selection: 'multiple',
}"
>
<template #moreBeforeActions>
<QBtn
icon="vn:clone"
color="primary"
class="q-mr-sm"
:disable="!selectedRows?.length"
@click="confirmationDialog = true"
>
<QTooltip>{{ t('route.Clone Selected Routes') }}</QTooltip>
</QBtn>
<QBtn
icon="cloud_download"
color="primary"
class="q-mr-sm"
:disable="!selectedRows?.length"
@click="showRouteReport"
>
<QTooltip>{{ t('route.Download selected routes as PDF') }}</QTooltip>
</QBtn>
<QBtn
icon="check"
color="primary"
class="q-mr-sm"
:disable="!selectedRows?.length"
@click="markAsServed()"
>
<QTooltip>{{ t('route.Mark as served') }}</QTooltip>
</QBtn>
</template>
</VnTable>
</template>

View File

@ -1,34 +1,19 @@
<script setup> <script setup>
import { computed, ref } from 'vue'; import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useSession } from 'composables/useSession';
import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import { useQuasar } from 'quasar'; import { toHour } from 'src/filters';
import { toDate } from 'src/filters';
import { useRouter } from 'vue-router';
import axios from 'axios';
import RouteSearchbar from 'pages/Route/Card/RouteSearchbar.vue'; import RouteSearchbar from 'pages/Route/Card/RouteSearchbar.vue';
import RouteListTicketsDialog from 'pages/Route/Card/RouteListTicketsDialog.vue';
import RouteSummary from 'pages/Route/Card/RouteSummary.vue'; import RouteSummary from 'pages/Route/Card/RouteSummary.vue';
import RightMenu from 'src/components/common/RightMenu.vue'; import RightMenu from 'src/components/common/RightMenu.vue';
import RouteFilter from 'pages/Route/Card/RouteFilter.vue'; import RouteFilter from 'pages/Route/Card/RouteFilter.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import VnTable from 'components/VnTable/VnTable.vue'; import VnTable from 'components/VnTable/VnTable.vue';
import { usePrintService } from 'src/composables/usePrintService'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
const { openReport } = usePrintService();
const { t } = useI18n(); const { t } = useI18n();
const { viewSummary } = useSummaryDialog(); const { viewSummary } = useSummaryDialog();
const quasar = useQuasar();
const session = useSession();
const selectedRows = ref([]);
const tableRef = ref([]); const tableRef = ref([]);
const confirmationDialog = ref(false);
const startingDate = ref(null);
const router = useRouter();
const routeFilter = { const routeFilter = {
include: [ include: [
{ {
@ -42,156 +27,70 @@ const routeFilter = {
const columns = computed(() => [ const columns = computed(() => [
{ {
align: 'left', align: 'left',
isId: true,
name: 'id', name: 'id',
label: 'Id', label: 'Id',
chip: { chip: {
condition: () => true, condition: () => true,
}, },
isId: true,
columnFilter: false, columnFilter: false,
}, },
{ {
align: 'left', align: 'left',
name: 'workerFk', name: 'workerFk',
label: t('Worker'), label: t('route.Worker'),
create: true, create: true,
component: 'select',
attrs: {
url: 'Workers/activeWithInheritedRole',
fields: ['id', 'name'],
useLike: false,
optionFilter: 'firstName',
find: {
value: 'workerFk',
label: 'workerUserName',
},
},
columnFilter: {
inWhere: true,
},
useLike: false,
cardVisible: true, cardVisible: true,
format: (row, dashIfEmpty) => dashIfEmpty(row.travelRef), format: (row, dashIfEmpty) => dashIfEmpty(row.travelRef),
},
{
align: 'left',
name: 'agencyModeFk',
label: t('Agency'),
isTitle: true,
cardVisible: true,
create: true,
component: 'select',
attrs: {
url: 'agencyModes',
fields: ['id', 'name'],
find: {
value: 'agencyModeFk',
label: 'agencyName',
},
},
columnClass: 'expand',
},
{
align: 'left',
name: 'vehicleFk',
label: t('Vehicle'),
cardVisible: true,
create: true,
component: 'select',
attrs: {
url: 'vehicles',
fields: ['id', 'numberPlate'],
optionLabel: 'numberPlate',
optionFilterValue: 'numberPlate',
find: {
value: 'vehicleFk',
label: 'vehiclePlateNumber',
},
},
columnFilter: {
inWhere: true,
},
},
{
align: 'left',
name: 'created',
label: t('Date'),
columnFilter: false, columnFilter: false,
cardVisible: true,
create: true,
component: 'date',
format: ({ date }) => toDate(date),
}, },
{ {
align: 'left', align: 'left',
name: 'from', name: 'agencyName',
label: t('From'), label: t('route.Agency'),
visible: false,
cardVisible: true, cardVisible: true,
create: true, create: true,
component: 'date', columnClass: 'expand',
format: ({ date }) => toDate(date), columnFilter: false,
}, },
{ {
align: 'left', align: 'left',
name: 'to', name: 'vehiclePlateNumber',
label: t('To'), label: t('route.Vehicle'),
visible: false,
cardVisible: true, cardVisible: true,
create: true, create: true,
component: 'date', columnFilter: false,
format: ({ date }) => toDate(date),
},
{
align: 'center',
name: 'm3',
label: t('Volume'),
cardVisible: true,
columnClass: 'shrink',
}, },
{ {
align: 'left', align: 'left',
name: 'started', name: 'started',
label: t('hourStarted'), label: t('route.hourStarted'),
component: 'time', cardVisible: true,
columnFilter: false, columnFilter: false,
format: (row) => toHour(row.started),
}, },
{ {
align: 'left', align: 'left',
name: 'finished', name: 'finished',
label: t('hourFinished'), label: t('route.hourFinished'),
component: 'time', cardVisible: true,
columnFilter: false, columnFilter: false,
}, format: (row) => toHour(row.started),
{
align: 'center',
name: 'kmStart',
label: t('KmStart'),
columnClass: 'shrink',
create: true,
visible: false,
},
{
align: 'center',
name: 'kmEnd',
label: t('KmEnd'),
columnClass: 'shrink',
create: true,
visible: false,
}, },
{ {
align: 'left', align: 'left',
name: 'description', name: 'description',
label: t('Description'), label: t('route.Description'),
cardVisible: true,
isTitle: true, isTitle: true,
create: true, create: true,
component: 'input',
field: 'description', field: 'description',
columnFilter: false,
}, },
{ {
align: 'left', align: 'left',
name: 'isOk', name: 'isOk',
label: t('Served'), label: t('route.Served'),
component: 'checkbox', component: 'checkbox',
columnFilter: false, columnFilter: false,
columnClass: 'shrink', columnClass: 'shrink',
@ -200,212 +99,43 @@ const columns = computed(() => [
align: 'right', align: 'right',
name: 'tableActions', name: 'tableActions',
actions: [ actions: [
{
title: t('Add tickets'),
icon: 'vn:ticketAdd',
action: (row) => openTicketsDialog(row?.id),
},
{ {
title: t('components.smartCard.viewSummary'), title: t('components.smartCard.viewSummary'),
icon: 'preview', icon: 'preview',
action: (row) => viewSummary(row?.id, RouteSummary), action: (row) => viewSummary(row?.id, RouteSummary),
},
{
title: t('Route summary'),
icon: 'arrow_forward',
isPrimary: true, isPrimary: true,
action: (row) => navigate(row?.id),
}, },
], ],
}, },
]); ]);
function navigate(id) {
router.push({ path: `/route/${id}` });
}
const cloneRoutes = () => {
if (!selectedRows.value.length || !startingDate.value) return;
axios.post('Routes/clone', {
created: startingDate.value,
ids: selectedRows.value.map((row) => row?.id),
});
startingDate.value = null;
tableRef.value.reload();
};
const showRouteReport = () => {
const ids = selectedRows.value.map((row) => row?.id);
const idString = ids.join(',');
let url = `Routes/${idString}/driver-route-pdf`;
let params = {};
if (selectedRows.value.length >= 1) {
params = {
id: idString,
};
url = `Routes/downloadZip`;
}
openReport(url, params, '_blank');
};
function markAsServed() {
selectedRows.value.forEach(async (row) => {
await axios.patch(`Routes/${row?.id}`, { isOk: true });
});
tableRef.value.reload();
startingDate.value = null;
}
const openTicketsDialog = (id) => {
quasar
.dialog({
component: RouteListTicketsDialog,
componentProps: {
id,
},
})
.onOk(() => tableRef.value.reload());
};
</script> </script>
<template> <template>
<RouteSearchbar /> <RouteSearchbar />
<QDialog v-model="confirmationDialog">
<QCard style="min-width: 350px">
<QCardSection>
<p class="text-h6 q-ma-none">{{ t('Select the starting date') }}</p>
</QCardSection>
<QCardSection class="q-pt-none">
<VnInputDate
:label="t('Stating date')"
v-model="startingDate"
autofocus
/>
</QCardSection>
<QCardActions align="right">
<QBtn flat :label="t('Cancel')" v-close-popup class="text-primary" />
<QBtn color="primary" v-close-popup @click="cloneRoutes">
{{ t('globals.clone') }}
</QBtn>
</QCardActions>
</QCard>
</QDialog>
<VnSubToolbar />
<RightMenu> <RightMenu>
<template #right-panel> <template #right-panel>
<RouteFilter data-key="RouteList" /> <RouteFilter data-key="RouteList" />
</template> </template>
</RightMenu> </RightMenu>
<VnTable <VnTable
class="route-list"
ref="tableRef"
data-key="RouteList" data-key="RouteList"
url="Routes/filter" url="Routes/filter"
:columns="columns" :columns="columns"
:right-search="false" :right-search="false"
:is-editable="true"
:filter="routeFilter" :filter="routeFilter"
redirect="route" redirect="route"
:row-click="false"
:create="{ :create="{
urlCreate: 'Routes', urlCreate: 'Routes',
title: t('Create route'), title: t('route.createRoute'),
onDataSaved: ({ id }) => tableRef.redirect(id), onDataSaved: ({ id }) => tableRef.redirect(id),
formInitialData: {}, formInitialData: {},
}" }"
save-url="Routes/crud"
:disable-option="{ card: true }"
table-height="85vh" table-height="85vh"
v-model:selected="selectedRows"
:table="{
'row-key': 'id',
selection: 'multiple',
}"
> >
<template #moreBeforeActions> <template #column-workerFk="{ row }">
<QBtn <span class="link" @click.stop>
icon="vn:clone" {{ row?.workerUserName }}
color="primary" <WorkerDescriptorProxy :id="row?.workerFk" v-if="row?.workerFk" />
class="q-mr-sm" </span>
:disable="!selectedRows?.length"
@click="confirmationDialog = true"
>
<QTooltip>{{ t('Clone Selected Routes') }}</QTooltip>
</QBtn>
<QBtn
icon="cloud_download"
color="primary"
class="q-mr-sm"
:disable="!selectedRows?.length"
@click="showRouteReport"
>
<QTooltip>{{ t('Download selected routes as PDF') }}</QTooltip>
</QBtn>
<QBtn
icon="check"
color="primary"
class="q-mr-sm"
:disable="!selectedRows?.length"
@click="markAsServed()"
>
<QTooltip>{{ t('Mark as served') }}</QTooltip>
</QBtn>
</template> </template>
</VnTable> </VnTable>
</template> </template>
<style lang="scss" scoped>
.table-input-cell {
max-width: 143px;
}
.route-list {
width: 100%;
max-height: 100%;
}
.table-actions {
gap: 12px;
}
th:last-child,
td:last-child {
background-color: var(--vn-section-color);
position: sticky;
right: 0;
}
</style>
<i18n>
en:
newRoute: New Route
hourStarted: Started hour
hourFinished: Finished hour
es:
From: Desde
To: Hasta
Worker: Trabajador
Agency: Agencia
Vehicle: Vehículo
Volume: Volumen
Date: Fecha
Description: Descripción
Hour started: Hora inicio
Hour finished: Hora fin
KmStart: Km inicio
KmEnd: Km fin
Served: Servida
newRoute: Nueva Ruta
Clone Selected Routes: Clonar rutas seleccionadas
Select the starting date: Seleccione la fecha de inicio
Stating date: Fecha de inicio
Cancel: Cancelar
Mark as served: Marcar como servidas
Download selected routes as PDF: Descargar rutas seleccionadas como PDF
Add ticket: Añadir tickets
Preview: Vista previa
Summary: Resumen
Route is closed: La ruta está cerrada
Route is not served: La ruta no está servida
hourStarted: Hora de inicio
hourFinished: Hora de fin
</i18n>

View File

@ -87,7 +87,7 @@ const columns = computed(() => [
actions: [ actions: [
{ {
title: t('Ver cmr'), title: t('Ver cmr'),
icon: 'visibility', icon: 'preview',
isPrimary: true, isPrimary: true,
action: (row) => viewSummary(row?.id, RoadmapSummary), action: (row) => viewSummary(row?.id, RoadmapSummary),
}, },

View File

@ -342,10 +342,7 @@ const openSmsDialog = async () => {
</template> </template>
<template #body-cell-city="{ value, row }"> <template #body-cell-city="{ value, row }">
<QTd auto-width> <QTd auto-width>
<span <span class="link" @click="goToBuscaman(row)">
class="text-primary cursor-pointer"
@click="goToBuscaman(row)"
>
{{ value }} {{ value }}
<QTooltip>{{ t('Open buscaman') }}</QTooltip> <QTooltip>{{ t('Open buscaman') }}</QTooltip>
</span> </span>
@ -353,7 +350,7 @@ const openSmsDialog = async () => {
</template> </template>
<template #body-cell-client="{ value, row }"> <template #body-cell-client="{ value, row }">
<QTd auto-width> <QTd auto-width>
<span class="text-primary cursor-pointer"> <span class="link">
{{ value }} {{ value }}
<CustomerDescriptorProxy :id="row?.clientFk" /> <CustomerDescriptorProxy :id="row?.clientFk" />
</span> </span>
@ -361,7 +358,7 @@ const openSmsDialog = async () => {
</template> </template>
<template #body-cell-ticket="{ value, row }"> <template #body-cell-ticket="{ value, row }">
<QTd auto-width class="text-center"> <QTd auto-width class="text-center">
<span class="text-primary cursor-pointer"> <span class="link">
{{ value }} {{ value }}
<TicketDescriptorProxy :id="row?.id" /> <TicketDescriptorProxy :id="row?.id" />
</span> </span>

View File

@ -0,0 +1,25 @@
route:
Worker: Worker
Agency: Agency
Vehicle: Vehicle
Description: Description
hourStarted: H.Start
hourFinished: H.End
createRoute: Create route
From: From
To: To
Date: Date
KmStart: Km start
KmEnd: Km end
Served: Served
Clone Selected Routes: Clone selected routes
Select the starting date: Select the starting date
Stating date: Starting date
Cancel: Cancel
Mark as served: Mark as served
Download selected routes as PDF: Download selected routes as PDF
Add ticket: Add ticket
Preview: Preview
Summary: Summary
Route is closed: Route is closed
Route is not served: Route is not served

View File

@ -0,0 +1,25 @@
route:
Worker: Trabajador
Agency: Agencia
Vehicle: Vehículo
Description: Descripción
hourStarted: H.Inicio
hourFinished: H.Fin
createRoute: Crear ruta
From: Desde
To: Hasta
Date: Fecha
KmStart: Km inicio
KmEnd: Km fin
Served: Servida
Clone Selected Routes: Clonar rutas seleccionadas
Select the starting date: Seleccione la fecha de inicio
Stating date: Fecha de inicio
Cancel: Cancelar
Mark as served: Marcar como servidas
Download selected routes as PDF: Descargar rutas seleccionadas como PDF
Add ticket: Añadir tickets
Preview: Vista previa
Summary: Resumen
Route is closed: La ruta está cerrada
Route is not served: La ruta no está servida

View File

@ -319,7 +319,7 @@ const getLink = (param) => `#/travel/${entityId.value}/${param}`;
</template> </template>
<template #body-cell-id="{ col, value }"> <template #body-cell-id="{ col, value }">
<QTd> <QTd>
<QBtn v-if="col.name === 'id'" flat color="blue"> <QBtn v-if="col.name === 'id'" flat class="link">
{{ value }} {{ value }}
<EntryDescriptorProxy :id="value" /> <EntryDescriptorProxy :id="value" />
</QBtn> </QBtn>

View File

@ -11,7 +11,14 @@ export default {
component: RouterView, component: RouterView,
redirect: { name: 'RouteMain' }, redirect: { name: 'RouteMain' },
menus: { menus: {
main: ['RouteList', 'RouteAutonomous', 'RouteRoadmap', 'CmrList', 'AgencyList'], main: [
'RouteList',
'RouteExtendedList',
'RouteAutonomous',
'RouteRoadmap',
'CmrList',
'AgencyList',
],
card: ['RouteBasicData', 'RouteTickets', 'RouteLog'], card: ['RouteBasicData', 'RouteTickets', 'RouteLog'],
}, },
children: [ children: [
@ -19,9 +26,6 @@ export default {
path: '/route', path: '/route',
name: 'RouteMain', name: 'RouteMain',
component: () => import('src/components/common/VnSectionMain.vue'), component: () => import('src/components/common/VnSectionMain.vue'),
props: {
leftDrawer: false,
},
redirect: { name: 'RouteList' }, redirect: { name: 'RouteList' },
children: [ children: [
{ {
@ -33,6 +37,15 @@ export default {
}, },
component: () => import('src/pages/Route/RouteList.vue'), component: () => import('src/pages/Route/RouteList.vue'),
}, },
{
path: 'extended-list',
name: 'RouteExtendedList',
meta: {
title: 'RouteExtendedList',
icon: 'format_list_bulleted',
},
component: () => import('src/pages/Route/RouteExtendedList.vue'),
},
{ {
path: 'create', path: 'create',
name: 'RouteCreate', name: 'RouteCreate',
@ -78,7 +91,7 @@ export default {
name: 'AgencyList', name: 'AgencyList',
meta: { meta: {
title: 'agencyList', title: 'agencyList',
icon: 'view_list', icon: 'list',
}, },
component: () => component: () =>
import('src/pages/Route/Agency/AgencyList.vue'), import('src/pages/Route/Agency/AgencyList.vue'),