From 3467f30b124a2a9bb14ad55dbfd6b002ae139aef Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 3 May 2024 08:40:53 +0200 Subject: [PATCH] refactor: refs #7274 changed CustomerNotificationsCampaignConsumption template and logic --- .../Notifications/CustomerNotifications.vue | 38 ++------ ...stomerNotificationsCampaignConsumption.vue | 89 +++++++++---------- 2 files changed, 50 insertions(+), 77 deletions(-) diff --git a/src/pages/Customer/Notifications/CustomerNotifications.vue b/src/pages/Customer/Notifications/CustomerNotifications.vue index 211309dc1..d19b52c2c 100644 --- a/src/pages/Customer/Notifications/CustomerNotifications.vue +++ b/src/pages/Customer/Notifications/CustomerNotifications.vue @@ -1,10 +1,7 @@ + + { diff --git a/src/pages/Customer/Notifications/CustomerNotificationsCampaignConsumption.vue b/src/pages/Customer/Notifications/CustomerNotificationsCampaignConsumption.vue index 641cdb851..d168aed6c 100644 --- a/src/pages/Customer/Notifications/CustomerNotificationsCampaignConsumption.vue +++ b/src/pages/Customer/Notifications/CustomerNotificationsCampaignConsumption.vue @@ -2,7 +2,6 @@ import { ref, reactive } from 'vue'; import { useI18n } from 'vue-i18n'; import axios from 'axios'; -import { useDialogPluginComponent } from 'quasar'; import useNotify from 'src/composables/useNotify'; import { useValidator } from 'src/composables/useValidator'; import VnRow from 'components/ui/VnRow.vue'; @@ -19,23 +18,24 @@ const $props = defineProps({ type: Function, required: true, }, + selectedRows: { + type: Boolean, + }, }); -const { dialogRef } = useDialogPluginComponent(); const { notify } = useNotify(); const { t } = useI18n(); const validationsStore = useValidator(); const campaignParams = reactive({}); const moreFields = ref([]); -async function onSubmit() { +const onSubmit = async () => { try { const data = { - clients: $props.clients._value.map((item) => item.id), - from: this.campaignParams.from, - to: this.campaignParams.to, + clients: $props.clients.map((item) => item.id), + from: campaignParams.from, + to: campaignParams.to, }; - const params = JSON.stringify(data); await axios.post('ClientConsumptionQueues', { params }); @@ -43,7 +43,7 @@ async function onSubmit() { } catch (error) { notify(error.message, 'negative'); } -} +}; onMounted(async () => { const { models } = validationsStore; const properties = models.Item?.properties || {}; @@ -68,44 +68,41 @@ onMounted(async () => { :filter="{ fields: ['id', 'code', 'dated'], order: 'code ASC', limit: 30 }" auto-load /> - - - - -
- {{ t('Campaign consumption') }} -
- - - - - - - -
- - -
-
-
-
-
+ + + + {{ t('Campaign consumption') }} + + + + + + + +
+ + +
+
+
+ {{ t('Campaign consumption') }} +