|
|
@@ -47,6 +47,7 @@
|
|
|
description="contas"
|
|
|
:female="true"
|
|
|
:columns="columns"
|
|
|
+ :actions="tableActions"
|
|
|
@on-add-item="handleAddItem"
|
|
|
/>
|
|
|
<DefaultTable
|
|
|
@@ -65,7 +66,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { ref } from "vue";
|
|
|
+import { ref, onMounted } from "vue";
|
|
|
+import api from "src/api";
|
|
|
import DefaultHeaderPage from "src/components/layout/DefaultHeaderPage.vue";
|
|
|
import DefaultTable from "src/components/defaults/DefaultTable.vue";
|
|
|
import FinancialCard from "src/components/financial/FinancialCard.vue";
|
|
|
@@ -74,12 +76,26 @@ const showMovimentacoes = ref(false);
|
|
|
const rows = ref([]);
|
|
|
const movimentacoesRows = ref([]);
|
|
|
|
|
|
+// Para controlar as Actions e o Link do Asaas
|
|
|
+const tableActions = [
|
|
|
+ {
|
|
|
+ label: "Ver Boleto/Pix",
|
|
|
+ icon: "mdi-barcode",
|
|
|
+ color: "primary",
|
|
|
+ onClick: (row) => {
|
|
|
+ if (row.invoice_url) window.open(row.invoice_url, "_blank");
|
|
|
+ else alert("Ainda não possui link de cobrança gerado no Asaas.");
|
|
|
+ },
|
|
|
+ },
|
|
|
+];
|
|
|
+
|
|
|
const columns = [
|
|
|
- { name: "description", label: "Descrição", field: "description", align: "left" },
|
|
|
- { name: "category", label: "Categoria", field: "category", align: "left" },
|
|
|
- { name: "value", label: "Valor", field: "value", align: "left" },
|
|
|
+ { name: "history", label: "Descrição", field: "history", align: "left" },
|
|
|
+ { name: "type", label: "Categoria", field: "type", align: "left" },
|
|
|
+ { name: "value", label: "Valor", field: "value", align: "left", format: val => `R$ ${val}` },
|
|
|
{ name: "due_date", label: "Vencimento", field: "due_date", align: "left" },
|
|
|
{ name: "status", label: "Status", field: "status", align: "left" },
|
|
|
+ { name: "actions", label: "Ações", field: "actions", align: "right" }
|
|
|
];
|
|
|
|
|
|
const movimentacoesColumns = [
|
|
|
@@ -89,5 +105,18 @@ const movimentacoesColumns = [
|
|
|
{ name: "status", label: "Status", field: "status", align: "left" },
|
|
|
];
|
|
|
|
|
|
+const loadData = async () => {
|
|
|
+ try {
|
|
|
+ const res = await api.get('/franchisee-receivable');
|
|
|
+ rows.value = res.data.payload;
|
|
|
+ } catch (error) {
|
|
|
+ console.error("Erro ao buscar contas a receber:", error);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ loadData();
|
|
|
+});
|
|
|
+
|
|
|
const handleAddItem = () => {};
|
|
|
</script>
|