{{ user.firstName }}
-
+
@@ -74,42 +74,6 @@ const items = ref([
label: 'Бюджеты',
icon: 'pi pi-briefcase',
url: '/budgets'
- // items: [
- // {
- // label: 'Core',
- // icon: 'pi pi-bolt',
- // shortcut: '⌘+S'
- // },
- // {
- // label: 'Blocks',
- // icon: 'pi pi-server',
- // shortcut: '⌘+B'
- // },
- // {
- // label: 'UI Kit',
- // icon: 'pi pi-pencil',
- // shortcut: '⌘+U'
- // },
- // {
- // separator: true
- // },
- // {
- // label: 'Templates',
- // icon: 'pi pi-palette',
- // items: [
- // {
- // label: 'Apollo',
- // icon: 'pi pi-palette',
- // badge: 2
- // },
- // {
- // label: 'Ultima',
- // icon: 'pi pi-palette',
- // badge: 3
- // }
- // ]
- // }
- // ]
},
{
label: 'Транзакции',
diff --git a/src/components/budgets/BudgetView2.vue b/src/components/budgets/BudgetView2.vue
index 9bb9700..ed1c441 100644
--- a/src/components/budgets/BudgetView2.vue
+++ b/src/components/budgets/BudgetView2.vue
@@ -1,5 +1,5 @@
@@ -640,18 +655,8 @@ onMounted(async () => {
-
-
+
+
Бюджет {{ budget.name }}
@@ -890,6 +895,7 @@ onMounted(async () => {
{{
category.name.category.name
}} {{ category.name.icon }}
+
{{
@@ -930,7 +936,7 @@ onMounted(async () => {
Расходы
-
@@ -939,10 +945,15 @@ onMounted(async () => {
class="flex flex-col justify-between p-4 shadow-lg rounded-lg bg-white ">
-
{{
+
+
{{
category.name.category.icon
}} {{ category.name.category.name }}
-
+
+
+
+
+
{{ formatAmount(category.name.currentSpent) }}
/
@@ -1030,6 +1041,7 @@ onMounted(async () => {
+
{
-
+
+
+
+
diff --git a/src/components/transactions/TransactionForm.vue b/src/components/transactions/TransactionForm.vue
index 300a509..77ab8b7 100644
--- a/src/components/transactions/TransactionForm.vue
+++ b/src/components/transactions/TransactionForm.vue
@@ -2,14 +2,14 @@
-
-
@@ -31,6 +31,7 @@ const props = defineProps({
},
transactionType: String,
categoryType: String,
+ categoryId: String,
})
const isDesktop = ref(window.innerWidth >= 1024);
diff --git a/src/components/transactions/TransactionFormContent.vue b/src/components/transactions/TransactionFormContent.vue
index 1a4538a..308af26 100644
--- a/src/components/transactions/TransactionFormContent.vue
+++ b/src/components/transactions/TransactionFormContent.vue
@@ -6,7 +6,7 @@ import InputNumber from "primevue/inputnumber";
import Button from "primevue/button";
import {ref, onMounted, computed, nextTick} from 'vue';
import {Transaction, TransactionType} from "@/models/Transaction";
-import {CategoryType} from "@/models/Category";
+import {Category, CategoryType} from "@/models/Category";
import SelectButton from "primevue/selectbutton";
import Select from "primevue/select";
import platform from 'platform';
@@ -38,6 +38,10 @@ const props = defineProps({
categoryType: {
type: String,
required: false
+ },
+ categoryId: {
+ type: String,
+ required: false
}
});
@@ -62,6 +66,7 @@ const editedTransaction = ref
(null);
const selectedCategoryType = ref(null);
const selectedTransactionType = ref(null);
+const selectedCategory = ref(null);
const entireCategories = ref([]);
const expenseCategories = ref([]);
@@ -118,7 +123,10 @@ const prepareData = () => {
editedTransaction.value = new Transaction();
editedTransaction.value.type = transactionTypes.value.find(type => type.code === props.transactionType) || transactionTypes.value[0];
selectedCategoryType.value = categoryTypes.value.find(type => type.code === props.categoryType) || categoryTypes.value[0];
- editedTransaction.value.category = props.categoryType === 'EXPENSE' ? expenseCategories.value[0] : incomeCategories.value[0];
+ console.log("hui " + props.categoryId)
+ entireCategories.value.find(category => category.id == props.categoryId ) ? entireCategories.value.find(category => category.id == props.categoryId ) : props.categoryType === 'EXPENSE' ? expenseCategories.value[0] : incomeCategories.value[0]
+ editedTransaction.value.category = entireCategories.value.find(category => category.id == props.categoryId ) ? entireCategories.value.find(category => category.id == props.categoryId ) : props.categoryType === 'EXPENSE' ? expenseCategories.value[0] : incomeCategories.value[0]
+ // editedTransaction.value.category = props.categoryType === 'EXPENSE' ? expenseCategories.value[0] : incomeCategories.value[0];
editedTransaction.value.date = new Date();
} else {
editedTransaction.value = {...props.transaction};
@@ -218,7 +226,7 @@ const createTransaction = async (): Promise => {
const transactionsUpdatedEmit = async () => {
await getTransactions('INSTANT', 'EXPENSE', null, user.value.id, false, 3).then(transactionsResponse => transactions.value = transactionsResponse.data);
-
+ console.log("here created ")
EventBus.emit('transactions-updated', true)
}
diff --git a/src/stores/drawerStore.ts b/src/stores/drawerStore.ts
index f0b7e1c..85052a3 100644
--- a/src/stores/drawerStore.ts
+++ b/src/stores/drawerStore.ts
@@ -5,6 +5,7 @@ export const useDrawerStore = defineStore('drawer', () => {
const visible = ref(false);
const transactionType = ref(null)
const categoryType = ref(null)
+ const categoryId = ref(null)
const setVisible = (isVisible: boolean) => {
visible.value = isVisible;
@@ -17,6 +18,12 @@ export const useDrawerStore = defineStore('drawer', () => {
const setCategoryType = (type: string) => {
categoryType.value = type;
}
- return {visible, transactionType, categoryType, setTransactionType, setCategoryType, setVisible}
+
+ const setCategoryId = (id: string|null) => {
+ categoryId.value = id
+ }
+
+
+ return {visible, transactionType, categoryType, categoryId, setTransactionType, setCategoryType, setVisible, setCategoryId};
})
\ No newline at end of file