0
0
Fork 0

fix: refs #7553 fixed TicketTransfer

This commit is contained in:
Jon Elias 2024-09-03 12:54:44 +02:00
parent d18ca14b4e
commit f35e33cf10
4 changed files with 5 additions and 31 deletions

View File

@ -283,7 +283,7 @@ const getMana = async () => {
const selectedValidSales = computed(() => {
if (!sales.value) return;
return selectedSales.value.filter((sale) => sale.id != undefined);
return [...selectedRows.value];
});
const onOpenEditPricePopover = async (sale) => {
@ -418,6 +418,7 @@ const removeSales = async () => {
const setTransferParams = async () => {
try {
selectedSales.value = selectedValidSales.value;
const checkedSales = JSON.parse(JSON.stringify(selectedSales.value));
transfer.value = {
lastActiveTickets: [],

View File

@ -1,13 +1,11 @@
<script setup>
import { ref, computed, onMounted } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import VnInput from 'src/components/common/VnInput.vue';
import TicketTransferForm from './TicketTransferForm.vue';
import { toDateFormat } from 'src/filters/date.js';
import axios from 'axios';
const $props = defineProps({
mana: {
@ -28,13 +26,10 @@ const $props = defineProps({
},
});
const emit = defineEmits(['refreshData']);
const router = useRouter();
const { t } = useI18n();
const QPopupProxyRef = ref(null);
const _transfer = ref(null);
const _transfer = ref();
const transferLinesColumns = computed(() => [
{
@ -85,29 +80,13 @@ const destinationTicketColumns = computed(() => [
},
]);
const transferSales = async (ticketId) => {
const params = {
ticketId: ticketId,
sales: $props.transfer.sales,
};
const { data } = await axios.post(
`tickets/${$props.ticket.id}/transferSales`,
params
);
if (data && data.id === $props.ticket.id) emit('refreshData');
else router.push({ name: 'TicketSale', params: { id: data.id } });
};
onMounted(() => (_transfer.value = $props.transfer));
</script>
<template>
<QPopupProxy ref="QPopupProxyRef">
<QCard class="q-px-md" style="display: flex">
<QCard class="q-px-md" style="display: flex; width: 80vw">
<QTable
v-if="transfer.sales"
:rows="transfer.sales"
:columns="transferLinesColumns"
:title="t('Sales to transfer')"
@ -121,9 +100,6 @@ onMounted(() => (_transfer.value = $props.transfer));
<VnInput
v-model.number="row.quantity"
:clearable="false"
@keyup.enter="changeQuantity(row)"
@blur="changeQuantity(row)"
@focus="edit.oldQuantity = row.quantity"
style="max-width: 60px"
/>
</QTd>

View File

@ -50,7 +50,6 @@ const transferSales = async (ticketId) => {
</script>
<template>
{{ _transfer }}
<QForm class="q-mt-lg full-width">
<VnInput
v-model.number="_transfer.ticketId"

View File

@ -490,9 +490,7 @@ function setReference(data) {
</QTooltip>
</QIcon>
<QIcon v-if="row.risk" color="primary" name="vn:risk" size="xs">
<QTooltip>
{{ t('Risk') }}
</QTooltip>
<QTooltip> {{ t('Risk') }}: {{ row.risk }} </QTooltip>
</QIcon>
<QIcon
v-if="row.hasComponentLack"