state button has the state pre selected
This commit is contained in:
parent
84aa2e8820
commit
987a851fc3
1 changed files with 25 additions and 12 deletions
|
@ -15,23 +15,25 @@
|
|||
Delete
|
||||
</button-->
|
||||
<div class="btn-group">
|
||||
<select class="form-control" v-model="ticket.assigned_to">
|
||||
<select class="form-control" v-model="selected_assignee">
|
||||
<option v-for="user in users" :value="user.username">{{ user.username }}</option>
|
||||
</select>
|
||||
<button class="form-control btn btn-success"
|
||||
@click="assignTicket(ticket)"
|
||||
:disabled="!ticket.assigned_to">
|
||||
:disabled="!selected_assignee && (selected_assignee == ticket.assigned_to)">
|
||||
Assign Ticket
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<select class="form-control" v-model="ticket.state">
|
||||
<select class="form-control" v-model="selected_state">
|
||||
<option v-for="status in state_options" :value="status.value">{{
|
||||
status.text
|
||||
}}
|
||||
</option>
|
||||
</select>
|
||||
<button class="form-control btn btn-success" @click="changeTicketStatus(ticket)">
|
||||
<button class="form-control btn btn-success"
|
||||
@click="changeTicketStatus(ticket)"
|
||||
:disabled="(selected_state == ticket.state)">
|
||||
Change Status
|
||||
</button>
|
||||
</div>
|
||||
|
@ -72,7 +74,16 @@ export default {
|
|||
components: {AsyncLoader, ClipboardButton, Timeline},
|
||||
data() {
|
||||
return {
|
||||
shipping_voucher_type: null
|
||||
selected_state: null,
|
||||
Selected_assignee: null,
|
||||
shipping_voucher_type: null,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
ticket(val) {
|
||||
if (this.selected_state == null){
|
||||
this.selected_state = val.state;
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -105,15 +116,17 @@ export default {
|
|||
})
|
||||
},
|
||||
changeTicketStatus(ticket) {
|
||||
ticket.state = this.selected_state;
|
||||
this.updateTicketPartial({
|
||||
id: ticket.id,
|
||||
state: ticket.state
|
||||
state: this.selected_state,
|
||||
})
|
||||
},
|
||||
assignTicket(ticket) {
|
||||
ticket.assigned_to = this.selected_assignee;
|
||||
this.updateTicketPartial({
|
||||
id: ticket.id,
|
||||
assigned_to: ticket.assigned_to
|
||||
assigned_to: this.selected_assignee
|
||||
})
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue