Fix feedback
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
4cf9548234
commit
ea9a9323e7
|
@ -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">
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
Loading…
Reference in New Issue