Merge pull request 'feat: #8237 changed observation type to be SalesPerson by default' (!1623) from 8237-defaultObservationType into dev
gitea/salix-front/pipeline/head This commit looks good Details

Reviewed-on: #1623
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
PAU ROVIRA ROSALENY 2025-03-25 06:16:16 +00:00
commit 97ceffc96c
1 changed files with 16 additions and 3 deletions

View File

@ -40,6 +40,11 @@ const quasar = useQuasar();
const newNote = reactive({ text: null, observationTypeFk: null }); const newNote = reactive({ text: null, observationTypeFk: null });
const observationTypes = ref([]); const observationTypes = ref([]);
const vnPaginateRef = ref(); const vnPaginateRef = ref();
const defaultObservationType = computed(() =>
observationTypes.value.find(ot => ot.code === 'salesPerson')?.id
);
let originalText; let originalText;
function handleClick(e) { function handleClick(e) {
@ -111,14 +116,22 @@ function fetchData([data]) {
originalText = data?.notes; originalText = data?.notes;
emit('onFetch', data); emit('onFetch', data);
} }
const handleObservationTypes = (data) => {
observationTypes.value = data;
if(defaultObservationType.value) {
newNote.observationTypeFk = defaultObservationType.value;
}
};
</script> </script>
<template> <template>
<FetchData <FetchData
v-if="selectType" v-if="selectType"
url="ObservationTypes" url="ObservationTypes"
:filter="{ fields: ['id', 'description'] }" :filter="{ fields: ['id', 'description', 'code'] }"
auto-load auto-load
@on-fetch="(data) => (observationTypes = data)" @on-fetch="handleObservationTypes"
/> />
<FetchData <FetchData
v-if="justInput" v-if="justInput"
@ -154,6 +167,7 @@ function fetchData([data]) {
filled filled
size="lg" size="lg"
autogrow autogrow
autofocus
@keyup.enter.stop="handleClick" @keyup.enter.stop="handleClick"
:required="isRequired" :required="isRequired"
clearable clearable
@ -189,7 +203,6 @@ function fetchData([data]) {
:search-url="false" :search-url="false"
@on-fetch=" @on-fetch="
newNote.text = ''; newNote.text = '';
newNote.observationTypeFk = null;
" "
> >
<template #body="{ rows }"> <template #body="{ rows }">