forked from verdnatura/salix-front
Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 5986-redisgnDescriptors
This commit is contained in:
commit
f94f87590a
|
@ -161,6 +161,7 @@ export default {
|
|||
summary: 'Summary',
|
||||
basicData: 'Basic Data',
|
||||
boxing: 'Boxing',
|
||||
sms: 'Sms',
|
||||
},
|
||||
list: {
|
||||
nickname: 'Nickname',
|
||||
|
|
|
@ -160,6 +160,7 @@ export default {
|
|||
summary: 'Resumen',
|
||||
basicData: 'Datos básicos',
|
||||
boxing: 'Encajado',
|
||||
sms: 'Sms',
|
||||
},
|
||||
list: {
|
||||
nickname: 'Alias',
|
||||
|
|
|
@ -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>
|
|
@ -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'),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
|
Loading…
Reference in New Issue