hotfix: fixed CustomerSamples table not loading correctly when reloading #1709
|
@ -42,7 +42,11 @@ const groupedStates = ref([]);
|
|||
auto-load
|
||||
/>
|
||||
<FetchData url="Warehouses" @on-fetch="(data) => (warehouses = data)" auto-load />
|
||||
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
||||
<VnFilterPanel
|
||||
:data-key="props.dataKey"
|
||||
:search-button="true"
|
||||
:unremovableParams="['from', 'to']"
|
||||
>
|
||||
<template #tags="{ tag, formatFn }">
|
||||
<div class="q-gutter-x-xs">
|
||||
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
||||
|
|
|
@ -68,7 +68,7 @@ const arrayData = useArrayData('ZoneEvents');
|
|||
const exclusionGeoCreate = async () => {
|
||||
const params = {
|
||||
zoneFk: parseInt(route.params.id),
|
||||
date: dated,
|
||||
date: dated.value,
|
||||
geoIds: tickedNodes.value,
|
||||
};
|
||||
await axios.post('Zones/exclusionGeo', params);
|
||||
|
@ -101,9 +101,17 @@ const exclusionCreate = async () => {
|
|||
const existsEvent = data.events.find(
|
||||
(event) => toDateFormat(event.dated) === toDateFormat(dated.value),
|
||||
);
|
||||
const existsGeoEvent = data.geoExclusions.find(
|
||||
(event) => toDateFormat(event.dated) === toDateFormat(dated.value),
|
||||
);
|
||||
if (existsEvent) {
|
||||
await axios.delete(`Zones/${existsEvent?.zoneFk}/events/${existsEvent?.id}`);
|
||||
}
|
||||
if (existsGeoEvent) {
|
||||
await axios.delete(
|
||||
`Zones/${existsGeoEvent?.zoneFk}/exclusions/${existsGeoEvent?.zoneExclusionFk}`,
|
||||
);
|
||||
}
|
||||
|
||||
if (isNew.value || props.event?.type) await axios.post(`${url}`, [body]);
|
||||
else await axios.put(`${url}/${props.event?.id}`, body);
|
||||
|
|
|
@ -107,14 +107,27 @@ const createEvent = async () => {
|
|||
`Zones/${existsExclusion?.zoneFk}/exclusions/${existsExclusion?.id}`,
|
||||
);
|
||||
}
|
||||
const {
|
||||
dated: formDated,
|
||||
started,
|
||||
ended,
|
||||
type,
|
||||
weekDays,
|
||||
wdays,
|
||||
} = eventInclusionFormData.value;
|
||||
|
||||
if (isNew.value)
|
||||
await axios.post(`Zones/${id}/events`, eventInclusionFormData.value);
|
||||
else
|
||||
await axios.put(
|
||||
`Zones/${id}/events/${props.event?.id}`,
|
||||
eventInclusionFormData.value,
|
||||
);
|
||||
const payload = {
|
||||
dated: formDated,
|
||||
started,
|
||||
ended,
|
||||
type,
|
||||
weekDays,
|
||||
wdays,
|
||||
};
|
||||
|
||||
if (isNew.value || props.eventType === 'exclusion')
|
||||
await axios.post(`Zones/${id}/events`, payload);
|
||||
else await axios.put(`Zones/${id}/events/${props.event?.id}`, payload);
|
||||
}
|
||||
quasar.notify({
|
||||
message: t('globals.dataSaved'),
|
||||
|
|
Loading…
Reference in New Issue