Initial commit: ROA2WEB - FastAPI + Vue.js + Telegram Bot
Modern ERP Reports Application with microservices architecture Tech Stack: - Backend: FastAPI + python-oracledb (Oracle DB integration) - Frontend: Vue.js 3 + PrimeVue + Vite - Telegram Bot: python-telegram-bot + SQLite - Infrastructure: Shared database pool, JWT authentication, SSH tunnel Features: - FastAPI backend with async Oracle connection pool - Vue.js 3 responsive frontend with PrimeVue components - Telegram bot alternative interface - Microservices architecture with shared components - Complete deployment support (Linux Docker + Windows IIS) - Comprehensive testing (Playwright E2E + pytest) Repository Structure: - reports-app/ - Main application (backend, frontend, telegram-bot) - shared/ - Shared components (database pool, auth, utils) - deployment/ - Deployment scripts (Linux & Windows) - docs/ - Project documentation - security/ - Security scanning and git hooks
This commit is contained in:
77
reports-app/frontend/src/stores/treasury.js
Normal file
77
reports-app/frontend/src/stores/treasury.js
Normal file
@@ -0,0 +1,77 @@
|
||||
import { defineStore } from "pinia";
|
||||
import { ref } from "vue";
|
||||
import { apiService } from "../services/api";
|
||||
|
||||
export const useTreasuryStore = defineStore("treasury", () => {
|
||||
const registers = ref([]);
|
||||
const isLoading = ref(false);
|
||||
const error = ref(null);
|
||||
const pagination = ref({
|
||||
page: 0,
|
||||
rows: 50,
|
||||
totalRecords: 0,
|
||||
});
|
||||
const totals = ref({
|
||||
total_incasari: 0,
|
||||
total_plati: 0
|
||||
});
|
||||
|
||||
const loadBankCashRegister = async (companyId, filters = {}) => {
|
||||
isLoading.value = true;
|
||||
error.value = null;
|
||||
|
||||
try {
|
||||
const params = {
|
||||
company: companyId,
|
||||
page: pagination.value.page + 1,
|
||||
page_size: pagination.value.rows,
|
||||
...filters
|
||||
};
|
||||
|
||||
const response = await apiService.get('/treasury/bank-cash-register', {
|
||||
params
|
||||
});
|
||||
|
||||
registers.value = response.data.registers || [];
|
||||
pagination.value.totalRecords = response.data.total_count || 0;
|
||||
totals.value = {
|
||||
total_incasari: response.data.total_incasari,
|
||||
total_plati: response.data.total_plati
|
||||
};
|
||||
|
||||
return { success: true };
|
||||
} catch (err) {
|
||||
error.value = err.response?.data?.detail || "Failed to load register";
|
||||
console.error("Failed to load register:", err);
|
||||
return { success: false, error: error.value };
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const setPagination = (newPagination) => {
|
||||
pagination.value = { ...pagination.value, ...newPagination };
|
||||
};
|
||||
|
||||
const reset = () => {
|
||||
registers.value = [];
|
||||
isLoading.value = false;
|
||||
error.value = null;
|
||||
pagination.value = {
|
||||
page: 0,
|
||||
rows: 50,
|
||||
totalRecords: 0,
|
||||
};
|
||||
};
|
||||
|
||||
return {
|
||||
registers,
|
||||
isLoading,
|
||||
error,
|
||||
pagination,
|
||||
totals,
|
||||
loadBankCashRegister,
|
||||
setPagination,
|
||||
reset
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user