feat: refs #8630 add Agency and Vehicle descriptor components with summary props
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
aa53b415dc
commit
ed8e48801d
|
@ -0,0 +1,20 @@
|
||||||
|
<script setup>
|
||||||
|
import AgencyDescriptor from 'pages/Route/Agency/Card/AgencyDescriptor.vue';
|
||||||
|
import AgencySummary from './AgencySummary.vue';
|
||||||
|
|
||||||
|
const $props = defineProps({
|
||||||
|
id: {
|
||||||
|
type: Number,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
summary: {
|
||||||
|
type: Object,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<QPopupProxy>
|
||||||
|
<AgencyDescriptor v-if="$props.id" :id="$props.id" :summary="AgencySummary" />
|
||||||
|
</QPopupProxy>
|
||||||
|
</template>
|
|
@ -7,6 +7,10 @@ const $props = defineProps({
|
||||||
type: Number,
|
type: Number,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
summary: {
|
||||||
|
type: Object,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
|
|
@ -13,6 +13,7 @@ import RouteSummary from 'pages/Route/Card/RouteSummary.vue';
|
||||||
import RouteDescriptorProxy from 'pages/Route/Card/RouteDescriptorProxy.vue';
|
import RouteDescriptorProxy from 'pages/Route/Card/RouteDescriptorProxy.vue';
|
||||||
import InvoiceInDescriptorProxy from 'pages/InvoiceIn/Card/InvoiceInDescriptorProxy.vue';
|
import InvoiceInDescriptorProxy from 'pages/InvoiceIn/Card/InvoiceInDescriptorProxy.vue';
|
||||||
import SupplierDescriptorProxy from 'pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
import SupplierDescriptorProxy from 'pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
||||||
|
import AgencyDescriptorProxy from 'pages/Route/Agency/Card/AgencyDescriptorProxy.vue';
|
||||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||||
import VnDms from 'components/common/VnDms.vue';
|
import VnDms from 'components/common/VnDms.vue';
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
|
@ -235,10 +236,16 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
selection: 'multiple',
|
selection: 'multiple',
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<template #column-id="{ row }">
|
<template #column-agencyModeName="{ row }">
|
||||||
<span class="link" @click.stop>
|
<span class="link" @click.stop>
|
||||||
{{ row.routeFk }}
|
{{ row?.agencyModeName }}
|
||||||
<RouteDescriptorProxy :id="row.route.id" />
|
<AgencyDescriptorProxy :id="row?.agencyModeFk" v-if="row?.agencyModeFk" />
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<template #column-agencyAgreement="{ row }">
|
||||||
|
<span class="link" @click.stop>
|
||||||
|
{{ row?.agencyAgreement }}
|
||||||
|
<AgencyDescriptorProxy :id="row?.agencyFk" v-if="row?.agencyFk" />
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template #column-invoiceInFk="{ row }">
|
<template #column-invoiceInFk="{ row }">
|
||||||
|
|
|
@ -7,6 +7,8 @@ import RouteSummary from 'pages/Route/Card/RouteSummary.vue';
|
||||||
import RouteFilter from 'pages/Route/Card/RouteFilter.vue';
|
import RouteFilter from 'pages/Route/Card/RouteFilter.vue';
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||||
|
import AgencyDescriptorProxy from 'src/pages/Route/Agency/Card/AgencyDescriptorProxy.vue';
|
||||||
|
import VehicleDescriptorProxy from 'src/pages/Route/Vehicle/Card/VehicleDescriptorProxy.vue';
|
||||||
import VnSection from 'src/components/common/VnSection.vue';
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||||
|
|
||||||
|
@ -184,6 +186,24 @@ const columns = computed(() => [
|
||||||
<WorkerDescriptorProxy :id="row?.workerFk" v-if="row?.workerFk" />
|
<WorkerDescriptorProxy :id="row?.workerFk" v-if="row?.workerFk" />
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
<template #column-agencyName="{ row }">
|
||||||
|
<span class="link" @click.stop>
|
||||||
|
{{ row?.agencyName }}
|
||||||
|
<AgencyDescriptorProxy
|
||||||
|
:id="row?.agencyModeFk"
|
||||||
|
v-if="row?.agencyModeFk"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<template #column-vehiclePlateNumber="{ row }">
|
||||||
|
<span class="link" @click.stop>
|
||||||
|
{{ row?.vehiclePlateNumber }}
|
||||||
|
<VehicleDescriptorProxy
|
||||||
|
:id="row?.vehicleFk"
|
||||||
|
v-if="row?.vehicleFk"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
</VnTable>
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
</VnSection>
|
</VnSection>
|
||||||
|
|
|
@ -2,13 +2,11 @@
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
import { dashIfEmpty } from 'src/filters';
|
import { dashIfEmpty } from 'src/filters';
|
||||||
import { toDate, toDateHourMin } from 'filters/index';
|
import { toDate, toDateHourMin, toCurrency } from 'filters/index';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import { useSummaryDialog } from 'composables/useSummaryDialog';
|
import { useSummaryDialog } from 'composables/useSummaryDialog';
|
||||||
import toCurrency from 'filters/toCurrency';
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import RoadmapSummary from 'pages/Route/Roadmap/RoadmapSummary.vue';
|
import RoadmapSummary from 'pages/Route/Roadmap/RoadmapSummary.vue';
|
||||||
|
@ -17,6 +15,8 @@ import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
import VnInputTime from 'src/components/common/VnInputTime.vue';
|
import VnInputTime from 'src/components/common/VnInputTime.vue';
|
||||||
import VnSection from 'src/components/common/VnSection.vue';
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
import RoadmapFilter from './Roadmap/RoadmapFilter.vue';
|
import RoadmapFilter from './Roadmap/RoadmapFilter.vue';
|
||||||
|
import VehicleDescriptorProxy from 'src/pages/Route/Vehicle/Card/VehicleDescriptorProxy.vue';
|
||||||
|
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
||||||
|
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -33,7 +33,7 @@ const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'name',
|
name: 'name',
|
||||||
label: t('Roadmap'),
|
label: t('route.roadmap.roadmap'),
|
||||||
create: true,
|
create: true,
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
|
@ -41,9 +41,9 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'center',
|
||||||
name: 'etd',
|
name: 'etd',
|
||||||
label: t('ETD'),
|
label: t('route.roadmap.etd'),
|
||||||
component: 'date',
|
component: 'date',
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
inWhere: true,
|
inWhere: true,
|
||||||
|
@ -54,7 +54,7 @@ const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'supplierFk',
|
name: 'supplierFk',
|
||||||
label: t('Carrier'),
|
label: t('route.roadmap.carrier'),
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'suppliers',
|
url: 'suppliers',
|
||||||
|
@ -65,21 +65,21 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'tractorPlate',
|
name: 'tractorPlate',
|
||||||
label: t('Plate'),
|
label: t('route.roadmap.vehicle'),
|
||||||
field: (row) => row.tractorPlate,
|
field: (row) => row.tractorPlate,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'price',
|
name: 'price',
|
||||||
label: t('Price'),
|
label: t('route.roadmap.price'),
|
||||||
field: (row) => toCurrency(row.price),
|
format: ({ price }) => toCurrency(price),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
align: 'left',
|
align: 'right',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'observations',
|
name: 'observations',
|
||||||
label: t('Observations'),
|
label: t('route.roadmap.observations'),
|
||||||
field: (row) => dashIfEmpty(row.observations),
|
field: (row) => dashIfEmpty(row.observations),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -89,7 +89,7 @@ const columns = computed(() => [
|
||||||
name: 'tableActions',
|
name: 'tableActions',
|
||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
title: t('Ver cmr'),
|
title: t('route.roadmap.seeCmr'),
|
||||||
icon: 'preview',
|
icon: 'preview',
|
||||||
isPrimary: true,
|
isPrimary: true,
|
||||||
action: (row) => viewSummary(row?.id, RoadmapSummary),
|
action: (row) => viewSummary(row?.id, RoadmapSummary),
|
||||||
|
@ -124,8 +124,8 @@ function confirmRemove() {
|
||||||
.dialog({
|
.dialog({
|
||||||
component: VnConfirm,
|
component: VnConfirm,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
title: t('Selected roadmaps will be removed'),
|
title: t('route.roadmap.selectedRoadmapsRemoved'),
|
||||||
message: t('Are you sure you want to continue?'),
|
message: t('route.roadmap.areYouSure'),
|
||||||
promise: removeSelection,
|
promise: removeSelection,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -157,15 +157,24 @@ function exprBuilder(param, value) {
|
||||||
<QCard style="min-width: 350px">
|
<QCard style="min-width: 350px">
|
||||||
<QCardSection>
|
<QCardSection>
|
||||||
<p class="text-h6 q-ma-none">
|
<p class="text-h6 q-ma-none">
|
||||||
{{ t('Select the estimated date of departure (ETD)') }}
|
{{ t('route.roadmap.selectEtd') }}
|
||||||
</p>
|
</p>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
|
|
||||||
<QCardSection class="q-pt-none">
|
<QCardSection class="q-pt-none">
|
||||||
<VnInputDate :label="t('ETD')" v-model="etdDate" autofocus />
|
<VnInputDate
|
||||||
|
:label="t('route.roadmap.etd')"
|
||||||
|
v-model="etdDate"
|
||||||
|
autofocus
|
||||||
|
/>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<QCardActions align="right">
|
<QCardActions align="right">
|
||||||
<QBtn flat :label="t('Cancel')" v-close-popup class="text-primary" />
|
<QBtn
|
||||||
|
flat
|
||||||
|
:label="t('globals.cancel')"
|
||||||
|
v-close-popup
|
||||||
|
class="text-primary"
|
||||||
|
/>
|
||||||
<QBtn color="primary" v-close-popup @click="cloneSelection">
|
<QBtn color="primary" v-close-popup @click="cloneSelection">
|
||||||
{{ t('globals.clone') }}
|
{{ t('globals.clone') }}
|
||||||
</QBtn>
|
</QBtn>
|
||||||
|
@ -181,7 +190,7 @@ function exprBuilder(param, value) {
|
||||||
:disable="!selectedRows?.length"
|
:disable="!selectedRows?.length"
|
||||||
@click="isCloneDialogOpen = true"
|
@click="isCloneDialogOpen = true"
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('Clone Selected Routes') }}</QTooltip>
|
<QTooltip>{{ t('route.roadmap.cloneSelected') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
<QBtn
|
<QBtn
|
||||||
icon="delete"
|
icon="delete"
|
||||||
|
@ -190,7 +199,7 @@ function exprBuilder(param, value) {
|
||||||
:disable="!selectedRows?.length"
|
:disable="!selectedRows?.length"
|
||||||
@click="confirmRemove"
|
@click="confirmRemove"
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('Delete roadmap(s)') }}</QTooltip>
|
<QTooltip>{{ t('route.roadmap.deleteRoadmap') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</template>
|
</template>
|
||||||
</VnSubToolbar>
|
</VnSubToolbar>
|
||||||
|
@ -222,7 +231,7 @@ function exprBuilder(param, value) {
|
||||||
redirect="route/roadmap"
|
redirect="route/roadmap"
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: 'Roadmaps',
|
urlCreate: 'Roadmaps',
|
||||||
title: t('Create routemap'),
|
title: t('route.roadmap.createRoadmap'),
|
||||||
onDataSaved: ({ id }) => tableRef.redirect(id),
|
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||||
formInitialData: {},
|
formInitialData: {},
|
||||||
}"
|
}"
|
||||||
|
@ -232,7 +241,10 @@ function exprBuilder(param, value) {
|
||||||
{{ toDateHourMin(row.etd) }}
|
{{ toDateHourMin(row.etd) }}
|
||||||
</template>
|
</template>
|
||||||
<template #column-supplierFk="{ row }">
|
<template #column-supplierFk="{ row }">
|
||||||
{{ row.supplierFk }}
|
<span class="link" @click.stop>
|
||||||
|
{{ row.driverName }}
|
||||||
|
<SupplierDescriptorProxy :id="row.supplierFk" />
|
||||||
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template #more-create-dialog="{ data }">
|
<template #more-create-dialog="{ data }">
|
||||||
<VnInputDate v-model="data.etd" />
|
<VnInputDate v-model="data.etd" />
|
||||||
|
@ -251,21 +263,3 @@ function exprBuilder(param, value) {
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<i18n>
|
|
||||||
es:
|
|
||||||
Create routemap: Crear troncal
|
|
||||||
Search roadmaps: Buscar troncales
|
|
||||||
You can search by roadmap reference: Puedes buscar por referencia del troncal
|
|
||||||
Delete roadmap(s): Eliminar troncal(es)
|
|
||||||
Selected roadmaps will be removed: Los troncales seleccionadas serán eliminados
|
|
||||||
Are you sure you want to continue?: ¿Seguro que quieres continuar?
|
|
||||||
The date can't be empty: La fecha no puede estar vacía
|
|
||||||
Clone Selected Routes: Clonar rutas seleccionadas
|
|
||||||
Create roadmap: Crear troncal
|
|
||||||
Roadmap: Troncal
|
|
||||||
Carrier: Transportista
|
|
||||||
Plate: Matrícula
|
|
||||||
Price: Precio
|
|
||||||
Observations: Observaciones
|
|
||||||
Select the estimated date of departure (ETD): Selecciona la fecha estimada de salida
|
|
||||||
</i18n>
|
|
||||||
|
|
|
@ -1,14 +1,27 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { computed } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
id: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
const entityId = computed(() => props.id || route.params.id);
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
:url="`Vehicles/${$route.params.id}`"
|
:url="`Vehicles/${entityId}`"
|
||||||
data-key="Vehicle"
|
data-key="Vehicle"
|
||||||
title="numberPlate"
|
title="numberPlate"
|
||||||
:to-module="{ name: 'VehicleList' }"
|
:to-module="{ name: 'VehicleList' }"
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
<script setup>
|
||||||
|
import VehicleDescriptor from 'pages/Route/Vehicle/Card/VehicleDescriptor.vue';
|
||||||
|
import VehicleSummary from './VehicleSummary.vue';
|
||||||
|
|
||||||
|
const $props = defineProps({
|
||||||
|
id: {
|
||||||
|
type: Number,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
summary: {
|
||||||
|
type: Object,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<QPopupProxy>
|
||||||
|
<VehicleDescriptor v-if="$props.id" :id="$props.id" :summary="VehicleSummary" />
|
||||||
|
</QPopupProxy>
|
||||||
|
</template>
|
|
@ -8,6 +8,19 @@ route:
|
||||||
downloadSelectedRoutes: Download selected routes as PDF
|
downloadSelectedRoutes: Download selected routes as PDF
|
||||||
markServed: Mark as served
|
markServed: Mark as served
|
||||||
roadmap:
|
roadmap:
|
||||||
|
roadmap: Roadmap
|
||||||
|
carrier: Carrier
|
||||||
|
vehicle: Vehicle
|
||||||
|
price: Price
|
||||||
|
observations: Observations
|
||||||
|
etd: ETD
|
||||||
|
dateCantEmpty: The date can't be empty
|
||||||
|
createRoadmap: Create roadmap
|
||||||
|
deleteRoadmap: Delete roadmap(s)
|
||||||
|
cloneSelected: Clone selected routes
|
||||||
|
selectedRoadmapsRemoved: Selected roadmaps will be removed
|
||||||
|
areYouSure: Are you sure you want to continue?
|
||||||
|
selectEtd: Select the estimated date of departure (ETD)
|
||||||
search: Search roadmap
|
search: Search roadmap
|
||||||
searchInfo: You can search by roadmap reference
|
searchInfo: You can search by roadmap reference
|
||||||
params:
|
params:
|
||||||
|
|
|
@ -8,6 +8,19 @@ route:
|
||||||
downloadSelectedRoutes: Descargar rutas seleccionadas como PDF
|
downloadSelectedRoutes: Descargar rutas seleccionadas como PDF
|
||||||
markServed: Marcar como servidas
|
markServed: Marcar como servidas
|
||||||
roadmap:
|
roadmap:
|
||||||
|
roadmap: Troncal
|
||||||
|
carrier: Transportista
|
||||||
|
vehicle: Vehículo
|
||||||
|
price: Precio
|
||||||
|
observations: Observaciones
|
||||||
|
etd: ETD
|
||||||
|
dateCantEmpty: La fecha no puede estar vacía
|
||||||
|
createRoadmap: Crear troncal
|
||||||
|
deleteRoadmap: Eliminar troncal(es)
|
||||||
|
cloneSelected: Clonar rutas seleccionadas
|
||||||
|
selectedRoadmapsRemoved: Los troncales seleccionadas serán eliminados
|
||||||
|
areYouSure: ¿Seguro que quieres continuar?
|
||||||
|
selectEtd: Selecciona la fecha estimada de salida
|
||||||
search: Buscar troncales
|
search: Buscar troncales
|
||||||
searchInfo: Puedes buscar por referencia del troncal
|
searchInfo: Puedes buscar por referencia del troncal
|
||||||
params:
|
params:
|
||||||
|
|
Loading…
Reference in New Issue