Parcourir la source

style: correcao de data e valor monetario

ebagabee il y a 1 mois
Parent
commit
b54df26e10
2 fichiers modifiés avec 17 ajouts et 2 suppressions
  1. 11 1
      src/pages/tbr/tabs/ContractsTab.vue
  2. 6 1
      src/pages/unit/tabs/ContractsTab.vue

+ 11 - 1
src/pages/tbr/tabs/ContractsTab.vue

@@ -7,6 +7,14 @@
     title="Contratos"
     description="contratos"
   >
+    <template #body-cell-start_date="{ row }">
+      <q-td>{{ formatDateYMDtoDMY(row.start_date) }}</q-td>
+    </template>
+
+    <template #body-cell-end_date="{ row }">
+      <q-td>{{ formatDateYMDtoDMY(row.end_date) }}</q-td>
+    </template>
+
     <template #body-cell-tbr_fixed_value="{ row }">
       <q-td>{{ formatToBRLCurrency(row.tbr_fixed_value) }}</q-td>
     </template>
@@ -38,13 +46,15 @@
 <script setup>
 import DefaultTable from "src/components/defaults/DefaultTable.vue";
 import { getActiveFranchiseeContracts } from "src/api/franchisee_contract";
-import { formatToBRLCurrency, formatPercentage } from "src/helpers/utils";
+import { formatToBRLCurrency, formatPercentage, formatDateYMDtoDMY } from "src/helpers/utils";
 
 const loadContracts = () => getActiveFranchiseeContracts();
 
 const columns = [
   { name: "protocol", label: "ID", field: "protocol", align: "left" },
   { name: "unit_name", label: "Unidade", field: "unit_name", align: "left" },
+  { name: "start_date", label: "Data Inicial", field: "start_date", align: "left" },
+  { name: "end_date", label: "Data Final", field: "end_date", 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" },

+ 6 - 1
src/pages/unit/tabs/ContractsTab.vue

@@ -12,7 +12,11 @@
       @on-add-item="openCreateDialog"
     >
       <template #body-cell-contract_dates="{ row }">
-        <q-td>{{ row.start_date }} - {{ row.end_date }}</q-td>
+        <q-td>{{ formatDateYMDtoDMY(row.start_date) }} - {{ formatDateYMDtoDMY(row.end_date) }}</q-td>
+      </template>
+
+      <template #body-cell-tbr_fixed_value="{ row }">
+        <q-td>{{ formatToBRLCurrency(row.tbr_fixed_value) }}</q-td>
       </template>
 
       <template #body-cell-actions="{ row: contract }">
@@ -50,6 +54,7 @@ import {
   getFranchiseeContractsByUnit,
   deleteFranchiseeContract,
 } from "src/api/franchisee_contract";
+import { formatDateYMDtoDMY, formatToBRLCurrency } from "src/helpers/utils";
 
 const CreateContractDialog = defineAsyncComponent(
   () => import("src/pages/unit/components/CreateContractDialog.vue"),