This commit is contained in:
parent
933736e06b
commit
293d51b741
|
@ -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"
|
||||||
|
@ -190,7 +203,6 @@ function fetchData([data]) {
|
||||||
:search-url="false"
|
:search-url="false"
|
||||||
@on-fetch="
|
@on-fetch="
|
||||||
newNote.text = '';
|
newNote.text = '';
|
||||||
newNote.observationTypeFk = 4;
|
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<template #body="{ rows }">
|
<template #body="{ rows }">
|
||||||
|
|
Loading…
Reference in New Issue