Prechádzať zdrojové kódy

feat: adiciona dados em tbr

ebagabee 1 mesiac pred
rodič
commit
53d0641eb9
2 zmenil súbory, kde vykonal 9 pridanie a 1 odobranie
  1. 5 0
      src/api/tbr.js
  2. 4 1
      src/pages/tbr/tabs/BillingsTab.vue

+ 5 - 0
src/api/tbr.js

@@ -24,3 +24,8 @@ export const getFranchiseeTbrs = async () => {
   const { data } = await api.get("/franchisee-tbr");
   return data.payload;
 };
+
+export const getTbrBillingPreview = async () => {
+  const { data } = await api.get("/tbr-billing-preview");
+  return data.payload;
+};

+ 4 - 1
src/pages/tbr/tabs/BillingsTab.vue

@@ -2,7 +2,7 @@
   <DefaultTable
     v-model:rows="rows"
     :columns="columns"
-    :no-api-call="true"
+    :api-call="loadBillings"
     :show-search-field="true"
     :add-item="true"
     add-item-label="Gerar Cobranças"
@@ -72,6 +72,7 @@ import { useQuasar } from "quasar";
 import DefaultTable from "src/components/defaults/DefaultTable.vue";
 import DefaultInput from "src/components/defaults/DefaultInput.vue";
 import GenerateBillingsDialog from "src/pages/tbr/components/GenerateBillingsDialog.vue";
+import { getTbrBillingPreview } from "src/api/tbr";
 import { formatToBRLCurrency } from "src/helpers/utils";
 
 const $q = useQuasar();
@@ -92,6 +93,8 @@ const columns = [
   { name: "actions", label: "Ações", field: "actions", align: "center" },
 ];
 
+const loadBillings = () => getTbrBillingPreview();
+
 function onMonthYearSelect(value) {
   if (!value) return;
   monthYearDisplay.value = value;