Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix-front into 7353-hotfix-fixUI
gitea/salix-front/pipeline/pr-master This commit looks good Details

This commit is contained in:
Jorge Penadés 2024-09-20 13:22:30 +02:00
commit 6216eedd88
1 changed files with 8 additions and 23 deletions

View File

@ -28,18 +28,8 @@ const route = useRoute();
const router = useRouter();
const state = useState();
const { notify } = useNotify();
const thermographFilter = {
fields: ['thermographFk'],
where: {
travelFk: null,
},
order: 'thermographFk ASC',
};
const fetchTravelThermographsRef = ref(null);
const allowedContentTypes = ref('');
const user = state.getUser();
const thermographsOptions = ref([]);
const dmsTypesOptions = ref([]);
const companiesOptions = ref([]);
const warehousesOptions = ref([]);
@ -168,24 +158,15 @@ const updateThermograph = async () => {
};
const onThermographCreated = async (data) => {
await fetchTravelThermographsRef.value.fetch();
thermographForm.thermographId = data.thermographId;
thermographForm.thermographId = data.id;
};
</script>
<template>
<FetchData
url="DmsContainers/allowedContentTypes"
@on-fetch="(data) => (allowedContentTypes = data.join(', '))"
auto-load
/>
<FetchData
ref="fetchTravelThermographsRef"
url="TravelThermographs"
@on-fetch="(data) => (thermographsOptions = data)"
:filter="thermographFilter"
auto-load
/>
<FetchData
url="DmsTypes"
:filter="{ order: 'name' }"
@ -239,15 +220,20 @@ const onThermographCreated = async (data) => {
<VnSelectDialog
:label="t('travel.thermographs.thermograph')"
v-model="thermographForm.thermographId"
:options="thermographsOptions"
url="TravelThermographs"
option-value="thermographFk"
option-label="thermographFk"
:fields="['thermographFk']"
:where="{ travelFk: null }"
sort-by="thermographFk ASC"
:disable="viewAction === 'edit'"
:tooltip="t('New thermograph')"
>
<template #form>
<CreateThermographForm
@on-data-saved="onThermographCreated($event, data)"
@on-data-saved="
(data) => (thermographForm.thermographId = data.id)
"
/>
</template>
</VnSelectDialog>
@ -323,7 +309,6 @@ const onThermographCreated = async (data) => {
</QForm>
</QPage>
</template>
<i18n>
es:
Select files: Selecciona ficheros