0
0
Fork 0

Fix feedback

This commit is contained in:
Kevin Martinez 2024-02-02 08:33:37 -03:00
parent 4cf9548234
commit ea9a9323e7
2 changed files with 11 additions and 3 deletions

View File

@ -1,7 +1,7 @@
<script setup>
import { useI18n } from 'vue-i18n';
import { ref } from 'vue';
import { useRoute } from 'vue-router';
import { useRoute, useRouter } from 'vue-router';
import VnRow from 'components/ui/VnRow.vue';
import FetchData from 'components/FetchData.vue';
import FormModel from 'components/FormModel.vue';
@ -10,11 +10,12 @@ import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
const { t } = useI18n();
const route = useRoute();
const router = useRouter();
const shelvingId = route.params?.id || null;
const isNew = Boolean(!shelvingId);
const defaultInitialData = {
parkingFk: null,
priority: 0,
priority: null,
code: null,
isRecyclable: false,
};
@ -58,6 +59,12 @@ const shelvingFilter = {
{ relation: 'parking' },
],
};
const onSave = () => {
if (isNew) {
router.push({ name: 'ShelvingList' });
}
};
</script>
<template>
<VnSubToolbar />
@ -75,6 +82,7 @@ const shelvingFilter = {
model="shelving"
:auto-load="!isNew"
:form-initial-data="defaultInitialData"
@on-data-saved="onSave"
>
<template #form="{ data, validate, filter }">
<VnRow class="row q-gutter-md q-mb-md">

View File

@ -9,7 +9,7 @@ const { t } = useI18n();
data-key="ShelvingList"
url="Shelvings"
:label="t('Search shelving')"
:info="t('You can search by search reference')"
:info="t('You can search by shelving reference')"
/>
</template>