From 815769fab751d585958a61a8fefa49c45177b396 Mon Sep 17 00:00:00 2001 From: Mohd Ariff Date: Mon, 2 Mar 2026 18:46:36 +0800 Subject: [PATCH] Update --- .../Views/Reporting/InventoryReport.cshtml | 55 +++++++++++++++++-- 1 file changed, 50 insertions(+), 5 deletions(-) diff --git a/Areas/Report/Views/Reporting/InventoryReport.cshtml b/Areas/Report/Views/Reporting/InventoryReport.cshtml index 53b50ee..d513fc8 100644 --- a/Areas/Report/Views/Reporting/InventoryReport.cshtml +++ b/Areas/Report/Views/Reporting/InventoryReport.cshtml @@ -101,13 +101,32 @@
-
+

User List

-
- {{ selectedUser }} +
+
+
+ + + + + + + + + + + + + + + + + +
Item NameItem Price
{{item.itemName}}{{item.itemPrice}}
Total{{selectedUser.totalItemPrice}}
@@ -159,7 +178,8 @@ usersInfo: [], submitBody: null, formResponse: null, - selectedUser: [], + selectedUser: {}, + userItemsTable:null, } }, mounted() { @@ -174,7 +194,15 @@ }, selectedCategory() { this.filterProducts(); + }, + }, + computed: { + userItemsTableCompt() { + if (!this.selectedUser || !this.$refs.userItemsTable) { + return null; } + return $(this.$refs.userItemsTable).DataTable(); + } }, methods: { async generateReport(){ @@ -334,7 +362,24 @@ selectedCategory.includes(product.category) ); } - } + }, + initUserItemsTable() { + this.$nextTick(() => { + if (this.$refs.userItemsTable) { + $(this.$refs.userItemsTable).DataTable().clear().destroy(); + } + this.userItemsTable = $('#userItemsTable').DataTable(); + }); + }, + // selectedUserFunc() { + // if (this.userItemsTable) { + // this.userItemsTable.destroy(); + // } + // if (this.selectedUser.length > 0) { + // console.log("YES") + // this.initUserItemsTable(); + // } + // } }, });