This commit is contained in:
parent
933736e06b
commit
293d51b741
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
v-if="selectType"
|
||||
url="ObservationTypes"
|
||||
:filter="{ fields: ['id', 'description'] }"
|
||||
:filter="{ fields: ['id', 'description', 'code'] }"
|
||||
auto-load
|
||||
@on-fetch="(data) => (observationTypes = data)"
|
||||
@on-fetch="handleObservationTypes"
|
||||
/>
|
||||
<FetchData
|
||||
v-if="justInput"
|
||||
|
@ -190,7 +203,6 @@ function fetchData([data]) {
|
|||
:search-url="false"
|
||||
@on-fetch="
|
||||
newNote.text = '';
|
||||
newNote.observationTypeFk = 4;
|
||||
"
|
||||
>
|
||||
<template #body="{ rows }">
|
||||
|
|
Loading…
Reference in New Issue