2024-01-07 20:32:42 +00:00
|
|
|
<template>
|
|
|
|
<div class="container-fluid px-xl-5 mt-3">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-xl-8 offset-xl-2">
|
|
|
|
<Table
|
|
|
|
:columns="['id', 'name', 'state', 'last_activity', 'assigned_to']"
|
|
|
|
:items="tickets"
|
|
|
|
:keyName="'id'"
|
2024-01-17 19:08:28 +00:00
|
|
|
v-if="layout === 'table'"
|
2024-01-07 20:32:42 +00:00
|
|
|
>
|
2023-12-28 22:32:30 +00:00
|
|
|
<template #actions="{ item }">
|
|
|
|
<div class="btn-group">
|
2024-01-06 17:59:44 +00:00
|
|
|
<a class="btn btn-primary" :href="'/'+ getEventSlug + '/ticket/' + item.id" title="view"
|
2023-12-28 22:32:30 +00:00
|
|
|
@click.prevent="gotoDetail(item)">
|
|
|
|
<font-awesome-icon icon="eye"/>
|
|
|
|
View
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</template>
|
2024-01-07 20:32:42 +00:00
|
|
|
</Table>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-01-17 19:08:28 +00:00
|
|
|
<CollapsableCards v-if="layout === 'tasks'" :items="tickets"
|
|
|
|
:columns="['id', 'name', 'last_activity', 'assigned_to']"
|
|
|
|
:keyName="'state'" :sections="['pending_new', 'pending_open','pending_shipping',
|
2024-01-19 20:13:04 +00:00
|
|
|
'pending_physical_confirmation','pending_return','pending_postponed'].map(stateInfo)">
|
2024-01-17 19:08:28 +00:00
|
|
|
<template #section_header="{index, section, count}">
|
|
|
|
{{ section.text }} <span class="badge badge-light ml-1">{{ count }}</span>
|
|
|
|
</template>
|
|
|
|
<template #section_body="{item}">
|
|
|
|
<tr>
|
|
|
|
<td>{{ item.id }}</td>
|
|
|
|
<td>{{ item.name }}</td>
|
|
|
|
<td>{{ item.last_activity }}</td>
|
|
|
|
<td>{{ item.assigned_to }}</td>
|
|
|
|
<td>
|
|
|
|
<div class="btn-group">
|
|
|
|
<a class="btn btn-primary" :href="'/'+ getEventSlug + '/ticket/' + item.id" title="view"
|
|
|
|
@click.prevent="gotoDetail(item)">
|
|
|
|
<font-awesome-icon icon="eye"/>
|
|
|
|
View
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</template>
|
|
|
|
</CollapsableCards>
|
2024-01-07 20:32:42 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import Cards from '@/components/Cards';
|
|
|
|
import Modal from '@/components/Modal';
|
|
|
|
import EditItem from '@/components/EditItem';
|
2024-01-06 17:59:44 +00:00
|
|
|
import {mapActions, mapGetters, mapState} from 'vuex';
|
2024-01-07 20:32:42 +00:00
|
|
|
import Lightbox from '../components/Lightbox';
|
2024-01-17 19:08:28 +00:00
|
|
|
import Table from '@/components/Table';
|
|
|
|
import CollapsableCards from "@/components/CollapsableCards.vue";
|
2024-01-07 20:32:42 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'Tickets',
|
2024-01-17 19:08:28 +00:00
|
|
|
components: {Lightbox, Table, Cards, Modal, EditItem, CollapsableCards},
|
2024-01-06 17:59:44 +00:00
|
|
|
computed: {
|
|
|
|
...mapState(['tickets']),
|
2024-01-17 19:08:28 +00:00
|
|
|
...mapGetters(['stateInfo', 'getEventSlug', 'layout']),
|
2024-01-06 17:59:44 +00:00
|
|
|
},
|
2024-01-07 20:32:42 +00:00
|
|
|
methods: {
|
2024-06-22 23:04:32 +00:00
|
|
|
...mapActions(['loadTickets', 'fetchTicketStates', 'scheduleAfterInit']),
|
2024-01-07 20:32:42 +00:00
|
|
|
gotoDetail(ticket) {
|
|
|
|
this.$router.push({name: 'ticket', params: {id: ticket.id}});
|
2024-01-17 19:08:28 +00:00
|
|
|
},
|
|
|
|
formatTicket(ticket) {
|
|
|
|
return {
|
|
|
|
id: ticket.id,
|
|
|
|
name: ticket.name,
|
|
|
|
state: this.stateInfo(ticket.state).text,
|
|
|
|
stateColor: this.stateInfo(ticket.state).color,
|
|
|
|
last_activity: ticket.last_activity,
|
|
|
|
assigned_to: ticket.assigned_to
|
|
|
|
};
|
2024-01-07 20:32:42 +00:00
|
|
|
}
|
|
|
|
},
|
2024-06-22 23:04:32 +00:00
|
|
|
mounted() {
|
|
|
|
this.scheduleAfterInit(() => [this.fetchTicketStates(), this.loadTickets()]);
|
2024-01-07 20:32:42 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
|
|
</style>
|