|
@@ -1,33 +1,30 @@
|
|
|
<template>
|
|
<template>
|
|
|
<DefaultTable
|
|
<DefaultTable
|
|
|
- v-model:rows="rows"
|
|
|
|
|
:columns="columns"
|
|
:columns="columns"
|
|
|
- title="Contratos TBR"
|
|
|
|
|
- description="contratos"
|
|
|
|
|
- :female="false"
|
|
|
|
|
- :no-api-call="true"
|
|
|
|
|
|
|
+ :api-call="loadContracts"
|
|
|
:show-search-field="true"
|
|
:show-search-field="true"
|
|
|
|
|
+ :female="false"
|
|
|
|
|
+ title="Contratos"
|
|
|
|
|
+ description="contratos"
|
|
|
>
|
|
>
|
|
|
- <template #body-cell-tbr_value="{ row }">
|
|
|
|
|
- <q-td>{{ formatToBRLCurrency(row.tbr_value) }}</q-td>
|
|
|
|
|
|
|
+ <template #body-cell-tbr_fixed_value="{ row }">
|
|
|
|
|
+ <q-td>{{ formatToBRLCurrency(row.tbr_fixed_value) }}</q-td>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<template #body-cell-royalties="{ row }">
|
|
<template #body-cell-royalties="{ row }">
|
|
|
- <q-td>{{ formatPercentage(row.base_royalties_percentage) }}</q-td>
|
|
|
|
|
|
|
+ <q-td>{{ formatPercentage(row.tbr_fixed_value_percentage) }}</q-td>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<template #body-cell-fnm="{ row }">
|
|
<template #body-cell-fnm="{ row }">
|
|
|
- <q-td>{{ formatPercentage(row.base_fnm_percentage) }}</q-td>
|
|
|
|
|
|
|
+ <q-td>{{ formatPercentage(row.marketing_fund_percentage) }}</q-td>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<template #body-cell-maintenance="{ row }">
|
|
<template #body-cell-maintenance="{ row }">
|
|
|
- <q-td>{{ formatPercentage(row.maintenance_percentage) }}</q-td>
|
|
|
|
|
|
|
+ <q-td>{{ formatPercentage(row.maintance_tax_percentage) }}</q-td>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<template #body-cell-ref_month="{ row }">
|
|
<template #body-cell-ref_month="{ row }">
|
|
|
- <q-td>{{
|
|
|
|
|
- formatRefMonth(row.contract_month_current, row.contract_validity_months)
|
|
|
|
|
- }}</q-td>
|
|
|
|
|
|
|
+ <q-td>{{ formatRefMonth(row.contract_month_current, row.validity_months) }}</q-td>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<template #body-cell-actions>
|
|
<template #body-cell-actions>
|
|
@@ -39,36 +36,20 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { ref, onMounted } from "vue";
|
|
|
|
|
import DefaultTable from "src/components/defaults/DefaultTable.vue";
|
|
import DefaultTable from "src/components/defaults/DefaultTable.vue";
|
|
|
-import { getFranchiseeTbrs } from "src/api/tbr";
|
|
|
|
|
|
|
+import { getActiveFranchiseeContracts } from "src/api/franchisee_contract";
|
|
|
import { formatToBRLCurrency, formatPercentage } from "src/helpers/utils";
|
|
import { formatToBRLCurrency, formatPercentage } from "src/helpers/utils";
|
|
|
|
|
|
|
|
-const rows = ref([]);
|
|
|
|
|
|
|
+const loadContracts = () => getActiveFranchiseeContracts();
|
|
|
|
|
|
|
|
const columns = [
|
|
const columns = [
|
|
|
- { name: "id", label: "ID", field: "id", align: "left" },
|
|
|
|
|
|
|
+ { name: "protocol", label: "ID", field: "protocol", align: "left" },
|
|
|
{ name: "unit_name", label: "Unidade", field: "unit_name", align: "left" },
|
|
{ name: "unit_name", label: "Unidade", field: "unit_name", align: "left" },
|
|
|
- { name: "tbr_value", label: "TBR", field: "tbr_value", align: "left" },
|
|
|
|
|
- {
|
|
|
|
|
- name: "royalties",
|
|
|
|
|
- label: "Royalties",
|
|
|
|
|
- field: "base_royalties_percentage",
|
|
|
|
|
- align: "left",
|
|
|
|
|
- },
|
|
|
|
|
- { name: "fnm", label: "FNM", field: "base_fnm_percentage", align: "left" },
|
|
|
|
|
- {
|
|
|
|
|
- name: "maintenance",
|
|
|
|
|
- label: "Manutenção",
|
|
|
|
|
- field: "maintenance_percentage",
|
|
|
|
|
- align: "left",
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: "ref_month",
|
|
|
|
|
- label: "Ref. Mês",
|
|
|
|
|
- field: "contract_month_current",
|
|
|
|
|
- align: "left",
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ { name: "tbr_fixed_value", label: "TBR", field: "tbr_fixed_value", align: "left" },
|
|
|
|
|
+ { name: "royalties", label: "Royalties", field: "tbr_fixed_value_percentage", align: "left" },
|
|
|
|
|
+ { name: "fnm", label: "FNM", field: "marketing_fund_percentage", align: "left" },
|
|
|
|
|
+ { name: "maintenance", label: "Manutenção", field: "maintance_tax_percentage", align: "left" },
|
|
|
|
|
+ { name: "ref_month", label: "Ref. Mês", field: "contract_month_current", align: "left" },
|
|
|
{ name: "actions", label: "Ações", field: "actions", align: "center" },
|
|
{ name: "actions", label: "Ações", field: "actions", align: "center" },
|
|
|
];
|
|
];
|
|
|
|
|
|
|
@@ -77,11 +58,4 @@ function formatRefMonth(current, total) {
|
|
|
const pad = (n) => String(n).padStart(2, "0");
|
|
const pad = (n) => String(n).padStart(2, "0");
|
|
|
return `${pad(current)}/${pad(total)}`;
|
|
return `${pad(current)}/${pad(total)}`;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-async function loadData() {
|
|
|
|
|
- const result = await getFranchiseeTbrs();
|
|
|
|
|
- rows.value = result?.data ?? result ?? [];
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-onMounted(loadData);
|
|
|
|
|
</script>
|
|
</script>
|