diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue
index 05c63d563..f10dee61a 100644
--- a/src/components/FormModel.vue
+++ b/src/components/FormModel.vue
@@ -83,6 +83,10 @@ const $props = defineProps({
default: '',
description: 'It is used for redirect on click "save and continue"',
},
+ reload: {
+ type: Boolean,
+ default: false,
+ },
});
const emit = defineEmits(['onFetch', 'onDataSaved']);
const modelValue = computed(
@@ -201,6 +205,7 @@ async function save() {
if ($props.urlCreate) notify('globals.dataCreated', 'positive');
updateAndEmit('onDataSaved', formData.value, response?.data);
+ if ($props.reload) await arrayData.fetch({});
} catch (err) {
console.error(err);
notify('errors.writeRequest', 'negative');
diff --git a/src/pages/Claim/Card/ClaimBasicData.vue b/src/pages/Claim/Card/ClaimBasicData.vue
index 50c9502d2..977a4dc5b 100644
--- a/src/pages/Claim/Card/ClaimBasicData.vue
+++ b/src/pages/Claim/Card/ClaimBasicData.vue
@@ -17,26 +17,6 @@ const { t } = useI18n();
const { getTokenMultimedia } = useSession();
const token = getTokenMultimedia();
-const claimFilter = {
- fields: [
- 'id',
- 'clientFk',
- 'created',
- 'workerFk',
- 'claimStateFk',
- 'packages',
- 'pickup',
- ],
- include: [
- {
- relation: 'client',
- scope: {
- fields: ['name'],
- },
- },
- ],
-};
-
const claimStates = ref([]);
const claimStatesCopy = ref([]);
const optionsList = ref([]);
@@ -87,11 +67,10 @@ const statesFilter = {
/>
diff --git a/src/pages/Claim/Card/ClaimCard.vue b/src/pages/Claim/Card/ClaimCard.vue
index f38ab5484..19d63e3b2 100644
--- a/src/pages/Claim/Card/ClaimCard.vue
+++ b/src/pages/Claim/Card/ClaimCard.vue
@@ -2,6 +2,7 @@
import VnCard from 'components/common/VnCard.vue';
import ClaimDescriptor from './ClaimDescriptor.vue';
import ClaimFilter from '../ClaimFilter.vue';
+import filter from './ClaimFilter.js';
diff --git a/src/pages/Claim/Card/ClaimDescriptor.vue b/src/pages/Claim/Card/ClaimDescriptor.vue
index aae999117..5336c4427 100644
--- a/src/pages/Claim/Card/ClaimDescriptor.vue
+++ b/src/pages/Claim/Card/ClaimDescriptor.vue
@@ -12,6 +12,7 @@ import useCardDescription from 'src/composables/useCardDescription';
import VnUserLink from 'src/components/ui/VnUserLink.vue';
import { getUrl } from 'src/composables/getUrl';
import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
+import filter from './ClaimFilter.js';
const $props = defineProps({
id: {
@@ -29,49 +30,6 @@ const entityId = computed(() => {
return $props.id || route.params.id;
});
-const filter = {
- include: [
- {
- relation: 'client',
- scope: {
- include: [
- { relation: 'salesPersonUser' },
- {
- relation: 'claimsRatio',
- scope: {
- fields: ['claimingRate'],
- limit: 1,
- },
- },
- ],
- },
- },
- {
- relation: 'claimState',
- },
- {
- relation: 'ticket',
- scope: {
- include: [
- { relation: 'zone' },
- {
- relation: 'address',
- scope: {
- include: { relation: 'province' },
- },
- },
- ],
- },
- },
- {
- relation: 'worker',
- scope: {
- include: { relation: 'user' },
- },
- },
- ],
-};
-
const STATE_COLOR = {
pending: 'warning',
incomplete: 'info',
@@ -101,7 +59,7 @@ onMounted(async () => {
:title="data.title"
:subtitle="data.subtitle"
@on-fetch="setData"
- data-key="claimData"
+ data-key="Claim"
>
diff --git a/src/pages/Claim/Card/ClaimFilter.js b/src/pages/Claim/Card/ClaimFilter.js
new file mode 100644
index 000000000..50cabe228
--- /dev/null
+++ b/src/pages/Claim/Card/ClaimFilter.js
@@ -0,0 +1,52 @@
+export default {
+ fields: [
+ 'id',
+ 'clientFk',
+ 'created',
+ 'workerFk',
+ 'claimStateFk',
+ 'packages',
+ 'pickup',
+ 'ticketFk',
+ ],
+ include: [
+ {
+ relation: 'client',
+ scope: {
+ include: [
+ { relation: 'salesPersonUser' },
+ {
+ relation: 'claimsRatio',
+ scope: {
+ fields: ['claimingRate'],
+ limit: 1,
+ },
+ },
+ ],
+ },
+ },
+ {
+ relation: 'claimState',
+ },
+ {
+ relation: 'ticket',
+ scope: {
+ include: [
+ { relation: 'zone' },
+ {
+ relation: 'address',
+ scope: {
+ include: { relation: 'province' },
+ },
+ },
+ ],
+ },
+ },
+ {
+ relation: 'worker',
+ scope: {
+ include: { relation: 'user' },
+ },
+ },
+ ],
+};