0
0
Fork 0

refs #6321 feat: status response after split

This commit is contained in:
Javier Segarra 2024-03-29 01:29:45 +01:00
parent 967fb4592b
commit 0c88efc291
4 changed files with 66 additions and 22 deletions

View File

@ -131,3 +131,8 @@ input::-webkit-inner-spin-button {
-webkit-appearance: none; -webkit-appearance: none;
-moz-appearance: none; -moz-appearance: none;
} }
.remove-bg {
filter: brightness(1.1);
mix-blend-mode: multiply;
}

View File

@ -13,7 +13,7 @@
// Tip: Use the "Theme Builder" on Quasar's documentation website. // Tip: Use the "Theme Builder" on Quasar's documentation website.
// Tip: to add new colors https://quasar.dev/style/color-palette/#adding-your-own-colors // Tip: to add new colors https://quasar.dev/style/color-palette/#adding-your-own-colors
$primary: #ec8916; $primary: #ec8916;
$secondary: $primary; $secondary: #89be34;
$positive: #c8e484; $positive: #c8e484;
$negative: #fb5252; $negative: #fb5252;
$info: #84d0e2; $info: #84d0e2;

View File

@ -221,11 +221,11 @@ const tableColumnComponents = computed(() => ({
}, },
event: getInputEvents, event: getInputEvents,
}, },
actions: { // actions: {
component: QBtn, // component: QBtn,
props: {}, // props: {},
event: getInputEvents, // event: getInputEvents,
}, // },
})); }));
const columns = computed(() => [ const columns = computed(() => [
@ -316,11 +316,11 @@ const columns = computed(() => [
field: 'peticionCompra', field: 'peticionCompra',
align: 'center', align: 'center',
}, },
{ // {
name: 'actions', // name: 'actions',
label: t('claim.summary.actions'), // label: t('claim.summary.actions'),
align: 'center', // align: 'center',
}, // },
]); ]);
const emit = defineEmits([...useDialogPluginComponent.emits, 'selection']); const emit = defineEmits([...useDialogPluginComponent.emits, 'selection']);
@ -328,6 +328,7 @@ function rowsHasSelected({ keys }) {
emit('selection', keys); emit('selection', keys);
} }
// const confirmationModal = ref(false); // const confirmationModal = ref(false);
const resultSplit = ref([]);
const split = async ({ simple }, data = []) => { const split = async ({ simple }, data = []) => {
openConfirmationModal( openConfirmationModal(
t('Confirm splitAll'), t('Confirm splitAll'),
@ -335,7 +336,10 @@ const split = async ({ simple }, data = []) => {
null, null,
() => { () => {
const body = simple ? data : selectedRows.value; const body = simple ? data : selectedRows.value;
axios.post(`Tickets/split`, body); // axios.post(`Tickets/split`, body).then((data) => {
// resultSplit.value = data;
// });
resultSplit.value = [{ ticketFk: 14, message: 'split' }];
} }
); );
// confirmationModal.value = true; // confirmationModal.value = true;
@ -361,6 +365,23 @@ defineExpose({ split });
await axios.post(`TicketTrackings/changeState`, formData);*/ await axios.post(`TicketTrackings/changeState`, formData);*/
// } // }
function getIcon(key, prop) {
const ticket = resultSplit.value.find((val) => val.ticketFk === key);
if (!ticket) return;
const { message } = ticket;
const icons = {
split: {
name: 'check_circle',
color: 'secondary',
},
noSplit: {
name: 'warning',
color: 'primary',
},
};
return icons[message][prop];
}
</script> </script>
<template> <template>
@ -396,10 +417,33 @@ defineExpose({ split });
<template #body="props"> <template #body="props">
<QTr> <QTr>
<QTd> <QTd>
<QIcon
v-if="resultSplit.length > 0"
:name="getIcon(props.key, 'name')"
:color="getIcon(props.key, 'color')"
class="fill-icon q-mr-sm"
size="xs"
style="font-weight: bold"
/>
<!-- <QIcon
name="warning"
color="primary"
class="fill-icon q-mr-sm"
size="xs"
style="font-weight: bold"
/>
<QIcon
name="check_circle"
class="fill-icon q-mr-sm"
size="xs"
color="secondary"
style="font-weight: bold"
/> -->
<QCheckbox v-model="props.selected" /> <QCheckbox v-model="props.selected" />
</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 <QBtn
round round
color="primary" color="primary"
@ -410,13 +454,8 @@ defineExpose({ split });
{{ t('globals.split') }} {{ t('globals.split') }}
</QTooltip> </QTooltip>
</QBtn> </QBtn>
</template> </template> -->
<template <template v-if="tableColumnComponents[col.name]?.component">
v-if="
col.name !== 'actions' &&
tableColumnComponents[col.name]?.component
"
>
<component <component
:is="tableColumnComponents[col.name].component" :is="tableColumnComponents[col.name].component"
v-bind="tableColumnComponents[col.name].props" v-bind="tableColumnComponents[col.name].props"

View File

@ -40,7 +40,7 @@ async function splitAll() {
:ratio="1" :ratio="1"
height="50px" height="50px"
width="50px" width="50px"
class="image" class="image remove-bg"
/> />
<span class="text-h6 text-grey">{{ ticket.longName }}</span> <span class="text-h6 text-grey">{{ ticket.longName }}</span>