-
+
{{ errors.truck_type }}
-
+
-
+
{{ errors.state }}
-
+
@@ -226,7 +227,7 @@
-
+
@@ -248,7 +249,7 @@
+ class="btn-primary-sm radius-sm" type="submit">{{ t('buttons.save') }}
diff --git a/src/components/DriverVehicleModal.vue b/src/components/DriverVehicleModal.vue
index 04f8e7c..1423e18 100644
--- a/src/components/DriverVehicleModal.vue
+++ b/src/components/DriverVehicleModal.vue
@@ -4,6 +4,7 @@
import Spiner from './ui/Spiner.vue';
import { useVehiclesStore } from '../stores/vehicles';
import Swal from 'sweetalert2';
+ import { useI18n } from 'vue-i18n';
const props = defineProps({
vehicle: {
@@ -17,6 +18,8 @@
const companyStore = useCompanyStore();
const vehicleStore = useVehiclesStore();
+ const { t } = useI18n()
+
const driverSelected = ref(null);
const drivers = ref([]);
const error = ref(null)
@@ -32,7 +35,7 @@
const handleSetDriver = async() => {
if(driverSelected.value === null) {
- error.value = 'Seleccione un conductor';
+ error.value = t('errors.driver');
return
}
@@ -63,7 +66,7 @@
if(result2 === 'success' ){
document.getElementById('btnCloseeditDriverVehicle').click();
Swal.fire({
- title: `Driver asignado con éxito!`,
+ title: `${t('vehicles.msgAssigedDriver')}`,
icon: 'success'
});
} else {
@@ -93,7 +96,7 @@
diff --git a/src/components/Header.vue b/src/components/Header.vue
index b8994c6..b8ee004 100644
--- a/src/components/Header.vue
+++ b/src/components/Header.vue
@@ -79,12 +79,10 @@ const closePopup = () => {
-
+
+
{{ locale }}
-
{{ locale }}
@@ -108,10 +106,13 @@ const closePopup = () => {
display: flex;
align-items: center;
align-content: center;
+ width: 100%;
/* width: 65%; */
}
.box-register{
margin-left: 24px;
+ display: flex;
+ flex: 1;
}
.title-header{
font-size: 1.8rem;
@@ -180,7 +181,7 @@ const closePopup = () => {
}
@media (max-width: 568px) {
.logo{
- height: 80px;
+ height: 60px;
}
.title-header{
font-size: 1rem;
diff --git a/src/components/LoadDetailModal.vue b/src/components/LoadDetailModal.vue
index 876200d..c3fdb08 100644
--- a/src/components/LoadDetailModal.vue
+++ b/src/components/LoadDetailModal.vue
@@ -6,7 +6,8 @@
import useDirectionsRender from '../composables/useDirectionRender';
import Cardload from './CardLoad.vue';
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;
@@ -22,6 +23,7 @@ import { useNotificationsStore } from '../stores/notifications';
const isLoadActive = ref(false);
const { getDirections, geocodeAddress } = useDirectionsRender()
+ const { t } = useI18n();
const props = defineProps({
proposal: {
@@ -59,7 +61,7 @@ import { useNotificationsStore } from '../stores/notifications';
if(addressOrigin.lat && addressOrigin.lng) {
originCoords.value = {lat: Number.parseFloat(addressOrigin.lat), lng: Number.parseFloat(addressOrigin.lng)};
} 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;
originCoords.value = await geocodeAddress(startLocation);
}
@@ -67,7 +69,7 @@ import { useNotificationsStore } from '../stores/notifications';
if(addressDestination.lat && addressDestination.lng) {
destinationCoords.value = {lat: Number.parseFloat(addressDestination.lat), lng: Number.parseFloat(addressDestination.lng)};
} 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;
destinationCoords.value = await geocodeAddress(endLocation);
}
@@ -100,7 +102,7 @@ import { useNotificationsStore } from '../stores/notifications';
}
} catch (error) {
notyStore.$patch({
- text : 'No se pudo cargar mapa',
+ text : t('errors.map'),
show : true,
error: true
});
@@ -128,7 +130,7 @@ import { useNotificationsStore } from '../stores/notifications';
diff --git a/src/components/MakeProposalModal.vue b/src/components/MakeProposalModal.vue
index eba1fa1..23e3bc5 100644
--- a/src/components/MakeProposalModal.vue
+++ b/src/components/MakeProposalModal.vue
@@ -10,6 +10,7 @@
import { useVehiclesStore } from '../stores/vehicles';
// import { saveProposal } from '../services/vehicles'
import Swal from 'sweetalert2';
+ import { useI18n } from 'vue-i18n';
const mapKey = import.meta.env.VITE_MAP_KEY;
@@ -46,6 +47,7 @@
defineEmits(['reset-load'])
+ const { t } = useI18n()
onMounted(() => {
window.addEventListener('resize', handleResize);
@@ -86,13 +88,13 @@
const handleSumit = async() => {
if(form.vehicle === ""){
- msgError.value = 'Selecciona vehiculo para continuar';
+ msgError.value = t('errors.vehicle');
setTimeout(() => {
msgError.value = '';
}, 5000);
return;
} else if (form.comments.trim().length <= 0) {
- msgError.value = 'Agrega un comentario';
+ msgError.value = t('errors.comment');
setTimeout(() => {
msgError.value = '';
}, 5000);
@@ -111,7 +113,7 @@
load : props.load._id
}
loadingSubmit.value = true;
- action = 'creada';
+ action = t('proposals.msgOffertDone');
result = await companyStore.createPropsal(formData);
} else {
let formData = {
@@ -127,14 +129,14 @@
_driver: vehicleSelected?.driver.first_name + ' ' + vehicleSelected?.driver.last_name
}
loadingSubmit.value = true;
- action = 'actualizada'
+ action = t('proposals.msgOffertUpdate')
result = await companyStore.updatePropsalLoad(props.proposal._id, formData, localData);
}
if(result === 'success') {
document.getElementById('btnClosemakeProposalModal').click();
Swal.fire({
- title: `Oferta ${action} con éxito!`,
+ title: `${action}`,
icon: 'success'
})
} else {
@@ -146,8 +148,8 @@
loadingSubmit.value = false;
}
- const title = computed(() => (props.proposal) ? 'Modificar oferta' : 'Realizar oferta');
- const btnSubmit = computed(() => (props.proposal) ? 'Guardar' : 'Enviar');
+ const title = computed(() => (props.proposal) ? t('proposals.modOffer') : t('proposals.makeOffer'));
+ const btnSubmit = computed(() => (props.proposal) ? t('buttons.save') : t('buttons.send'));
@@ -174,19 +176,19 @@
diff --git a/src/components/StatusVehicleModal.vue b/src/components/StatusVehicleModal.vue
index c3fb433..8c4d33a 100644
--- a/src/components/StatusVehicleModal.vue
+++ b/src/components/StatusVehicleModal.vue
@@ -7,6 +7,7 @@
import States from './ui/States.vue';
import Cities from './ui/Cities.vue';
import Swal from 'sweetalert2';
+ import { useI18n } from 'vue-i18n';
const props = defineProps({
vehicle: {
@@ -28,6 +29,8 @@
defineEmits(['reset-vehicle']);
+ const { t } = useI18n()
+
const formAvailiable = reactive({
available_date: new Date(),
destino: '',
@@ -43,9 +46,9 @@
const handleSetStatusVehicle = async() => {
let vehicleData;
- console.log(statusSelected.value);
+ // console.log(statusSelected.value);
if(statusSelected.value === 'Availiable') {
- console.log('check validations');
+ // console.log('check validations');
validations();
if(errors.value.city || errors.value.state || errors.value.destino ) return;
vehicleData = {
@@ -71,7 +74,7 @@
if(result === 'success') {
document.getElementById('btnCloseeditStatusVehicle').click();
Swal.fire({
- title: `
Status del vehiculo actualizado con éxito!`,
+ title: `
${t('vehicles.msgStatusUpdate')}`,
icon: 'success'
})
} else {
@@ -84,9 +87,9 @@
const validations = () => {
errors.value = {
- state: (!formAvailiable.state) ? 'Seleccione estado' : null,
- city: (!formAvailiable.city) ? 'Seleccione municipio' : null,
- destino: (!formAvailiable.destino) ? 'Ingrese destino' : null,
+ state: (!formAvailiable.state) ? t('errors.state') : null,
+ city: (!formAvailiable.city) ? t('errors.city') : null,
+ destino: (!formAvailiable.destino) ? t('errors.destination') : null,
};
}
@@ -97,7 +100,7 @@