@@ -26,38 +103,63 @@ onBeforeMount(async () => {
-
+
-
+
-
-
-
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
+
diff --git a/src/views/pages/Belonging/ListBelongings.vue b/src/views/pages/Belonging/ListBelongings.vue
index f7bc693..0ec1578 100644
--- a/src/views/pages/Belonging/ListBelongings.vue
+++ b/src/views/pages/Belonging/ListBelongings.vue
@@ -4,6 +4,7 @@ import { FilterMatchMode } from '@primevue/core/api';
import { useToast } from 'primevue/usetoast';
import { onMounted, ref } from 'vue';
import { BelongingService } from '@/service/BelongingService';
+import { useRouter } from 'vue-router';
onMounted(() => {
BelongingService.getAllBelongings().then((data) => (belongings.value = data));
@@ -15,22 +16,12 @@ const belongings = ref();
const productDialog = ref(false);
const deleteProductDialog = ref(false);
const deleteProductsDialog = ref(false);
-const product = ref({});
+const belonging = ref({});
const selectedBelongings = ref();
const filters = ref({
global: { value: null, matchMode: FilterMatchMode.CONTAINS }
});
const submitted = ref(false);
-const statuses = ref([
- { label: 'INSTOCK', value: 'instock' },
- { label: 'LOWSTOCK', value: 'lowstock' },
- { label: 'OUTOFSTOCK', value: 'outofstock' }
-]);
-
-function formatCurrency(value) {
- if (value) return value.toLocaleString('en-US', { style: 'currency', currency: 'USD' });
- return;
-}
function openNew() {
product.value = {};
@@ -65,9 +56,10 @@ function saveProduct() {
}
}
-function editProduct(prod) {
- product.value = { ...prod };
- productDialog.value = true;
+const router = useRouter();
+
+function editBelonging(belongingId) {
+ router.push('/belonging/edit-belonging/' + belongingId);
}
function confirmDeleteProduct(prod) {
@@ -112,7 +104,7 @@ function confirmDeleteSelected() {
}
function deleteSelectedBelongings() {
- products.value = products.value.filter((val) => !selectedBelongings.value.includes(val));
+ belonging.value = belonging.value.filter((val) => !selectedBelongings.value.includes(val));
deleteProductsDialog.value = false;
selectedBelongings.value = null;
toast.add({ severity: 'success', summary: 'Successful', detail: 'Products Deleted', life: 3000 });
@@ -144,8 +136,7 @@ function getStatusLabel(status) {
-
-
+
-
+
- {{ slotProps.data.nativeName }}
+ {{ slotProps.data.category.nativeName }}
-
-
+
+
@@ -196,7 +187,7 @@ function getStatusLabel(status) {