make tickets assignable to users
This commit is contained in:
parent
4be8109753
commit
e605292bf0
11 changed files with 317 additions and 110 deletions
|
@ -17,6 +17,14 @@
|
|||
<font-awesome-icon icon="clipboard"/>
|
||||
Copy DHL contact to clipboard
|
||||
</ClipboardButton>
|
||||
<div class="btn-group">
|
||||
<select class="form-control" v-model="ticket.assigned_to">
|
||||
<option v-for="user in users" :value="user.username">{{ user.username }}</option>
|
||||
</select>
|
||||
<button class="form-control btn btn-success" @click="assigTicket(ticket)">
|
||||
Assign Ticket
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<select class="form-control" v-model="ticket.state">
|
||||
<option v-for="status in state_options" :value="status.value">{{ status.text }}</option>
|
||||
|
@ -41,7 +49,7 @@ export default {
|
|||
name: 'Ticket',
|
||||
components: {ClipboardButton, Timeline},
|
||||
computed: {
|
||||
...mapState(['tickets', 'state_options']),
|
||||
...mapState(['tickets', 'state_options', 'users']),
|
||||
ticket() {
|
||||
const id = parseInt(this.$route.params.id)
|
||||
const ret = this.tickets.find(ticket => ticket.id === id);
|
||||
|
@ -53,7 +61,8 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['deleteItem', 'markItemReturned', 'loadTickets', 'sendMail', 'updateTicketPartial', 'fetchTicketStates', 'postComment']),
|
||||
...mapActions(['deleteItem', 'markItemReturned', 'sendMail', 'updateTicketPartial', 'postComment']),
|
||||
...mapActions(['loadTickets', 'loadUsers', 'fetchTicketStates']),
|
||||
handleMail(mail) {
|
||||
this.sendMail({
|
||||
id: this.ticket.id,
|
||||
|
@ -71,11 +80,18 @@ export default {
|
|||
id: ticket.id,
|
||||
state: ticket.state
|
||||
})
|
||||
},
|
||||
assigTicket(ticket) {
|
||||
this.updateTicketPartial({
|
||||
id: ticket.id,
|
||||
assigned_to: ticket.assigned_to
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchTicketStates()
|
||||
this.loadTickets()
|
||||
this.loadUsers()
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue