0
0
Fork 0

refactor: refs #6887 fixed errors

This commit is contained in:
Jon Elias 2024-04-30 10:32:32 +02:00
parent 6ae38d2611
commit 5b15558dbf
11 changed files with 212 additions and 61 deletions

View File

@ -141,15 +141,6 @@ select:-webkit-autofill {
background-color: var(--vn-section-color); background-color: var(--vn-section-color);
} }
.q-checkbox {
& .q-checkbox__label {
color: var(--vn-text-color);
}
& .q-checkbox__inner {
color: var(--vn-label-color);
}
}
.tr-header { .tr-header {
color: var(--vn-label-color); color: var(--vn-label-color);
} }

View File

@ -1166,6 +1166,12 @@ item:
type: Type type: Type
intrastat: Intrastat intrastat: Intrastat
origin: Origin origin: Origin
zone:
pageTitles:
zones: Zone
zonesList: Zones
deliveryList: Delivery days
upcomingList: Upcoming deliveries
components: components:
topbar: {} topbar: {}
itemsFilterPanel: itemsFilterPanel:

View File

@ -1165,6 +1165,12 @@ item:
type: Tipo type: Tipo
intrastat: Intrastat intrastat: Intrastat
origin: Origen origin: Origen
zone:
pageTitles:
zones: Zona
zonesList: Zonas
deliveryList: Días de entrega
upcomingList: Próximos repartos
components: components:
topbar: {} topbar: {}
itemsFilterPanel: itemsFilterPanel:

View File

