diff --git a/src/pages/Ticket/Negative/TicketLackDialog.vue b/src/pages/Ticket/Negative/TicketLackDialog.vue index 48c0d52f7..4ba04d136 100644 --- a/src/pages/Ticket/Negative/TicketLackDialog.vue +++ b/src/pages/Ticket/Negative/TicketLackDialog.vue @@ -67,7 +67,8 @@ const saveChange = async (field, { rowIndex, row }) => { // Buscador_Ticket (vNewTicketFk) // Call Form_Requery - await split({ simple: true }); + await split({ simple: true }, [row]); + break; case 'code': // Call ticketChangeState(ticketFk, stateFk) @@ -326,23 +327,26 @@ const emit = defineEmits([...useDialogPluginComponent.emits, 'selection']); function rowsHasSelected({ keys }) { emit('selection', keys); } -const split = async (options) => { +// const confirmationModal = ref(false); +const split = async ({ simple }, data = []) => { openConfirmationModal( t('Confirm splitAll'), t('Are you sure you want to split all tickets?'), null, - () => console.log('') + () => { + const body = simple ? data : selectedRows.value; + axios.post(`Tickets/split`, body); + } ); + // confirmationModal.value = true; - let body = []; + // 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(); @@ -365,6 +369,12 @@ defineExpose({ split }); @on-fetch="(data) => (editableStates = data)" auto-load /> + @@ -438,11 +447,6 @@ defineExpose({ split }); - diff --git a/src/pages/Ticket/Negative/TicketLackDialogProxy.vue b/src/pages/Ticket/Negative/TicketLackDialogProxy.vue index b9e2c084a..18d3e4464 100644 --- a/src/pages/Ticket/Negative/TicketLackDialogProxy.vue +++ b/src/pages/Ticket/Negative/TicketLackDialogProxy.vue @@ -38,7 +38,6 @@ async function splitAll() {