add: translations in carriers & public users
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
import Swal from 'sweetalert2';
|
||||
import { getDateMonthDayEs } from '../helpers/date_formats';
|
||||
import { useVehiclesStore } from '../stores/vehicles';
|
||||
import { useAuthStore } from '../stores/auth';
|
||||
import { useAuthStore } from '../stores/auth';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
const props = defineProps({
|
||||
vehicle: {
|
||||
@@ -13,6 +14,8 @@ import { useAuthStore } from '../stores/auth';
|
||||
console.log(props.vehicle);
|
||||
defineEmits(['set-vehicle']);
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const vehicleStore = useVehiclesStore();
|
||||
const authStore = useAuthStore();
|
||||
|
||||
@@ -23,12 +26,12 @@ import { useAuthStore } from '../stores/auth';
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
cancelButtonColor: "#d33",
|
||||
confirmButtonText: 'Eliminar',
|
||||
cancelButtonText: 'Cancelar',
|
||||
confirmButtonText: t('buttons.delete'),
|
||||
cancelButtonText: t('buttons.cancel'),
|
||||
}).then(async(result) => {
|
||||
if(result.isConfirmed) {
|
||||
Swal.fire({
|
||||
title: 'Por favor espere!',
|
||||
title: t('messages.loading'),
|
||||
html: 'Eliminando vehiculo...',// add html attribute if you want or remove
|
||||
allowOutsideClick: false,
|
||||
didOpen: () => {
|
||||
@@ -62,14 +65,14 @@ import { useAuthStore } from '../stores/auth';
|
||||
<div class="card-fixed card-vehicle">
|
||||
<div class="row my-2">
|
||||
<div class="col-lg-6">
|
||||
<p>Código: <span>{{ vehicle?.vehicle_code }}</span></p>
|
||||
<p>Tipo de transporte: <span>{{ vehicle.truck_type }}</span></p>
|
||||
<p>Número de Serie: <span>{{ vehicle.vehicle_number }}</span></p>
|
||||
<p>Segmento: <span>{{vehicle.categories?.map((e) => e.name).join(', ')}}</span></p>
|
||||
<p>Conductor:
|
||||
<p>{{ t('labels.codeId') }}: <span>{{ vehicle?.vehicle_code }}</span></p>
|
||||
<p>{{ t('directory.typeTruck') }}: <span>{{ vehicle.truck_type }}</span></p>
|
||||
<p>{{ t('vehicles.serialNumber') }}: <span>{{ vehicle.vehicle_number }}</span></p>
|
||||
<p>{{ t('global.segment') }}: <span>{{vehicle.categories?.map((e) => e.name).join(', ')}}</span></p>
|
||||
<p>{{ t('labels.driver') }}:
|
||||
<span>
|
||||
<span v-if="vehicle?.driver">{{ vehicle?.driver?.first_name }} {{ vehicle?.driver?.last_name }} </span>
|
||||
<span v-else>No asignado </span>
|
||||
<span v-else>{{ t('vehicles.noDriver') }} </span>
|
||||
<i
|
||||
class="fa-solid fa-pen-to-square icon-btn"
|
||||
data-toggle="modal"
|
||||
@@ -78,15 +81,15 @@ import { useAuthStore } from '../stores/auth';
|
||||
</i>
|
||||
</span>
|
||||
</p>
|
||||
<p v-if="vehicle.is_available">Disponible en: <span>{{ vehicle.destino }}</span></p>
|
||||
<p v-if="vehicle.is_available">{{ t('vehicles.availableIn') }}: <span>{{ vehicle.destino }}</span></p>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<p>Placas Tracto Camión: <span>{{ vehicle.circulation_serial_number }}</span></p>
|
||||
<p>Placas Remolque 1: <span>{{ vehicle.trailer_plate_1 }}</span></p>
|
||||
<p>Placas Remolque 2: <span>{{ vehicle.trailer_plate_2 }}</span></p>
|
||||
<p>Base de carga: <span>{{ vehicle.city }}, {{ vehicle.state }}</span></p>
|
||||
<p>{{ t('vehicles.truckPlates') }}: <span>{{ vehicle.circulation_serial_number }}</span></p>
|
||||
<p>{{ t('vehicles.trailerPlates') }} 1: <span>{{ vehicle.trailer_plate_1 }}</span></p>
|
||||
<p>{{ t('vehicles.trailerPlates') }} 2: <span>{{ vehicle.trailer_plate_2 }}</span></p>
|
||||
<p>{{ t('vehicles.chargingBase') }}: <span>{{ vehicle.city }}, {{ vehicle.state }}</span></p>
|
||||
<p>Status:
|
||||
<span>{{ vehicle.is_available ? 'Disponible' : 'Reservado'}}
|
||||
<span>{{ vehicle.is_available ? t('vehicles.available') : t('vehicles.reserved')}}
|
||||
<i
|
||||
class="fa-solid fa-pen-to-square icon-btn"
|
||||
data-toggle="modal"
|
||||
@@ -95,10 +98,10 @@ import { useAuthStore } from '../stores/auth';
|
||||
</i>
|
||||
</span>
|
||||
</p>
|
||||
<p v-if="vehicle.is_available">Fecha Disponible: <span>{{ getDateMonthDayEs(vehicle.available_date, false) }}</span></p>
|
||||
<p v-if="vehicle.is_available">{{ t('vehicles.availableDate') }}: <span>{{ getDateMonthDayEs(vehicle.available_date, false) }}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
<p v-if="vehicle.notes">Información Adicional del Transporte:</p>
|
||||
<p v-if="vehicle.notes">{{ t('vehicles.additionalInfoVehicle') }}:</p>
|
||||
<div v-if="vehicle.notes" class="box-note mb-4">
|
||||
{{ vehicle.notes }}
|
||||
</div>
|
||||
@@ -108,7 +111,7 @@ import { useAuthStore } from '../stores/auth';
|
||||
class="btn btn-dark radius-sm"
|
||||
@click="handleDeleteVehicle"
|
||||
>
|
||||
<i class="fa-solid fa-trash" /> <span class="clear-xsm">Eliminar</span>
|
||||
<i class="fa-solid fa-trash" /> <span class="clear-xsm">{{ t('buttons.delete') }}</span>
|
||||
</button>
|
||||
<button
|
||||
v-if="(authStore.user?.job_role === 'owner' || authStore.user?.job_role === 'manager') || authStore.user._id === props.vehicle.posted_by"
|
||||
@@ -117,7 +120,7 @@ import { useAuthStore } from '../stores/auth';
|
||||
data-toggle="modal"
|
||||
data-target="#createVehicleModal"
|
||||
>
|
||||
<i class="fa-solid fa-pen-to-square" /> <span class="clear-xsm">Editar</span>
|
||||
<i class="fa-solid fa-pen-to-square" /> <span class="clear-xsm">{{ t('buttons.edit') }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user