c3lf-system-3/web/src/components/AddTicketModal.vue

51 lines
1.5 KiB
Vue
Raw Normal View History

2024-01-07 20:44:22 +00:00
<template>
<div>
2023-12-28 21:49:55 +00:00
<Modal v-if="isModal" title="Add Ticket" @close="$emit('close')">
2024-01-07 20:44:22 +00:00
<template #body>
<div>
<input type="text" class="form-control" placeholder="Sender" v-model="ticket.sender">
<input type="text" class="form-control" placeholder="Title" v-model="ticket.title">
<textarea class="form-control" placeholder="Message" v-model="ticket.message"></textarea>
</div>
</template>
<template #buttons>
<button type="button" class="btn btn-secondary" @click="$emit('close')">Cancel</button>
<button type="button" class="btn btn-success" @click="saveNewTicket()">Save new Item</button>
</template>
</Modal>
</div>
</template>
<script>
2024-06-18 18:10:10 +00:00
import {mapActions} from 'vuex';
2024-01-07 20:44:22 +00:00
import Modal from '@/components/Modal';
import EditItem from '@/components/EditItem';
export default {
name: 'AddTicketModal',
components: {Modal, EditItem},
props: ['isModal'],
data: () => ({
ticket: {
sender: '',
message: '',
title: '',
}
}),
created() {
2024-06-18 18:10:10 +00:00
this.ticket = {};
2024-01-07 20:44:22 +00:00
},
methods: {
2024-06-18 18:10:10 +00:00
...mapActions(['postManualTicket']),
2024-01-07 20:44:22 +00:00
saveNewTicket() {
2024-06-18 18:10:10 +00:00
this.postManualTicket(this.ticket).then(() => {
2024-01-07 20:44:22 +00:00
this.$emit('close');
});
}
}
};
</script>
<style scoped>
</style>