local search & fix texts

This commit is contained in:
Alexandro Uc
2026-04-01 20:39:45 -06:00
parent 974c34ad1c
commit 0fbe83d737
17 changed files with 81 additions and 47 deletions

View File

@@ -40,24 +40,6 @@ body {
border-radius: 3rem !important;
}
/* Fuentes */
.font-bold {
font-weight: bold;
}
.fsize-1 {
font-size: 1rem;
}
.fsize-1-5 {
font-size: 1.5rem;
}
.fsize-2 {
font-size: 2rem;
}
/* *********** */
.divider {
display: block;
height: 2px;

View File

@@ -0,0 +1,15 @@
.font-bold {
font-weight: bold;
}
.fsize-1 {
font-size: 1rem;
}
.fsize-1-5 {
font-size: 1.5rem;
}
.fsize-2 {
font-size: 2rem;
}

View File

@@ -198,7 +198,7 @@
<option v-for="vehicle in vehiclesAvailable" :value="vehicle._id">
{{vehicle.vehicle_code?.toUpperCase()}} - {{ vehicle.truck_type }}
<span v-if="vehicle?.driver">- {{ vehicle?.driver?.first_name + ' ' + vehicle?.driver?.last_name }}</span>
<span v-else>- Sin conductor</span>
<span v-else>- Sin conductor -</span>
</option>
</select>
</div>

View File

@@ -159,7 +159,8 @@ const en = {
loading: 'Please wait!',
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.'
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.'
},
global: {
signIn: "Sign In",
@@ -208,6 +209,8 @@ const en = {
delivered: 'Delivered',
downloading: 'Downloading',
add: 'Add',
dashboard: 'Dashboard',
notDriver: 'Without driver'
},
login: {
title: 'Sign in',

View File

@@ -162,7 +162,8 @@ const es = {
loading: 'Por favor espere!',
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.'
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.'
},
global: {
signIn: 'Ingresar',
@@ -211,6 +212,8 @@ const es = {
delivered: 'Entregado',
downloading: 'Descargando',
add: 'Agregar',
dashboard: 'Panel',
notDriver: 'Sin conductor'
},
login: {
title: 'Iniciar sesión',

View File

@@ -4,8 +4,6 @@
import Sidebar from './components/Sidebar.vue';
import ProfilePopup from '../views/profile/modals/ProfilePopup.vue';
import NotificationsPopup from './components/NotificationsPopup.vue';
import ConfigPopup from './components/ConfigPopup.vue';
</script>
<template>
@@ -20,7 +18,7 @@ import ConfigPopup from './components/ConfigPopup.vue';
</div>
<LoadingModal/>
<ProfilePopup/>
<ConfigPopup/>
<!-- <ConfigPopup/> -->
<NotificationsPopup/>
</template>

View File

@@ -75,13 +75,16 @@
<a
active-class="router-link-active"
@click="noty.toggleProfile"
class="nav-link"><i class="fa-regular fa-user"></i></a>
<a
class="nav-link">
<i class="fa-regular fa-user"></i>
</a>
<!-- <a
v-if="permission === 'role_shipper'"
active-class="router-link-active"
@click="noty.toggleConfig"
class="nav-link">
<i class="fa-solid fa-gear"></i>
</a>
</a> -->
</div>
</div>
</nav>

View File

@@ -65,7 +65,7 @@
<i class="fa-solid fa-gauge-high" :class="[route.name === 'home' ? 'router-link-active' : '']"></i>
<RouterLink
active-class="router-link-active"
class="nav-link" :to="{name: 'home'}">Dashboard</RouterLink>
class="nav-link" :to="{name: 'home'}">{{ t('global.dashboard') }}</RouterLink>
</div>
</li>
<li

View File

@@ -1,4 +1,5 @@
import './assets/main.css'
import './assets/styles/fonts.css'
import { createApp } from 'vue'
import { createPinia } from 'pinia'

View File

@@ -54,7 +54,6 @@ export const updateUser = async(user_id, formData) => {
export const updateMyUserProfile = async(formData) => {
try {
const endpoint = `/v1/users/profile`;
console.log(formData);
const {data} = await api.patch(endpoint, formData);
return {
msg: "success",
@@ -224,7 +223,6 @@ export const getPrivateListService = async() => {
try {
const endpoint = `/v1/groups/private`;
const {data} = await api.get(endpoint);
console.log(data);
return {
msg: 'success',
data: data

View File

@@ -6,6 +6,7 @@ export const usePrivacyStore = defineStore('privacy', () => {
const privacy = ref(false);
const privateListRef = ref([]);
const loading = ref(false);
const privateList = ref([]);
@@ -20,7 +21,9 @@ export const usePrivacyStore = defineStore('privacy', () => {
}
const getPrivateList = async (id) => {
loading.value = true;
const response = await getPrivateListService();
loading.value = false;
if(response.msg == 'success') {
privateList.value = response.data.allowedCompanies || [];
privateListRef.value = privateList.value.map((e) => e._id);
@@ -60,6 +63,7 @@ export const usePrivacyStore = defineStore('privacy', () => {
}
return {
loading,
privacy,
privateListRef,
privateList,

View File

@@ -98,7 +98,7 @@
localStorage.setItem('id', result.data._id);
localStorage.setItem('session', auth.sesion);
localStorage.setItem('access', auth.accessToken);
localStorage.setItem('access', auth.token);
const userData = {
"first_name" : user.name,

View File

@@ -8,16 +8,21 @@
import EditCompanyModal from './modals/EditCompanyModal.vue';
import { storeToRefs } from 'pinia';
import { useI18n } from 'vue-i18n';
import CustomSwitch from '../../components/CustomSwitch.vue';
import { usePrivacyStore } from '../../stores/privacy';
const auth = useAuthStore()
const privacyStore = usePrivacyStore();
const company = useCompanyStore();
const { user } = storeToRefs(auth);
const { t, locale } = useI18n()
const privacy = ref(false);
onMounted(() => {
if(user.value) {
getInitialData()
}
privacy.value = privacyStore.privacy;
});
watch(user, () => {
@@ -26,6 +31,10 @@
}
})
watch(privacy, () => {
privacyStore.updatePrivacy(privacy.value);
})
const getInitialData = async() => {
await company.getCompanyData();
}
@@ -36,7 +45,7 @@
<template>
<EditCompanyModal v-if="company.loading === false"/>
<div>
<h2 class="title my-5">{{ t('company.title') }}</h2>
<h2 class="title my-2">{{ t('company.title') }}</h2>
<div class="card-info">
<Spiner v-if="company.loading"/>
<div v-else class="view">
@@ -93,6 +102,16 @@
</div>
</div>
</div>
<div class="card-fixed flex-d-column"
v-if="auth.user?.job_role === 'owner' || auth.user?.job_role === 'manager'">
<h3>Configuraciones de empresa </h3>
<hr>
<CustomSwitch
label="Activar configuración de privacidad"
v-model="privacy"
name="privacity"
/>
</div>
</div>
</template>

View File

@@ -7,27 +7,34 @@
import Spiner from '../../components/ui/Spiner.vue';
const privateStore = usePrivacyStore();
const contacts = ref([]);
const { t } = useI18n();
const loading = ref(false);
const query = ref('');
let timeout = null;
onMounted(() => {
privateStore.getPrivateList();
onMounted( async () => {
await privateStore.getPrivateList();
contacts.value = privateStore.privateList;
});
watch(query, (newValue) => {
clearTimeout(timeout);
timeout = setTimeout(() => {
if (newValue.length >= 2) {
search();
}
}, 400);
});
const search = () => {
console.log('Searching:', query.value);
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;
}
};
</script>
@@ -38,12 +45,12 @@
v-model:saerch="query"
/>
<div class="row">
<div v-if="loading" class="d-flex justify-content-center">
<div v-if="privateStore.loading" class="d-flex justify-content-center">
<Spiner />
</div>
<ContactCard
v-else
v-for="contact in privateStore.privateList"
v-for="contact in contacts"
:key="contact.id"
:contact="contact"
/>

View File

@@ -215,7 +215,7 @@
<div v-if="!proposal.vehicle?.driver"
class="box-note bg-warning mb-3"
>
<i class="fa-solid fa-triangle-exclamation"></i> Oferta sin conductor asignado. Solicite al transportista que asigne un operador para continuar con el proceso de carga.
<i class="fa-solid fa-triangle-exclamation"></i> {{ t('messages.notDriverAssign') }}
</div>
<Spiner v-if="isLoadingActions"/>
<div class="d-flex justify-content-end gap-3" v-else>

View File

@@ -9,7 +9,9 @@
import Cities from '../../components/ui/Cities.vue';
import Pagination from '../../components/Pagination.vue';
import { useI18n } from 'vue-i18n';
import { usePrivacyStore } from '../../stores/privacy';
const privacyStore = usePrivacyStore();
const {loading, companies, getCompaniesData, companiesTotal, currentCompaniesPage} = useDirectory();
const query = ref('');
const selectedTruckType = ref([]);
@@ -22,10 +24,11 @@
const limit = 10;
onMounted(() => {
onMounted( async () => {
filterQuery.value.company_type = 'carrier';
filterQuery.value.limit = 'elements=' + limit;
filterQuery.value.page = "page=0";
await privacyStore.getPrivateList();
getCompaniesData(filterQuery.value);
});

View File

@@ -83,11 +83,9 @@
<p><span>{{ t('labels.infoCompany') }}: </span>{{company.company_description}}</p>
</div>
</div>
<div
class="d-flex justify-content-end gap-2"
v-if="authStore.user?.permissions === 'role_shipper'">
<div class="d-flex justify-content-end gap-2">
<button
v-if="!existInPrivateList"
v-if="authStore.user?.permissions === 'role_shipper' && !existInPrivateList"
class="btn-primary-sm bg-dark radius-sm"
@click="handleAddPrivateList"
>