Merge branch 'dev' into 8387-itemTagCrudModelFront
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Robert Ferrús 2025-01-27 08:05:51 +00:00
commit 9deb5bceea
22 changed files with 441 additions and 341 deletions

View File

@ -75,6 +75,7 @@ const focus = () => {
defineExpose({ defineExpose({
focus, focus,
vnInputRef,
}); });
const mixinRules = [ const mixinRules = [

View File

@ -94,8 +94,8 @@ function checkIsMain() {
/> />
<div :id="searchbarId"></div> <div :id="searchbarId"></div>
</slot> </slot>
<RightAdvancedMenu :is-main-section="isMainSection"> <RightAdvancedMenu :is-main-section="isMainSection && rightFilter">
<template #advanced-menu v-if="$slots[advancedMenuSlot] || rightFilter"> <template #advanced-menu v-if="$slots[advancedMenuSlot]">
<slot :name="advancedMenuSlot"> <slot :name="advancedMenuSlot">
<VnTableFilter <VnTableFilter
v-if="rightFilter && columns" v-if="rightFilter && columns"

View File

@ -149,7 +149,7 @@ function sendPdfInvoice({ address }) {
const createInvoiceInCorrection = async () => { const createInvoiceInCorrection = async () => {
const { data: correctingId } = await axios.post( const { data: correctingId } = await axios.post(
'InvoiceIns/corrective', 'InvoiceIns/corrective',
Object.assign(correctionFormData, { id: entityId.value }) Object.assign(correctionFormData, { id: entityId.value }),
); );
push({ path: `/invoice-in/${correctingId}/summary` }); push({ path: `/invoice-in/${correctingId}/summary` });
}; };
@ -272,7 +272,6 @@ const createInvoiceInCorrection = async () => {
> >
<template #option="{ itemProps, opt }"> <template #option="{ itemProps, opt }">
<QItem v-bind="itemProps"> <QItem v-bind="itemProps">
{{ console.log('opt: ', opt) }}
<QItemSection> <QItemSection>
<QItemLabel <QItemLabel
>{{ opt.id }} - >{{ opt.id }} -

View File

@ -272,11 +272,12 @@ const onDenyAccept = (_, responseData) => {
<template #column-achieved="{ row }"> <template #column-achieved="{ row }">
<span> <span>
<VnInput <VnInput
ref="achievedRef"
type="number" type="number"
v-model.number="row.saleQuantity" v-model.number="row.saleQuantity"
:disable="!row.itemFk || row.isOk != null" :disable="!row.itemFk || row.isOk != null"
@blur="changeQuantity(row)" @blur="changeQuantity(row)"
@keyup.enter="changeQuantity(row)" @keyup.enter="$refs.achievedRef.vnInputRef.blur()"
dense dense
/> />
</span> </span>

View File

@ -2,11 +2,12 @@
import { computed } from 'vue'; import { computed } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import VnTable from 'components/VnTable/VnTable.vue'; import VnTable from 'components/VnTable/VnTable.vue';
import VnSection from 'src/components/common/VnSection.vue';
const { t } = useI18n(); const { t } = useI18n();
const router = useRouter(); const router = useRouter();
const dataKey = 'AgencyList';
function navigate(id) { function navigate(id) {
router.push({ path: `/agency/${id}` }); router.push({ path: `/agency/${id}` });
} }
@ -67,26 +68,28 @@ const columns = computed(() => [
]); ]);
</script> </script>
<template> <template>
<VnSearchbar <VnSection
:info="t('You can search by name')" :data-key
:label="t('Search agency')" :columns="columns"
data-key="AgencyList" prefix="agency"
:expr-builder="exprBuilder" :right-filter="false"
/> :array-data-props="{
<div class="list-container"> url: 'Agencies',
<div class="list"> order: 'name',
exprBuilder,
}"
>
<template #body>
<VnTable <VnTable
data-key="AgencyList" :data-key
url="Agencies"
order="name"
:columns="columns" :columns="columns"
:right-search="false" :right-search="false"
:use-model="true" :use-model="true"
redirect="agency" redirect="route/agency"
default-mode="card" default-mode="card"
/> />
</div> </template>
</div> </VnSection>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.list { .list {
@ -104,8 +107,6 @@ const columns = computed(() => [
es: es:
isOwn: Tiene propietario isOwn: Tiene propietario
isAnyVolumeAllowed: Permite cualquier volumen isAnyVolumeAllowed: Permite cualquier volumen
Search agency: Buscar agencia
You can search by name: Puedes buscar por nombre
en: en:
isOwn: Has owner isOwn: Has owner
isAnyVolumeAllowed: Allows any volume isAnyVolumeAllowed: Allows any volume

View File

@ -1,17 +1,7 @@
<script setup> <script setup>
import AgencyDescriptor from 'pages/Route/Agency/Card/AgencyDescriptor.vue'; import AgencyDescriptor from 'pages/Route/Agency/Card/AgencyDescriptor.vue';
import VnCard from 'components/common/VnCard.vue'; import VnCardBeta from 'src/components/common/VnCardBeta.vue';
</script> </script>
<template> <template>
<VnCard <VnCardBeta data-key="Agency" base-url="Agencies" :descriptor="AgencyDescriptor" />
data-key="Agency"
base-url="Agencies"
:descriptor="AgencyDescriptor"
search-data-key="AgencyList"
:searchbar-props="{
url: 'Agencies',
label: 'agency.searchBar.label',
info: 'agency.searchBar.info',
}"
/>
</template> </template>

View File

@ -1,4 +1,6 @@
agency: agency:
search: Search agency
searchInfo: You can search by name
isOwn: Own isOwn: Own
isAnyVolumeAllowed: Any volume allowed isAnyVolumeAllowed: Any volume allowed
notification: notification:

View File

@ -1,4 +1,6 @@
agency: agency:
search: Buscar agencia
searchInfo: Puedes buscar por nombre
isOwn: Propio isOwn: Propio
isAnyVolumeAllowed: Cualquier volumen isAnyVolumeAllowed: Cualquier volumen
removeItem: Agencia eliminada correctamente removeItem: Agencia eliminada correctamente

View File

@ -1,19 +1,8 @@
<script setup> <script setup>
import VnCard from 'components/common/VnCard.vue';
import RouteDescriptor from 'pages/Route/Card/RouteDescriptor.vue'; import RouteDescriptor from 'pages/Route/Card/RouteDescriptor.vue';
import RouteFilter from './RouteFilter.vue'; import VnCardBeta from 'src/components/common/VnCardBeta.vue';
import RouteSearchbar from 'pages/Route/Card/RouteSearchbar.vue';
</script> </script>
<template> <template>
<VnCard <VnCardBeta data-key="Route" base-url="Routes" :descriptor="RouteDescriptor" />
data-key="Route"
base-url="Routes"
:descriptor="RouteDescriptor"
:filter-panel="RouteFilter"
search-data-key="RouteList"
>
<template #searchbar>
<RouteSearchbar />
</template>
</VnCard>
</template> </template>

View File

@ -1,19 +1,7 @@
<script setup> <script setup>
import VnCard from 'components/common/VnCard.vue'; import VnCardBeta from 'components/common/VnCardBeta.vue';
import RoadmapDescriptor from 'pages/Route/Roadmap/RoadmapDescriptor.vue'; import RoadmapDescriptor from 'pages/Route/Roadmap/RoadmapDescriptor.vue';
import RoadmapFilter from 'pages/Route/Roadmap/RoadmapFilter.vue';
</script> </script>
<template> <template>
<VnCard <VnCardBeta data-key="Roadmap" base-url="Roadmaps" :descriptor="RoadmapDescriptor" />
data-key="Roadmap"
base-url="Roadmaps"
:descriptor="RoadmapDescriptor"
:filter-panel="RoadmapFilter"
search-data-key="RoadmapList"
:searchbar-props="{
url: 'Roadmaps',
label: 'Search roadmap',
info: 'You can search by roadmap id or customer name',
}"
/>
</template> </template>

View File

@ -18,22 +18,6 @@ const props = defineProps({
const emit = defineEmits(['search']); const emit = defineEmits(['search']);
const supplierList = ref([]); const supplierList = ref([]);
const exprBuilder = (param, value) => {
switch (param) {
case 'tractorPlate':
case 'trailerPlate':
case 'driverName':
case 'phone':
return { [param]: { like: `%${value}%` } };
case 'supplierFk':
case 'price':
return { [param]: value };
case 'from':
return { etd: { gte: value } };
case 'to':
return { etd: { lte: value } };
}
};
</script> </script>
<template> <template>
@ -48,7 +32,6 @@ const exprBuilder = (param, value) => {
<VnFilterPanel <VnFilterPanel
:data-key="props.dataKey" :data-key="props.dataKey"
:search-button="true" :search-button="true"
:expr-builder="exprBuilder"
@search="emit('search')" @search="emit('search')"
> >
<template #tags="{ tag, formatFn }"> <template #tags="{ tag, formatFn }">

View File

@ -3,17 +3,16 @@ import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import { toHour } from 'src/filters'; import { toHour } from 'src/filters';
import RouteSearchbar from 'pages/Route/Card/RouteSearchbar.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 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 VnSection from 'src/components/common/VnSection.vue';
const { t } = useI18n(); const { t } = useI18n();
const { viewSummary } = useSummaryDialog(); const { viewSummary } = useSummaryDialog();
const tableRef = ref([]); const tableRef = ref([]);
const dataKey = 'RouteList';
const routeFilter = { const routeFilter = {
include: [ include: [
{ {
@ -110,18 +109,23 @@ const columns = computed(() => [
]); ]);
</script> </script>
<template> <template>
<RouteSearchbar /> <VnSection
<RightMenu> :data-key
<template #right-panel> :columns="columns"
<RouteFilter data-key="RouteList" /> prefix="route"
:array-data-props="{
url: 'Routes/filter',
userFilter: routeFilter,
}"
>
<template #advanced-menu>
<RouteFilter :data-key />
</template> </template>
</RightMenu> <template #body>
<VnTable <VnTable
data-key="RouteList" :data-key
url="Routes/filter"
:columns="columns" :columns="columns"
:right-search="false" :right-search="false"
:filter="routeFilter"
redirect="route" redirect="route"
:create="{ :create="{
urlCreate: 'Routes', urlCreate: 'Routes',
@ -139,3 +143,5 @@ const columns = computed(() => [
</template> </template>
</VnTable> </VnTable>
</template> </template>
</VnSection>
</template>

View File

@ -15,11 +15,14 @@ import RoadmapSummary from 'pages/Route/Roadmap/RoadmapSummary.vue';
import VnConfirm from 'components/ui/VnConfirm.vue'; import VnConfirm from 'components/ui/VnConfirm.vue';
import VnInputDate from 'components/common/VnInputDate.vue'; 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 RoadmapFilter from './Roadmap/RoadmapFilter.vue';
const { viewSummary } = useSummaryDialog(); const { viewSummary } = useSummaryDialog();
const { t } = useI18n(); const { t } = useI18n();
const quasar = useQuasar(); const quasar = useQuasar();
const selectedRows = ref([]); const selectedRows = ref([]);
const dataKey = 'RoadmapList';
const columns = computed(() => [ const columns = computed(() => [
{ {
align: 'left', align: 'left',
@ -128,14 +131,28 @@ function confirmRemove() {
}) })
.onOk(() => tableRef.value++); .onOk(() => tableRef.value++);
} }
function exprBuilder(param, value) {
switch (param) {
case 'search':
return /^\d+$/.test(value) ? { id: value } : { name: { like: `%${value}%` } };
case 'tractorPlate':
case 'trailerPlate':
case 'driverName':
case 'phone':
return { [param]: { like: `%${value}%` } };
case 'supplierFk':
case 'price':
return { [param]: value };
case 'from':
return { etd: { gte: value } };
case 'to':
return { etd: { lte: value } };
}
}
</script> </script>
<template> <template>
<VnSearchbar
data-key="RoadmapList"
:label="t('Search roadmaps')"
:info="t('You can search by roadmap reference')"
/>
<QDialog v-model="isCloneDialogOpen"> <QDialog v-model="isCloneDialogOpen">
<QCard style="min-width: 350px"> <QCard style="min-width: 350px">
<QCardSection> <QCardSection>
@ -177,12 +194,24 @@ function confirmRemove() {
</QBtn> </QBtn>
</template> </template>
</VnSubToolbar> </VnSubToolbar>
<VnSection
:data-key
:columns="columns"
prefix="route.roadmap"
:array-data-props="{
url: 'roadmaps',
exprBuilder,
}"
>
<template #advanced-menu>
<RoadmapFilter :dataKey />
</template>
<template #body>
<VnTable <VnTable
ref="tableRef" ref="tableRef"
data-key="RoadmapList" :data-key
url="roadmaps"
:columns="columns" :columns="columns"
:right-search="true" :right-search="false"
:use-model="true" :use-model="true"
default-mode="table" default-mode="table"
v-model:selected="selectedRows" v-model:selected="selectedRows"
@ -211,6 +240,8 @@ function confirmRemove() {
</template> </template>
</VnTable> </VnTable>
</template> </template>
</VnSection>
</template>
<style lang="scss" scoped> <style lang="scss" scoped>
.route-list { .route-list {

View File

@ -1,4 +1,7 @@
route: route:
roadmap:
search: Search roadmap
searchInfo: You can search by roadmap reference
params: params:
etd: ETD etd: ETD
tractorPlate: Plate tractorPlate: Plate
@ -36,6 +39,8 @@ route:
Summary: Summary Summary: Summary
Route is closed: Route is closed Route is closed: Route is closed
Route is not served: Route is not served Route is not served: Route is not served
search: Search route
searchInfo: You can search by route reference
cmr: cmr:
list: list:
results: results results: results

View File

@ -1,4 +1,7 @@
route: route:
roadmap:
search: Buscar troncales
searchInfo: Puedes buscar por referencia del troncal
params: params:
agencyModeName: Agencia Ruta agencyModeName: Agencia Ruta
agencyAgreement: Agencia Acuerdo agencyAgreement: Agencia Acuerdo
@ -37,6 +40,8 @@ route:
Summary: Resumen Summary: Resumen
Route is closed: La ruta está cerrada Route is closed: La ruta está cerrada
Route is not served: La ruta no está servida Route is not served: La ruta no está servida
search: Buscar rutas
searchInfo: Puedes buscar por referencia de la ruta
cmr: cmr:
list: list:
results: resultados results: resultados

View File

@ -1,25 +1,13 @@
import { RouterView } from 'vue-router'; import { RouterView } from 'vue-router';
export default { const agencyCard = {
path: '/agency', path: ':id',
name: 'Agency',
meta: {
title: 'agency',
icon: 'garage_home',
moduleName: 'Agency',
},
component: RouterView,
redirect: { name: 'AgencyCard' },
menus: {
main: [],
card: ['AgencyBasicData', 'AgencyModes', 'AgencyWorkCenters', 'AgencyLog'],
},
children: [
{
path: '/agency/:id',
name: 'AgencyCard', name: 'AgencyCard',
component: () => import('src/pages/Route/Agency/Card/AgencyCard.vue'), component: () => import('src/pages/Route/Agency/Card/AgencyCard.vue'),
redirect: { name: 'AgencySummary' }, redirect: { name: 'AgencySummary' },
meta: {
menu: ['AgencyBasicData', 'AgencyModes', 'AgencyWorkCenters', 'AgencyLog'],
},
children: [ children: [
{ {
name: 'AgencySummary', name: 'AgencySummary',
@ -28,8 +16,7 @@ export default {
title: 'summary', title: 'summary',
icon: 'view_list', icon: 'view_list',
}, },
component: () => component: () => import('src/pages/Route/Agency/Card/AgencySummary.vue'),
import('src/pages/Route/Agency/Card/AgencySummary.vue'),
}, },
{ {
name: 'AgencyBasicData', name: 'AgencyBasicData',
@ -38,8 +25,7 @@ export default {
title: 'basicData', title: 'basicData',
icon: 'vn:settings', icon: 'vn:settings',
}, },
component: () => component: () => import('pages/Route/Agency/Card/AgencyBasicData.vue'),
import('pages/Route/Agency/Card/AgencyBasicData.vue'),
}, },
{ {
path: 'workCenter', path: 'workCenter',
@ -54,9 +40,7 @@ export default {
title: 'workCenters', title: 'workCenters',
}, },
component: () => component: () =>
import( import('src/pages/Route/Agency/Card/AgencyWorkcenter.vue'),
'src/pages/Route/Agency/Card/AgencyWorkcenter.vue'
),
}, },
], ],
}, },
@ -87,6 +71,43 @@ export default {
component: () => import('src/pages/Route/Agency/Card/AgencyLog.vue'), component: () => import('src/pages/Route/Agency/Card/AgencyLog.vue'),
}, },
], ],
};
export default {
name: 'Agency',
path: '/agency',
meta: {
title: 'agency',
icon: 'garage_home',
moduleName: 'Agency',
},
component: RouterView,
redirect: { name: 'RouteMain' },
children: [
{
name: 'AgencyMain',
path: '',
component: () => import('src/components/common/VnModule.vue'),
redirect: { name: 'AgencyIndexMain' },
children: [
{
name: 'AgencyIndexMain',
path: '',
redirect: { name: 'AgencyList' },
component: () => import('src/pages/Route/Agency/AgencyList.vue'),
children: [
{
name: 'AgencyList',
path: 'list',
meta: {
title: 'list',
icon: 'view_list',
},
},
agencyCard,
],
},
],
}, },
], ],
}; };

View File

@ -12,8 +12,6 @@ import Supplier from './supplier';
import Travel from './travel'; import Travel from './travel';
import Order from './order'; import Order from './order';
import Entry from './entry'; import Entry from './entry';
import roadmap from './roadmap';
import Agency from './agency';
import Zone from './zone'; import Zone from './zone';
import Account from './account'; import Account from './account';
import Monitor from './monitor'; import Monitor from './monitor';
@ -33,8 +31,6 @@ export default [
Order, Order,
invoiceIn, invoiceIn,
Entry, Entry,
roadmap,
Agency,
Zone, Zone,
Account, Account,
Monitor, Monitor,

View File

@ -1,53 +0,0 @@
import { RouterView } from 'vue-router';
export default {
path: '/route/roadmap',
name: 'Roadmap',
meta: {
title: 'roadmap',
icon: 'vn:troncales',
moduleName: 'Roadmap',
},
component: RouterView,
redirect: { name: 'RouteMain' },
menus: {
card: ['RoadmapBasicData', 'RoadmapStops'],
},
children: [
{
name: 'RouteRoadmapCard',
path: ':id',
component: () => import('src/pages/Route/Roadmap/RoadmapCard.vue'),
redirect: { name: 'RoadmapSummary' },
children: [
{
name: 'RoadmapSummary',
path: 'summary',
meta: {
title: 'summary',
icon: 'open_in_new',
},
component: () => import('pages/Route/Roadmap/RoadmapSummary.vue'),
},
{
name: 'RoadmapBasicData',
path: 'basic-data',
meta: {
title: 'basicData',
icon: 'vn:settings',
},
component: () => import('pages/Route/Roadmap/RoadmapBasicData.vue'),
},
{
name: 'RoadmapStops',
path: 'stops',
meta: {
title: 'stops',
icon: 'vn:lines',
},
component: () => import('pages/Route/Roadmap/RoadmapStops.vue'),
},
],
},
],
};

View File

@ -1,110 +1,13 @@
import { RouterView } from 'vue-router'; import { RouterView } from 'vue-router';
export default { const routeCard = {
path: '/route',
name: 'Route',
meta: {
title: 'routes',
icon: 'vn:delivery',
moduleName: 'Route',
},
component: RouterView,
redirect: { name: 'RouteMain' },
menus: {
main: [
'RouteList',
'RouteExtendedList',
'RouteAutonomous',
'RouteRoadmap',
'CmrList',
'AgencyList',
],
card: ['RouteBasicData', 'RouteTickets', 'RouteLog'],
},
children: [
{
path: '/route',
name: 'RouteMain',
component: () => import('src/components/common/VnModule.vue'),
redirect: { name: 'RouteList' },
children: [
{
path: 'list',
name: 'RouteList',
meta: {
title: 'RouteList',
icon: 'view_list',
},
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',
name: 'RouteCreate',
meta: {
title: 'routeCreate',
icon: 'add',
},
component: () => import('src/pages/Route/Card/RouteForm.vue'),
},
{
path: 'agency-term',
name: 'RouteAutonomous',
meta: {
title: 'autonomous',
icon: 'vn:agency-term',
},
component: () => import('src/pages/Route/RouteAutonomous.vue'),
},
{
path: 'roadmap',
name: 'RouteRoadmap',
meta: {
title: 'RouteRoadmap',
icon: 'vn:troncales',
},
component: () => import('src/pages/Route/RouteRoadmap.vue'),
},
{
path: 'cmr',
name: 'CmrList',
meta: {
title: 'cmrsList',
icon: 'fact_check',
},
component: () => import('src/pages/Route/Cmr/CmrList.vue'),
},
{
path: '/agency',
redirect: { name: 'AgencyList' },
children: [
{
path: 'list',
name: 'AgencyList',
meta: {
title: 'agencyList',
icon: 'list',
},
component: () =>
import('src/pages/Route/Agency/AgencyList.vue'),
},
],
},
],
},
{
name: 'RouteCard', name: 'RouteCard',
path: ':id', path: ':id',
component: () => import('src/pages/Route/Card/RouteCard.vue'), component: () => import('src/pages/Route/Card/RouteCard.vue'),
redirect: { name: 'RouteSummary' }, redirect: { name: 'RouteSummary' },
meta: {
menu: ['RouteBasicData', 'RouteTickets', 'RouteLog'],
},
children: [ children: [
{ {
name: 'RouteBasicData', name: 'RouteBasicData',
@ -143,6 +46,241 @@ export default {
component: () => import('src/pages/Route/RouteLog.vue'), component: () => import('src/pages/Route/RouteLog.vue'),
}, },
], ],
};
const agencyCard = {
path: ':id',
name: 'AgencyCard',
component: () => import('src/pages/Route/Agency/Card/AgencyCard.vue'),
redirect: { name: 'AgencySummary' },
meta: {
menu: ['AgencyBasicData', 'AgencyModes', 'AgencyWorkCenters', 'AgencyLog'],
},
children: [
{
name: 'AgencySummary',
path: 'summary',
meta: {
title: 'summary',
icon: 'view_list',
},
component: () => import('src/pages/Route/Agency/Card/AgencySummary.vue'),
},
{
name: 'AgencyBasicData',
path: 'basic-data',
meta: {
title: 'basicData',
icon: 'vn:settings',
},
component: () => import('pages/Route/Agency/Card/AgencyBasicData.vue'),
},
{
path: 'workCenter',
name: 'AgencyWorkCenterCard',
redirect: { name: 'AgencyWorkCenters' },
children: [
{
path: '',
name: 'AgencyWorkCenters',
meta: {
icon: 'apartment',
title: 'workCenters',
},
component: () =>
import('src/pages/Route/Agency/Card/AgencyWorkcenter.vue'),
},
],
},
{
path: 'modes',
name: 'AgencyModesCard',
redirect: { name: 'AgencyModes' },
children: [
{
path: '',
name: 'AgencyModes',
meta: {
icon: 'format_list_bulleted',
title: 'modes',
},
component: () =>
import('src/pages/Route/Agency/Card/AgencyModes.vue'),
},
],
},
{
name: 'AgencyLog',
path: 'log',
meta: {
title: 'log',
icon: 'history',
},
component: () => import('src/pages/Route/Agency/Card/AgencyLog.vue'),
},
],
};
const roadmapCard = {
path: ':id',
name: 'RoadmapCard',
component: () => import('src/pages/Route/Roadmap/RoadmapCard.vue'),
redirect: { name: 'RoadmapSummary' },
meta: {
menu: ['RoadmapBasicData', 'RoadmapStops'],
},
children: [
{
name: 'RoadmapSummary',
path: 'summary',
meta: {
title: 'summary',
icon: 'open_in_new',
},
component: () => import('pages/Route/Roadmap/RoadmapSummary.vue'),
},
{
name: 'RoadmapBasicData',
path: 'basic-data',
meta: {
title: 'basicData',
icon: 'vn:settings',
},
component: () => import('pages/Route/Roadmap/RoadmapBasicData.vue'),
},
{
name: 'RoadmapStops',
path: 'stops',
meta: {
title: 'stops',
icon: 'vn:lines',
},
component: () => import('pages/Route/Roadmap/RoadmapStops.vue'),
},
],
};
export default {
name: 'Route',
path: '/route',
meta: {
title: 'routes',
icon: 'vn:delivery',
moduleName: 'Route',
menu: [
'RouteList',
'RouteExtendedList',
'RouteAutonomous',
'RouteRoadmap',
'CmrList',
'AgencyList',
],
},
component: RouterView,
redirect: { name: 'RouteMain' },
children: [
{
name: 'RouteMain',
path: '',
component: () => import('src/components/common/VnModule.vue'),
redirect: { name: 'RouteIndexMain' },
children: [
{
path: '',
name: 'RouteIndexMain',
redirect: { name: 'RouteList' },
component: () => import('src/pages/Route/RouteList.vue'),
children: [
{
name: 'RouteList',
path: 'list',
meta: {
title: 'list',
icon: 'view_list',
},
},
routeCard,
],
},
{
path: 'extended-list',
name: 'RouteExtendedList',
meta: {
title: 'RouteExtendedList',
icon: 'format_list_bulleted',
},
component: () => import('src/pages/Route/RouteExtendedList.vue'),
},
{
path: 'create',
name: 'RouteCreate',
meta: {
title: 'routeCreate',
icon: 'add',
},
component: () => import('src/pages/Route/Card/RouteForm.vue'),
},
{
path: 'agency-term',
name: 'RouteAutonomous',
meta: {
title: 'autonomous',
icon: 'vn:agency-term',
},
component: () => import('src/pages/Route/RouteAutonomous.vue'),
},
{
path: 'roadmap',
name: 'RouteRoadmap',
redirect: { name: 'RoadmapList' },
meta: {
title: 'RouteRoadmap',
icon: 'vn:troncales',
},
component: () => import('src/pages/Route/RouteRoadmap.vue'),
children: [
{
name: 'RoadmapList',
path: 'list',
meta: {
title: 'list',
icon: 'view_list',
},
},
roadmapCard,
],
},
{
path: 'cmr',
name: 'CmrList',
meta: {
title: 'cmrsList',
icon: 'fact_check',
},
component: () => import('src/pages/Route/Cmr/CmrList.vue'),
},
{
path: 'agency',
name: 'RouteAgency',
redirect: { name: 'AgencyList' },
meta: {
title: 'agency',
icon: 'garage_home',
},
component: () => import('src/pages/Route/Agency/AgencyList.vue'),
children: [
{
name: 'AgencyList',
path: 'list',
meta: {
title: 'list',
icon: 'view_list',
},
},
agencyCard,
],
},
],
}, },
], ],
}; };

View File

@ -12,8 +12,6 @@ import travel from './modules/travel';
import shelving from 'src/router/modules/shelving'; import shelving from 'src/router/modules/shelving';
import order from 'src/router/modules/order'; import order from 'src/router/modules/order';
import entry from 'src/router/modules/entry'; import entry from 'src/router/modules/entry';
import roadmap from 'src/router/modules/roadmap';
import agency from 'src/router/modules/agency';
import zone from 'src/router/modules/zone'; import zone from 'src/router/modules/zone';
import account from './modules/account'; import account from './modules/account';
import monitor from 'src/router/modules/monitor'; import monitor from 'src/router/modules/monitor';
@ -82,9 +80,7 @@ const routes = [
route, route,
supplier, supplier,
travel, travel,
roadmap,
entry, entry,
agency,
zone, zone,
account, account,
{ {

View File

@ -2,7 +2,7 @@ describe('AgencyWorkCenter', () => {
beforeEach(() => { beforeEach(() => {
cy.viewport(1920, 1080); cy.viewport(1920, 1080);
cy.login('developer'); cy.login('developer');
cy.visit(`/#/agency/11/workCenter`); cy.visit(`/#/route/agency/11/workCenter`);
}); });
const createButton = '.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon'; const createButton = '.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon';
const workCenterCombobox = 'input[role="combobox"]'; const workCenterCombobox = 'input[role="combobox"]';

View File

@ -1,12 +1,11 @@
describe('RoadMap', () => { describe('RoadMap', () => {
beforeEach(() => { beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer'); cy.login('developer');
cy.visit(`/#/route/roadmap`); cy.visit(`/#/route/roadmap`);
}); });
it('Route list create roadmap and redirect', () => { it('Route list create roadmap and redirect', () => {
cy.addBtnClick(); cy.addBtnClick();
cy.get('input[name="name"]').eq(1).type('roadMapTestOne{enter}'); cy.get('input[name="name"]').type('roadMapTestOne{enter}');
cy.get('.q-notification__message').should('have.text', 'Data created'); cy.get('.q-notification__message').should('have.text', 'Data created');
cy.url().should('include', '/summary'); cy.url().should('include', '/summary');
}); });