link item to ticket frontend
All checks were successful
/ test (push) Successful in 2m44s

This commit is contained in:
j3d1 2025-01-26 19:56:25 +01:00
parent fbbf8352cf
commit 2677f4b8b6
2 changed files with 17 additions and 1 deletions

View file

@ -61,7 +61,6 @@ const store = createStore({
'2kg-de': '2kg Paket (DE)', '2kg-de': '2kg Paket (DE)',
'5kg-de': '5kg Paket (DE)', '5kg-de': '5kg Paket (DE)',
'10kg-de': '10kg Paket (DE)', '10kg-de': '10kg Paket (DE)',
'2kg-eu': '2kg Paket (EU)',
'5kg-eu': '5kg Paket (EU)', '5kg-eu': '5kg Paket (EU)',
'10kg-eu': '10kg Paket (EU)', '10kg-eu': '10kg Paket (EU)',
} }
@ -564,6 +563,14 @@ const store = createStore({
state.fetchedData.tickets = 0; state.fetchedData.tickets = 0;
await Promise.all([dispatch('loadTickets'), dispatch('fetchShippingVouchers')]); await Promise.all([dispatch('loadTickets'), dispatch('fetchShippingVouchers')]);
} }
},
async linkTicketItem({dispatch, state, getters}, {ticket_id, item_id}) {
const {data, success} = await getters.session.post(`/2/matches/`, {issue_thread: ticket_id, item: item_id});
if (data && success) {
state.fetchedData.tickets = 0;
state.fetchedData.items = 0;
await Promise.all([dispatch('loadTickets'), dispatch('loadEventItems')]);
}
} }
}, },
plugins: [persistentStatePlugin({ // TODO change remember to some kind of enable field plugins: [persistentStatePlugin({ // TODO change remember to some kind of enable field

View file

@ -81,6 +81,13 @@
<font-awesome-icon icon="clipboard"/> <font-awesome-icon icon="clipboard"/>
Copy&nbsp;DHL&nbsp;contact&nbsp;to&nbsp;clipboard Copy&nbsp;DHL&nbsp;contact&nbsp;to&nbsp;clipboard
</ClipboardButton> </ClipboardButton>
<div class="btn-group">
<input type="text" class="form-control" v-model="item_id">
<button class="form-control btn btn-success"
@click="linkTicketItem({ticket_id: ticket.id, item_id: item_id}).then(()=>item_id='')">
Link&nbsp;Item
</button>
</div>
<div class="btn-group"> <div class="btn-group">
<select class="form-control" v-model="shipping_voucher_type"> <select class="form-control" v-model="shipping_voucher_type">
<option v-for="type in availableShippingVoucherTypes.filter(t=>t.count>0)" <option v-for="type in availableShippingVoucherTypes.filter(t=>t.count>0)"
@ -141,6 +148,7 @@ export default {
selected_state: null, selected_state: null,
selected_assignee: null, selected_assignee: null,
shipping_voucher_type: null, shipping_voucher_type: null,
item_id: "",
newMail: "", newMail: "",
newComment: "" newComment: ""
} }
@ -166,6 +174,7 @@ export default {
...mapActions(['deleteItem', 'markItemReturned', 'sendMail', 'updateTicketPartial', 'postComment']), ...mapActions(['deleteItem', 'markItemReturned', 'sendMail', 'updateTicketPartial', 'postComment']),
...mapActions(['loadTickets', 'fetchTicketStates', 'loadUsers', 'scheduleAfterInit']), ...mapActions(['loadTickets', 'fetchTicketStates', 'loadUsers', 'scheduleAfterInit']),
...mapActions(['claimShippingVoucher', 'fetchShippingVouchers']), ...mapActions(['claimShippingVoucher', 'fetchShippingVouchers']),
...mapActions(['linkTicketItem']),
...mapMutations(['openLightboxModalWith']), ...mapMutations(['openLightboxModalWith']),
changeTicketStatus() { changeTicketStatus() {
this.ticket.state = this.selected_state; this.ticket.state = this.selected_state;