Merge branch 'dev' into 8717-reviewAndFixAgencySection
gitea/salix-front/pipeline/pr-dev This commit is unstable Details

This commit is contained in:
Jose Antonio Tubau 2025-03-25 07:13:20 +00:00
commit 090c77dd91
2 changed files with 25 additions and 4 deletions

View File

@ -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"
@ -154,6 +167,7 @@ function fetchData([data]) {
filled
size="lg"
autogrow
autofocus
@keyup.enter.stop="handleClick"
:required="isRequired"
clearable
@ -189,7 +203,6 @@ function fetchData([data]) {
:search-url="false"
@on-fetch="
newNote.text = '';
newNote.observationTypeFk = null;
"
>
<template #body="{ rows }">

View File

@ -2,6 +2,7 @@
import { ref } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { getDifferences, getUpdatedValues } from 'src/filters';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnSelectEnum from 'src/components/common/VnSelectEnum.vue';
import FetchData from 'components/FetchData.vue';
@ -9,12 +10,18 @@ import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import VnAvatar from 'src/components/ui/VnAvatar.vue';
const route = useRoute();
const { t } = useI18n();
const workersOptions = ref([]);
function onBeforeSave(formData, originalData) {
return getUpdatedValues(
Object.keys(getDifferences(formData, originalData)),
formData,
);
}
</script>
<template>
<FetchData
@ -27,6 +34,7 @@ const workersOptions = ref([]);
<FormModel
model="Claim"
:url-update="`Claims/updateClaim/${route.params.id}`"
:mapper="onBeforeSave"
auto-load
>
<template #form="{ data, validate }">