add: finish translation feature

This commit is contained in:
Alexandro Uc Santos
2024-06-08 17:26:02 -06:00
parent b32b2c310c
commit bb30443faa
15 changed files with 269 additions and 133 deletions

View File

@@ -1,9 +1,10 @@
<script setup> <script setup>
import Swal from 'sweetalert2'; import Swal from 'sweetalert2';
import { getDateMonthDay } from '../helpers/date_formats'; import { getDateMonthDay } from '../helpers/date_formats';
import { getStatusLoad } from '../helpers/status'; import { getStatusLoad } from '../helpers/status';
import { useCompanyStore } from '../stores/company'; import { useCompanyStore } from '../stores/company';
import { useAuthStore } from '../stores/auth'; import { useAuthStore } from '../stores/auth';
import { useI18n } from 'vue-i18n';
const props = defineProps({ const props = defineProps({
proposal: { proposal: {
@@ -12,24 +13,27 @@ import { useAuthStore } from '../stores/auth';
} }
}) })
console.log(props.proposal)
const companyStore = useCompanyStore(); const companyStore = useCompanyStore();
const authStore = useAuthStore(); const authStore = useAuthStore();
const { t, locale } = useI18n();
const handleWithdrawnProposal = async() => { const handleWithdrawnProposal = async() => {
Swal.fire({ Swal.fire({
title: 'Retirar oferta!', title: t('proposals.titleRetireModal'),
text: '¿Estás seguro de retirar esta oferta?', text: t('proposals.textRetireModal'),
icon: 'warning', icon: 'warning',
showCancelButton: true, showCancelButton: true,
cancelButtonColor: "#d33", cancelButtonColor: "#d33",
confirmButtonText: 'Si, Retirar', confirmButtonText: t('proposals.confirmRetire'),
cancelButtonText: 'No', cancelButtonText: 'No',
}).then(async(result) => { }).then(async(result) => {
if(result.isConfirmed) { if(result.isConfirmed) {
Swal.fire({ Swal.fire({
title: 'Por favor espere!', title: t('messages.loading'),
html: 'Retirando oferta...',// add html attribute if you want or remove html: t('proposals.loadingRetired') + '...',// add html attribute if you want or remove
allowOutsideClick: false, allowOutsideClick: false,
didOpen: () => { didOpen: () => {
Swal.showLoading() Swal.showLoading()
@@ -51,14 +55,14 @@ import { useAuthStore } from '../stores/auth';
if(resp != null) { if(resp != null) {
Swal.fire({ Swal.fire({
title: "Oferta retirada!", title: t('proposals.msgTitleRetire'),
text: "Tu oferta ha sido retirada exitosamente.", text: t('proposals.msgCancel'),
icon: "success" icon: "success"
}); });
} else { } else {
Swal.fire({ Swal.fire({
title: "Oferta no retirada!", title: "Error",
text: "Tu oferta no se pudo retirar, intente más tarde.", text: t('proposals.msgNotCancel'),
icon: "error" icon: "error"
}); });
} }
@@ -75,26 +79,26 @@ import { useAuthStore } from '../stores/auth';
<br> <br>
<div class="box-proposal"> <div class="box-proposal">
<div class=""> <div class="">
<p v-if="proposal.vehicle"><span>Código:</span> {{proposal.vehicle.vehicle_code}}</p> <p v-if="proposal.vehicle"><span>{{ t('labels.codeId') }}:</span> {{proposal.vehicle.vehicle_code}}</p>
<p v-if="proposal.vehicle"><span>Segmento:</span> {{proposal._categories}}</p> <p v-if="proposal.vehicle"><span>{{ t('global.segment') }}:</span> {{proposal.load.categories?.map((e) => e.name).join(', ')}}</p>
<p v-if="proposal.vehicle"><span>Tipo de transporte:</span> {{proposal.vehicle.truck_type}}</p> <p v-if="proposal.vehicle"><span>{{ t('directory.typeTruck') }}:</span> {{proposal.vehicle.truck_type}}</p>
<p v-if="proposal.vehicle"><span>Fecha de publicación:</span> {{ getDateMonthDay(proposal.vehicle.published_date) }}</p> <p v-if="proposal.vehicle"><span>{{ t('labels.datePublished') }}:</span> {{ getDateMonthDay(proposal.vehicle.published_date) }}</p>
<p v-if="proposal.vehicle"><span>Fecha dispobible:</span> {{ getDateMonthDay(proposal.vehicle.available_date) }}</p> <p v-if="proposal.vehicle"><span>{{ t('labels.dateAvailable') }}:</span> {{ getDateMonthDay(proposal.vehicle.available_date) }}</p>
<p v-if="proposal.vehicle"><span>Disponible en:</span> {{proposal.vehicle.city}}<template v-if="proposal.vehicle.state">, {{proposal.vehicle.state}}</template></p> <p v-if="proposal.vehicle"><span>{{ t('vehicles.availableIn') }}:</span> {{proposal.vehicle.city}}<template v-if="proposal.vehicle.state">, {{proposal.vehicle.state}}</template></p>
<p v-if="proposal.vehicle"><span>Destino:</span> {{proposal.vehicle.destino}}</p> <p v-if="proposal.vehicle"><span>{{ t('loads.destination') }}:</span> {{proposal.vehicle.destino}}</p>
<p v-if="proposal.vehicle"><span>Placas remolque 1:</span> {{proposal.vehicle.trailer_plate_1}}</p> <p v-if="proposal.vehicle"><span>{{ t('vehicles.trailerPlates') }} 1:</span> {{proposal.vehicle.trailer_plate_1}}</p>
<p v-if="proposal.vehicle"><span>Placas remolque 2:</span> {{proposal.vehicle.trailer_plate_2}}</p> <p v-if="proposal.vehicle"><span>{{ t('vehicles.trailerPlates') }} 2:</span> {{proposal.vehicle.trailer_plate_2}}</p>
<p v-if="proposal.vehicle" :style="{color: getStatusLoad(proposal.load).color}"><span>Status de la carga:</span> {{ getStatusLoad(proposal.load).status }}</p> <p v-if="proposal.vehicle" :style="{color: getStatusLoad(proposal.load, locale).color}"><span>{{ t('loads.loadStatus') }}:</span> {{ getStatusLoad(proposal.load, locale).status}}</p>
</div> </div>
<div class=""> <div class="">
<p v-if="proposal.load"> Código de carga: <p v-if="proposal.load"> {{ t('loads.loadCode') }}:
<span <span
class="code-enruta" class="code-enruta"
@click="$emit('set-proposal', {proposal: proposal, modal: 'detail'})" @click="$emit('set-proposal', {proposal: proposal, modal: 'detail'})"
data-toggle="modal" data-target="#loadDetailModal" data-toggle="modal" data-target="#loadDetailModal"
>{{proposal.load.shipment_code}}</span></p> >{{proposal.load.shipment_code}}</span></p>
<p v-if="proposal._driver">Operator: {{proposal._driver}}</p> <p v-if="proposal._driver">{{ t('labels.operator') }}: {{proposal._driver}}</p>
</div> </div>
</div> </div>
<div class="btn-row"> <div class="btn-row">
@@ -104,7 +108,7 @@ import { useAuthStore } from '../stores/auth';
><i class="fa-solid fa-ban"></i> Retirar</button> --> ><i class="fa-solid fa-ban"></i> Retirar</button> -->
<div v-if="proposal.is_withdrawn" class="indicator-cancel"> <div v-if="proposal.is_withdrawn" class="indicator-cancel">
<i class="fa-solid fa-ban"></i> <i class="fa-solid fa-ban"></i>
Retirado {{ t('proposals.retired') }}
</div> </div>
<button <button
v-else v-else
@@ -114,14 +118,14 @@ import { useAuthStore } from '../stores/auth';
@click="handleWithdrawnProposal" @click="handleWithdrawnProposal"
> >
<i class="fa-solid fa-ban"></i> <i class="fa-solid fa-ban"></i>
Retirar {{ t('proposals.withdraw') }}
</button> </button>
<button <button
v-if="authStore.user?.job_role === 'owner' || authStore.user?.job_role === 'manager'" v-if="authStore.user?.job_role === 'owner' || authStore.user?.job_role === 'manager'"
class="btn-primary-sm radius-sm" class="btn-primary-sm radius-sm"
@click="$emit('set-proposal', {proposal: proposal, modal: 'edit'})" @click="$emit('set-proposal', {proposal: proposal, modal: 'edit'})"
data-toggle="modal" data-target="#makeProposalModal" data-toggle="modal" data-target="#makeProposalModal"
><i class="fa-solid fa-pen-to-square"></i> Editar</button> ><i class="fa-solid fa-pen-to-square"></i> {{ t('buttons.edit') }}</button>
</div> </div>
</div> </div>
</template> </template>

View File

@@ -21,8 +21,8 @@
const handleDeleteVehicle = async() => { const handleDeleteVehicle = async() => {
Swal.fire({ Swal.fire({
title: `Eliminar vehiculo "${props.vehicle.vehicle_code}""`, title: `${t('vehicles.titleDel')} "${props.vehicle.vehicle_code}""`,
text: '¿Estás seguro de eliminar este vehiculo?', text: t('vehicles.textDel'),
icon: 'warning', icon: 'warning',
showCancelButton: true, showCancelButton: true,
cancelButtonColor: "#d33", cancelButtonColor: "#d33",
@@ -32,7 +32,7 @@
if(result.isConfirmed) { if(result.isConfirmed) {
Swal.fire({ Swal.fire({
title: t('messages.loading'), title: t('messages.loading'),
html: 'Eliminando vehiculo...',// add html attribute if you want or remove html: t('vehicles.loadingDel') + '...',// add html attribute if you want or remove
allowOutsideClick: false, allowOutsideClick: false,
didOpen: () => { didOpen: () => {
Swal.showLoading() Swal.showLoading()
@@ -43,14 +43,14 @@
if(resp != null) { if(resp != null) {
Swal.fire({ Swal.fire({
title: "vehiculo eliminado!", title: t('vehicles.msgTitleDel'),
text: "Tu vehiculo ha sido eliminado exitosamente.", text: t('vehicles.msgDel'),
icon: "success" icon: "success"
}); });
} else { } else {
Swal.fire({ Swal.fire({
title: "Error!", title: "Error!",
text: "Tu vehiculo no se pudo eliminar, intente más tarde.", text: t('vehicles.msgNotDel'),
icon: "error" icon: "error"
}); });
} }

View File

@@ -9,6 +9,7 @@
import Spiner from './ui/Spiner.vue'; import Spiner from './ui/Spiner.vue';
import Swal from 'sweetalert2'; import Swal from 'sweetalert2';
import { useVehiclesStore } from '../stores/vehicles'; import { useVehiclesStore } from '../stores/vehicles';
import { useI18n } from 'vue-i18n';
const props = defineProps({ const props = defineProps({
vehicle: { vehicle: {
@@ -17,8 +18,6 @@
} }
}); });
console.log(props.vehicle);
defineEmits(['reset-vehicle']); defineEmits(['reset-vehicle']);
const initState = { const initState = {
@@ -70,9 +69,11 @@
const loading = ref(false); const loading = ref(false);
const title = computed(() => { const title = computed(() => {
return (props.vehicle) ? 'Editar vehiculo' : 'Agregar vehiculo'; return (props.vehicle) ? t('vehicles.modalEdit') : t('vehicles.addVehicle');
}); });
const { t } = useI18n()
const handleSaveVehicle = async() => { const handleSaveVehicle = async() => {
validations(); validations();
@@ -94,20 +95,20 @@
}; };
let localData = {}; let localData = {};
let result = 'error'; let result = 'error';
let action = 'Creado'; let action = t('vehicles.msgVehicleCreated');
loading.value = true; loading.value = true;
if(props.vehicle) { if(props.vehicle) {
localData = { localData = {
categories: vehicleForm.categories, categories: vehicleForm.categories,
driver: props.vehicle.driver driver: props.vehicle.driver
}; };
action = 'actualizado'; action = t('vehicles.msgVehicleUpdate');
result = await vehicleStore.updateVehicleCompany(props.vehicle._id, vehicleData, localData); result = await vehicleStore.updateVehicleCompany(props.vehicle._id, vehicleData, localData);
} else { } else {
localData = { localData = {
categories: vehicleForm.categories categories: vehicleForm.categories
} }
action = 'añadido'; action = t('vehicles.msgVehicleCreated');
result = await vehicleStore.createVehicleCompany(vehicleData, localData); result = await vehicleStore.createVehicleCompany(vehicleData, localData);
} }
@@ -115,7 +116,7 @@
if(result === 'success') { if(result === 'success') {
document.getElementById('btnClosecreateVehicleModal').click(); document.getElementById('btnClosecreateVehicleModal').click();
Swal.fire({ Swal.fire({
title: `<strong>Vehiculo ${action} con éxito!</strong>`, title: action,
icon: 'success' icon: 'success'
}) })
} else { } else {
@@ -128,12 +129,12 @@
const validations = () => { const validations = () => {
errors.value = { errors.value = {
truck_type: (!vehicleForm.truck_type) ? 'Seleccione tipo de transporte' : null, truck_type: (!vehicleForm.truck_type) ? t('errors.truck') : null,
categories: (!vehicleForm.categories) ? 'Seleccione al menos un segmento' : null, categories: (!vehicleForm.categories) ? t('errors.segments') : null,
vehicle_number: (!vehicleForm.vehicle_number) ? 'Campo es requerido' : null, vehicle_number: (!vehicleForm.vehicle_number) ? t('errors.required') : null,
state: (!vehicleForm.state) ? 'Seleccione estado' : null, state: (!vehicleForm.state) ? t('errors.state') : null,
city: (!vehicleForm.city) ? 'Seleccione municipio' : null, city: (!vehicleForm.city) ? t('errors.city') : null,
destino: (!vehicleForm.destino) ? 'Ingrese destino' : null, destino: (!vehicleForm.destino) ? t('errors.destination') : null,
}; };
} }
</script> </script>
@@ -156,14 +157,14 @@
<form @submit.prevent="handleSaveVehicle" autocomplete="off" class="vehicle-form"> <form @submit.prevent="handleSaveVehicle" autocomplete="off" class="vehicle-form">
<div class="row mt-4"> <div class="row mt-4">
<div class="col-lg-6 col-12"> <div class="col-lg-6 col-12">
<label class="custom-label">Tipo de Transporte*</label> <label class="custom-label">{{ t('directory.typeTruck') }}*</label>
<TruckTypes <TruckTypes
v-model="vehicleForm.truck_type" v-model="vehicleForm.truck_type"
/> />
<span class="error-msg" v-if="errors.truck_type">{{ errors.truck_type }}</span> <span class="error-msg" v-if="errors.truck_type">{{ errors.truck_type }}</span>
</div> </div>
<div class="col-lg-6 col-12"> <div class="col-lg-6 col-12">
<label class="custom-label">Segmento del transporte*</label> <label class="custom-label">{{ t('vehicles.segments') }}*</label>
<Segments <Segments
v-model="vehicleForm.categories" v-model="vehicleForm.categories"
:multiple="true" :multiple="true"
@@ -174,7 +175,7 @@
<div class="row mt-4"> <div class="row mt-4">
<div class="col-lg-6 col-12"> <div class="col-lg-6 col-12">
<CustomInput <CustomInput
label="Número de Serie*" :label="t('vehicles.serialNumber') + '*'"
name="vehicle_number" name="vehicle_number"
v-model:field="vehicleForm.vehicle_number" v-model:field="vehicleForm.vehicle_number"
:filled="false" :filled="false"
@@ -183,7 +184,7 @@
</div> </div>
<div class="col-lg-6 col-12"> <div class="col-lg-6 col-12">
<CustomInput <CustomInput
label="Placas Tracto Camión" :label="t('vehicles.truckPlates')"
name="circulation_serial_number" name="circulation_serial_number"
v-model:field="vehicleForm.circulation_serial_number" v-model:field="vehicleForm.circulation_serial_number"
:filled="false" :filled="false"
@@ -193,7 +194,7 @@
<div class="row"> <div class="row">
<div class="col-lg-6 col-12"> <div class="col-lg-6 col-12">
<CustomInput <CustomInput
label="Placas Remolque 1" :label="t('vehicles.trailerPlates') + ' 1'"
name="trailer_plate_1" name="trailer_plate_1"
v-model:field="vehicleForm.trailer_plate_1" v-model:field="vehicleForm.trailer_plate_1"
:filled="false" :filled="false"
@@ -201,7 +202,7 @@
</div> </div>
<div class="col-lg-6 col-12"> <div class="col-lg-6 col-12">
<CustomInput <CustomInput
label="Placas Remolque 1" :label="t('vehicles.trailerPlates') + ' 2'"
name="trailer_plate_2" name="trailer_plate_2"
v-model:field="vehicleForm.trailer_plate_2" v-model:field="vehicleForm.trailer_plate_2"
:filled="false" :filled="false"
@@ -210,14 +211,14 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-lg-6 col-12"> <div class="col-lg-6 col-12">
<label class="custom-label">Base de carga por Estado*</label> <label class="custom-label">{{ t('labels.stateBase') }}*</label>
<States <States
v-model="vehicleForm.state" v-model="vehicleForm.state"
/> />
<span class="error-msg" v-if="errors.state">{{ errors.state }}</span> <span class="error-msg" v-if="errors.state">{{ errors.state }}</span>
</div> </div>
<div class="col-lg-6 col-12"> <div class="col-lg-6 col-12">
<label class="custom-label">Base de Carga por Municipio*</label> <label class="custom-label">{{ t('labels.cityBase') }}*</label>
<Cities <Cities
v-model="vehicleForm.city" v-model="vehicleForm.city"
/> />
@@ -226,7 +227,7 @@
</div> </div>
<div class="col-lg-6 col-12 mt-4"> <div class="col-lg-6 col-12 mt-4">
<CustomInput <CustomInput
label="Destino*" :label="t('loads.destination') + '*'"
type="text" type="text"
:filled="false" :filled="false"
name="destino" name="destino"
@@ -235,12 +236,12 @@
/> />
</div> </div>
<div class="d-flex flex-column mt-4"> <div class="d-flex flex-column mt-4">
<label class="custom-label" for="notes">Información Adicional del Transporte:</label> <label class="custom-label" for="notes">{{ t('vehicles.additionalInfoVehicle') }}:</label>
<textarea <textarea
class="custom-input-light" class="custom-input-light"
name="notes" name="notes"
id="notes" id="notes"
placeholder="Escribe aqui..." :placeholder=" t('labels.writeHere') + '...'"
v-model="vehicleForm.notes" v-model="vehicleForm.notes"
></textarea> ></textarea>
</div> </div>
@@ -248,7 +249,7 @@
<Spiner v-if="loading"/> <Spiner v-if="loading"/>
<button <button
v-else v-else
class="btn-primary-sm radius-sm" type="submit">Guardar</button> class="btn-primary-sm radius-sm" type="submit">{{ t('buttons.save') }}</button>
</div> </div>
</form> </form>
</div> </div>

View File

@@ -4,6 +4,7 @@
import Spiner from './ui/Spiner.vue'; import Spiner from './ui/Spiner.vue';
import { useVehiclesStore } from '../stores/vehicles'; import { useVehiclesStore } from '../stores/vehicles';
import Swal from 'sweetalert2'; import Swal from 'sweetalert2';
import { useI18n } from 'vue-i18n';
const props = defineProps({ const props = defineProps({
vehicle: { vehicle: {
@@ -17,6 +18,8 @@
const companyStore = useCompanyStore(); const companyStore = useCompanyStore();
const vehicleStore = useVehiclesStore(); const vehicleStore = useVehiclesStore();
const { t } = useI18n()
const driverSelected = ref(null); const driverSelected = ref(null);
const drivers = ref([]); const drivers = ref([]);
const error = ref(null) const error = ref(null)
@@ -32,7 +35,7 @@
const handleSetDriver = async() => { const handleSetDriver = async() => {
if(driverSelected.value === null) { if(driverSelected.value === null) {
error.value = 'Seleccione un conductor'; error.value = t('errors.driver');
return return
} }
@@ -63,7 +66,7 @@
if(result2 === 'success' ){ if(result2 === 'success' ){
document.getElementById('btnCloseeditDriverVehicle').click(); document.getElementById('btnCloseeditDriverVehicle').click();
Swal.fire({ Swal.fire({
title: `<strong>Driver asignado con éxito!</strong>`, title: `<strong>${t('vehicles.msgAssigedDriver')}</strong>`,
icon: 'success' icon: 'success'
}); });
} else { } else {
@@ -93,7 +96,7 @@
<div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h2 class="title mt-2 mb-3">Cambiar conductor</h2> <h2 class="title mt-2 mb-3">{{ t('vehicles.changeDriver') }}</h2>
<button <button
id="btnCloseeditDriverVehicle" id="btnCloseeditDriverVehicle"
type="button" type="button"
@@ -107,17 +110,17 @@
</div> </div>
<div class="modal-body view-proposals"> <div class="modal-body view-proposals">
<div class="custom-selected-field"> <div class="custom-selected-field">
<label class="custom-label my-2" for="driver">Conductor asignado:</label> <label class="custom-label my-2" for="driver">{{ t('vehicles.assignedDriver') }}:</label>
<select <select
class="custom-input-light" class="custom-input-light"
name="driver" name="driver"
id="driver" id="driver"
v-model="driverSelected" v-model="driverSelected"
> >
<option disabled value="">-- Seleccionar conductor --</option> <option disabled value="">-- {{ t('vehicles.selectDriver') }} --</option>
<option v-for="driver in drivers" :value="driver">{{driver.first_name}} {{ driver.last_name }}</option> <option v-for="driver in drivers" :value="driver">{{driver.first_name}} {{ driver.last_name }}</option>
</select> </select>
<span class="error-msg" v-if="error">{{ error }}</span> <span class="error-msg mt-2" v-if="error">{{ error }}</span>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
@@ -128,12 +131,12 @@
class="btn btn-dark radius-sm" class="btn btn-dark radius-sm"
data-dismiss="modal" data-dismiss="modal"
@click="$emit('reset-vehicle')" @click="$emit('reset-vehicle')"
>Cancelar</button> >{{ t('buttons.cancel') }}</button>
<button <button
class="btn-primary-sm radius-sm" class="btn-primary-sm radius-sm"
@click="handleSetDriver" @click="handleSetDriver"
> >
<span class="clear-xsm">Guardar</span> <span class="clear-xsm">{{ t('buttons.save') }}</span>
</button> </button>
</div> </div>
</div> </div>

View File

@@ -81,10 +81,8 @@ const closePopup = () => {
<div class="box-register"> <div class="box-register">
<p class="title-header">Tablero de <span class="title-main">Embarques</span> y <span class="title-main">Transportes</span></p> <p class="title-header">Tablero de <span class="title-main">Embarques</span> y <span class="title-main">Transportes</span></p>
</div> </div>
<a @click="openPopup = true" class="lang"><i class="fa-solid fa-globe"></i> {{ locale }}</a>
</div> </div>
<a
@click="openPopup = true"
class="lang"><i class="fa-solid fa-globe"></i> {{ locale }}</a>
</div> </div>
</template> </template>
@@ -108,10 +106,13 @@ const closePopup = () => {
display: flex; display: flex;
align-items: center; align-items: center;
align-content: center; align-content: center;
width: 100%;
/* width: 65%; */ /* width: 65%; */
} }
.box-register{ .box-register{
margin-left: 24px; margin-left: 24px;
display: flex;
flex: 1;
} }
.title-header{ .title-header{
font-size: 1.8rem; font-size: 1.8rem;
@@ -180,7 +181,7 @@ const closePopup = () => {
} }
@media (max-width: 568px) { @media (max-width: 568px) {
.logo{ .logo{
height: 80px; height: 60px;
} }
.title-header{ .title-header{
font-size: 1rem; font-size: 1rem;

View File

@@ -6,7 +6,8 @@
import useDirectionsRender from '../composables/useDirectionRender'; import useDirectionsRender from '../composables/useDirectionRender';
import Cardload from './CardLoad.vue'; import Cardload from './CardLoad.vue';
import { useLoadsStore } from '../stores/loads'; import { useLoadsStore } from '../stores/loads';
import { useNotificationsStore } from '../stores/notifications'; import { useNotificationsStore } from '../stores/notifications';
import { useI18n } from 'vue-i18n';
const mapKey = import.meta.env.VITE_MAP_KEY; const mapKey = import.meta.env.VITE_MAP_KEY;
@@ -22,6 +23,7 @@ import { useNotificationsStore } from '../stores/notifications';
const isLoadActive = ref(false); const isLoadActive = ref(false);
const { getDirections, geocodeAddress } = useDirectionsRender() const { getDirections, geocodeAddress } = useDirectionsRender()
const { t } = useI18n();
const props = defineProps({ const props = defineProps({
proposal: { proposal: {
@@ -59,7 +61,7 @@ import { useNotificationsStore } from '../stores/notifications';
if(addressOrigin.lat && addressOrigin.lng) { if(addressOrigin.lat && addressOrigin.lng) {
originCoords.value = {lat: Number.parseFloat(addressOrigin.lat), lng: Number.parseFloat(addressOrigin.lng)}; originCoords.value = {lat: Number.parseFloat(addressOrigin.lat), lng: Number.parseFloat(addressOrigin.lng)};
} else { } else {
console.log('No hay coords origin') // console.log('No hay coords origin')
let startLocation = addressOrigin.street_address1 + ', ' + addressOrigin.city + ', ' + addressOrigin.state + ', ' + addressOrigin.country + ', ' +addressOrigin.zipcode; let startLocation = addressOrigin.street_address1 + ', ' + addressOrigin.city + ', ' + addressOrigin.state + ', ' + addressOrigin.country + ', ' +addressOrigin.zipcode;
originCoords.value = await geocodeAddress(startLocation); originCoords.value = await geocodeAddress(startLocation);
} }
@@ -67,7 +69,7 @@ import { useNotificationsStore } from '../stores/notifications';
if(addressDestination.lat && addressDestination.lng) { if(addressDestination.lat && addressDestination.lng) {
destinationCoords.value = {lat: Number.parseFloat(addressDestination.lat), lng: Number.parseFloat(addressDestination.lng)}; destinationCoords.value = {lat: Number.parseFloat(addressDestination.lat), lng: Number.parseFloat(addressDestination.lng)};
} else { } else {
console.log('No hay coords destinatiom') // console.log('No hay coords destinatiom')
let endLocation = addressDestination.street_address1 + ', ' + addressDestination.city + ', ' + addressDestination.state + ', ' + addressDestination.country + ', ' +addressDestination.zipcode; let endLocation = addressDestination.street_address1 + ', ' + addressDestination.city + ', ' + addressDestination.state + ', ' + addressDestination.country + ', ' +addressDestination.zipcode;
destinationCoords.value = await geocodeAddress(endLocation); destinationCoords.value = await geocodeAddress(endLocation);
} }
@@ -100,7 +102,7 @@ import { useNotificationsStore } from '../stores/notifications';
} }
} catch (error) { } catch (error) {
notyStore.$patch({ notyStore.$patch({
text : 'No se pudo cargar mapa', text : t('errors.map'),
show : true, show : true,
error: true error: true
}); });
@@ -128,7 +130,7 @@ import { useNotificationsStore } from '../stores/notifications';
<div class="modal-dialog modal-dialog-centered modal-xl" role="document"> <div class="modal-dialog modal-dialog-centered modal-xl" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h2 class="title mt-2 mb-3">Detalles de carga</h2> <h2 class="title mt-2 mb-3">{{ t('loads.loadDetails') }}</h2>
<button <button
id="btnCloseloadDetailModal" id="btnCloseloadDetailModal"
type="button" type="button"
@@ -186,7 +188,7 @@ import { useNotificationsStore } from '../stores/notifications';
/> />
</GoogleMap> </GoogleMap>
</div> </div>
<CardEmpty v-else text="No hay información disponible"/> <CardEmpty v-else :text="t('loads.noInfo')"/>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
@@ -195,7 +197,7 @@ import { useNotificationsStore } from '../stores/notifications';
class="btn btn-dark" class="btn btn-dark"
data-dismiss="modal" data-dismiss="modal"
@click="$emit('reset-proposal')" @click="$emit('reset-proposal')"
>Cerrar</button> >{{ t('buttons.close') }}</button>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -10,6 +10,7 @@
import { useVehiclesStore } from '../stores/vehicles'; import { useVehiclesStore } from '../stores/vehicles';
// import { saveProposal } from '../services/vehicles' // import { saveProposal } from '../services/vehicles'
import Swal from 'sweetalert2'; import Swal from 'sweetalert2';
import { useI18n } from 'vue-i18n';
const mapKey = import.meta.env.VITE_MAP_KEY; const mapKey = import.meta.env.VITE_MAP_KEY;
@@ -46,6 +47,7 @@
defineEmits(['reset-load']) defineEmits(['reset-load'])
const { t } = useI18n()
onMounted(() => { onMounted(() => {
window.addEventListener('resize', handleResize); window.addEventListener('resize', handleResize);
@@ -86,13 +88,13 @@
const handleSumit = async() => { const handleSumit = async() => {
if(form.vehicle === ""){ if(form.vehicle === ""){
msgError.value = 'Selecciona vehiculo para continuar'; msgError.value = t('errors.vehicle');
setTimeout(() => { setTimeout(() => {
msgError.value = ''; msgError.value = '';
}, 5000); }, 5000);
return; return;
} else if (form.comments.trim().length <= 0) { } else if (form.comments.trim().length <= 0) {
msgError.value = 'Agrega un comentario'; msgError.value = t('errors.comment');
setTimeout(() => { setTimeout(() => {
msgError.value = ''; msgError.value = '';
}, 5000); }, 5000);
@@ -111,7 +113,7 @@
load : props.load._id load : props.load._id
} }
loadingSubmit.value = true; loadingSubmit.value = true;
action = 'creada'; action = t('proposals.msgOffertDone');
result = await companyStore.createPropsal(formData); result = await companyStore.createPropsal(formData);
} else { } else {
let formData = { let formData = {
@@ -127,14 +129,14 @@
_driver: vehicleSelected?.driver.first_name + ' ' + vehicleSelected?.driver.last_name _driver: vehicleSelected?.driver.first_name + ' ' + vehicleSelected?.driver.last_name
} }
loadingSubmit.value = true; loadingSubmit.value = true;
action = 'actualizada' action = t('proposals.msgOffertUpdate')
result = await companyStore.updatePropsalLoad(props.proposal._id, formData, localData); result = await companyStore.updatePropsalLoad(props.proposal._id, formData, localData);
} }
if(result === 'success') { if(result === 'success') {
document.getElementById('btnClosemakeProposalModal').click(); document.getElementById('btnClosemakeProposalModal').click();
Swal.fire({ Swal.fire({
title: `<strong>Oferta ${action} con éxito!</strong>`, title: `<strong>${action}</strong>`,
icon: 'success' icon: 'success'
}) })
} else { } else {
@@ -146,8 +148,8 @@
loadingSubmit.value = false; loadingSubmit.value = false;
} }
const title = computed(() => (props.proposal) ? 'Modificar oferta' : 'Realizar oferta'); const title = computed(() => (props.proposal) ? t('proposals.modOffer') : t('proposals.makeOffer'));
const btnSubmit = computed(() => (props.proposal) ? 'Guardar' : 'Enviar'); const btnSubmit = computed(() => (props.proposal) ? t('buttons.save') : t('buttons.send'));
</script> </script>
<template> <template>
@@ -174,19 +176,19 @@
<form @submit.prevent="handleSumit" class="box-form mb-4"> <form @submit.prevent="handleSumit" class="box-form mb-4">
<BadgeError :msg="msgError"/> <BadgeError :msg="msgError"/>
<div class="custom-selected-field"> <div class="custom-selected-field">
<label class="custom-label" for="vehicle">Vehiculo:</label> <label class="custom-label" for="vehicle">{{ t('labels.vehicle') }}:</label>
<select <select
class="custom-input-light" class="custom-input-light"
name="vehicle" name="vehicle"
id="vehicle" id="vehicle"
v-model="form.vehicle" v-model="form.vehicle"
> >
<option disabled value="">-- Seleccionar vehículo --</option> <option disabled value="">-- {{ t('proposals.selectVehicle') }} --</option>
<option v-for="vehicle in vehiclesStore.vehicles" :value="vehicle._id">{{vehicle.vehicle_code}}</option> <option v-for="vehicle in vehiclesStore.vehicles" :value="vehicle._id">{{vehicle.vehicle_code}}</option>
</select> </select>
</div> </div>
<div class="custom-selected-field"> <div class="custom-selected-field">
<label class="custom-label" for="comment">Comentario:</label> <label class="custom-label" for="comment">{{ t('labels.comment') }}:</label>
<textarea <textarea
class="custom-input-light" class="custom-input-light"
name="comment" name="comment"
@@ -247,7 +249,7 @@
class="btn btn-dark" class="btn btn-dark"
data-dismiss="modal" data-dismiss="modal"
@click="$emit('reset-load')" @click="$emit('reset-load')"
>Cerrar</button> >{{ t('buttons.close') }}</button>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -7,6 +7,7 @@
import States from './ui/States.vue'; import States from './ui/States.vue';
import Cities from './ui/Cities.vue'; import Cities from './ui/Cities.vue';
import Swal from 'sweetalert2'; import Swal from 'sweetalert2';
import { useI18n } from 'vue-i18n';
const props = defineProps({ const props = defineProps({
vehicle: { vehicle: {
@@ -28,6 +29,8 @@
defineEmits(['reset-vehicle']); defineEmits(['reset-vehicle']);
const { t } = useI18n()
const formAvailiable = reactive({ const formAvailiable = reactive({
available_date: new Date(), available_date: new Date(),
destino: '', destino: '',
@@ -43,9 +46,9 @@
const handleSetStatusVehicle = async() => { const handleSetStatusVehicle = async() => {
let vehicleData; let vehicleData;
console.log(statusSelected.value); // console.log(statusSelected.value);
if(statusSelected.value === 'Availiable') { if(statusSelected.value === 'Availiable') {
console.log('check validations'); // console.log('check validations');
validations(); validations();
if(errors.value.city || errors.value.state || errors.value.destino ) return; if(errors.value.city || errors.value.state || errors.value.destino ) return;
vehicleData = { vehicleData = {
@@ -71,7 +74,7 @@
if(result === 'success') { if(result === 'success') {
document.getElementById('btnCloseeditStatusVehicle').click(); document.getElementById('btnCloseeditStatusVehicle').click();
Swal.fire({ Swal.fire({
title: `<strong>Status del vehiculo actualizado con éxito!</strong>`, title: `<strong>${t('vehicles.msgStatusUpdate')}</strong>`,
icon: 'success' icon: 'success'
}) })
} else { } else {
@@ -84,9 +87,9 @@
const validations = () => { const validations = () => {
errors.value = { errors.value = {
state: (!formAvailiable.state) ? 'Seleccione estado' : null, state: (!formAvailiable.state) ? t('errors.state') : null,
city: (!formAvailiable.city) ? 'Seleccione municipio' : null, city: (!formAvailiable.city) ? t('errors.city') : null,
destino: (!formAvailiable.destino) ? 'Ingrese destino' : null, destino: (!formAvailiable.destino) ? t('errors.destination') : null,
}; };
} }
@@ -97,7 +100,7 @@
<div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h2 class="title mt-2 mb-3">Cambiar status vehiculo</h2> <h2 class="title mt-2 mb-3">{{ t('vehicles.changeStatus') }}</h2>
<button <button
id="btnCloseeditStatusVehicle" id="btnCloseeditStatusVehicle"
type="button" type="button"
@@ -112,17 +115,17 @@
<div class="modal-body view-proposals"> <div class="modal-body view-proposals">
<form @submit.prevent="handleSetStatusVehicle"> <form @submit.prevent="handleSetStatusVehicle">
<div class="custom-selected-field"> <div class="custom-selected-field">
<h4 class="custom-label my-3">Status del vehiculo</h4> <h4 class="custom-label my-3">{{ t('vehicles.statusVehicle') }}</h4>
<div class="d-flex"> <div class="d-flex">
<CustomRadioInput <CustomRadioInput
value="Booked" value="Booked"
label="Reservado" :label="t('vehicles.reserved')"
:name="'status-vehicle' + vehicle._id" :name="'status-vehicle' + vehicle._id"
v-model:typeselected="statusSelected" v-model:typeselected="statusSelected"
/> />
<CustomRadioInput <CustomRadioInput
value="Availiable" value="Availiable"
label="Disponible" :label="t('vehicles.available')"
:name="'status-vehicle' + vehicle._id" :name="'status-vehicle' + vehicle._id"
v-model:typeselected="statusSelected" v-model:typeselected="statusSelected"
/> />
@@ -130,28 +133,28 @@
</div> </div>
<div v-if="statusSelected === 'Availiable'"> <div v-if="statusSelected === 'Availiable'">
<CustomInput <CustomInput
label="Fecha de carga*" :label="t('loads.dateLoad') + '*'"
type="date" type="date"
:filled="false" :filled="false"
name="date-load" name="date-load"
v-model:field="formAvailiable.available_date" v-model:field="formAvailiable.available_date"
/> />
<div class="mb-4 mt-3"> <div class="mb-4 mt-3">
<label class="custom-label">Base de carga por Estado</label> <label class="custom-label">{{ t('labels.stateBase') }}</label>
<States <States
v-model="formAvailiable.state" v-model="formAvailiable.state"
/> />
<span class="error-msg" v-if="errors.state">{{ errors.state }}</span> <span class="error-msg" v-if="errors.state">{{ errors.state }}</span>
</div> </div>
<div class="mb-4 mt-3"> <div class="mb-4 mt-3">
<label class="custom-label">Base de Carga por Municipio</label> <label class="custom-label">{{ t('labels.cityBase') }}</label>
<Cities <Cities
v-model="formAvailiable.city" v-model="formAvailiable.city"
/> />
<span class="error-msg" v-if="errors.city">{{ errors.city }}</span> <span class="error-msg" v-if="errors.city">{{ errors.city }}</span>
</div> </div>
<CustomInput <CustomInput
label="Destino*" :label="t('loads.destination') + '*'"
type="text" type="text"
:filled="false" :filled="false"
name="destino" name="destino"
@@ -166,7 +169,7 @@
class="btn-primary-sm radius-sm" class="btn-primary-sm radius-sm"
type="submit" type="submit"
> >
<span class="clear-xsm">Cuardar</span> <span class="clear-xsm">{{ t('buttons.save') }}</span>
</button> </button>
</div> </div>
</form> </form>

View File

@@ -18,13 +18,11 @@ export default function useSearchLoads() {
try { try {
const endpoint = `/v1/loads/find${filterStr}&$sort%5BcreatedAt%5D=-1`; const endpoint = `/v1/loads/find${filterStr}&$sort%5BcreatedAt%5D=-1`;
const {data} = await api.get(endpoint); const {data} = await api.get(endpoint);
console.log(data);
total.value = data.total; total.value = data.total;
loads.value = data.data; loads.value = data.data;
} catch (error) { } catch (error) {
loads.value = []; loads.value = [];
total.value = 0; total.value = 0;
console.log(error);
} }
loading.value = false; loading.value = false;
} }

View File

@@ -1,32 +1,34 @@
export const getStatusLoad = (load) => { export const getStatusLoad = (load, locale = 'es') => {
let statusTemp;
let status; let status;
let color; let color;
switch (load.load_status) { switch (load.load_status) {
case 'Published': case 'Published':
status = "Publicado"; statusTemp = "Publicado";
color = "#000000"; color = "#000000";
break; break;
case 'Loading': case 'Loading':
color = "#F44336"; color = "#F44336";
status = "Cargando"; statusTemp = "Cargando";
break; break;
case 'Transit': case 'Transit':
status = "En Transito"; statusTemp = "En Transito";
color = "#ffd22b" color = "#ffd22b"
break; break;
case 'Downloading': case 'Downloading':
status = "Descargando"; statusTemp = "Descargando";
color = "#428502" color = "#428502"
break; break;
case 'Delivered': case 'Delivered':
status = "Entregado"; statusTemp = "Entregado";
color = "#000000"; color = "#000000";
break; break;
default: default:
status = 'Sin publicar'; statusTemp = 'Sin publicar';
color = "#000000"; color = "#000000";
break; break;
} }
status = (locale === 'es') ? statusTemp : load.load_status;
return { return {
status, status,
color, color,

View File

@@ -51,6 +51,13 @@ const en = {
writeHere: 'Write here', writeHere: 'Write here',
create: 'Create', create: 'Create',
date: 'Date', date: 'Date',
stateBase: 'Load base by state',
cityBase: 'Load base by city',
datePublished: 'Published date',
dateAvailable: 'Available date',
operator: 'Operator',
vehicle: 'Vehicle',
comment: 'Comment',
}, },
buttons: { buttons: {
enter: "Enter here", enter: "Enter here",
@@ -76,9 +83,11 @@ const en = {
accepted: 'Accepted', accepted: 'Accepted',
confirm: 'Confirm', confirm: 'Confirm',
search: 'Search', search: 'Search',
profile: 'View profile' profile: 'View profile',
send: 'Send'
}, },
errors: { errors: {
required: 'Field is required',
requireds: "All fields required", requireds: "All fields required",
email: "Email is not valid", email: "Email is not valid",
weakPassword: "Weak password", weakPassword: "Weak password",
@@ -105,7 +114,12 @@ const en = {
zipcode: 'Enter valid zip code', zipcode: 'Enter valid zip code',
date: 'Date is required', date: 'Date is required',
weight: 'Weight is required', weight: 'Weight is required',
notMatchEmails: 'Emails do not match' notMatchEmails: 'Emails do not match',
driver: 'Select a driver',
destination: 'Enter destination',
map: 'Could not be loaded',
vehicle: 'Select a vehicle',
comment: 'Add comment',
}, },
messages: { messages: {
sendCode: 'We send you a code to the email, entered!', sendCode: 'We send you a code to the email, entered!',
@@ -277,7 +291,12 @@ const en = {
msgSave: 'Load saved!', msgSave: 'Load saved!',
msgNotSave: '"Could not save upload, try later', msgNotSave: '"Could not save upload, try later',
msgPost: 'Load posted!', msgPost: 'Load posted!',
msgNotPost: 'Could not post load, please try later' msgNotPost: 'Could not post load, please try later',
loadDetails: 'Load Details',
noInfo: '"No information available',
trackingLoad: 'Load tracking',
searchLoads: 'Search loads',
}, },
evidence: { evidence: {
evidence: "Evidence", evidence: "Evidence",
@@ -301,10 +320,27 @@ const en = {
msgTitleCancel: 'Offer cancelled!', msgTitleCancel: 'Offer cancelled!',
msgCancel: 'The offer was successfully withdrawn.', msgCancel: 'The offer was successfully withdrawn.',
msgNotCancel: 'Could not withdraw offer, try later', msgNotCancel: 'Could not withdraw offer, try later',
titleRetireModal: 'Withdraw offer',
textRetireModal: 'Are you sure to withdraw this offer?',
confirmRetire: 'Yes, Remove',
loadingRetired: 'Withdrawing offer',
msgTitleRetire: 'Offer withdrawn!',
title: 'My offers accepted',
retired: 'Retired',
withdraw: 'Withdraw',
modOffer: 'Modify offer',
makeOffer: 'Make offer',
msgOffertDone: 'Offer successfully completed',
msgOffertUpdate: 'Offer updated successfully',
selectVehicle: 'Select vehicle'
}, },
vehicles: { vehicles: {
title: 'Vehicles', title: 'Vehicles',
modalEdit: 'Edit vehicle', modalEdit: 'Edit vehicle',
addVehicle: 'Add vehicle',
search: 'Search vehicles', search: 'Search vehicles',
infoVehicle: 'Vehicle information', infoVehicle: 'Vehicle information',
truckPlates: 'Truck Tract Plates', truckPlates: 'Truck Tract Plates',
@@ -317,7 +353,26 @@ const en = {
availableIn: 'Available in', availableIn: 'Available in',
available: 'Available', available: 'Available',
reserved: 'Reserved', reserved: 'Reserved',
availableDate: 'Available date' availableDate: 'Available date',
segments: 'Transportation segment',
titleDel: 'Delete vehicle',
textDel: 'Are you sure to delete this vehicle?',
loadingDel: 'Deleting vehicle',
msgTitleDel: 'Vehicle removed!',
msgDel: 'Your vehicle has been successfully deleted.',
msgNotDel: 'Your vehicle could not be deleted, try again later.',
changeDriver: 'Change driver',
assignedDriver: 'Assigned driver',
selectDriver: 'Select driver',
msgAssigedDriver: 'Driver assigned successfully!',
changeStatus: 'Change vehicle status',
statusVehicle: 'Vehicle status',
msgStatusUpdate: 'Vehicle status updated successfully!',
msgVehicleUpdate: '<strong>Vehicle updated successfully!</strong>',
msgVehicleCreated: '<strong>Vehicle added successfully!</strong>',
}, },
profile: { profile: {
profile: 'User data', profile: 'User data',
@@ -337,6 +392,10 @@ const en = {
searchByCarrier: 'Search by carrier', searchByCarrier: 'Search by carrier',
empty: 'No records' empty: 'No records'
}, },
shippers: {
searchShipper: "Search by shipper",
empty: 'No uploads published'
},
calendar: { calendar: {
title: 'Calendar', title: 'Calendar',
helpText: 'Load status indicators' helpText: 'Load status indicators'

View File

@@ -53,6 +53,13 @@ const es = {
writeHere: 'Escribe aqui', writeHere: 'Escribe aqui',
create: 'Crear', create: 'Crear',
date: 'Fecha', date: 'Fecha',
stateBase: 'Base de carga por Estado',
cityBase: 'Base de Carga por Municipio',
datePublished: 'Fecha de publicación',
dateAvailable: 'Fecha dispobible',
operator: 'Operador',
vehicle: 'Vehiculo',
comment: 'Comentario',
}, },
buttons: { buttons: {
enter: "Ingresa aqui", enter: "Ingresa aqui",
@@ -78,9 +85,11 @@ const es = {
accepted: 'Aceptado', accepted: 'Aceptado',
confirm: 'Confirmar', confirm: 'Confirmar',
search: 'Buscar', search: 'Buscar',
profile: 'Ver perfil' profile: 'Ver perfil',
send: 'Enviar',
}, },
errors: { errors: {
required: 'Campo es requerido',
requireds: 'Todos los campos con obligatorios', requireds: 'Todos los campos con obligatorios',
email: 'Correo electrónico no es valido', email: 'Correo electrónico no es valido',
weakPassword: 'Contraseña poco segura', weakPassword: 'Contraseña poco segura',
@@ -107,7 +116,12 @@ const es = {
zipcode: 'Ingrese código postal valido', zipcode: 'Ingrese código postal valido',
date: 'Fecha es requerida', date: 'Fecha es requerida',
weight: 'Peso es requerido', weight: 'Peso es requerido',
notMatchEmails: 'Los correos electrónicos no coinciden' notMatchEmails: 'Los correos electrónicos no coinciden',
driver: 'Seleccione un conductor',
destination: 'Ingrese destino',
map: "No se pudo cargar mapa",
vehicle: 'Selecciona un vehiculo',
comment: 'Agrega comentario',
}, },
messages: { messages: {
sendCode: 'Te enviamos un código al correo, ingresado!', sendCode: 'Te enviamos un código al correo, ingresado!',
@@ -282,8 +296,13 @@ const es = {
msgSave: 'Carga guardada!', msgSave: 'Carga guardada!',
msgNotSave: 'No se pudo guardar carga, intente más tarde', msgNotSave: 'No se pudo guardar carga, intente más tarde',
msgPost: 'Carga publicada!', msgPost: 'Carga publicada!',
msgNotPost: 'No se pudo publicar carga, intente más tarde' msgNotPost: 'No se pudo publicar carga, intente más tarde',
loadDetails: 'Detalles de carga',
noInfo: '"No hay información disponible',
trackingLoad: 'Seguimiento de carga',
searchLoads: 'Buscar cargas',
}, },
evidence: { evidence: {
evidence: "Evidencias", evidence: "Evidencias",
@@ -307,10 +326,27 @@ const es = {
msgTitleCancel: 'Oferta cancelada!', msgTitleCancel: 'Oferta cancelada!',
msgCancel: 'La oferta fue retirada exitosamente.', msgCancel: 'La oferta fue retirada exitosamente.',
msgNotCancel: 'No se pudo retirar oferta, intente más tarde', msgNotCancel: 'No se pudo retirar oferta, intente más tarde',
titleRetireModal: 'Retirar oferta',
textRetireModal: '¿Estás seguro de retirar esta oferta?',
confirmRetire: 'Si, Retirar',
loadingRetired: 'Retirando oferta',
msgTitleRetire: 'Oferta retirada!',
title: 'Mis ofertas aceptadas',
retired: 'Retirado',
withdraw: 'Retirar',
modOffer: 'Modificar oferta',
makeOffer: 'Realizar oferta',
msgOffertDone: 'Oferta realizada con éxito',
msgOffertUpdate: 'Oferta actualizada con éxito',
selectVehicle: 'Seleccionaar vehículo'
}, },
vehicles: { vehicles: {
title: 'Vehiculos', title: 'Vehiculos',
modalEdit: 'Editar vehiculo', modalEdit: 'Editar vehiculo',
addVehicle: 'Agregar vehiculo',
search: 'Buscar vehiculos', search: 'Buscar vehiculos',
infoVehicle: 'Información del vehiculo', infoVehicle: 'Información del vehiculo',
truckPlates: 'Placas Tracto Camión', truckPlates: 'Placas Tracto Camión',
@@ -324,13 +360,26 @@ const es = {
available: 'Disponible', available: 'Disponible',
reserved: 'Reservado', reserved: 'Reservado',
availableDate: 'Fecha disponible', availableDate: 'Fecha disponible',
segments: 'Segmento del transporte',
titleDel: 'Eliminar Locación!', titleDel: 'Eliminar vehiculo',
textDel: '¿Estás seguro de eliminar este locación?', textDel: '¿Estás seguro de eliminar este vehiculo?',
loadingDel: 'Eliminando locación', loadingDel: 'Eliminando vehiculo',
msgTitleDel: 'Locación eliminado!', msgTitleDel: 'Vehiculo eliminado!',
msgDel: 'Tu locación ha sido eliminado exitosamente.', msgDel: 'Tu vehiculo ha sido eliminado exitosamente.',
msgNotDel: 'Tu locación no se pudo eliminar, intente más tarde.', msgNotDel: 'Tu vehiculo no se pudo eliminar, intente más tarde.',
changeDriver: 'Cambiar conductor',
assignedDriver: 'Conductor asignado',
selectDriver: 'Seleccionar conductor',
msgAssigedDriver: 'Conductor asignado con éxito!',
changeStatus: 'Cambiar status vehiculo',
statusVehicle: 'Estado del vehiculo',
msgStatusUpdate: 'Status del vehiculo actualizado con éxito!',
msgVehicleUpdate: '<strong>Vehiculo actualizado con éxito!</strong>',
msgVehicleCreated: '<strong>Vehiculo añadido con éxito!</strong>',
}, },
profile: { profile: {
profile: 'Datos de usuario', profile: 'Datos de usuario',
@@ -350,6 +399,10 @@ const es = {
searchByCarrier: 'Buscar por transportista', searchByCarrier: 'Buscar por transportista',
empty: 'No hay registros' empty: 'No hay registros'
}, },
shippers: {
searchShipper: "Buscar por embarcador",
empty: 'No hay cargas publicadas'
},
calendar: { calendar: {
title: 'Calendario', title: 'Calendario',
helpText: 'Indicadores de estado de la carga' helpText: 'Indicadores de estado de la carga'

View File

@@ -10,6 +10,7 @@
import Cities from '../components/ui/Cities.vue'; import Cities from '../components/ui/Cities.vue';
import MakeProposalModal from '../components/MakeProposalModal.vue'; import MakeProposalModal from '../components/MakeProposalModal.vue';
import Pagination from '../components/Pagination.vue'; import Pagination from '../components/Pagination.vue';
import { useI18n } from 'vue-i18n';
const filterQuery = ref([]); const filterQuery = ref([]);
const query = ref(''); const query = ref('');
@@ -25,6 +26,8 @@
getInitData(); getInitData();
}); });
const { t } = useI18n()
watch(query, () => { watch(query, () => {
isSearch.value = true; isSearch.value = true;
setFilterUnlimited(); setFilterUnlimited();
@@ -162,7 +165,7 @@
</script> </script>
<template> <template>
<h2 class="title mb-5">Buscar cargas</h2> <h2 class="title mb-5">{{ t('loads.searchLoads') }}</h2>
<MakeProposalModal <MakeProposalModal
v-if="currentLoad" v-if="currentLoad"
:load="currentLoad" :load="currentLoad"
@@ -171,8 +174,8 @@
<div class="card-filters"> <div class="card-filters">
<div class="d-flex mb-2"> <div class="d-flex mb-2">
<input class="form-control me-2" type="search" name="" placeholder="Buscar embarcador" id="" @:input="search()" v-model="query" aria-label="Search"> <input class="form-control me-2" type="search" name="" :placeholder="t('shippers.searchShipper')" id="" @:input="search()" v-model="query" aria-label="Search">
<button class="btn btn-outline-dark me-2" type="button" @click="search">Buscar</button> <button class="btn btn-outline-dark me-2" type="button" @click="search">{{ t('buttons.search') }}</button>
<button <button
class="btn btn-danger" type="button" @click="clearFilter"> class="btn btn-danger" type="button" @click="clearFilter">
<i class="fa-solid fa-arrow-rotate-right"></i> <i class="fa-solid fa-arrow-rotate-right"></i>

View File

@@ -7,6 +7,7 @@
import { GoogleMap, Marker, CustomMarker, Polyline } from 'vue3-google-map'; import { GoogleMap, Marker, CustomMarker, Polyline } from 'vue3-google-map';
import CardEmpty from '../components/CardEmpty.vue'; import CardEmpty from '../components/CardEmpty.vue';
import useTrackingLoad from '../composables/useTrackingLoad'; import useTrackingLoad from '../composables/useTrackingLoad';
import { useI18n } from 'vue-i18n';
const mapKey = import.meta.env.VITE_MAP_KEY; const mapKey = import.meta.env.VITE_MAP_KEY;
@@ -31,6 +32,7 @@
initData(); initData();
}); });
const { t } = useI18n();
const initData = async() => { const initData = async() => {
const id = route.params['code']; const id = route.params['code'];
await getLoadTracking(id) await getLoadTracking(id)
@@ -88,7 +90,7 @@
</script> </script>
<template> <template>
<h2 class="title text-center mt-5">Seguimiento de carga</h2> <h2 class="title text-center mt-5">{{ t('loads.trackingLoad') }}</h2>
<Spiner v-if="loading"/> <Spiner v-if="loading"/>
<div v-else> <div v-else>
<div v-if="load"> <div v-if="load">
@@ -137,7 +139,7 @@
/> />
</GoogleMap> </GoogleMap>
</div> </div>
<CardEmpty v-else text="No hay información disponible"/> <CardEmpty v-else :text="t('loads.noInfo')"/>
</div> </div>
</template> </template>

View File

@@ -6,6 +6,7 @@
import LoadDetailModal from '../components/LoadDetailModal.vue'; import LoadDetailModal from '../components/LoadDetailModal.vue';
import MakeProposalModal from '../components/MakeProposalModal.vue'; import MakeProposalModal from '../components/MakeProposalModal.vue';
import Pagination from '../components/Pagination.vue'; import Pagination from '../components/Pagination.vue';
import { useI18n } from 'vue-i18n';
const companyStore = useCompanyStore(); const companyStore = useCompanyStore();
const loading = ref(false); const loading = ref(false);
@@ -18,6 +19,8 @@
getInitData(); getInitData();
}) })
const { t } = useI18n();
const getInitData = async() => { const getInitData = async() => {
loading.value = true; loading.value = true;
const filter = 'elements=' + limit + "&page=0"; const filter = 'elements=' + limit + "&page=0";
@@ -46,7 +49,7 @@
openModal.value = false; openModal.value = false;
openModalProposal.value = false; openModalProposal.value = false;
proposalCurrent.value = null; proposalCurrent.value = null;
console.log('clear proposal'); // console.log('clear proposal');
} }
</script> </script>
@@ -63,7 +66,7 @@
@reset-load="handleResetCurrentProposal" @reset-load="handleResetCurrentProposal"
/> />
<div> <div>
<h2 class="title mb-5">Mis ofertas aceptadas</h2> <h2 class="title mb-5">{{ t('proposals.title') }}</h2>
<Spiner v-if="loading"/> <Spiner v-if="loading"/>
<CardProposal <CardProposal
v-else v-else