local search & fix texts
This commit is contained in:
@@ -40,24 +40,6 @@ body {
|
|||||||
border-radius: 3rem !important;
|
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 {
|
.divider {
|
||||||
display: block;
|
display: block;
|
||||||
height: 2px;
|
height: 2px;
|
||||||
|
|||||||
15
src/assets/styles/fonts.css
Normal file
15
src/assets/styles/fonts.css
Normal 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;
|
||||||
|
}
|
||||||
@@ -198,7 +198,7 @@
|
|||||||
<option v-for="vehicle in vehiclesAvailable" :value="vehicle._id">
|
<option v-for="vehicle in vehiclesAvailable" :value="vehicle._id">
|
||||||
{{vehicle.vehicle_code?.toUpperCase()}} - {{ vehicle.truck_type }}
|
{{vehicle.vehicle_code?.toUpperCase()}} - {{ vehicle.truck_type }}
|
||||||
<span v-if="vehicle?.driver">- {{ vehicle?.driver?.first_name + ' ' + vehicle?.driver?.last_name }}</span>
|
<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>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -159,7 +159,8 @@ const en = {
|
|||||||
loading: 'Please wait!',
|
loading: 'Please wait!',
|
||||||
savingChanes: 'Saving changes',
|
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.',
|
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: {
|
global: {
|
||||||
signIn: "Sign In",
|
signIn: "Sign In",
|
||||||
@@ -208,6 +209,8 @@ const en = {
|
|||||||
delivered: 'Delivered',
|
delivered: 'Delivered',
|
||||||
downloading: 'Downloading',
|
downloading: 'Downloading',
|
||||||
add: 'Add',
|
add: 'Add',
|
||||||
|
dashboard: 'Dashboard',
|
||||||
|
notDriver: 'Without driver'
|
||||||
},
|
},
|
||||||
login: {
|
login: {
|
||||||
title: 'Sign in',
|
title: 'Sign in',
|
||||||
|
|||||||
@@ -162,7 +162,8 @@ const es = {
|
|||||||
loading: 'Por favor espere!',
|
loading: 'Por favor espere!',
|
||||||
savingChanes: 'Guardando cambios',
|
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.',
|
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: {
|
global: {
|
||||||
signIn: 'Ingresar',
|
signIn: 'Ingresar',
|
||||||
@@ -211,6 +212,8 @@ const es = {
|
|||||||
delivered: 'Entregado',
|
delivered: 'Entregado',
|
||||||
downloading: 'Descargando',
|
downloading: 'Descargando',
|
||||||
add: 'Agregar',
|
add: 'Agregar',
|
||||||
|
dashboard: 'Panel',
|
||||||
|
notDriver: 'Sin conductor'
|
||||||
},
|
},
|
||||||
login: {
|
login: {
|
||||||
title: 'Iniciar sesión',
|
title: 'Iniciar sesión',
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
import Sidebar from './components/Sidebar.vue';
|
import Sidebar from './components/Sidebar.vue';
|
||||||
import ProfilePopup from '../views/profile/modals/ProfilePopup.vue';
|
import ProfilePopup from '../views/profile/modals/ProfilePopup.vue';
|
||||||
import NotificationsPopup from './components/NotificationsPopup.vue';
|
import NotificationsPopup from './components/NotificationsPopup.vue';
|
||||||
import ConfigPopup from './components/ConfigPopup.vue';
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -20,7 +18,7 @@ import ConfigPopup from './components/ConfigPopup.vue';
|
|||||||
</div>
|
</div>
|
||||||
<LoadingModal/>
|
<LoadingModal/>
|
||||||
<ProfilePopup/>
|
<ProfilePopup/>
|
||||||
<ConfigPopup/>
|
<!-- <ConfigPopup/> -->
|
||||||
<NotificationsPopup/>
|
<NotificationsPopup/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -75,13 +75,16 @@
|
|||||||
<a
|
<a
|
||||||
active-class="router-link-active"
|
active-class="router-link-active"
|
||||||
@click="noty.toggleProfile"
|
@click="noty.toggleProfile"
|
||||||
class="nav-link"><i class="fa-regular fa-user"></i></a>
|
class="nav-link">
|
||||||
<a
|
<i class="fa-regular fa-user"></i>
|
||||||
|
</a>
|
||||||
|
<!-- <a
|
||||||
|
v-if="permission === 'role_shipper'"
|
||||||
active-class="router-link-active"
|
active-class="router-link-active"
|
||||||
@click="noty.toggleConfig"
|
@click="noty.toggleConfig"
|
||||||
class="nav-link">
|
class="nav-link">
|
||||||
<i class="fa-solid fa-gear"></i>
|
<i class="fa-solid fa-gear"></i>
|
||||||
</a>
|
</a> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
<i class="fa-solid fa-gauge-high" :class="[route.name === 'home' ? 'router-link-active' : '']"></i>
|
<i class="fa-solid fa-gauge-high" :class="[route.name === 'home' ? 'router-link-active' : '']"></i>
|
||||||
<RouterLink
|
<RouterLink
|
||||||
active-class="router-link-active"
|
active-class="router-link-active"
|
||||||
class="nav-link" :to="{name: 'home'}">Dashboard</RouterLink>
|
class="nav-link" :to="{name: 'home'}">{{ t('global.dashboard') }}</RouterLink>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li
|
<li
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import './assets/main.css'
|
import './assets/main.css'
|
||||||
|
import './assets/styles/fonts.css'
|
||||||
import { createApp } from 'vue'
|
import { createApp } from 'vue'
|
||||||
import { createPinia } from 'pinia'
|
import { createPinia } from 'pinia'
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ export const updateUser = async(user_id, formData) => {
|
|||||||
export const updateMyUserProfile = async(formData) => {
|
export const updateMyUserProfile = async(formData) => {
|
||||||
try {
|
try {
|
||||||
const endpoint = `/v1/users/profile`;
|
const endpoint = `/v1/users/profile`;
|
||||||
console.log(formData);
|
|
||||||
const {data} = await api.patch(endpoint, formData);
|
const {data} = await api.patch(endpoint, formData);
|
||||||
return {
|
return {
|
||||||
msg: "success",
|
msg: "success",
|
||||||
@@ -224,7 +223,6 @@ export const getPrivateListService = async() => {
|
|||||||
try {
|
try {
|
||||||
const endpoint = `/v1/groups/private`;
|
const endpoint = `/v1/groups/private`;
|
||||||
const {data} = await api.get(endpoint);
|
const {data} = await api.get(endpoint);
|
||||||
console.log(data);
|
|
||||||
return {
|
return {
|
||||||
msg: 'success',
|
msg: 'success',
|
||||||
data: data
|
data: data
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ export const usePrivacyStore = defineStore('privacy', () => {
|
|||||||
|
|
||||||
const privacy = ref(false);
|
const privacy = ref(false);
|
||||||
const privateListRef = ref([]);
|
const privateListRef = ref([]);
|
||||||
|
const loading = ref(false);
|
||||||
|
|
||||||
const privateList = ref([]);
|
const privateList = ref([]);
|
||||||
|
|
||||||
@@ -20,7 +21,9 @@ export const usePrivacyStore = defineStore('privacy', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getPrivateList = async (id) => {
|
const getPrivateList = async (id) => {
|
||||||
|
loading.value = true;
|
||||||
const response = await getPrivateListService();
|
const response = await getPrivateListService();
|
||||||
|
loading.value = false;
|
||||||
if(response.msg == 'success') {
|
if(response.msg == 'success') {
|
||||||
privateList.value = response.data.allowedCompanies || [];
|
privateList.value = response.data.allowedCompanies || [];
|
||||||
privateListRef.value = privateList.value.map((e) => e._id);
|
privateListRef.value = privateList.value.map((e) => e._id);
|
||||||
@@ -60,6 +63,7 @@ export const usePrivacyStore = defineStore('privacy', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
loading,
|
||||||
privacy,
|
privacy,
|
||||||
privateListRef,
|
privateListRef,
|
||||||
privateList,
|
privateList,
|
||||||
|
|||||||
@@ -98,7 +98,7 @@
|
|||||||
|
|
||||||
localStorage.setItem('id', result.data._id);
|
localStorage.setItem('id', result.data._id);
|
||||||
localStorage.setItem('session', auth.sesion);
|
localStorage.setItem('session', auth.sesion);
|
||||||
localStorage.setItem('access', auth.accessToken);
|
localStorage.setItem('access', auth.token);
|
||||||
|
|
||||||
const userData = {
|
const userData = {
|
||||||
"first_name" : user.name,
|
"first_name" : user.name,
|
||||||
|
|||||||
@@ -8,16 +8,21 @@
|
|||||||
import EditCompanyModal from './modals/EditCompanyModal.vue';
|
import EditCompanyModal from './modals/EditCompanyModal.vue';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import CustomSwitch from '../../components/CustomSwitch.vue';
|
||||||
|
import { usePrivacyStore } from '../../stores/privacy';
|
||||||
|
|
||||||
const auth = useAuthStore()
|
const auth = useAuthStore()
|
||||||
|
const privacyStore = usePrivacyStore();
|
||||||
const company = useCompanyStore();
|
const company = useCompanyStore();
|
||||||
const { user } = storeToRefs(auth);
|
const { user } = storeToRefs(auth);
|
||||||
const { t, locale } = useI18n()
|
const { t, locale } = useI18n()
|
||||||
|
const privacy = ref(false);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if(user.value) {
|
if(user.value) {
|
||||||
getInitialData()
|
getInitialData()
|
||||||
}
|
}
|
||||||
|
privacy.value = privacyStore.privacy;
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(user, () => {
|
watch(user, () => {
|
||||||
@@ -26,6 +31,10 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
watch(privacy, () => {
|
||||||
|
privacyStore.updatePrivacy(privacy.value);
|
||||||
|
})
|
||||||
|
|
||||||
const getInitialData = async() => {
|
const getInitialData = async() => {
|
||||||
await company.getCompanyData();
|
await company.getCompanyData();
|
||||||
}
|
}
|
||||||
@@ -36,7 +45,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<EditCompanyModal v-if="company.loading === false"/>
|
<EditCompanyModal v-if="company.loading === false"/>
|
||||||
<div>
|
<div>
|
||||||
<h2 class="title my-5">{{ t('company.title') }}</h2>
|
<h2 class="title my-2">{{ t('company.title') }}</h2>
|
||||||
<div class="card-info">
|
<div class="card-info">
|
||||||
<Spiner v-if="company.loading"/>
|
<Spiner v-if="company.loading"/>
|
||||||
<div v-else class="view">
|
<div v-else class="view">
|
||||||
@@ -93,6 +102,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -7,27 +7,34 @@
|
|||||||
import Spiner from '../../components/ui/Spiner.vue';
|
import Spiner from '../../components/ui/Spiner.vue';
|
||||||
|
|
||||||
const privateStore = usePrivacyStore();
|
const privateStore = usePrivacyStore();
|
||||||
|
const contacts = ref([]);
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const loading = ref(false);
|
|
||||||
const query = ref('');
|
const query = ref('');
|
||||||
let timeout = null;
|
let timeout = null;
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted( async () => {
|
||||||
privateStore.getPrivateList();
|
await privateStore.getPrivateList();
|
||||||
|
contacts.value = privateStore.privateList;
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(query, (newValue) => {
|
watch(query, (newValue) => {
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
|
|
||||||
timeout = setTimeout(() => {
|
timeout = setTimeout(() => {
|
||||||
if (newValue.length >= 2) {
|
|
||||||
search();
|
search();
|
||||||
}
|
|
||||||
}, 400);
|
}, 400);
|
||||||
});
|
});
|
||||||
|
|
||||||
const search = () => {
|
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>
|
</script>
|
||||||
@@ -38,12 +45,12 @@
|
|||||||
v-model:saerch="query"
|
v-model:saerch="query"
|
||||||
/>
|
/>
|
||||||
<div class="row">
|
<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 />
|
<Spiner />
|
||||||
</div>
|
</div>
|
||||||
<ContactCard
|
<ContactCard
|
||||||
v-else
|
v-else
|
||||||
v-for="contact in privateStore.privateList"
|
v-for="contact in contacts"
|
||||||
:key="contact.id"
|
:key="contact.id"
|
||||||
:contact="contact"
|
:contact="contact"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -215,7 +215,7 @@
|
|||||||
<div v-if="!proposal.vehicle?.driver"
|
<div v-if="!proposal.vehicle?.driver"
|
||||||
class="box-note bg-warning mb-3"
|
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>
|
</div>
|
||||||
<Spiner v-if="isLoadingActions"/>
|
<Spiner v-if="isLoadingActions"/>
|
||||||
<div class="d-flex justify-content-end gap-3" v-else>
|
<div class="d-flex justify-content-end gap-3" v-else>
|
||||||
|
|||||||
@@ -9,7 +9,9 @@
|
|||||||
import Cities from '../../components/ui/Cities.vue';
|
import Cities from '../../components/ui/Cities.vue';
|
||||||
import Pagination from '../../components/Pagination.vue';
|
import Pagination from '../../components/Pagination.vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { usePrivacyStore } from '../../stores/privacy';
|
||||||
|
|
||||||
|
const privacyStore = usePrivacyStore();
|
||||||
const {loading, companies, getCompaniesData, companiesTotal, currentCompaniesPage} = useDirectory();
|
const {loading, companies, getCompaniesData, companiesTotal, currentCompaniesPage} = useDirectory();
|
||||||
const query = ref('');
|
const query = ref('');
|
||||||
const selectedTruckType = ref([]);
|
const selectedTruckType = ref([]);
|
||||||
@@ -22,10 +24,11 @@
|
|||||||
|
|
||||||
const limit = 10;
|
const limit = 10;
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted( async () => {
|
||||||
filterQuery.value.company_type = 'carrier';
|
filterQuery.value.company_type = 'carrier';
|
||||||
filterQuery.value.limit = 'elements=' + limit;
|
filterQuery.value.limit = 'elements=' + limit;
|
||||||
filterQuery.value.page = "page=0";
|
filterQuery.value.page = "page=0";
|
||||||
|
await privacyStore.getPrivateList();
|
||||||
getCompaniesData(filterQuery.value);
|
getCompaniesData(filterQuery.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -83,11 +83,9 @@
|
|||||||
<p><span>{{ t('labels.infoCompany') }}: </span>{{company.company_description}}</p>
|
<p><span>{{ t('labels.infoCompany') }}: </span>{{company.company_description}}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="d-flex justify-content-end gap-2">
|
||||||
class="d-flex justify-content-end gap-2"
|
|
||||||
v-if="authStore.user?.permissions === 'role_shipper'">
|
|
||||||
<button
|
<button
|
||||||
v-if="!existInPrivateList"
|
v-if="authStore.user?.permissions === 'role_shipper' && !existInPrivateList"
|
||||||
class="btn-primary-sm bg-dark radius-sm"
|
class="btn-primary-sm bg-dark radius-sm"
|
||||||
@click="handleAddPrivateList"
|
@click="handleAddPrivateList"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user