feat: refs #8225 added route and shelving module
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jon Elias 2025-01-10 10:14:56 +01:00
parent 5d9227723e
commit 774c714755
8 changed files with 29 additions and 10 deletions

View File

@ -48,7 +48,6 @@ let store;
let entity;
const isLoading = ref(false);
const isSameDataKey = computed(() => $props.dataKey === route.meta.moduleName);
const menuRef = ref();
defineExpose({ getData });
onBeforeMount(async () => {
@ -161,7 +160,7 @@ const toModule = computed(() =>
</QBtn>
</RouterLink>
<VnMoreOptions v-if="$slots.menu">
<template #menu>
<template #menu="{ menuRef }">
<slot name="menu" :entity="entity" :menu-ref="menuRef" />
</template>
</VnMoreOptions>

View File

@ -87,8 +87,8 @@ async function fetch() {
<span class="row no-wrap">
<slot name="header-right" :entity="entity" />
<VnMoreOptions v-if="$slots.menu && isDialogOpened()">
<template #menu>
<slot name="menu" :entity="entity" />
<template #menu="{ menuRef }">
<slot name="menu" :entity="entity" :menu-ref="menuRef" />
</template>
</VnMoreOptions>
</span>

View File

@ -13,7 +13,7 @@
</QTooltip>
<QMenu ref="menuRef">
<QList>
<slot name="menu" />
<slot name="menu" :menu-ref="$refs.menuRef" />
</QList>
</QMenu>
</QBtn>

View File

@ -52,7 +52,7 @@ async function actualizeVolume() {
const params = { isOk: true };
await axios.post(`Routes/${routeId}/updateVolume`, params);
quasar.notify({
message: t('globals.dataUpdated'),
message: t('globals.dataSaved'),
type: 'positive',
});
}

View File

@ -12,6 +12,7 @@ import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy
import TicketDescriptorProxy from 'pages/Ticket/Card/TicketDescriptorProxy.vue';
import VnLv from 'components/ui/VnLv.vue';
import VnTitle from 'src/components/common/VnTitle.vue';
import RouteDescriptorMenu from './RouteDescriptorMenu.vue';
const $props = defineProps({
id: {
@ -128,6 +129,9 @@ const ticketColumns = ref([
<template #header="{ entity }">
<span>{{ `${entity?.route.id} - ${entity?.route?.description}` }}</span>
</template>
<template #menu="{ entity }">
<RouteDescriptorMenu :route="entity.route" />
</template>
<template #body="{ entity }">
<QCard class="vn-max">
<VnTitle

View File

@ -10,6 +10,7 @@ import VnTitle from 'src/components/common/VnTitle.vue';
import CardSummary from 'components/ui/CardSummary.vue';
import SupplierDescriptorProxy from 'pages/Supplier/Card/SupplierDescriptorProxy.vue';
import VnLinkPhone from 'components/ui/VnLinkPhone.vue';
import RoadmapDescriptorMenu from './RoadmapDescriptorMenu.vue';
const $props = defineProps({
id: {
@ -86,6 +87,9 @@ const filter = {
<template #header="{ entity }">
<span>{{ `${entity?.id} - ${entity?.name}` }}</span>
</template>
<template #menu="{ entity }">
<RoadmapDescriptorMenu :route="entity" />
</template>
<template #body="{ entity }">
<QCard class="vn-one">
<VnTitle

View File

@ -4,6 +4,7 @@ import { useQuasar } from 'quasar';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import VnConfirm from 'components/ui/VnConfirm.vue';
import { useRoute } from 'vue-router';
const $props = defineProps({
shelving: {
@ -14,8 +15,11 @@ const $props = defineProps({
const router = useRouter();
const quasar = useQuasar();
const route = useRoute();
const { t } = useI18n();
const emit = defineEmits(['onRemove']);
function confirmRemove() {
quasar.dialog({
component: VnConfirm,
@ -32,11 +36,12 @@ async function remove() {
return;
}
await axios.delete(`Shelvings/${$props.shelving.id}`);
await router.push({ name: 'ShelvingList' });
if (route.name != 'ShelvingList') await router.push({ name: 'ShelvingList' });
quasar.notify({
message: t('globals.dataDeleted'),
type: 'positive',
});
emit('onRemove', {});
}
</script>
<template>

View File

@ -1,10 +1,11 @@
<script setup>
import { computed } from 'vue';
import { computed, ref } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import CardSummary from 'components/ui/CardSummary.vue';
import VnLv from 'components/ui/VnLv.vue';
import VnUserLink from 'components/ui/VnUserLink.vue';
import ShelvingDescriptorMenu from './ShelvingDescriptorMenu.vue';
const $props = defineProps({
id: {
@ -14,7 +15,7 @@ const $props = defineProps({
});
const route = useRoute();
const { t } = useI18n();
const summary = ref({});
const entityId = computed(() => $props.id || route.params.id);
const filter = {
@ -43,7 +44,13 @@ const filter = {
data-key="ShelvingSummary"
>
<template #header="{ entity }">
<div>{{ entity.id }} - {{ entity.code }}</div>
<div>{{ entity.code }}</div>
</template>
<template #menu="{ entity }">
<ShelvingDescriptorMenu
:shelving="entity"
@on-remove="$refs.summary.fetch()"
/>
</template>
<template #body="{ entity }">
<QCard class="vn-one">