0
0
Fork 0

hotfix: refs #6769 Changes

This commit is contained in:
Guillermo Bonet 2024-07-05 07:10:41 +02:00
parent b09cbe442c
commit 317746b1f5
4 changed files with 77 additions and 19 deletions

View File

@ -5,7 +5,9 @@ import { useRoute } from 'vue-router';
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
import EntryDescriptorProxy from 'src/pages/Entry/Card/EntryDescriptorProxy.vue';
import OrderDescriptorProxy from 'src/pages/Order/Card/OrderDescriptorProxy.vue';
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
import FetchData from 'components/FetchData.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue';
@ -45,8 +47,8 @@ const columns = computed(() => [
align: 'left',
},
{
label: t('itemDiary.id'),
name: 'id',
label: t('itemDiary.origin'),
name: 'origin',
align: 'left',
},
{
@ -65,8 +67,8 @@ const columns = computed(() => [
},
{
label: t('itemDiary.client'),
name: 'client',
label: t('itemDiary.entity'),
name: 'entity',
align: 'left',
format: (val) => dashIfEmpty(val),
},
@ -111,10 +113,30 @@ const getBadgeAttrs = (_date) => {
return attrs;
};
const getIdDescriptor = (row) => {
let descriptor = EntryDescriptorProxy;
if (row.isTicket) descriptor = TicketDescriptorProxy;
return descriptor;
const originTypeMap = {
entry: {
descriptor: EntryDescriptorProxy,
icon: 'vn:entry',
},
ticket: {
descriptor: TicketDescriptorProxy,
icon: 'vn:ticket',
},
order: {
descriptor: OrderDescriptorProxy,
icon: 'vn:basket',
},
};
const entityTypeMap = {
client: {
descriptor: CustomerDescriptorProxy,
icon: 'vn:client',
},
supplier: {
descriptor: SupplierDescriptorProxy,
icon: 'vn:supplier',
},
};
onMounted(async () => {
@ -206,10 +228,10 @@ onUnmounted(() => (stateStore.rightDrawer = false));
</QBadge>
</QTd>
</template>
<template #body-cell-id="{ row }">
<template #body-cell-origin="{ row }">
<QTd @click.stop>
<component
:is="getIdDescriptor(row)"
:is="originTypeMap[row.originType]?.descriptor"
:id="row.origin"
class="q-ma-none"
dense
@ -217,10 +239,17 @@ onUnmounted(() => (stateStore.rightDrawer = false));
>
{{ row.origin }}
</component>
<span class="link">{{ row.origin }}</span>
<span class="link">
<QIcon
:name="originTypeMap[row.originType]?.icon"
class="fill-icon q-mr-sm"
size="xs"
/>
{{ row.origin }}
</span>
</QTd>
</template>
<template #body-cell-client="{ row }">
<template #body-cell-entity="{ row }">
<QTd @click.stop>
<QBadge
:color="row.highlighted ? 'warning' : 'transparent'"
@ -228,11 +257,23 @@ onUnmounted(() => (stateStore.rightDrawer = false));
dense
style="font-size: 14px"
>
<span v-if="row.isTicket" class="link">
<component
:is="entityTypeMap[row.entityType]?.descriptor"
:id="row.entity"
class="q-ma-none"
dense
style="font-size: 14px"
>
{{ row.entity }}
</component>
<span class="link">
<QIcon
:name="entityTypeMap[row.entityType]?.icon"
class="fill-icon q-mr-sm"
size="xs"
/>
{{ dashIfEmpty(row.name) }}
<CustomerDescriptorProxy :id="row.clientFk" />
</span>
<span v-else>{{ dashIfEmpty(row.name) }}</span>
</QBadge>
</QTd>
</template>

View File

@ -14,10 +14,10 @@ shelvings:
removeConfirmSubtitle: Are you sure you want to continue?
itemDiary:
date: Date
id: Id
origin: Otigin
state: State
reference: Reference
client: Client
entity: Entity
in: In
out: Out
balance: Balance

View File

@ -14,10 +14,10 @@ shelvings:
removeConfirmSubtitle: ¿Seguro que quieres continuar?
itemDiary:
date: Fecha
id: Id
origin: Origen
state: Estado
reference: Referencia
client: Cliente
entity: Entidad
in: Entrada
out: Salida
balance: Balance

View File

@ -0,0 +1,17 @@
<script setup>
import OrderDescriptor from './OrderDescriptor.vue';
import OrderSummary from './OrderSummary.vue';
const $props = defineProps({
id: {
type: Number,
required: true,
},
});
</script>
<template>
<QPopupProxy>
<OrderDescriptor v-if="$props.id" :id="$props.id" :summary="OrderSummary" />
</QPopupProxy>
</template>