@ -74,8 +74,9 @@ const filter = {
const STATE_COLOR = { const STATE_COLOR = {
pending: 'warning', pending: 'warning',
managed: 'info', incomplete: 'info',
resolved: 'positive', resolved: 'positive',
canceled: 'negative',
}; };
function stateColor(code) { function stateColor(code) {
return STATE_COLOR[code]; return STATE_COLOR[code];
@ -142,7 +143,7 @@ onMounted(async () => {
<template #value> <template #value>
<span class="link"> <span class="link">
{{ entity.ticket?.zone?.name }} {{ entity.ticket?.zone?.name }}
<ZoneDescriptorProxy :id="entity.ticket?.zoneFk" /> <ZoneDescriptorProxy :id="entity.ticket?.zone?.id" />
</span> </span>
</template> </template>
</VnLv> </VnLv>

View File

@ -14,6 +14,7 @@ import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import VnTitle from 'src/components/common/VnTitle.vue'; import VnTitle from 'src/components/common/VnTitle.vue';
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue'; import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
import axios from 'axios'; import axios from 'axios';
import dashIfEmpty from 'src/filters/dashIfEmpty';
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
@ -101,8 +102,9 @@ const detailsColumns = ref([
const STATE_COLOR = { const STATE_COLOR = {
pending: 'warning', pending: 'warning',
managed: 'info', incomplete: 'info',
resolved: 'positive', resolved: 'positive',
canceled: 'negative',
}; };
function stateColor(code) { function stateColor(code) {
return STATE_COLOR[code]; return STATE_COLOR[code];
@ -260,7 +262,7 @@ async function changeState(value) {
</VnLv> </VnLv>
<VnLv <VnLv
:label="t('claim.basicData.pickup')" :label="t('claim.basicData.pickup')"
:value="t(`claim.basicData.${claim.pickup}`)" :value="`${dashIfEmpty(claim.pickup)}`"
/> />
</QCard> </QCard>
<QCard class="vn-three"> <QCard class="vn-three">

View File

@ -0,0 +1,6 @@
<script setup>
import VnCard from 'components/common/VnCard.vue';
</script>
<template>
<VnCard data-key="Zone" base-url="Zones" />
</template>

View File

@ -8,7 +8,6 @@ import VnLv from 'src/components/ui/VnLv.vue';
import ZoneDescriptorMenuItems from './ZoneDescriptorMenuItems.vue'; import ZoneDescriptorMenuItems from './ZoneDescriptorMenuItems.vue';
import useCardDescription from 'src/composables/useCardDescription'; import useCardDescription from 'src/composables/useCardDescription';
import { toDate } from 'src/filters';
const $props = defineProps({ const $props = defineProps({
id: { id: {
@ -22,28 +21,11 @@ const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
const filter = { const filter = {
fields: [
'id',
'ref',
'shipped',
'landed',
'totalEntries',
'warehouseInFk',
'warehouseOutFk',
'cargoSupplierFk',
'agencyModeFk',
],
include: [ include: [
{ {
relation: 'warehouseIn', relation: 'agencyMode',
scope: { scope: {
fields: ['name'], fields: ['name', 'id'],
},
},
{
relation: 'warehouseOut',
scope: {
fields: ['name'],
}, },
}, },
], ],
@ -58,6 +40,13 @@ const data = ref(useCardDescription());
const setData = (entity) => { const setData = (entity) => {
data.value = useCardDescription(entity.ref, entity.id); data.value = useCardDescription(entity.ref, entity.id);
}; };
function extractHour(dateTime) {
const date = new Date(dateTime);
const hours = date.getHours().toString().padStart(2, '0');
const minutes = date.getMinutes().toString().padStart(2, '0');
return `${hours}:${minutes}`;
}
</script> </script>
<template> <template>
@ -76,52 +65,39 @@ const setData = (entity) => {
flat flat
dense dense
size="md" size="md"
icon="local_airport" icon="preview"
color="white" color="white"
class="link" class="link"
:to="{ name: 'ZoneList' }" :to="{ name: 'ZoneList' }"
> >
<QTooltip> <QTooltip>
{{ t('Go to module index') }} {{ t('Summary') }}
</QTooltip> </QTooltip>
</QBtn> </QBtn>
</template> </template>
<template #menu="{ entity }"> <template #menu="{ entity }">
<ZoneDescriptorMenuItems :travel="entity" /> <ZoneDescriptorMenuItems :zone="entity" />
</template> </template>
<template #body="{ entity }"> <template #body="{ entity }">
<VnLv :label="t('globals.wareHouseIn')" :value="entity.warehouseIn.name" /> {{ console.log('entity', entity) }}
<VnLv :label="t('globals.wareHouseOut')" :value="entity.warehouseOut.name" /> <VnLv :label="t('Agency')" :value="entity.agencyMode.name" />
<VnLv :label="t('globals.shipped')" :value="toDate(entity.shipped)" /> <VnLv :label="t('Closing hour')" :value="extractHour(entity.hour)" />
<VnLv :label="t('globals.landed')" :value="toDate(entity.landed)" /> <VnLv :label="t('traveling days')" :value="entity.travelingDays" />
<VnLv :label="t('globals.totalEntries')" :value="entity.totalEntries" /> <VnLv :label="t('Price')" :value="entity.price" />
</template> <VnLv :label="t('Bonus')" :value="entity.bonus" />
<template #actions="{ entity }">
<QCardActions>
<QBtn
:to="{
name: 'ZoneList',
query: {
params: JSON.stringify({
agencyModeFk: entity.agencyModeFk,
}),
},
}"
size="md"
icon="local_airport"
color="primary"
>
<QTooltip>{{ t('All travels with current agency') }}</QTooltip>
</QBtn>
</QCardActions>
</template> </template>
</CardDescriptor> </CardDescriptor>
</template> </template>
<i18n> <i18n>
es: es:
Go to module index: Ir al índice del módulo Summary: Detalles
The travel will be deleted: El envío será eliminado The travel will be deleted: El envío será eliminado
Do you want to delete this travel?: ¿Quieres eliminar este envío? Do you want to delete this travel?: ¿Quieres eliminar este envío?
All travels with current agency: Todos los envíos con la agencia actual All travels with current agency: Todos los envíos con la agencia actual
Agency: Agencia
Closing hour: Hora de cierre
traveling days: Días de viaje
Price: Precio
Bonus: Bonificación
</i18n> </i18n>

View File

@ -15,6 +15,7 @@ import Department from './department';
import Entry from './entry'; import Entry from './entry';
import roadmap from './roadmap'; import roadmap from './roadmap';
import Parking from './parking'; import Parking from './parking';
import Zone from './zone';
export default [ export default [
Item, Item,
@ -34,4 +35,5 @@ export default [
Entry, Entry,
roadmap, roadmap,
Parking, Parking,
Zone,
]; ];

158
src/router/modules/zone.js Normal file
View File

@ -0,0 +1,158 @@
import { RouterView } from 'vue-router';
export default {
path: '/zone',
name: 'Zone',
meta: {
title: 'zones',
icon: 'vn:zone',
moduleName: 'Zone',
},
component: RouterView,
redirect: { name: 'ZoneMain' },
menus: {
main: ['ZoneList' /*'ZoneDeliveryList', 'ZoneUpcomingList'*/],
card: [
//
],
},
children: [
{
path: '/zone',
name: 'ZoneMain',
component: () => import('src/pages/Zone/ZoneMain.vue'),
redirect: { name: 'ZoneList' },
children: [
{
path: 'list',
name: 'ZoneList',
meta: {
title: 'zonesList',
icon: 'vn:zone',
},
component: () => import('src/pages/Zone/ZoneList.vue'),
},
// {
// path: 'create',
// name: 'ZoneCreate',
// meta: {
// title: 'zoneCreate',
// icon: 'create',
// },
// component: () => import('src/pages/Zone/ZoneCreate.vue'),
// },
// {
// path: ':id/edit',
// name: 'ZoneEdit',
// meta: {
// title: 'zoneEdit',
// icon: 'edit',
// },
// component: () => import('src/pages/Zone/ZoneCreate.vue'),
// },
// {
// path: 'counter',
// name: 'ZoneCounter',
// meta: {
// title: 'zoneCounter',
// icon: 'add_circle',
// },
// component: () => import('src/pages/Zone/ZoneCounter.vue'),
// },
],
},
{
name: 'ZoneCard',
path: ':id',
component: () => import('src/pages/Zone/Card/ZoneCard.vue'),
redirect: { name: 'ZoneSummary' },
children: [
{
name: 'ZoneSummary',
path: 'summary',
meta: {
title: 'summary',
icon: 'launch',
},
component: () => import('src/pages/Zone/Card/ZoneSummary.vue'),
},
// {
// path: '/zone/delivery',
// name: 'ZoneDeliveryMain',
// component: () => import('src/pages/Zone/ZoneMain.vue'),
// redirect: { name: 'ZoneDeliveryList' },
// children: [
// {
// path: 'list',
// name: 'ZoneDeliveryList',
// meta: {
// title: 'deliveryList',
// icon: 'today',
// },
// component: () =>
// import('src/pages/Zone/Delivery/ZoneDeliveryList.vue'),
// },
// {
// path: 'create',
// name: 'ZoneDeliveryCreate',
// meta: {
// title: 'deliveryCreate',
// icon: 'create',
// },
// component: () =>
// import('src/pages/Zone/Delivery/ZoneDeliveryCreate.vue'),
// },
// {
// path: ':id/edit',
// name: 'ZoneDeliveryEdit',
// meta: {
// title: 'deliveryEdit',
// icon: 'edit',
// },
// component: () =>
// import('src/pages/Zone/Delivery/ZoneDeliveryCreate.vue'),
// },
// ],
// },
// {
// path: '/zone/upcoming',
// name: 'ZoneUpcomingMain',
// component: () => import('src/pages/Zone/ZoneMain.vue'),
// redirect: { name: 'ZoneUpcomingList' },
// children: [
// {
// path: 'list',
// name: 'ZoneUpcomingList',
// meta: {
// title: 'upcomingList',
// icon: 'today',
// },
// component: () =>
// import('src/pages/Zone/Upcoming/ZoneUpcomingList.vue'),
// },
// {
// path: 'create',
// name: 'ZoneUpcomingCreate',
// meta: {
// title: 'upcomingCreate',
// icon: 'create',
// },
// component: () =>
// import('src/pages/Zone/Upcoming/ZoneUpcomingCreate.vue'),
// },
// {
// path: ':id/edit',
// name: 'ZoneUpcomingEdit',
// meta: {
// title: 'upcomingEdit',
// icon: 'edit',
// },
// component: () =>
// import('src/pages/Zone/Upcoming/ZoneUpcomingCreate.vue'),
// },
// ],
// },
],
},
],
};

View File

@ -15,6 +15,7 @@ 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 roadmap from 'src/router/modules/roadmap';
import parking from 'src/router/modules/parking'; import parking from 'src/router/modules/parking';
import zone from 'src/router/modules/zone';
const routes = [ const routes = [
{ {
@ -71,6 +72,7 @@ const routes = [
roadmap, roadmap,
entry, entry,
parking, parking,
zone,
{ {
path: '/:catchAll(.*)*', path: '/:catchAll(.*)*',
name: 'NotFound', name: 'NotFound',

View File

@ -21,6 +21,7 @@ export const useNavigationStore = defineStore('navigationStore', () => {
'ticket', 'ticket',
'worker', 'worker',
'wagon', 'wagon',
'zone',
]; ];
const pinnedModules = ref([]); const pinnedModules = ref([]);
const role = useRole(); const role = useRole();