From 6d5973f4b74da846b9cc9bba5daa758bb585e34b Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 20 Jun 2024 10:26:22 +0200 Subject: [PATCH] refs #6504 fix formModel claimFilter claimCard --- src/boot/qformMixin.js | 1 - src/components/FormModel.vue | 5 +++ src/pages/Claim/Card/ClaimBasicData.vue | 25 +----------- src/pages/Claim/Card/ClaimCard.vue | 2 + src/pages/Claim/Card/ClaimDescriptor.vue | 46 +-------------------- src/pages/Claim/Card/ClaimFilter.js | 52 ++++++++++++++++++++++++ 6 files changed, 63 insertions(+), 68 deletions(-) create mode 100644 src/pages/Claim/Card/ClaimFilter.js diff --git a/src/boot/qformMixin.js b/src/boot/qformMixin.js index a809140b0..0bf1f9795 100644 --- a/src/boot/qformMixin.js +++ b/src/boot/qformMixin.js @@ -27,7 +27,6 @@ export default { this.$el.addEventListener('keyup', function (evt) { if (evt.key === 'Enter') { const input = evt.target; - console.log('input', input); if (input.type == 'textarea' && evt.shiftKey) { evt.preventDefault(); let { selectionStart, selectionEnd } = input; 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 = { />