From 3a024e81b5644cc3cc0e900b0f6731272d06e237 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Wed, 27 Mar 2024 15:20:15 +0100 Subject: [PATCH] refs #6321 updates --- .../Ticket/Negative/TicketLackDialog.vue | 24 ++++++- .../Ticket/Negative/TicketLackDialogProxy.vue | 66 ++++++++++++++++++- src/pages/Ticket/Negative/TicketLackList.vue | 32 ++------- 3 files changed, 90 insertions(+), 32 deletions(-) diff --git a/src/pages/Ticket/Negative/TicketLackDialog.vue b/src/pages/Ticket/Negative/TicketLackDialog.vue index 7445b3a67..1f7553b05 100644 --- a/src/pages/Ticket/Negative/TicketLackDialog.vue +++ b/src/pages/Ticket/Negative/TicketLackDialog.vue @@ -318,8 +318,22 @@ const columns = computed(() => [ }, ]); -defineEmits([...useDialogPluginComponent.emits]); +const emit = defineEmits([...useDialogPluginComponent.emits, 'selection']); +function rowsHasSelected({ keys }) { + emit('selection', keys); +} +const split = async (options) => { + let body = []; + // if (options.simple) { + body = selectedRows.value; + // } + // if (options.all) { + // body = $props.rows; + // } + await axios.post(`Tickets/split`, body); +}; +defineExpose({ split }); // const { dialogRef, onDialogHide } = useDialogPluginComponent(); // async function changeState(value) { @@ -354,6 +368,7 @@ defineEmits([...useDialogPluginComponent.emits]); row-key="ticketFk" selection="multiple" v-model:selected="selectedRows" + @selection="rowsHasSelected" :grid="$q.screen.lt.md" hide-bottom > @@ -364,7 +379,12 @@ defineEmits([...useDialogPluginComponent.emits]); diff --git a/src/pages/Ticket/Negative/TicketLackList.vue b/src/pages/Ticket/Negative/TicketLackList.vue index 98e37a4c5..486209dd3 100644 --- a/src/pages/Ticket/Negative/TicketLackList.vue +++ b/src/pages/Ticket/Negative/TicketLackList.vue @@ -3,7 +3,6 @@ import { computed, ref } from 'vue'; import { useI18n } from 'vue-i18n'; import { useStateStore } from 'stores/useStateStore'; import VnPaginate from 'components/ui/VnPaginate.vue'; -import { useSession } from 'src/composables/useSession'; import TicketLackFilter from 'pages/Ticket/Negative/TicketLackFilter.vue'; import TicketLackDialogProxy from 'src/pages/Ticket/Negative/TicketLackDialogProxy.vue'; import NegativeOriginDialog from 'pages/Ticket/Negative/NegativeOriginDialog.vue'; @@ -13,10 +12,6 @@ import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; import axios from 'axios'; import { useDialogPluginComponent } from 'quasar'; -const session = useSession(); - -const token = session.getTokenMultimedia(); - const stateStore = useStateStore(); const { t } = useI18n(); const selectedRows = ref([]); @@ -268,29 +263,12 @@ const updateNegativeOrigin = async () => { - - - - - {{ currentRow.longName }} - - - - - - - - +