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