From 331a8da55352c736f08339ae6ca0d9e0eb690058 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Mon, 4 Dec 2023 15:26:36 +0530 Subject: added table to show items of an invoice --- src/components/invoice_items_table.vue | 142 +++++++++++++++++++++++++++++++++ src/components/item_selector.vue | 4 +- src/components/items_table.vue | 2 +- 3 files changed, 145 insertions(+), 3 deletions(-) create mode 100644 src/components/invoice_items_table.vue (limited to 'src/components') diff --git a/src/components/invoice_items_table.vue b/src/components/invoice_items_table.vue new file mode 100644 index 0000000..6a89f5a --- /dev/null +++ b/src/components/invoice_items_table.vue @@ -0,0 +1,142 @@ + + + + + diff --git a/src/components/item_selector.vue b/src/components/item_selector.vue index 9cdbeed..5dc9b84 100644 --- a/src/components/item_selector.vue +++ b/src/components/item_selector.vue @@ -4,7 +4,7 @@ import axios from 'axios' import { useToast } from 'vue-toast-notification' import InvoiceItem from "./../classes/invoice_item" -const props = defineProps(["invoice"]) +const props = defineProps(["invoiceId"]) const emit = defineEmits(["added"]) const toast = useToast({ @@ -42,7 +42,7 @@ const submit = async (e: Event) => { submitting.value = true try { - await axios.post(`/invoice/${props.invoice.ID}/item`, toRaw(item.value)) + await axios.post(`/invoice/${props.invoiceId}/item`, toRaw(item.value)) itemSelection.value = null item.value = new InvoiceItem() emit("added") diff --git a/src/components/items_table.vue b/src/components/items_table.vue index 187ee0f..e9f103e 100644 --- a/src/components/items_table.vue +++ b/src/components/items_table.vue @@ -92,7 +92,7 @@ onMounted(() => { - + {{ index + 1 }} {{ item.Name }} {{ item.Description }} -- cgit v1.2.3