forked from verdnatura/salix-front
Fix Shelving creation
This commit is contained in:
parent
7e45486abd
commit
011e15233e
|
@ -1,6 +1,6 @@
|
|||
<script setup>
|
||||
import axios from 'axios';
|
||||
import { onMounted, onUnmounted, computed, ref, watch } from 'vue';
|
||||
import { onMounted, onUnmounted, computed, ref, watch, nextTick } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useQuasar } from 'quasar';
|
||||
import { useState } from 'src/composables/useState';
|
||||
|
@ -67,7 +67,13 @@ defineExpose({
|
|||
save,
|
||||
});
|
||||
|
||||
const componentIsRendered = ref(false);
|
||||
|
||||
onMounted(async () => {
|
||||
nextTick(() => {
|
||||
componentIsRendered.value = true;
|
||||
});
|
||||
|
||||
// Podemos enviarle al form la estructura de data inicial sin necesidad de fetchearla
|
||||
if ($props.formInitialData && !$props.autoLoad) {
|
||||
state.set($props.model, $props.formInitialData);
|
||||
|
@ -202,7 +208,10 @@ watch(formUrl, async () => {
|
|||
</QCard>
|
||||
</QForm>
|
||||
</div>
|
||||
<Teleport to="#st-actions" v-if="stateStore?.isSubToolbarShown()">
|
||||
<Teleport
|
||||
to="#st-actions"
|
||||
v-if="stateStore?.isSubToolbarShown() && componentIsRendered"
|
||||
>
|
||||
<div v-if="$props.defaultActions">
|
||||
<QBtnGroup push class="q-gutter-x-sm">
|
||||
<slot name="moreActions" />
|
||||
|
|
|
@ -60,9 +60,9 @@ const shelvingFilter = {
|
|||
],
|
||||
};
|
||||
|
||||
const onSave = () => {
|
||||
const onSave = (shelving, newShelving) => {
|
||||
if (isNew) {
|
||||
router.push({ name: 'ShelvingList' });
|
||||
router.push({ name: 'ShelvingBasicData', params: { id: newShelving?.id } });
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue