0
0
Fork 0

refs #6321 updates

This commit is contained in:
Javier Segarra 2024-03-28 07:17:06 +01:00
parent 3a024e81b5
commit 30a32ad17d
3 changed files with 35 additions and 5 deletions

View File

@ -51,7 +51,7 @@ async function confirm() {
} }
</script> </script>
<template> <template>
<QDialog ref="dialogRef"> <QDialog ref="dialogRef" persistent>
<QCard class="q-pa-sm"> <QCard class="q-pa-sm">
<QCardSection class="row items-center q-pb-none"> <QCardSection class="row items-center q-pb-none">
<QAvatar <QAvatar

View File

@ -10,6 +10,9 @@ import VnSelectFilter from 'components/common/VnSelectFilter.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue'; import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import { toDate, toHour } from 'src/filters'; import { toDate, toHour } from 'src/filters';
import { useVnConfirm } from 'composables/useVnConfirm';
const { openConfirmationModal } = useVnConfirm();
import VnConfirm from 'components/ui/VnConfirm.vue';
import { useDialogPluginComponent } from 'quasar'; import { useDialogPluginComponent } from 'quasar';
const { t } = useI18n(); const { t } = useI18n();
@ -64,6 +67,7 @@ const saveChange = async (field, { rowIndex, row }) => {
// Buscador_Ticket (vNewTicketFk) // Buscador_Ticket (vNewTicketFk)
// Call Form_Requery // Call Form_Requery
await split({ simple: true });
break; break;
case 'code': case 'code':
// Call ticketChangeState(ticketFk, stateFk) // Call ticketChangeState(ticketFk, stateFk)
@ -323,6 +327,13 @@ function rowsHasSelected({ keys }) {
emit('selection', keys); emit('selection', keys);
} }
const split = async (options) => { const split = async (options) => {
openConfirmationModal(
t('Confirm splitAll'),
t('Are you sure you want to split all tickets?'),
null,
() => console.log('')
);
let body = []; let body = [];
// if (options.simple) { // if (options.simple) {
body = selectedRows.value; body = selectedRows.value;
@ -379,7 +390,12 @@ defineExpose({ split });
</QTd> </QTd>
<QTd v-for="col in props.cols" :key="col.name"> <QTd v-for="col in props.cols" :key="col.name">
<template v-if="col.name == 'actions'"> <template v-if="col.name == 'actions'">
<QBtn round v-close-popup color="primary"> <QBtn
round
v-close-popup
color="primary"
@click="saveChange('split', props)"
>
<QIcon name="call_split"></QIcon> <QIcon name="call_split"></QIcon>
<QTooltip> <QTooltip>
{{ t('components.leftMenu.removeFromPinned') }} {{ t('components.leftMenu.removeFromPinned') }}
@ -422,6 +438,11 @@ defineExpose({ split });
</QTable> </QTable>
</template> </template>
</VnPaginate> </VnPaginate>
<VnConfirm
model="confirmationModal"
:title="t('Confirm splitAll')"
:message="t('Are you sure you want to split all tickets?')"
></VnConfirm>
</template> </template>
<style lang="scss"></style> <style lang="scss"></style>

View File

@ -2,8 +2,9 @@
import { toRefs, ref } from 'vue'; import { toRefs, ref } from 'vue';
import TicketLackDialog from './TicketLackDialog.vue'; import TicketLackDialog from './TicketLackDialog.vue';
import { useSession } from 'src/composables/useSession'; import { useSession } from 'src/composables/useSession';
import { useVnConfirm } from 'composables/useVnConfirm'; // import { useVnConfirm } from 'composables/useVnConfirm';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
// import VnConfirm from 'components/ui/VnConfirm.vue';
const { t } = useI18n(); const { t } = useI18n();
const $props = defineProps({ const $props = defineProps({
@ -20,10 +21,12 @@ const { ticket } = toRefs($props);
const session = useSession(); const session = useSession();
const token = session.getTokenMultimedia(); const token = session.getTokenMultimedia();
const { openConfirmationModal } = useVnConfirm(); // const { openConfirmationModal } = useVnConfirm();
const ticketRef = ref(null); const ticketRef = ref(null);
const hasRowsSelected = ref(false); const hasRowsSelected = ref(false);
// const confirmationModal = ref(false);
async function splitAll() { async function splitAll() {
// confirmationModal.value = true;
ticketRef.value.split({ all: true }); ticketRef.value.split({ all: true });
// openConfirmationModal( // openConfirmationModal(
// t('Confirm splitAll'), // t('Confirm splitAll'),
@ -34,7 +37,12 @@ async function splitAll() {
} }
</script> </script>
<template> <template>
<QDialog ref="dialogRef" full-width> <QDialog
persistent
ref="dialogLackRef"
full-width
@before-show="() => (hasRowsSelected = false)"
>
<QCard class="q-pa-sm"> <QCard class="q-pa-sm">
<QCardSection class="row items-center q-pb-none"> <QCardSection class="row items-center q-pb-none">
<QImg <QImg
@ -70,4 +78,5 @@ async function splitAll() {
@selection="(rows) => (hasRowsSelected = rows.length > 0)" @selection="(rows) => (hasRowsSelected = rows.length > 0)"
/> </QCardSection></QCard /> </QCardSection></QCard
></QDialog> ></QDialog>
<!-- <VnConfirm v-if="confirmationModal"></VnConfirm> -->
</template> </template>