add: fixes user card & removed logs
This commit is contained in:
@@ -15,9 +15,7 @@
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
<!-- <script src="https://apis.google.com/js/api.js" type="text/javascript"></script> -->
|
||||
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBm3n6I_uMzKkMS0eVXnLdoa1S_hPcsx0A"></script>
|
||||
<!-- <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script> -->
|
||||
<script src="https://kit.fontawesome.com/3675730ed5.js" crossorigin="anonymous"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
|
||||
|
||||
@@ -68,7 +68,6 @@
|
||||
<style scoped>
|
||||
.attachment {
|
||||
width: 100%;
|
||||
/* border: 1px #e9e9e9 solid; */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 20px;
|
||||
@@ -102,5 +101,4 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -83,7 +83,6 @@
|
||||
<p><span>{{ t('calculator.totalBeforeIva') }}:</span> {{ formatCurrency(budget.total_before_tax) }}</p>
|
||||
<p><span>{{ t('calculator.totalUtityByKm') }}:</span> {{ formatCurrency( budget.total_utility_per_km) }}</p>
|
||||
<p><span>{{ t('calculator.totalUtity') }}:</span> {{ formatCurrency( budget.total_profit ) }}</p>
|
||||
<!-- <p>{{ $t('CALCULATOR.PROFIT_PERCENTAGE') }}: {{budget.profit_percentage}}%</p> -->
|
||||
<p><span>{{ t('calculator.percentUtility') }}:</span> {{ totalPercentage }}</p>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -19,12 +19,9 @@
|
||||
<div class="divider"></div>
|
||||
<div class="row mt-4">
|
||||
<div class="col-lg-6 col-sm-12">
|
||||
<!-- <p><span>RFC:</span> {{ company.rfc }}</p> -->
|
||||
<!-- <p><span>Tipo de empresa:</span> {{ company.company_type || 'No definido' }}</p> -->
|
||||
<p><span>{{ t('labels.codeId') }}:</span> {{ company.company_code }}</p>
|
||||
<p><span>{{ t('labels.dateMembership') }}: </span>{{getDateMonthDay(company.createdAt)}}</p>
|
||||
<p><span>{{ t('company.segment') }}:</span> {{ company._categories }}</p>
|
||||
<!-- <p><span>Afiliación: </span> {{company.membership}}</p> -->
|
||||
</div>
|
||||
<div class="col-lg-6 col-sm-12">
|
||||
<p><span>{{ t('labels.locationLoadState') }}: </span>{{company._company_state}}</p>
|
||||
|
||||
@@ -44,7 +44,6 @@ import { ref } from 'vue';
|
||||
width: 100%;
|
||||
padding: 12px 20px;
|
||||
background-color: white;
|
||||
/* background-color: rgb(184, 236, 234); */
|
||||
margin-bottom: 15px;
|
||||
filter: drop-shadow(0px 4px 4px rgba(0, 255, 255,0.3));
|
||||
border-radius: 13px;
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
if(result.isConfirmed) {
|
||||
Swal.fire({
|
||||
title: t('messages.loading'),
|
||||
html: t('loads.loadingDel') + '...',// add html attribute if you want or remove
|
||||
html: t('loads.loadingDel') + '...',
|
||||
allowOutsideClick: false,
|
||||
didOpen: () => {
|
||||
Swal.showLoading()
|
||||
|
||||
@@ -222,5 +222,4 @@
|
||||
gap: 0.2rem;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -18,6 +18,8 @@
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
console.log(props.user)
|
||||
|
||||
defineEmits(['set-user'])
|
||||
|
||||
@@ -80,22 +82,22 @@
|
||||
</div>
|
||||
<div class="col-lg-6 col-sm-12" v-if="readonly">
|
||||
<p><span>{{ t('global.segments') }}: </span>{{user.categories?.map((e) => e.name).join(', ')}}</p>
|
||||
<p><span>{{ t('labels.locationLoadCity') }}: </span>{{user._user_city}}</p>
|
||||
<p><span>{{ t('labels.locationLoadState') }}: </span>{{user._user_state}}</p>
|
||||
<p v-if="user.company.truck_type"><span>{{ t('labels.truckUsed') }}: </span> {{user._truck_type}}</p>
|
||||
<p ><span>{{ t('labels.userInfo') }}: </span> {{user.user_description}}</p>
|
||||
<p><span>{{ t('labels.locationLoadCity') }}: </span>{{user._user_city}}</p>
|
||||
<p v-if="user._truck_type"><span>{{ t('labels.truckUsed') }}: </span> {{user._truck_type}}</p>
|
||||
<p v-if="user.createAt"><span>{{ t('labels.memberSince') }}: </span>{{getDateOnly(user.createAt)}}</p>
|
||||
<p v-if="readonly && user.company.membership"><span>Tipo de afiliación: </span> {{user.company.membership}}</p>
|
||||
<p v-if="user.user_description"><span>{{ t('labels.userInfo') }}: </span> {{user.user_description}}</p>
|
||||
<!-- <p v-if="readonly && user.company.membership"><span>Tipo de afiliación: </span> {{user.company.membership}}</p> -->
|
||||
<!-- <p><span>{{ t('labels.userRole') }}: </span>{{user.job_role}}</p> -->
|
||||
</div>
|
||||
<div class="col-lg-6 col-sm-12" v-else>
|
||||
<p><span>{{ t('global.segments') }}: </span>{{user.categories?.map((e) => e.name).join(', ')}}</p>
|
||||
<p><span>{{ t('labels.locationLoadCity') }}: </span>{{user.user_city?.join(', ')}}</p>
|
||||
<p><span>{{ t('labels.locationLoadState') }}: </span>{{user.user_state?.join(', ')}}</p>
|
||||
<p><span>{{ t('labels.locationLoadCity') }}: </span>{{user.user_city?.join(', ')}}</p>
|
||||
<p v-if="user.truck_type"><span>{{ t('labels.truckUsed') }}: </span> {{user.truck_type?.join(', ')}}</p>
|
||||
<p><span>{{ t('labels.userInfo') }}: </span> {{user.user_description}}</p>
|
||||
<p v-if="user.createAt"><span>{{ t('labels.memberSince') }}: </span>{{getDateOnly(user.createAt)}}</p>
|
||||
<p v-if="readonly && user.company.membership" ><span>Tipo de afiliación: </span> {{user.company.membership}}</p>
|
||||
<p v-if="user.user_description"><span>{{ t('labels.userInfo') }}: </span> {{user.user_description}}</p>
|
||||
<!-- <p v-if="readonly && user.company.membership" ><span>Tipo de afiliación: </span> {{user.company.membership}}</p> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-row" v-if="readonly === false && (authStore.user?.job_role === 'owner' || authStore.user?.job_role === 'manager')">
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
if(result.isConfirmed) {
|
||||
Swal.fire({
|
||||
title: t('messages.loading'),
|
||||
html: t('vehicles.loadingDel') + '...',// add html attribute if you want or remove
|
||||
html: t('vehicles.loadingDel') + '...',
|
||||
allowOutsideClick: false,
|
||||
didOpen: () => {
|
||||
Swal.showLoading()
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
const { t } = useI18n();
|
||||
|
||||
onMounted(() => {
|
||||
console.log(props.budget);
|
||||
if(props.budget) {
|
||||
budgetForm.budget_id = props.budget._id;
|
||||
budgetForm.client = props.budget.client;
|
||||
@@ -116,10 +115,6 @@
|
||||
client: null
|
||||
})
|
||||
|
||||
// const total = computed(() => {
|
||||
|
||||
// });
|
||||
|
||||
const totalTravel = computed(() => {
|
||||
budgetForm.total_travel = budgetForm.warehouse_distance * 1 + budgetForm.delivery_distance * 1 + budgetForm.pickup_distance * 1;
|
||||
budgetForm.total_travel = isNaN(budgetForm.total_travel) ? 0.0 : budgetForm.total_travel;
|
||||
@@ -257,7 +252,6 @@
|
||||
<div class="modal-dialog modal-dialog-centered modal-xl" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<!-- <h2 class="title mt-2 mb-3">Calculadora</h2> -->
|
||||
<div></div>
|
||||
<button
|
||||
id="btnClosebudgetModal"
|
||||
@@ -575,7 +569,6 @@
|
||||
}
|
||||
|
||||
.calculator-card__subtitle {
|
||||
// background-color: #50b1e5;
|
||||
background-color: #FBBA33;
|
||||
padding: 8px 20px;
|
||||
color: #FFF;
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
userForm.last_name = props.user.last_name;
|
||||
userForm.email = props.user.email;
|
||||
userForm.phone = props.user.phone;
|
||||
// userForm.phone2 = props.user.phone2;
|
||||
userForm.job_role = props.user.job_role;
|
||||
userForm.categories = props.user.categories;
|
||||
userForm.user_city = props.user.user_city?.map(m =>{
|
||||
@@ -92,7 +91,6 @@
|
||||
last_name: userForm.last_name,
|
||||
email: userForm.email,
|
||||
phone: userForm.phone,
|
||||
// phone2: userForm.phone2,
|
||||
job_role: userForm.job_role,
|
||||
permissions: authStore.user.permissions,
|
||||
company: authStore.user.company,
|
||||
|
||||
@@ -70,8 +70,6 @@
|
||||
padding: 20px 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* flex-wrap: nowrap; */
|
||||
/* overflow: hidden; */
|
||||
filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.10));
|
||||
}
|
||||
|
||||
|
||||
@@ -83,9 +83,6 @@
|
||||
}
|
||||
|
||||
loading.value = false;
|
||||
|
||||
//Continua en la lina 568 web_main
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,10 +8,6 @@
|
||||
|
||||
const loading = ref(false)
|
||||
const user = reactive({
|
||||
// name: '',
|
||||
// lastName: '',
|
||||
// phone1: '',
|
||||
// phone2: '',
|
||||
name: auth.user?.first_name,
|
||||
lastName: auth.user?.last_name,
|
||||
phone1: auth.user?.phone,
|
||||
|
||||
@@ -144,12 +144,6 @@
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
/* .box-back-btn {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 16px 0px;
|
||||
} */
|
||||
|
||||
.warning-info {
|
||||
display: flex;
|
||||
padding: 16px;
|
||||
@@ -165,7 +159,6 @@
|
||||
.warning {
|
||||
font-size: 33px;
|
||||
margin-right: 12px;
|
||||
/* color: white; */
|
||||
}
|
||||
|
||||
.btn-block {
|
||||
|
||||
@@ -210,12 +210,6 @@
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
/* .box-back-btn {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 16px 0px;
|
||||
} */
|
||||
|
||||
.warning-info {
|
||||
display: flex;
|
||||
padding: 16px;
|
||||
|
||||
@@ -92,9 +92,6 @@
|
||||
formLoad.segment = loadStore.currentLoad.categories?.length <= 0 ? [] : loadStore.currentLoad.categories.map(m =>{
|
||||
return m;
|
||||
});
|
||||
// formLoad.segment = loadStore.currentLoad.categories?.length <= 0 ? null : loadStore.currentLoad.categories.map(m =>{
|
||||
// return m;
|
||||
// });
|
||||
startLocation.value = loadStore.currentLoad.origin_formatted_address;
|
||||
endLocation.value = loadStore.currentLoad.destination_formatted_address;
|
||||
formLoad.terms = loadStore.currentLoad.product;
|
||||
@@ -165,7 +162,6 @@
|
||||
|
||||
const getLocations = async() => {
|
||||
loadingLocations.value = true;
|
||||
// filterQueryVehicles.value.company = "company="+ localStorage.getItem('id');
|
||||
await companyStore.getLocationsLoads()
|
||||
loadingLocations.value = false;
|
||||
}
|
||||
@@ -207,7 +203,6 @@
|
||||
city: '',
|
||||
country: '',
|
||||
postalCode: '',
|
||||
// ref: '',
|
||||
});
|
||||
|
||||
const destination = reactive({
|
||||
@@ -217,7 +212,6 @@
|
||||
city: '',
|
||||
country: '',
|
||||
postalCode: '',
|
||||
// ref: '',
|
||||
});
|
||||
|
||||
const setLoadData = () => {
|
||||
|
||||
@@ -4,19 +4,16 @@ import CustomPopup from './CustomPopup.vue';
|
||||
import { ref } from 'vue';
|
||||
import { onMounted } from 'vue';
|
||||
import { watch } from 'vue';
|
||||
// import { useAuthStore } from '../stores/auth';
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
|
||||
const openPopup = ref(false);
|
||||
const options = ref([]);
|
||||
const lang = ref(null);
|
||||
// const auth = useAuthStore();
|
||||
|
||||
onMounted(() => {
|
||||
const langInit = localStorage.getItem('lang') ?? locale.value;
|
||||
locale.value = langInit
|
||||
// auth.lang = langInit;
|
||||
lang.value = {value: langInit, label: langInit == 'en' ? t('global.en') : t('global.es')}
|
||||
options.value = [
|
||||
{value: 'es',label: t('global.es')},
|
||||
@@ -107,7 +104,6 @@ const closePopup = () => {
|
||||
align-items: center;
|
||||
align-content: center;
|
||||
width: 100%;
|
||||
/* width: 65%; */
|
||||
}
|
||||
.box-register{
|
||||
margin-left: 24px;
|
||||
@@ -131,7 +127,6 @@ const closePopup = () => {
|
||||
|
||||
.app-btn{
|
||||
background-color: #FBBA33;
|
||||
/* background-color: #000; */
|
||||
border: none;
|
||||
color: #FFF;
|
||||
border-radius: 25px;
|
||||
|
||||
@@ -49,7 +49,6 @@
|
||||
const initData = async() => {
|
||||
isLoading.value = true;
|
||||
const code = props.proposal.load.shipment_code;
|
||||
// console.log(props.proposal)
|
||||
const filter = "?shipment_code[$in]=" + code;
|
||||
const resp = await loadStore.getLoad(filter);
|
||||
if(resp.total > 0) {
|
||||
@@ -61,7 +60,6 @@
|
||||
if(addressOrigin.lat && addressOrigin.lng) {
|
||||
originCoords.value = {lat: Number.parseFloat(addressOrigin.lat), lng: Number.parseFloat(addressOrigin.lng)};
|
||||
} else {
|
||||
// console.log('No hay coords origin')
|
||||
let startLocation = addressOrigin.street_address1 + ', ' + addressOrigin.city + ', ' + addressOrigin.state + ', ' + addressOrigin.country + ', ' +addressOrigin.zipcode;
|
||||
originCoords.value = await geocodeAddress(startLocation);
|
||||
}
|
||||
@@ -69,7 +67,6 @@
|
||||
if(addressDestination.lat && addressDestination.lng) {
|
||||
destinationCoords.value = {lat: Number.parseFloat(addressDestination.lat), lng: Number.parseFloat(addressDestination.lng)};
|
||||
} else {
|
||||
// console.log('No hay coords destinatiom')
|
||||
let endLocation = addressDestination.street_address1 + ', ' + addressDestination.city + ', ' + addressDestination.state + ', ' + addressDestination.country + ', ' +addressDestination.zipcode;
|
||||
destinationCoords.value = await geocodeAddress(endLocation);
|
||||
}
|
||||
|
||||
@@ -8,13 +8,10 @@
|
||||
const originCoords = ref(null);
|
||||
const destinationCoords = ref(null);
|
||||
const polyline = ref([]);
|
||||
// const startLocation = ref({ lat: 37.7749, lng: -122.4194 }); // San Francisco
|
||||
// const endLocation = ref({ lat: 34.0522, lng: -118.2437 }); // Los Angeles
|
||||
const mapKey = import.meta.env.VITE_MAP_KEY;
|
||||
|
||||
onMounted(async() => {
|
||||
window.addEventListener('resize', handleResize);
|
||||
// mapRef.value = this.$refs.myMap;
|
||||
if(window.innerWidth <= 1024) {
|
||||
zoom.value = 4;
|
||||
heightMap.value = 420;
|
||||
@@ -22,9 +19,6 @@
|
||||
|
||||
originCoords.value = await geocodeAddress('C. 40 370, San Román, 97540 Izamal, Yuc.');
|
||||
destinationCoords.value = await geocodeAddress('Izamal-Valladolid, 97557 Sudzal, Yuc.');
|
||||
|
||||
// Trazar la ruta entre el origen y el destino
|
||||
// await getDirections();
|
||||
});
|
||||
|
||||
|
||||
@@ -55,7 +49,6 @@
|
||||
};
|
||||
|
||||
const getDirections = async () => {
|
||||
// const apiKey = 'AIzaSyAJtfvrAKy7vnUSv2nzk4dYQkOs3OP4MMs';
|
||||
const originLatLng = `${originCoords.value.lat},${originCoords.value.lng}`;
|
||||
const destinationLatLng = `${destinationCoords.value.lat},${destinationCoords.value.lng}`;
|
||||
try {
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
const deleteNoty = async() => {
|
||||
loading.value = true;
|
||||
const resp = await deleteNotification(props.noty._id);
|
||||
console.log(resp);
|
||||
if(resp.msg === 'Done') {
|
||||
notyStore.removeNoty(props.noty._id);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
noty.toggleNotifications()
|
||||
noty.newNoty = false;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -69,15 +68,12 @@
|
||||
padding: 20px 16px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* flex-wrap: nowrap; */
|
||||
/* overflow: hidden; */
|
||||
filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.10));
|
||||
}
|
||||
|
||||
.body {
|
||||
overflow-y: auto;
|
||||
max-height: 500px;
|
||||
/* padding: 20px 20px; */
|
||||
}
|
||||
|
||||
.section-prefs {
|
||||
|
||||
@@ -25,7 +25,6 @@ import { onMounted, ref } from 'vue';
|
||||
})
|
||||
|
||||
const setPage = (p) => {
|
||||
console.log('Page:', p);
|
||||
currentPage.value = p
|
||||
const skip = (p - 1) * props.limit;
|
||||
emits('get-elements', {skip: skip, page: p});
|
||||
|
||||
@@ -102,8 +102,6 @@
|
||||
padding: 20px 32px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* flex-wrap: nowrap; */
|
||||
/* overflow: hidden; */
|
||||
filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.10));
|
||||
}
|
||||
|
||||
|
||||
@@ -114,34 +114,6 @@
|
||||
class="nav-link" :to="{name: 'calculator'}">{{ t('global.calculator') }}</RouterLink>
|
||||
</div>
|
||||
</li>
|
||||
<!-- <li
|
||||
v-if="auth.user?.permissions === 'role_carrier'"
|
||||
:class="[route.name === 'carriers' ? 'bg-nav-active' : '']">
|
||||
<div>
|
||||
<i class="fa-solid fa-truck" :class="[route.name === 'carriers' ? 'router-link-active' : '']"></i>
|
||||
<RouterLink
|
||||
active-class="router-link-active"
|
||||
class="nav-link" :to="{name: 'carriers'}">Transportistas</RouterLink>
|
||||
</div>
|
||||
</li> -->
|
||||
<!-- <li
|
||||
v-if="auth.user?.permissions === 'role_shipper'"
|
||||
:class="[route.name === 'carriers' ? 'bg-nav-active' : '']">
|
||||
<div>
|
||||
<i class="fa-solid fa-truck" :class="[route.name === 'carriers' ? 'router-link-active' : '']"></i>
|
||||
<RouterLink
|
||||
active-class="router-link-active"
|
||||
class="nav-link" :to="{name: 'carriers'}">Transportistas</RouterLink>
|
||||
</div>
|
||||
</li> -->
|
||||
<!-- <li :class="[route.name === 'reports' ? 'bg-nav-active' : '']">
|
||||
<div>
|
||||
<i class="fa-solid fa-chart-simple" :class="[route.name === 'reports' ? 'router-link-active' : '']"></i>
|
||||
<RouterLink
|
||||
active-class="router-link-active"
|
||||
class="nav-link" :to="{name: 'reports'}">Reportes</RouterLink>
|
||||
</div>
|
||||
</li> -->
|
||||
</ul>
|
||||
<div class="eta-info">
|
||||
<div class="divider"></div>
|
||||
@@ -252,7 +224,6 @@
|
||||
|
||||
.nav-link{
|
||||
cursor: pointer;
|
||||
/* color: #5f5c5c; */
|
||||
color: #ebd6d6;
|
||||
font-size: 1.2rem;
|
||||
margin-right: 1.2rem;
|
||||
@@ -263,22 +234,17 @@
|
||||
color: #FFF;
|
||||
}
|
||||
.nav-link:hover{
|
||||
/* color: #413f3c; */
|
||||
color: #FFF;
|
||||
}
|
||||
.nav-link:focus{
|
||||
/* color: #413f3c; */
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
.eta-info {
|
||||
// position: fixed;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
// margin-top: 8px;
|
||||
bottom: 10px;
|
||||
gap: 1rem;
|
||||
// background-color: red;
|
||||
align-items: start;
|
||||
padding: 10px 16px;
|
||||
}
|
||||
|
||||
@@ -196,14 +196,6 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- <div class="modal-footer">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-dark radius-sm"
|
||||
data-dismiss="modal"
|
||||
@click="$emit('reset-vehicle')"
|
||||
>Cerrar</button>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
const isLoading = ref(false);
|
||||
const { t } = useI18n();
|
||||
|
||||
// defineProps(['selectedCities', 'multiple']);
|
||||
defineProps({
|
||||
selectedCities: {
|
||||
type: Array
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
});
|
||||
|
||||
const handleSave = async() => {
|
||||
// const resp = editCompany()
|
||||
const resp = validations();
|
||||
if(resp !== '') {
|
||||
msgError.value = resp;
|
||||
@@ -169,10 +168,6 @@
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
/* .modal-width{
|
||||
width: 1500px !important;
|
||||
} */
|
||||
|
||||
.view-form {
|
||||
padding: 1rem 4rem;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
height: 100vh;
|
||||
padding: 16px 32px;
|
||||
background-color: #FFF;
|
||||
/* opacity: 0.9; */
|
||||
}
|
||||
|
||||
.body {
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
const isLoading = ref(false);
|
||||
const { t } = useI18n();
|
||||
|
||||
// defineProps(['selectedCategory']);
|
||||
defineProps({
|
||||
selectedProduct: {
|
||||
type: Array
|
||||
@@ -29,7 +28,6 @@
|
||||
const resp = await searchProducts(query);
|
||||
options.value = resp;
|
||||
isLoading.value = false;
|
||||
// truckTypes.value = resp;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
const isLoading = ref(false);
|
||||
const { t } = useI18n();
|
||||
|
||||
// defineProps(['selectedCategory']);
|
||||
defineProps({
|
||||
selectedCategory: {
|
||||
type: Array
|
||||
@@ -25,7 +24,6 @@
|
||||
const resp = await searchcategories(query);
|
||||
options.value = resp;
|
||||
isLoading.value = false;
|
||||
// truckTypes.value = resp;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
const isLoading = ref(false);
|
||||
const { t } = useI18n();
|
||||
|
||||
// defineProps(['selectedState', 'multiple']);
|
||||
defineProps({
|
||||
selectedState: {
|
||||
type: Array
|
||||
@@ -26,7 +25,6 @@
|
||||
options.value = resp;
|
||||
isLoading.value = false;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
const isLoading = ref(false);
|
||||
const { t } = useI18n();
|
||||
|
||||
// defineProps(['selectedTruckType']);
|
||||
defineProps({
|
||||
selectedTruckType: {
|
||||
type: Array
|
||||
|
||||
@@ -16,7 +16,7 @@ export default function useAttachments() {
|
||||
attachments.value = data;
|
||||
} catch (error) {
|
||||
attachments.value = null;
|
||||
console.log(error);
|
||||
// console.log(error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ export default function useCalendar() {
|
||||
const loading = ref(false);
|
||||
|
||||
const getCalendarDate = async(startDate, endDate, filter) => {
|
||||
console.log(filter);
|
||||
loading.value = true;
|
||||
const resp = await getCalendar(startDate, endDate, filter);
|
||||
if(resp === null) {
|
||||
|
||||
@@ -16,7 +16,6 @@ export default function useCompany() {
|
||||
if(companyStore.company === null) {
|
||||
loading.value = true;
|
||||
const companyId = auth.user.company;
|
||||
console.log(companyId)
|
||||
const resp = await getCompany();
|
||||
companyStore.company = resp;
|
||||
company.value = resp;
|
||||
|
||||
@@ -8,21 +8,6 @@ export default function useDirectionsRender() {
|
||||
const originCoords = ref(null);
|
||||
const destinationCoords = ref(null);
|
||||
|
||||
// const geocodeAddress = async (address) => {
|
||||
// try {
|
||||
// const response = await fetch(
|
||||
// `https://maps.googleapis.com/maps/api/geocode/json?address=${encodeURIComponent(
|
||||
// address
|
||||
// )}&key=${mapKey}`
|
||||
// );
|
||||
// const data = await response.json();
|
||||
// const location = data.results[0].geometry.location;
|
||||
// return location;
|
||||
// } catch (error) {
|
||||
// return null;
|
||||
// }
|
||||
// };
|
||||
|
||||
const geocodeAddress = async (address) => {
|
||||
try {
|
||||
const geocoder = new google.maps.Geocoder();
|
||||
@@ -32,7 +17,7 @@ export default function useDirectionsRender() {
|
||||
const longitude = data.results[0].geometry.location.lng();
|
||||
return {lng: longitude, lat: latitude};
|
||||
} catch (error) {
|
||||
console.log('Error location', error);
|
||||
// console.log('Error location', error);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@@ -65,45 +50,14 @@ export default function useDirectionsRender() {
|
||||
return [];
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
// console.log(error);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
// const getDirections = async (originCoords, destinationCoords) => {
|
||||
// const originLatLng = `${originCoords.lat},${originCoords.lng}`;
|
||||
// const destinationLatLng = `${destinationCoords.lat},${destinationCoords.lng}`;
|
||||
// try {
|
||||
// let url = `https://maps.googleapis.com/maps/api/directions/json?origin=${originLatLng}&destination=${destinationLatLng}&mode=driving&key=${mapKey}`;
|
||||
// // let url = `https://maps.googleapis.com/maps/api/directions/json?origin=${originLatLng}&destination=${destinationLatLng}&mode=driving&key=${mapKey}`;
|
||||
// const response = await fetch(url);
|
||||
// const data = await response.json();
|
||||
// let polylines = [];
|
||||
// if (data.routes && data.routes.length > 0) {
|
||||
// const steps = data.routes[0].legs[0].steps;
|
||||
// steps.forEach(item => {
|
||||
// const points = decode(item.polyline.points);
|
||||
// points.forEach(poly => {
|
||||
// polylines.push({
|
||||
// lat: poly[0],
|
||||
// lng: poly[1]
|
||||
// })
|
||||
// })
|
||||
// });
|
||||
// console.log({polylines})
|
||||
// return polylines;
|
||||
// } else {
|
||||
// return [];
|
||||
// }
|
||||
// } catch (error) {
|
||||
// console.log(error);
|
||||
// return [];
|
||||
// }
|
||||
// };
|
||||
|
||||
return {
|
||||
originCoords,
|
||||
geocodeAddress,
|
||||
getDirections,
|
||||
// polylines
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,6 @@ export default function useDirectory() {
|
||||
if(resp !== null) {
|
||||
companies.value = resp.data;
|
||||
companiesTotal.value = resp.total;
|
||||
console.log(companiesTotal.value)
|
||||
} else {
|
||||
companies.value = [];
|
||||
companiesTotal.value = 0;
|
||||
|
||||
@@ -17,7 +17,6 @@ export default function useSearchLoads() {
|
||||
}
|
||||
try {
|
||||
const endpoint = `/v1/loads/find${filterStr}&$sort[createdAt]=-1`;
|
||||
// console.log(endpoint);
|
||||
const {data} = await api.get(endpoint);
|
||||
total.value = data.total;
|
||||
loads.value = data.data;
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
.main-panel {
|
||||
position: relative;
|
||||
margin-left: 220px;
|
||||
// width: calc(100wv - 220px) !important;
|
||||
width: calc(100% - 220px); //new
|
||||
}
|
||||
|
||||
|
||||
@@ -14,21 +14,12 @@
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
/* .auth-layout {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
width: 100%;
|
||||
margin: 0px 0px !important;
|
||||
padding: 0px 0px !important;
|
||||
overflow: hidden;
|
||||
} */
|
||||
.auth-layout {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
align-content: center;
|
||||
/* background-color: red; */
|
||||
width: 55%;
|
||||
margin: 0px auto !important;
|
||||
padding: 0px 5px !important;
|
||||
@@ -41,11 +32,6 @@
|
||||
width: 80%;
|
||||
}
|
||||
}
|
||||
/* @media (max-width: 1024px) {
|
||||
.auth-layout {
|
||||
width: 80%;
|
||||
}
|
||||
} */
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.auth-layout {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<script setup>
|
||||
import Header from '../components/Header.vue';
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -18,7 +16,6 @@
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
align-content: center;
|
||||
/* background-color: red; */
|
||||
width: 100%;
|
||||
margin: 0px auto !important;
|
||||
padding: 0px 5px !important;
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
import AuthLayout from '../layouts/AuthLayout.vue'
|
||||
import PublicLayout from '../layouts/PublicLayout.vue'
|
||||
// import {useAuthStore} from '../stores/auth';
|
||||
|
||||
// const authStore = useAuthStore();
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
@@ -138,11 +135,6 @@ const router = createRouter({
|
||||
name: 'shippers',
|
||||
component: () => import('../views/ShippersView.vue'),
|
||||
},
|
||||
// {
|
||||
// path: 'tracking/:code',
|
||||
// name: 'tracking-load',
|
||||
// component: () => import('../views/TrackingLoadView.vue'),
|
||||
// },
|
||||
{
|
||||
path: 'buscar-cargas',
|
||||
name: 'search-loads',
|
||||
@@ -164,15 +156,11 @@ router.beforeEach( async(to, from, next) => {
|
||||
const session = localStorage.getItem('session');
|
||||
//Comprobamos si el usuario esta authenticado
|
||||
if(session) {
|
||||
// if(!authStore.user) {
|
||||
// await authStore.checkSession();
|
||||
next();
|
||||
// }
|
||||
} else {
|
||||
next({name: 'login'})
|
||||
}
|
||||
} else {
|
||||
// No esta protegido
|
||||
next();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -6,7 +6,6 @@ export const login = async(body) => {
|
||||
try {
|
||||
const endpoint = "/v1/account/authorize";
|
||||
const {data} = await apiPublic.post(endpoint, body);
|
||||
// console.log('auth: ', data);
|
||||
if(data.accessToken !== null){
|
||||
if(data.user.job_role !== 'driver'){
|
||||
return {
|
||||
|
||||
@@ -7,7 +7,6 @@ export const getCompany = async() => {
|
||||
const {data} = await api.get(endpoint);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -18,7 +17,6 @@ export const updateCompany = async(formData) => {
|
||||
const {data} = await api.patch(endpoint, formData);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -29,7 +27,6 @@ export const getUsers = async(filter) => {
|
||||
const {data} = await api.get(endpoint);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -40,7 +37,6 @@ export const createUser = async(formData) => {
|
||||
const {data} = await api.post(endpoint, formData);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -51,7 +47,6 @@ export const updateUser = async(user_id, formData) => {
|
||||
const {data} = await api.patch(endpoint, formData);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -65,7 +60,6 @@ export const updateMyUserProfile = async(formData) => {
|
||||
data: data
|
||||
};
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return {
|
||||
msg: error.response.data.error,
|
||||
data: null
|
||||
@@ -79,7 +73,6 @@ export const deleteUser = async(user_id) => {
|
||||
const {data} = await api.delete(endpoint);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -90,7 +83,6 @@ export const getBudgets = async(filter) => {
|
||||
const {data} = await api.get(endpoint);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -100,10 +92,8 @@ export const updateBudget = async(id, formData) => {
|
||||
try {
|
||||
const endpoint = `v1/budgets/${id}`;
|
||||
const {data} = await api.patch(endpoint, formData);
|
||||
console.log(data);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -114,7 +104,6 @@ export const createBudget = async(formData) => {
|
||||
const {data} = await api.post(endpoint, formData);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -125,7 +114,6 @@ export const deleteBudget = async(id) => {
|
||||
const {data} = await api.delete(endpoint);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -133,11 +121,9 @@ export const deleteBudget = async(id) => {
|
||||
export const getLocations = async(filter) => {
|
||||
try {
|
||||
const endpoint = `/v1/branches/find${filter}&$sort[createdAt]=1`;
|
||||
console.log(endpoint);
|
||||
const {data} = await api.get(endpoint);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -148,7 +134,6 @@ export const createLocation = async(formData) => {
|
||||
const {data} = await api.post(endpoint, formData);
|
||||
return {data};
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -159,7 +144,6 @@ export const updateLocation = async(id, formData) => {
|
||||
const {data} = await api.patch(endpoint, formData);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -170,7 +154,6 @@ export const deleteLocation = async(id) => {
|
||||
const {data} = await api.delete(endpoint);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -178,14 +161,12 @@ export const deleteLocation = async(id) => {
|
||||
export const getCalendar = async(startDate, endDate, global) => {
|
||||
try {
|
||||
const endpoint = `/v1/loads/calendar?$sort[createdAt]=-1&date[lte]=${endDate}&date[gte]=${startDate}&global=${global}&elements=1000`;
|
||||
console.log(endpoint);
|
||||
const {data} = await api.get(endpoint);
|
||||
return {
|
||||
msg: "success",
|
||||
data: data
|
||||
};
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return {
|
||||
msg: "Algo salió mal, intente nás tarde",
|
||||
data: null
|
||||
@@ -198,13 +179,11 @@ export const getNotificationsCompany = async() => {
|
||||
try {
|
||||
const endpoint = `/v1/notifications`;
|
||||
const {data} = await api.get(endpoint);
|
||||
console.log(data)
|
||||
return {
|
||||
msg: "success",
|
||||
data: data
|
||||
};
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return {
|
||||
msg: "Algo salió mal, intente nás tarde",
|
||||
data: null
|
||||
@@ -218,7 +197,6 @@ export const deleteNotification = async(id) => {
|
||||
const {data} = await api.delete(endpoint);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return {
|
||||
msg: "Algo salió mal, intente nás tarde",
|
||||
};
|
||||
|
||||
@@ -6,7 +6,6 @@ export const getLoadDirectories = async(filterStr) => {
|
||||
const {data} = await api.get(endpoint);
|
||||
return data.data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -17,20 +16,16 @@ export const getVehicleDirectories = async(filter) => {
|
||||
const {data} = await api.get(endpoint);
|
||||
return data.data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
export const getFreeVehicles = async() => {
|
||||
try {
|
||||
// console.log(process.env.API_URL + "/vehicles/?status=Free&updatedAt[$gt]=" + moment.utc(lasthour).valueOf());
|
||||
const endpoint = `/v1/public-vehicles/location`;
|
||||
console.log({endpoint});
|
||||
const {data} = await api.get(endpoint);
|
||||
return data.data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -38,12 +33,9 @@ export const getFreeVehicles = async() => {
|
||||
export const getNews = async() => {
|
||||
try {
|
||||
const endpoint = `/news`;
|
||||
console.log({endpoint});
|
||||
const {data} = await api.get(endpoint);
|
||||
console.log(data);
|
||||
return data.data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -51,12 +43,9 @@ export const getNews = async() => {
|
||||
export const getCompanies = async(filter) => {
|
||||
try {
|
||||
const endpoint = `/v1/companies/${filter}`;
|
||||
console.log(endpoint);
|
||||
const {data} = await api.get(endpoint);
|
||||
console.log(data);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -64,11 +53,9 @@ export const getCompanies = async(filter) => {
|
||||
export const getLoadPublic = async(id) => {
|
||||
try {
|
||||
const endpoint = `/v1/public-load-tracking/${id}`;
|
||||
// console.log(endpoint);
|
||||
const {data} = await api.get(endpoint);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -76,11 +63,9 @@ export const getLoadPublic = async(id) => {
|
||||
export const getUsersCompany = async(filter) => {
|
||||
try {
|
||||
const endpoint = `/v1/users/find?${filter}`;
|
||||
// console.log({endpoint});
|
||||
const {data} = await api.get(endpoint);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -88,13 +73,9 @@ export const getUsersCompany = async(filter) => {
|
||||
export const getPublicUsersCompany = async(filter) => {
|
||||
try {
|
||||
const endpoint = `/v1/companies/users/${filter}`;
|
||||
// console.log({endpoint});
|
||||
const {data} = await api.get(endpoint);
|
||||
console.log(data.data)
|
||||
// console.log(data);
|
||||
return data.data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -105,7 +86,6 @@ export const getSettingsQuery = async(filter) => {
|
||||
const {data} = await api.get(endpoint);
|
||||
return data.data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -116,7 +96,6 @@ export const searchcategories = async(query) => {
|
||||
const {data} = await api.get(endpoint);
|
||||
return data.data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -127,7 +106,6 @@ export const searchProducts = async(query) => {
|
||||
const {data} = await api.get(endpoint);
|
||||
return data.data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -138,19 +116,16 @@ export const searchstates = async(query) => {
|
||||
const {data} = await api.get(endpoint);
|
||||
return data.data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
export const searchcities = async(query) => {
|
||||
try {
|
||||
// const endpoint = "/cities/?city_name[$regex]=" + query + "&city_name[$options]=i";
|
||||
const endpoint = "/v1/cities/find?regex=" + query;
|
||||
const {data} = await api.get(endpoint);
|
||||
return data.data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,6 @@ export const getVehicles = async(filter) => {
|
||||
const {data} = await api.get(endpoint);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -18,7 +17,6 @@ export const updateVehicle = async(id, formData) => {
|
||||
const {data} = await api.patch(endpoint, formData);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -29,7 +27,6 @@ export const deleteVehicle = async(id) => {
|
||||
const {data} = await api.delete(endpoint);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -40,7 +37,6 @@ export const createVehicle = async(formData) => {
|
||||
const {data} = await api.post(endpoint, formData);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -51,7 +47,6 @@ export const saveProposal = async(formData) => {
|
||||
const {data} = await api.post(endpoint, formData);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -62,7 +57,6 @@ export const updateProposal = async(id, formData) => {
|
||||
const {data} = await api.patch(endpoint, formData);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -155,19 +155,14 @@ export const useCompanyStore = defineStore('company', () => {
|
||||
proposals.value = [];
|
||||
proposalsTotal.value = 0;
|
||||
proposalsCurrentPage.value = 0;
|
||||
// companyid = null;
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
const $reset = () => {
|
||||
company.value = null;
|
||||
// companyid = null;
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
|
||||
///loads?company=64fa70c130d2650011ac4f3a&status[$ne]=Closed,posted_by_name[$regex]=ju&posted_by_name[$options]=i
|
||||
|
||||
const getProposalsCompany = async(filter, reload = false) => {
|
||||
const companyId = localStorage.getItem('id');
|
||||
try {
|
||||
|
||||
@@ -23,7 +23,6 @@ export const useLoadsStore = defineStore('load', () => {
|
||||
loadsDashboard.value = data.data;
|
||||
} catch (error) {
|
||||
loadsDashboard.value = [];
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,7 +33,6 @@ export const useLoadsStore = defineStore('load', () => {
|
||||
if(loadsDashboard.value.length <= 0 || reload) {
|
||||
const endpoint = `/v1/proposals/find?carrier=${companyId}&elements=100`;
|
||||
const {data} = await api.get(endpoint);
|
||||
console.log(data);
|
||||
loadsDashboard.value = data.data.map( (e) => e.load);
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -53,14 +51,12 @@ export const useLoadsStore = defineStore('load', () => {
|
||||
if(loads.value.length <= 0 || reload) {
|
||||
try {
|
||||
const endpoint = `/v1/loads/find?company=${companyid}&${filterStr}&$sort%5BcreatedAt%5D=-1`;
|
||||
console.log(endpoint);
|
||||
const {data} = await api.get(endpoint);
|
||||
loads.value = data.data;
|
||||
loadsTotal.value = data.total;
|
||||
} catch (error) {
|
||||
loads.value = [];
|
||||
loadsTotal.value = 0;
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,13 +64,10 @@ export const useLoadsStore = defineStore('load', () => {
|
||||
const getProposalsOfLoads = async(filterQuery) => {
|
||||
try {
|
||||
const endpoint = `/v1/proposals/find?load=${filterQuery}`;
|
||||
console.log(endpoint)
|
||||
const {data} = await api.get(endpoint);
|
||||
console.log(data);
|
||||
proposalsOfLoads.value = data.data;
|
||||
} catch (error) {
|
||||
proposalsOfLoads.value = [];
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +78,6 @@ export const useLoadsStore = defineStore('load', () => {
|
||||
loadsTotal.value++;
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -94,10 +86,8 @@ export const useLoadsStore = defineStore('load', () => {
|
||||
try {
|
||||
const endpoint = `/v1/proposals/${id}`;
|
||||
const {data} = await api.patch(endpoint, proposal);
|
||||
// console.log(data);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -106,10 +96,8 @@ export const useLoadsStore = defineStore('load', () => {
|
||||
try {
|
||||
const endpoint = `/v1/proposals/${id}`;
|
||||
const {data} = await api.delete(endpoint);
|
||||
// console.log(data);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -118,10 +106,8 @@ export const useLoadsStore = defineStore('load', () => {
|
||||
try {
|
||||
const endpoint = `/v1/loads/${loadId}`;
|
||||
const {data} = await api.patch(endpoint, load);
|
||||
// console.log(data);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -129,12 +115,10 @@ export const useLoadsStore = defineStore('load', () => {
|
||||
const deleteLoad = async(loadId) => {
|
||||
try {
|
||||
const endpoint = `/v1/loads/${loadId}`;
|
||||
console.log(endpoint);
|
||||
const {data} = await api.delete(endpoint);
|
||||
loadsTotal.value--;
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -145,7 +129,6 @@ export const useLoadsStore = defineStore('load', () => {
|
||||
const {data} = await api.get(endpoint);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ export const useVehiclesStore = defineStore('vehicles', () => {
|
||||
}
|
||||
if(vehicles.value.length <= 0 || reload === true) {
|
||||
const resp = await getVehicles(filterStr + '&$sort%5BcreatedAt%5D=-1');
|
||||
// console.log(resp);
|
||||
if(resp !== null) {
|
||||
vehiclesTotal.value = resp.total;
|
||||
vehicles.value = resp.data;
|
||||
@@ -44,15 +43,12 @@ export const useVehiclesStore = defineStore('vehicles', () => {
|
||||
const updateVehicleCompany = async(id, formData, localData = {}) => {
|
||||
const data = await updateVehicle(id, formData);
|
||||
if(data) {
|
||||
console.log({data});
|
||||
const index = vehicles.value.findIndex((vehicle) => vehicle._id === id);
|
||||
vehicles.value[index] = {
|
||||
...vehicles.value[index],
|
||||
...data,
|
||||
...localData
|
||||
};
|
||||
|
||||
console.log(vehicles.value[index]);
|
||||
return 'success';
|
||||
} else {
|
||||
return t('errors.generic');
|
||||
|
||||
@@ -109,7 +109,6 @@
|
||||
|
||||
const mapLoadsToEvents = () => {
|
||||
events.value = [];
|
||||
console.log(loads.value)
|
||||
loads.value.forEach((e) => {
|
||||
const indicator = eventStatusLoad(e.load_status);
|
||||
const dateStart = getDateTime(e.est_loading_date, 0);
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
});
|
||||
|
||||
const getCompaniesByPage = (data) => {
|
||||
console.log(data);
|
||||
// filterQuery.value.company_type = 'shipper';
|
||||
filterQuery.value.page = "page="+ data.page;
|
||||
currentCompaniesPage.value = data.page
|
||||
|
||||
@@ -54,7 +54,6 @@
|
||||
clearMessages();
|
||||
return;
|
||||
}
|
||||
console.log(typeCompany);
|
||||
step.value = 2;
|
||||
}
|
||||
|
||||
@@ -66,7 +65,6 @@
|
||||
return;
|
||||
}
|
||||
step.value = 3;
|
||||
// console.log(company);
|
||||
}
|
||||
|
||||
const handleSendRegister = async () => {
|
||||
@@ -98,7 +96,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
// console.log(result);
|
||||
localStorage.setItem('id', result.data._id);
|
||||
localStorage.setItem('session', auth.sesion);
|
||||
// localStorage.setItem('access', auth.token);
|
||||
@@ -110,7 +107,6 @@
|
||||
"phone2" : user.phone2,
|
||||
};
|
||||
let respUser = await updateMyUserProfile( userData );
|
||||
// console.log('User create: ', respUser);
|
||||
if(respUser.msg === 'success') {
|
||||
auth.user = respUser.data;
|
||||
} else {
|
||||
|
||||
@@ -161,10 +161,6 @@
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
/* .profile {
|
||||
margin: 0 auto;
|
||||
} */
|
||||
|
||||
.box-btns {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
@@ -62,10 +62,6 @@
|
||||
segmentsData.value.push(e?.categories[0].name)
|
||||
}
|
||||
|
||||
// if( (user.value?.permissions === "role_carrier") && e?.load?.categories) {
|
||||
// segmentsData.value.push(e?.load?.categories[0].name)
|
||||
// }
|
||||
|
||||
if( e?.origin?.city) {
|
||||
cities.value.push(e?.origin.city)
|
||||
}
|
||||
|
||||
@@ -17,20 +17,15 @@
|
||||
const limit = 10;
|
||||
|
||||
onMounted(() =>{
|
||||
console.log('init')
|
||||
getDataLoadsInit(false);
|
||||
})
|
||||
|
||||
///loads?company=64fa70c130d2650011ac4f3a&elements=3&page=0&status[$ne]=Closed&$sort%5BcreatedAt%5D=-1
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
watch(query, () => {
|
||||
filterQuery.value.page = "page="+ 0;
|
||||
filterQuery.value.limit = "elements="+ 100;
|
||||
if(query.value.length === 0){
|
||||
console.log('Clear manueal')
|
||||
// console.log(loadStore.loadsTotal)
|
||||
clearRequest();
|
||||
filterQuery.value.search = "";
|
||||
getLoadWithFilters(filterQuery.value);
|
||||
@@ -47,7 +42,6 @@
|
||||
}
|
||||
|
||||
const getLoadsByPage = async(data) => {
|
||||
console.log(data);
|
||||
loading.value = true;
|
||||
filterQuery.value.page = "page="+ data.page;
|
||||
loadStore.loadsCurrentPage = data.page
|
||||
@@ -57,7 +51,6 @@
|
||||
|
||||
const getLoadWithFilters = async(filter) => {
|
||||
loading.value = true;
|
||||
console.log(filter);
|
||||
await loadStore.getCompanyLoads(filter, true);
|
||||
loading.value = false;
|
||||
}
|
||||
@@ -65,7 +58,6 @@
|
||||
const search = () => {
|
||||
setTimeout(() => {
|
||||
if(query.value.length >= 2){
|
||||
// filterQuery.value.search = "company_name[$regex]=" + query.value + "&company_name[$options]=i";
|
||||
filterQuery.value.search = "posted_by_name[$regex]="+query.value+"&posted_by_name[$options]=i";
|
||||
getLoadWithFilters(filterQuery.value);
|
||||
}
|
||||
@@ -77,7 +69,6 @@
|
||||
clearRequest();
|
||||
filterQuery.value.search = ""
|
||||
filterQuery.value.status = "status[$ne]="+"Closed";
|
||||
console.log('click here');
|
||||
if(query.value == ''){
|
||||
getDataLoadsInit(true);
|
||||
} else {
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
const locationCurrent = ref(null);
|
||||
const openModal = ref(false);
|
||||
const { t, locale } = useI18n();
|
||||
// const typeDirection = ref(null)
|
||||
const typeDirection = ref({value: 'both', label: t('labels.both')})
|
||||
const optionsFilter = ref([]);
|
||||
const openPopup = ref(false);
|
||||
@@ -31,7 +30,6 @@
|
||||
|
||||
const getInitData = async() => {
|
||||
loading.value = true;
|
||||
// companyStore.locationsCurrentPage = companyStore.locationsCurrentPage;
|
||||
filterQuery.value.company = "company="+ localStorage.getItem('id');
|
||||
filterQuery.value.limit = "elements=" + limit;
|
||||
filterQuery.value.page = "page=" + 0;
|
||||
@@ -41,7 +39,6 @@
|
||||
{value: 'loading',label: t('labels.load')},
|
||||
{value: 'unloading',label: t('labels.download')}
|
||||
]
|
||||
console.log(companyStore.locations)
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
@@ -74,14 +71,12 @@
|
||||
if(query.value.length === 0){
|
||||
clearRequest();
|
||||
filterQuery.value.search = "";
|
||||
// filterQuery.value.page = 1
|
||||
getLocationsWithFilters(filterQuery.value);
|
||||
}
|
||||
});
|
||||
|
||||
const search = () => {
|
||||
if(query.value.length >= 2){
|
||||
// filterQuery.value = "company_name[$regex]=" + query.value + "&company_name[$options]=i";
|
||||
filterQuery.value.search = "branch_name[$regex]="+ query.value +"&branch_name[$options]=i";
|
||||
getLocationsWithFilters(filterQuery.value);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { login } from '../services/auth';
|
||||
import { RouterLink, useRouter } from 'vue-router';
|
||||
import { useAuthStore } from '../stores/auth';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
const form = reactive({
|
||||
email: '',
|
||||
@@ -55,8 +55,6 @@ import { useI18n } from 'vue-i18n';
|
||||
token: resp.data.accessToken,
|
||||
user: resp.data.user,
|
||||
})
|
||||
// localStorage.setItem('session', resp.data.session_token);
|
||||
// localStorage.setItem('access', resp.data.accessToken);
|
||||
router.push({name: 'register-company'});
|
||||
}
|
||||
} else {
|
||||
@@ -127,8 +125,6 @@ import { useI18n } from 'vue-i18n';
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
/* min-width: 420px; */
|
||||
/* padding: 2rem 3rem; */
|
||||
}
|
||||
|
||||
.icon-success{
|
||||
|
||||
@@ -28,10 +28,7 @@
|
||||
|
||||
const getInitialData = async() => {
|
||||
await auth.authenticationPromise;
|
||||
// await authenticationPromise;
|
||||
await company.getCompanyData();
|
||||
console.log(company.company)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -75,10 +72,6 @@
|
||||
<span class="font-weight-bold">{{ t('labels.segmentsCompany') }}: </span>
|
||||
{{company.company?.categories.map((e) => e.name).join(', ')}}
|
||||
</div>
|
||||
<!-- <div class="item-company">
|
||||
<span class="font-weight-bold">Afiliación: </span>
|
||||
{{ company.company?.membership }}
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6 col-lg-6">
|
||||
<div class="item-company">
|
||||
@@ -125,7 +118,6 @@
|
||||
margin-bottom: 1rem;
|
||||
font-size: 1.2rem;
|
||||
color: #323030;
|
||||
/* font-weight: bold; */
|
||||
}
|
||||
|
||||
.item-company span {
|
||||
|
||||
@@ -73,7 +73,6 @@
|
||||
checksum: checksum.value
|
||||
}
|
||||
const result = await recoveryPasswordConfirm(data);
|
||||
// console.log(result);
|
||||
if(result.msg === 'success' && result.data !== null){
|
||||
msgSuccess.value = t('messages.changePassword');
|
||||
step.value = 3;
|
||||
|
||||
@@ -75,9 +75,7 @@
|
||||
checksum: checksum.value
|
||||
}
|
||||
const result = await regiterConfirm(data);
|
||||
// console.log(result);
|
||||
if(result.msg === 'success' && result.data !== null){
|
||||
// msgSuccess.value = 'Registro exitoso!';
|
||||
step.value = 3;
|
||||
checksum.value = '';
|
||||
Object.assign(form, {
|
||||
|
||||
@@ -134,7 +134,6 @@
|
||||
}
|
||||
|
||||
const getLoadsByPage = (data) => {
|
||||
console.log(data);
|
||||
filterQuery.value.page = "page="+ data.page;
|
||||
currentPage.value = data.page
|
||||
getLoadsPublished(filterQuery.value);
|
||||
@@ -154,7 +153,6 @@
|
||||
const currentLoad = ref(null);
|
||||
|
||||
const handleSetCurrentLoad = (load) => {
|
||||
console.log(load);
|
||||
currentLoad.value = load
|
||||
}
|
||||
|
||||
@@ -163,7 +161,6 @@
|
||||
}
|
||||
|
||||
const removeLoadOfList = (load) => {
|
||||
console.log('se ejecuta removeLoadOfList');
|
||||
loads.value = loads.value.filter((e) => e._id !== load._id);
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -209,9 +209,7 @@
|
||||
margin: 0 auto;
|
||||
background-color: #FFF;
|
||||
border-radius: 13px;
|
||||
/* background-color: red; */
|
||||
flex-direction: column;
|
||||
/* align-items: center; */
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
padding: 20px 10%;
|
||||
|
||||
@@ -26,11 +26,7 @@
|
||||
getCompaniesData(filterQuery.value);
|
||||
});
|
||||
|
||||
///v1/public-companies/shipper?elements=3&skip=6&$sort%5BcreatedAt%5D=-1
|
||||
|
||||
const getCompaniesByPage = (data) => {
|
||||
console.log(data);
|
||||
// filterQuery.value.company_type = 'shipper';
|
||||
filterQuery.value.page = "page="+ data.page;
|
||||
currentCompaniesPage.value = data.page
|
||||
getCompaniesData(filterQuery.value);
|
||||
@@ -190,9 +186,7 @@
|
||||
margin: 0 auto;
|
||||
background-color: #FFF;
|
||||
border-radius: 13px;
|
||||
/* background-color: red; */
|
||||
flex-direction: column;
|
||||
/* align-items: center; */
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
padding: 20px 10%;
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
const id = route.params['code'];
|
||||
await getLoadTracking(id)
|
||||
if(load.value !== null) {
|
||||
// console.log(load.value)
|
||||
const addressOrigin = load.value?.origin_geo?.coordinates;
|
||||
const addressDestination = load.value?.destination_geo?.coordinates;
|
||||
if(addressOrigin && addressDestination) {
|
||||
@@ -53,11 +52,8 @@
|
||||
lat: parseFloat(load.value.vehicle.last_location_lat),
|
||||
lng: parseFloat(load.value.vehicle.last_location_lng)
|
||||
}
|
||||
console.log(vehicleLastLocation);
|
||||
}
|
||||
|
||||
|
||||
console.log(load.value);
|
||||
switch (load.value.load_status) {
|
||||
case 'Loading':
|
||||
isLoadActive.value = true;
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
const limit = 10;
|
||||
|
||||
const getInitData = async() => {
|
||||
console.log('callll')
|
||||
loading.value = true;
|
||||
await companyStore.getUsersCompany(limit);
|
||||
loading.value = false;
|
||||
|
||||
@@ -58,7 +58,6 @@
|
||||
|
||||
const search = () => {
|
||||
if(query.value.length >= 2){
|
||||
// filterQuery.value = "company_name[$regex]=" + query.value + "&company_name[$options]=i";
|
||||
filterQuery.value.search = "truck_type[$regex]=" + query.value +"&truck_type[$options]=i";
|
||||
getVehiclesWithFilters(filterQuery.value);
|
||||
}
|
||||
@@ -176,7 +175,6 @@
|
||||
}
|
||||
|
||||
.box-search {
|
||||
/* width: 60%; */
|
||||
flex: 1;
|
||||
}
|
||||
.custom-search {
|
||||
@@ -185,19 +183,12 @@
|
||||
}
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
/* .box-search {
|
||||
width: 60%;
|
||||
} */
|
||||
.box-filters {
|
||||
gap: .4rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
|
||||
/* .box-search {
|
||||
width: 100%;
|
||||
} */
|
||||
.box-filters {
|
||||
gap: .3rem;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user