diff --git a/src/i18n/en.js b/src/i18n/en.js index 4a4b227..41299ec 100644 --- a/src/i18n/en.js +++ b/src/i18n/en.js @@ -160,7 +160,9 @@ const en = { savingChanes: 'Saving changes', observerWarehouse: 'Warehouse observers will receive notifications about the load location, including arrival and departure times, and will be able to view the cargo on the warehouse dashboard.', observerClient: 'Observers will receive notifications about the load, including the loading and unloading date, as well as any changes in the load status. They can monitor the cargo on their customer dashboard.', - notDriverAssign: 'This offer does not include an assigned driver. Please request that the carrier assign an operator to continue the loading process.' + notDriverAssign: 'This offer does not include an assigned driver. Please request that the carrier assign an operator to continue the loading process.', + changeSuccess: 'Changes successfully implemented!', + actionSuccess: 'Action successfully completed!', }, global: { signIn: "Sign In", @@ -210,7 +212,8 @@ const en = { downloading: 'Downloading', add: 'Add', dashboard: 'Dashboard', - notDriver: 'Without driver' + notDriver: 'Without driver', + mistake: 'Mistake' }, login: { title: 'Sign in', @@ -498,6 +501,19 @@ const en = { }, store: { title: "Warehouse" + }, + contacts: { + privacyList: 'Private list', + truckTypesUsed: 'Types of Used Trucks', + deleteCarrier: 'Delete carrier', + QuestionDeleteCarrier: 'Are you sure you want to remove this carrier from the private list?', + QuestionAddCarrier: 'Are you sure you want to add this carrier to the private list?', + deletedCarrier: 'Carrier removed', + deletedCarrierSuccess: 'The carrier has been removed from the private list', + deletedCarrierError: 'The removal of the carrier from the private list could not be completed.', + settingsCompany: 'Company settings', + privacyCompanyLabel: 'Activate company privacy settings', + privacyLoadLabel: 'Post as private', } }; diff --git a/src/i18n/es.js b/src/i18n/es.js index 47b7b1b..123f4e6 100644 --- a/src/i18n/es.js +++ b/src/i18n/es.js @@ -163,7 +163,9 @@ const es = { savingChanes: 'Guardando cambios', observerWarehouse: 'Los observadores de bodega recibirán notificaciones sobre la ubicación de la carga, incluyendo la hora de llegada y salida, podran visualizar la carga en el panel de bodega.', observerClient: 'Los observadores recibirán notificaciones sobre la carga, incluyendo la fecha de carga y descarga, así como cualquier cambio en el estado de la carga. podran monitorer la carga en el panel de clientes.', - notDriverAssign: 'Oferta sin conductor asignado. Solicite al transportista que asigne un operador para continuar con el proceso de carga.' + notDriverAssign: 'Oferta sin conductor asignado. Solicite al transportista que asigne un operador para continuar con el proceso de carga.', + changeSuccess: 'Cambios aplicados con exito!', + actionSuccess: 'Acción realizada con exito!', }, global: { signIn: 'Ingresar', @@ -213,7 +215,8 @@ const es = { downloading: 'Descargando', add: 'Agregar', dashboard: 'Panel', - notDriver: 'Sin conductor' + notDriver: 'Sin conductor', + mistake: 'Error' }, login: { title: 'Iniciar sesión', @@ -507,6 +510,19 @@ const es = { }, store: { title: "Bodega" + }, + contacts: { + privacyList: 'Lista privada', + truckTypesUsed: 'Camiones usados', + deleteCarrier: 'Eliminar transportista', + QuestionDeleteCarrier: '¿Estas seguro de eliminar este transportista de la lista privada?', + QuestionAddCarrier: '¿Estas seguro de añadir a este transportista de la lista privada?', + deletedCarrier: 'Transportista eliminado', + deletedCarrierSuccess: 'Se ha eliminado el transportista de la lista privada', + deletedCarrierError: 'No se pudo completar la eliminación del transportista de la lista privada', + settingsCompany: 'Configuraciones de empresa', + privacyCompanyLabel: 'Activar configuración de privacidad de la empresa', + privacyLoadLabel: 'Publicar como privada', } }; diff --git a/src/views/company/MyCompanyView.vue b/src/views/company/MyCompanyView.vue index 396ac35..c3fbb27 100644 --- a/src/views/company/MyCompanyView.vue +++ b/src/views/company/MyCompanyView.vue @@ -104,10 +104,10 @@ import { usePrivacyStore } from '../../stores/privacy';
-

Configuraciones de empresa

+

{{ t('contacts.settingsCompany') }}


diff --git a/src/views/contacts/ContactsView.vue b/src/views/contacts/ContactsView.vue index 1099f74..d1dd785 100644 --- a/src/views/contacts/ContactsView.vue +++ b/src/views/contacts/ContactsView.vue @@ -17,7 +17,7 @@ contacts.value = privateStore.privateList; }); - watch(query, (newValue) => { + watch(query, () => { clearTimeout(timeout); timeout = setTimeout(() => { @@ -25,13 +25,19 @@ }, 400); }); + watch( + () => privateStore.privateList, + (newValue) => { + contacts.value = newValue; + } + ); + const search = () => { if(query.value.length > 0) { contacts.value = privateStore.privateList.filter( (e) => e.company_name .toLowerCase() .includes(query.value.toLocaleLowerCase())); - console.log(values.length); } else { contacts.value = privateStore.privateList; } diff --git a/src/views/contacts/components/ContactCard.vue b/src/views/contacts/components/ContactCard.vue index bcfceed..0262dce 100644 --- a/src/views/contacts/components/ContactCard.vue +++ b/src/views/contacts/components/ContactCard.vue @@ -19,8 +19,8 @@ import { computed } from 'vue'; const handleDeleteContact = async() => { Swal.fire({ - title: 'Eliminar transportista', - text: '¿Estas seguro de eliminar este transportista de la lista privada?', + title: t('contacts.deleteCarrier'), + text: t('contacts.QuestionDeleteCarrier'), icon: 'warning', showCancelButton: true, cancelButtonColor: "#d33", @@ -36,25 +36,20 @@ import { computed } from 'vue'; Swal.showLoading() }, }); - let resp = null; - setTimeout(() => { - resp = true - Swal.close(); - if(resp != null) { - contactsStore.deleteCompanyToPrivateList(id); - Swal.fire({ - title: 'Transportista eliminado', - text: 'Se ha eliminado el transportista de la lista privada', - icon: "success" - }); - } else { - Swal.fire({ - title: t('errors.msgTitleNotDel'), - text: 'No se pudo completar la eliminación del transportista de la lista privada', - icon: "error" - }); - } - }, 500); + const resp = await contactsStore.deleteCompanyToPrivateList(id); + Swal.close(); + if(resp === 'success') { + Swal.fire({ + text: t('messages.actionSuccess'), + icon: "success" + }); + } else { + Swal.fire({ + title: t('global.mistake'), + text: resp, + icon: "error" + }); + } } }); @@ -94,7 +89,7 @@ import { computed } from 'vue';

RFC: {{ contact.rfc}}

{{ t('global.segments') }}: {{ categories }}

Camiones usados: {{ truckTypes }}

-

Estados: {{ states }}

+

{{ t('global.states') }}: {{ states }}

diff --git a/src/views/loads/modals/FormLoadModal.vue b/src/views/loads/modals/FormLoadModal.vue index 488e722..4db16b7 100644 --- a/src/views/loads/modals/FormLoadModal.vue +++ b/src/views/loads/modals/FormLoadModal.vue @@ -613,7 +613,7 @@