Przeglądaj źródła

feat: corrige campos faltantes e adiciona datas corretas

ebagabee 1 miesiąc temu
rodzic
commit
04f59bd305

+ 14 - 14
src/components/defaults/DefaultInputDatePicker.vue

@@ -117,8 +117,19 @@ watch(date, (value) => {
   treatedDate.value = formatDate(value);
 });
 
+watch(treatedDate, (value) => {
+  if (!value) {
+    date.value = null;
+    untreatedDate.value = null;
+    treatedDate.value = null;
+    activePanel.value = "date";
+    return;
+  }
+  date.value = unformatDate(value);
+});
+
 watch(
-  treatedDate,
+  untreatedDate,
   (value) => {
     if (!value) {
       date.value = null;
@@ -127,20 +138,9 @@ watch(
       activePanel.value = "date";
       return;
     }
-    date.value = unformatDate(value);
+    date.value = value;
+    treatedDate.value = formatDate(value);
   },
   { immediate: true },
 );
-
-watch(untreatedDate, (value) => {
-  if (!value) {
-    date.value = null;
-    untreatedDate.value = null;
-    treatedDate.value = null;
-    activePanel.value = "date";
-    return;
-  }
-  date.value = value;
-  treatedDate.value = formatDate(value);
-});
 </script>

+ 9 - 0
src/pages/unit/components/ViewContractDialog.vue

@@ -265,6 +265,15 @@ const historyColumns = [
     field: "tbr_fixed_value",
     align: "left",
   },
+  {
+    name: "tbr_fixed_value_percentage",
+    label: "Royalties",
+    field: (row) =>
+      row.tbr_fixed_value_percentage != null
+        ? `${(row.tbr_fixed_value_percentage * 100).toFixed(0)}%`
+        : "-",
+    align: "left",
+  },
   {
     name: "marketing_fund_percentage",
     label: "FNM",

+ 58 - 0
src/pages/unit/tabs/ContractsTab.vue

@@ -21,6 +21,40 @@
         <q-td>{{ formatToBRLCurrency(row.tbr_fixed_value) }}</q-td>
       </template>
 
+      <template #body-cell-royalties="{ row }">
+        <q-td>
+          {{
+            row.tbr_fixed_value_percentage != null
+              ? `${(row.tbr_fixed_value_percentage * 100).toFixed(2)}%`
+              : "-"
+          }}
+        </q-td>
+      </template>
+
+      <template #body-cell-fnm="{ row }">
+        <q-td>
+          {{
+            row.marketing_fund_percentage != null
+              ? `${(row.marketing_fund_percentage * 100).toFixed(2)}%`
+              : "-"
+          }}
+        </q-td>
+      </template>
+
+      <template #body-cell-maintenance="{ row }">
+        <q-td>
+          {{
+            row.maintance_tax_percentage != null
+              ? `${(row.maintance_tax_percentage * 100).toFixed(2)}%`
+              : "-"
+          }}
+        </q-td>
+      </template>
+
+      <template #body-cell-inhabitant_classification="{ row }">
+        <q-td>{{ row.inhabitant_classification?.description ?? "-" }}</q-td>
+      </template>
+
       <template #body-cell-actions="{ row: contract }">
         <q-td align="center">
           <q-btn
@@ -86,6 +120,30 @@ const columns = [
     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: "Taxa de Manutenção",
+    field: "maintance_tax_percentage",
+    align: "left",
+  },
+  {
+    name: "inhabitant_classification",
+    label: "Faixa de Habitantes",
+    field: "inhabitant_classification",
+    align: "left",
+  },
   {
     name: "actions",
     label: "Ações",