From 561025d646c5d72829f2ce667f1cbb6c46a35c97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Sat, 17 Apr 2021 23:48:28 +0200 Subject: [PATCH] [balance] modify balance transfer in admin page --- .../balance/components/BalanceTransfer.vue | 41 +--------- .../components/BalanceTransferBody.vue | 82 +++++++++++++++++++ src/plugins/balance/pages/Admin.vue | 38 ++++++++- 3 files changed, 120 insertions(+), 41 deletions(-) create mode 100644 src/plugins/balance/components/BalanceTransferBody.vue diff --git a/src/plugins/balance/components/BalanceTransfer.vue b/src/plugins/balance/components/BalanceTransfer.vue index fdfe0f5..a66878b 100644 --- a/src/plugins/balance/components/BalanceTransfer.vue +++ b/src/plugins/balance/components/BalanceTransfer.vue @@ -3,21 +3,7 @@ -
- -
-
- -
-
- -
+
@@ -25,37 +11,20 @@ + + diff --git a/src/plugins/balance/pages/Admin.vue b/src/plugins/balance/pages/Admin.vue index 398c3ac..65e2bc0 100644 --- a/src/plugins/balance/pages/Admin.vue +++ b/src/plugins/balance/pages/Admin.vue @@ -26,9 +26,31 @@ {{ getBalance(props.row.debit, props.row.credit) }}€ - - + + + + + + + + + + + + + @@ -46,9 +68,10 @@ import { ref, defineComponent, computed, onBeforeMount } from 'vue'; import { useBalanceStore } from '../store'; import { useUserStore } from 'src/plugins/user/store'; import BalanceAddBody from 'src/plugins/balance/components/BalanceAddBody.vue'; +import BalanceTransferBody from 'src/plugins/balance/components/BalanceTransferBody.vue'; export default defineComponent({ - components: { BalanceAddBody }, + components: { BalanceTransferBody, BalanceAddBody }, // name: 'PageName' setup() { const store = useBalanceStore(); @@ -116,6 +139,13 @@ export default defineComponent({ void store.getBalance(user); } + function updateBalances(sender: FG.User, receiver: FG.User) { + updateBalance(sender); + updateBalance(receiver); + } + + const tab = ref('add'); + return { rows, columns, @@ -125,6 +155,8 @@ export default defineComponent({ getLimit, getBalance, updateBalance, + updateBalances, + tab, }; }, });