0
0
Fork 0

Merge pull request 'TEST refs #6083 feat: ticketSms section' (!72) from 6083-ticketSms into test

Reviewed-on: verdnatura/salix-front#72
Reviewed-by: Juan Ferrer <juan@verdnatura.es>
This commit is contained in:
Alex Moreno 2023-08-08 06:47:12 +00:00
commit c077b7cbcf
4 changed files with 138 additions and 9 deletions

View File

@ -161,6 +161,7 @@ export default {
summary: 'Summary',
basicData: 'Basic Data',
boxing: 'Boxing',
sms: 'Sms',
},
list: {
nickname: 'Nickname',
@ -295,7 +296,7 @@ export default {
result: 'Result',
responsible: 'Responsible',
worker: 'Worker',
redelivery: 'Redelivery'
redelivery: 'Redelivery',
},
basicData: {
customer: 'Customer',
@ -411,7 +412,7 @@ export default {
wagonEdit: 'Edit wagon',
typesList: 'Types List',
typeCreate: 'Create type',
typeEdit: 'Edit type'
typeEdit: 'Edit type',
},
type: {
name: 'Name',
@ -431,7 +432,7 @@ export default {
plate: 'Plate',
volume: 'Volume',
type: 'Type',
label: 'Label'
label: 'Label',
},
warnings: {
noData: 'No data available',
@ -444,7 +445,7 @@ export default {
minHeightBetweenTrays: 'The minimum height between trays is ',
maxWagonHeight: 'The maximum height of the wagon is ',
uncompleteTrays: 'There are incomplete trays',
}
},
},
components: {
topbar: {},

View File

@ -63,7 +63,7 @@ export default {
webPayments: 'Pagos Web',
createCustomer: 'Crear cliente',
basicData: 'Datos básicos',
summary: 'Resumen'
summary: 'Resumen',
},
list: {
phone: 'Teléfono',
@ -160,6 +160,7 @@ export default {
summary: 'Resumen',
basicData: 'Datos básicos',
boxing: 'Encajado',
sms: 'Sms',
},
list: {
nickname: 'Alias',
@ -294,7 +295,7 @@ export default {
result: 'Consecuencias',
responsible: 'Responsable',
worker: 'Trabajador',
redelivery: 'Devolución'
redelivery: 'Devolución',
},
basicData: {
customer: 'Cliente',
@ -411,7 +412,7 @@ export default {
wagonEdit: 'Editar tipo',
typesList: 'Listado tipos',
typeCreate: 'Crear tipo',
typeEdit: 'Editar tipo'
typeEdit: 'Editar tipo',
},
type: {
name: 'Nombre',
@ -444,7 +445,7 @@ export default {
minHeightBetweenTrays: 'La distancia mínima entre bandejas es ',
maxWagonHeight: 'La altura máxima del vagón es ',
uncompleteTrays: 'Hay bandejas sin completar',
}
},
},
components: {
topbar: {},

View File

@ -0,0 +1,118 @@
<script setup>
import { date } from 'quasar';
import { computed } from 'vue';
import { useRouter } from 'vue-router';
import { useSession } from 'src/composables/useSession';
import VnPaginate from 'src/components/ui/VnPaginate.vue';
import WorkerDescriptorProxy from 'pages/Worker/Card/WorkerDescriptorProxy.vue';
const router = useRouter();
const session = useSession();
const token = session.getToken();
const entityId = computed(function () {
return router.currentRoute.value.params.id;
});
const filter = {
fields: ['ticketFk', 'smsFk'],
include: {
relation: 'sms',
scope: {
fields: [
'senderFk',
'sender',
'destination',
'message',
'statusCode',
'status',
'created',
],
include: {
relation: 'sender',
scope: {
fields: ['name'],
},
},
},
},
where: {
ticketFk: entityId,
},
};
function formatNumer(number) {
if (number.length <= 10) return number;
return number.slice(0, 4) + ' ' + number.slice(4);
}
</script>
<template>
<div class="column items-center">
<div class="list">
<VnPaginate
data-key="TicketSms"
url="TicketSms"
:filter="filter"
order="smsFk DESC"
:offset="100"
:limit="5"
auto-load
>
<template #body="{ rows }">
<QCard
flat
bordered
class="card q-pa-md"
v-for="row of rows"
:key="row.smsFk"
>
<QItem>
<QItmSection top avatar>
<QItemLabel class="column items-center">
<QAvatar>
<QImg
:src="`/api/Images/user/160x160/${row.sms.senderFk}/download?access_token=${token}`"
spinner-color="white"
/>
</QAvatar>
<span class="link">
{{ row.sms.sender.name }}
<WorkerDescriptorProxy :id="row.sms.senderFk" />
</span>
</QItemLabel>
</QItmSection>
<QSeparator spaced inset="item" />
<QItemSection>
<QItemLabel caption>{{
formatNumer(row.sms.destination)
}}</QItemLabel>
<QItemLabel>{{ row.sms.message }}</QItemLabel>
</QItemSection>
<QItemSection side top>
<QItemLabel caption>{{
date.formatDate(
row.sms.created,
'YYYY-MM-DD HH:mm:ss'
)
}}</QItemLabel>
<QItemLabel>
<QChip
:color="
row.sms.status == 'OK'
? 'positive'
: 'negative'
"
>
{{ row.sms.status }}
</QChip>
</QItemLabel>
</QItemSection>
</QItem>
</QCard>
</template>
</VnPaginate>
</div>
</div>
</template>

View File

@ -11,7 +11,7 @@ export default {
redirect: { name: 'TicketMain' },
menus: {
main: ['TicketList'],
card: ['TicketBoxing'],
card: ['TicketBoxing', 'TicketSms'],
},
children: [
{
@ -74,6 +74,15 @@ export default {
},
component: () => import('src/pages/Ticket/Card/TicketBoxing.vue'),
},
{
path: 'sms',
name: 'TicketSms',
meta: {
title: 'sms',
icon: 'sms',
},
component: () => import('src/pages/Ticket/Card/TicketSms.vue'),
},
],
},
],