diff --git a/src/components/ui/VnNotes.vue b/src/components/ui/VnNotes.vue index a0621dc1d..b7e6ccbec 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; + } +}; +