This commit is contained in:
parent
4ff3c18f33
commit
0fb9b22935
|
@ -29,7 +29,7 @@ const { t } = useI18n();
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
const currentUser = ref(state.getUser());
|
const currentUser = ref(state.getUser());
|
||||||
const newNote = reactive({ text: '', observationTypeFk: null });
|
const newNote = reactive({ text: null, observationTypeFk: null });
|
||||||
const observationTypes = ref([]);
|
const observationTypes = ref([]);
|
||||||
const vnPaginateRef = ref();
|
const vnPaginateRef = ref();
|
||||||
|
|
||||||
|
|
|
@ -25,20 +25,22 @@ const { notify } = useNotify();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
const newObservation = ref(null);
|
const newObservation = ref(null);
|
||||||
|
const obsId = ref(null);
|
||||||
|
|
||||||
const onSubmit = async () => {
|
const onSubmit = async () => {
|
||||||
try {
|
try {
|
||||||
const observationTypeFk = (
|
if (!obsId.value)
|
||||||
await axios.get('ObservationTypes/findOne', {
|
obsId.value = (
|
||||||
params: { filter: { where: { description: 'Finance' } } },
|
await axios.get('ObservationTypes/findOne', {
|
||||||
})
|
params: { filter: { where: { description: 'Finance' } } },
|
||||||
).data?.id;
|
})
|
||||||
|
).data?.id;
|
||||||
|
|
||||||
const bodyObs = $props.clients.map((item) => {
|
const bodyObs = $props.clients.map((item) => {
|
||||||
return {
|
return {
|
||||||
clientFk: item.clientFk,
|
clientFk: item.clientFk,
|
||||||
text: newObservation.value,
|
text: newObservation.value,
|
||||||
observationTypeFk,
|
observationTypeFk: obsId.value,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
await axios.post('ClientObservations', bodyObs);
|
await axios.post('ClientObservations', bodyObs);
|
||||||
|
|
Loading…
Reference in New Issue