From 293d51b7413b70e2f95bfe103b2059b86bf62b18 Mon Sep 17 00:00:00 2001 From: provira Date: Mon, 24 Mar 2025 14:06:38 +0100 Subject: [PATCH] feat: refs #8237 #8237 modified fetch to find default select value by "code" --- src/components/ui/VnNotes.vue | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/components/ui/VnNotes.vue b/src/components/ui/VnNotes.vue index a0621dc1dda..b7e6ccbecd5 100644 --- a/src/components/ui/VnNotes.vue +++ b/src/components/ui/VnNotes.vue @@ -40,6 +40,11 @@ const quasar = useQuasar(); const newNote = reactive({ text: null, observationTypeFk: null }); const observationTypes = ref([]); const vnPaginateRef = ref(); + +const defaultObservationType = computed(() => + observationTypes.value.find(ot => ot.code === 'salesPerson')?.id +); + let originalText; function handleClick(e) { @@ -111,14 +116,22 @@ function fetchData([data]) { originalText = data?.notes; emit('onFetch', data); } + +const handleObservationTypes = (data) => { + observationTypes.value = data; + if(defaultObservationType.value) { + newNote.observationTypeFk = defaultObservationType.value; + } +}; +