|
@@ -27,8 +27,8 @@
|
|
|
|
|
|
|
|
<template #body-cell-price_range="template_props">
|
|
<template #body-cell-price_range="template_props">
|
|
|
<q-td :props="template_props">
|
|
<q-td :props="template_props">
|
|
|
- {{ formatCurrency(template_props.row.min_price) }}
|
|
|
|
|
- {{ formatCurrency(template_props.row.max_price) }}
|
|
|
|
|
|
|
+ {{ formatToBRLCurrency(template_props.row.min_price) }}
|
|
|
|
|
+ {{ formatToBRLCurrency(template_props.row.max_price) }}
|
|
|
</q-td>
|
|
</q-td>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -47,6 +47,7 @@ import { useQuasar } from 'quasar'
|
|
|
import { getCustomSchedules, deleteCustomSchedule } from 'src/api/customSchedule'
|
|
import { getCustomSchedules, deleteCustomSchedule } from 'src/api/customSchedule'
|
|
|
import DefaultTable from 'src/components/defaults/DefaultTable.vue'
|
|
import DefaultTable from 'src/components/defaults/DefaultTable.vue'
|
|
|
import AddEditCustomScheduleDialog from './components/AddEditCustomScheduleDialog.vue'
|
|
import AddEditCustomScheduleDialog from './components/AddEditCustomScheduleDialog.vue'
|
|
|
|
|
+import { formatToBRLCurrency } from 'src/helpers/utils'
|
|
|
|
|
|
|
|
const { t } = useI18n()
|
|
const { t } = useI18n()
|
|
|
const $q = useQuasar()
|
|
const $q = useQuasar()
|
|
@@ -58,7 +59,7 @@ const columns = computed(() => [
|
|
|
name: 'id',
|
|
name: 'id',
|
|
|
label: 'ID',
|
|
label: 'ID',
|
|
|
align: 'left',
|
|
align: 'left',
|
|
|
- field: 'id',
|
|
|
|
|
|
|
+ field: row => row.schedule?.id,
|
|
|
sortable: true
|
|
sortable: true
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
@@ -86,21 +87,21 @@ const columns = computed(() => [
|
|
|
name: 'period',
|
|
name: 'period',
|
|
|
label: t('opportunities.period'),
|
|
label: t('opportunities.period'),
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
- field: row => row.schedule?.period_type,
|
|
|
|
|
|
|
+ field: row => row.schedule?.period_type + ' h',
|
|
|
sortable: true
|
|
sortable: true
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
name: 'price_range',
|
|
name: 'price_range',
|
|
|
label: t('opportunities.price_range'),
|
|
label: t('opportunities.price_range'),
|
|
|
align: 'right',
|
|
align: 'right',
|
|
|
- field: row => `${row.min_price} - ${row.max_price}`,
|
|
|
|
|
|
|
+ field: row => `${formatToBRLCurrency(row.min_price)} - ${formatToBRLCurrency(row.max_price)}`,
|
|
|
sortable: false
|
|
sortable: false
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
name: 'status',
|
|
name: 'status',
|
|
|
label: t('common.terms.status'),
|
|
label: t('common.terms.status'),
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
- field: row => row.schedule?.status,
|
|
|
|
|
|
|
+ field: row => t(`schedules.statuses.${row.schedule?.status}`),
|
|
|
sortable: true
|
|
sortable: true
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
@@ -124,13 +125,6 @@ const getStatusColor = (status) => {
|
|
|
return colors[status] || 'grey'
|
|
return colors[status] || 'grey'
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const formatCurrency = (value) => {
|
|
|
|
|
- return new Intl.NumberFormat('pt-BR', {
|
|
|
|
|
- style: 'currency',
|
|
|
|
|
- currency: 'BRL'
|
|
|
|
|
- }).format(value)
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
const onAddItem = () => {
|
|
const onAddItem = () => {
|
|
|
$q.dialog({
|
|
$q.dialog({
|
|
|
component: AddEditCustomScheduleDialog,
|
|
component: AddEditCustomScheduleDialog,
|