+
{{ t('Add ticket') }}
@@ -485,6 +420,20 @@ const markAsServed = () => {
>
{{ t('Preview') }}
+
+
+ {{ t('Summary') }}
+
+
@@ -505,8 +454,13 @@ const markAsServed = () => {
+
+es:
+ Search roadmaps: Buscar troncales
+ You can search by roadmap reference: Puedes buscar por referencia de la troncal
+ Delete roadmap(s): Eliminar troncal(es)
+ Selected roadmaps will be removed: Las troncales seleccionadas serán eliminadas
+ Are you sure you want to continue?: ¿Seguro que quieres continuar?
+ The date can't be empty: La fecha no puede estar vacía
+ Clone Selected Routes: Clonar rutas seleccionadas
+ Create roadmap: Crear troncal
+ Roadmap: Troncal
+ Carrier: Transportista
+ Plate: Matrícula
+ Price: Precio
+ Observations: Observaciones
+ Preview: Vista previa
+
diff --git a/src/pages/Route/RouteTickets.vue b/src/pages/Route/RouteTickets.vue
new file mode 100644
index 000000000..8410232c5
--- /dev/null
+++ b/src/pages/Route/RouteTickets.vue
@@ -0,0 +1,453 @@
+
+
+
+
+
+
+
+
+ (routeEntity = data)"
+ auto-load
+ :url="`Routes/${route.params?.id}`"
+ :filter="{
+ fields: ['vehicleFk'],
+ }"
+ />
+
+
+
+ {{ t('Select the starting date') }}
+
+
+
+
+
+
+
+
+ {{ t('Clone') }}
+
+
+
+
+
+
+
+
+ {{ t('Sort routes') }}
+
+
+ {{ t('Open buscaman') }}
+
+
+ {{ t('Delete priority') }}
+
+
+ {{
+ t('Renumber all tickets in the order you see on the screen')
+ }}
+
+
+
+ {{ t('Send SMS to all clients') }}
+
+
+
+
+
(ticketList = data)"
+ >
+
+
+
+
+
+
+
+
+ {{ t('Assign highest priority') }}
+
+
+
+
+
+
+
+
+
+ {{ value }}
+ {{ t('Open buscaman') }}
+
+
+
+
+
+
+ {{ value }}
+
+
+
+
+
+
+
+ {{ value }}
+
+
+
+
+
+
+
+
+ {{ t('globals.remove') }}
+
+
+ {{ value }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('Add ticket') }}
+
+
+
+
+
+
+
+
+es:
+ Order: Orden
+ Street: Dirección fiscal
+ City: Población
+ PC: CP
+ Client: Cliente
+ Warehouse: Almacén
+ Packages: Bultos
+ Packaging: Encajado
+ Confirm removal from route: Quitar de la ruta
+ Are you sure you want to remove this ticket from the route?: ¿Seguro que quieres quitar este ticket de la ruta?
+ Sort routes: Ordenar rutas
+ Open buscaman: Abrir buscaman
+ Delete priority: Borrar orden
+ Renumber all tickets in the order you see on the screen: Renumerar todos los tickets con el orden que ves por pantalla
+ Assign highest priority: Asignar máxima prioridad
+ Send SMS to all clients: Mandar sms a todos los clientes de las rutas
+ Send SMS to the selected tickets: Enviar SMS a los tickets seleccionados
+ Add ticket: Añadir ticket
+
diff --git a/src/pages/Wagon/WagonCounter.vue b/src/pages/Wagon/WagonCounter.vue
index bd5d2ca67..15a1ab7ba 100644
--- a/src/pages/Wagon/WagonCounter.vue
+++ b/src/pages/Wagon/WagonCounter.vue
@@ -7,8 +7,8 @@ import VnConfirm from 'components/ui/VnConfirm.vue';
const quasar = useQuasar();
const { t } = useI18n();
-const session = useSession();
-const token = session.getToken();
+const { getTokenMultimedia } = useSession();
+const token = getTokenMultimedia();
const counters = ref({
alquilerBandeja: { count: 0, id: 96001, title: 'CC Bandeja', isTray: true },
diff --git a/src/pages/Worker/Card/WorkerDescriptor.vue b/src/pages/Worker/Card/WorkerDescriptor.vue
index bec56bee7..5144b3bfa 100644
--- a/src/pages/Worker/Card/WorkerDescriptor.vue
+++ b/src/pages/Worker/Card/WorkerDescriptor.vue
@@ -22,7 +22,7 @@ const $props = defineProps({
const route = useRoute();
const { t } = useI18n();
-const { getToken } = useSession();
+const { getTokenMultimedia } = useSession();
const entityId = computed(() => {
return $props.id || route.params.id;
@@ -56,7 +56,7 @@ const filter = {
const sip = computed(() => worker.value?.sip && worker.value.sip.extension);
function getWorkerAvatar() {
- const token = getToken();
+ const token = getTokenMultimedia();
return `/api/Images/user/160x160/${entityId.value}/download?access_token=${token}`;
}
const data = ref(useCardDescription());
diff --git a/src/router/modules/index.js b/src/router/modules/index.js
index 84a26798d..076605f24 100644
--- a/src/router/modules/index.js
+++ b/src/router/modules/index.js
@@ -13,6 +13,7 @@ import Travel from './travel';
import Order from './order';
import Department from './department';
import Entry from './entry';
+import roadmap from "./roadmap";
export default [
Item,
@@ -30,4 +31,5 @@ export default [
invoiceIn,
Department,
Entry,
+ roadmap
];
diff --git a/src/router/modules/invoiceOut.js b/src/router/modules/invoiceOut.js
index 386e04ed8..7c05b82e6 100644
--- a/src/router/modules/invoiceOut.js
+++ b/src/router/modules/invoiceOut.js
@@ -44,7 +44,7 @@ export default {
name: 'InvoiceOutNegativeBases',
meta: {
title: 'negativeBases',
- icon: 'view_list',
+ icon: 'vn:ticket',
},
component: () =>
import('src/pages/InvoiceOut/InvoiceOutNegativeBases.vue'),
diff --git a/src/router/modules/roadmap.js b/src/router/modules/roadmap.js
new file mode 100644
index 000000000..02edf94be
--- /dev/null
+++ b/src/router/modules/roadmap.js
@@ -0,0 +1,52 @@
+import { RouterView } from 'vue-router';
+
+export default {
+ path: '/route/roadmap',
+ name: 'Roadmap',
+ meta: {
+ title: 'roadmap',
+ icon: 'vn:troncales',
+ },
+ component: RouterView,
+ redirect: { name: 'RouteMain' },
+ menus: {
+ card: ['RoadmapBasicData', 'RoadmapStops'],
+ },
+ children: [
+ {
+ name: 'RouteRoadmapCard',
+ path: ':id',
+ component: () => import('src/pages/Route/Roadmap/RoadmapCard.vue'),
+ redirect: { name: 'RoadmapSummary' },
+ children: [
+ {
+ name: 'RoadmapSummary',
+ path: 'summary',
+ meta: {
+ title: 'summary',
+ icon: 'open_in_new',
+ },
+ component: () => import('pages/Route/Roadmap/RoadmapSummary.vue'),
+ },
+ {
+ name: 'RoadmapBasicData',
+ path: 'basic-data',
+ meta: {
+ title: 'basicData',
+ icon: 'vn:settings',
+ },
+ component: () => import('pages/Route/Roadmap/RoadmapBasicData.vue'),
+ },
+ {
+ name: 'RoadmapStops',
+ path: 'stops',
+ meta: {
+ title: 'stops',
+ icon: 'vn:lines',
+ },
+ component: () => import('pages/Route/Roadmap/RoadmapStops.vue'),
+ },
+ ],
+ },
+ ],
+};
diff --git a/src/router/modules/route.js b/src/router/modules/route.js
index fad991fc6..099492981 100644
--- a/src/router/modules/route.js
+++ b/src/router/modules/route.js
@@ -11,8 +11,8 @@ export default {
component: RouterView,
redirect: { name: 'RouteMain' },
menus: {
- main: ['RouteList', 'CmrList'],
- card: ['RouteBasicData'],
+ main: ['RouteList', 'RouteAutonomous', 'RouteRoadmap', 'CmrList'],
+ card: ['RouteBasicData', 'RouteTickets', 'RouteLog'],
},
children: [
{
@@ -21,15 +21,6 @@ export default {
component: () => import('src/pages/Route/RouteMain.vue'),
redirect: { name: 'RouteList' },
children: [
- {
- path: 'cmr',
- name: 'CmrList',
- meta: {
- title: 'cmrsList',
- icon: 'fact_check',
- },
- component: () => import('src/pages/Route/Cmr/CmrList.vue'),
- },
{
path: 'list',
name: 'RouteList',
@@ -47,6 +38,42 @@ export default {
},
component: () => import('src/pages/Route/Card/RouteForm.vue'),
},
+ {
+ path: 'agency-term',
+ name: 'RouteAutonomous',
+ meta: {
+ title: 'autonomous',
+ icon: 'vn:agency-term',
+ },
+ component: () => import('src/pages/Route/RouteAutonomous.vue'),
+ },
+ {
+ path: 'roadmap',
+ name: 'RouteRoadmap',
+ meta: {
+ title: 'RouteRoadmap',
+ icon: 'vn:troncales',
+ },
+ component: () => import('src/pages/Route/RouteRoadmap.vue'),
+ },
+ {
+ path: 'roadmap/create',
+ name: 'RouteRoadmapCreate',
+ meta: {
+ title: 'RouteRoadmapCreate',
+ icon: 'vn:troncales',
+ },
+ component: () => import('src/pages/Route/Roadmap/RoadmapCreate.vue'),
+ },
+ {
+ path: 'cmr',
+ name: 'CmrList',
+ meta: {
+ title: 'cmrsList',
+ icon: 'fact_check',
+ },
+ component: () => import('src/pages/Route/Cmr/CmrList.vue'),
+ },
],
},
{
@@ -73,6 +100,24 @@ export default {
},
component: () => import('pages/Route/Card/RouteSummary.vue'),
},
+ {
+ path: 'tickets',
+ name: 'RouteTickets',
+ meta: {
+ title: 'tickets',
+ icon: 'vn:ticket',
+ },
+ component: () => import('src/pages/Route/RouteTickets.vue'),
+ },
+ {
+ path: 'log',
+ name: 'RouteLog',
+ meta: {
+ title: 'log',
+ icon: 'vn:History',
+ },
+ component: () => import('src/pages/Route/RouteLog.vue'),
+ },
],
},
],
diff --git a/src/router/routes.js b/src/router/routes.js
index d1027955f..32f43965f 100644
--- a/src/router/routes.js
+++ b/src/router/routes.js
@@ -13,6 +13,7 @@ import department from './modules/department';
import shelving from 'src/router/modules/shelving';
import order from 'src/router/modules/order';
import entry from 'src/router/modules/entry';
+import roadmap from "src/router/modules/roadmap";
const routes = [
{
@@ -66,6 +67,7 @@ const routes = [
supplier,
travel,
department,
+ roadmap,
entry,
{
path: '/:catchAll(.*)*',
diff --git a/src/stores/invoiceOutGlobal.js b/src/stores/invoiceOutGlobal.js
index 7151aac5f..b1bcc0e7d 100644
--- a/src/stores/invoiceOutGlobal.js
+++ b/src/stores/invoiceOutGlobal.js
@@ -73,6 +73,9 @@ export const useInvoiceOutGlobalStore = defineStore({
const stringDate = data.issued.substring(0, 10);
this.minInvoicingDate = stringDate;
this.formInitialData.invoiceDate = stringDate;
+
+ this.minInvoicingDate = new Date(data.issued);
+ this.formInitialData.invoiceDate = this.minInvoicingDate;
} catch (err) {
console.error('Error fetching invoice out global initial data');
throw new Error();
@@ -103,12 +106,8 @@ export const useInvoiceOutGlobalStore = defineStore({
if (clientsToInvoice == 'all') params.clientId = undefined;
- const addressesResponse = await await axios.post(
- 'InvoiceOuts/clientsToInvoice',
- params
- );
-
- this.addresses = addressesResponse.data;
+ const { data } = await axios.post('InvoiceOuts/clientsToInvoice', params);
+ this.addresses = data;
if (!this.addresses || !this.addresses.length > 0) {
notify(
@@ -118,9 +117,9 @@ export const useInvoiceOutGlobalStore = defineStore({
throw new Error("There aren't addresses to invoice");
}
- this.addresses.forEach(async (address) => {
+ for (const address of this.addresses) {
await this.invoiceClient(address, formData);
- });
+ }
} catch (err) {
this.handleError(err);
}
@@ -186,15 +185,10 @@ export const useInvoiceOutGlobalStore = defineStore({
this.status = 'invoicing';
this.invoicing = true;
- const invoiceResponse = await axios.post(
- 'InvoiceOuts/invoiceClient',
- params
- );
-
- if (invoiceResponse.data) {
- this.makePdfAndNotify(invoiceResponse.data, address);
- }
+ const { data } = await axios.post('InvoiceOuts/invoiceClient', params);
+ if (data) await this.makePdfAndNotify(data, address);
+ this.addressIndex++;
this.isInvoicing = false;
} catch (err) {
if (
@@ -203,8 +197,7 @@ export const useInvoiceOutGlobalStore = defineStore({
err.response.status >= 400 &&
err.response.status < 500
) {
- this.invoiceClientError(address, err.response);
- this.addressIndex++;
+ this.invoiceClientError(address, err.response?.data?.error?.message);
return;
} else {
this.invoicing = false;
@@ -227,12 +220,11 @@ export const useInvoiceOutGlobalStore = defineStore({
this.nPdfs++;
this.nRequests--;
} catch (err) {
- this.invoiceClientError(client, err, true);
+ this.invoiceClientError(client, err.response?.data?.error?.message, true);
}
},
- invoiceClientError(client, response, isWarning) {
- const message = response.data?.error?.message || response.message;
+ invoiceClientError(client, message, isWarning) {
this.errors.unshift({ client, message, isWarning });
},
diff --git a/src/utils/buscaman.js b/src/utils/buscaman.js
new file mode 100644
index 000000000..0778a21e8
--- /dev/null
+++ b/src/utils/buscaman.js
@@ -0,0 +1,22 @@
+import axios from 'axios';
+
+const BUSCAMAN_URL = 'https://gps.buscalia.com/usuario/localizar.aspx?bmi=true&addr=';
+
+export async function openBuscaman(vehicleId, tickets) {
+ if (!vehicleId) throw new Error(`The route doesn't have a vehicle`);
+
+ const response = await axios.get(`Routes/${vehicleId}/getDeliveryPoint`);
+
+ if (!response.data) {
+ throw new Error(`The route's vehicle doesn't have a delivery point`);
+ }
+
+ let addresses = response.data;
+ tickets.forEach((ticket, index) => {
+ const previousLine = tickets[index - 1] ? tickets[index - 1].street : null;
+ if (previousLine !== tickets.street) {
+ addresses += `+to:${ticket.postalCode} ${ticket.city} ${ticket.street}`;
+ }
+ });
+ window.open(BUSCAMAN_URL + encodeURI(addresses), '_blank');
+}
diff --git a/test/cypress/integration/VnLocation.spec.js b/test/cypress/integration/VnLocation.spec.js
index 02b924e4d..5892e3ad5 100644
--- a/test/cypress/integration/VnLocation.spec.js
+++ b/test/cypress/integration/VnLocation.spec.js
@@ -40,9 +40,9 @@ describe('VnLocation', () => {
cy.waitForElement('.q-card');
});
- it('Show all options', function() {
+ it('Show locations options', function() {
cy.get(inputLocation).click();
- cy.get(locationOptions).should('have.length', 1);
+ cy.get(locationOptions).should('have.length', 5);
});
});
})
diff --git a/test/cypress/integration/worker/workerList.spec.js b/test/cypress/integration/worker/workerList.spec.js
index b5c57f920..bc4b2383e 100644
--- a/test/cypress/integration/worker/workerList.spec.js
+++ b/test/cypress/integration/worker/workerList.spec.js
@@ -16,7 +16,7 @@ describe('WorkerList', () => {
it('should open the worker summary', () => {
cy.openListSummary(0);
cy.get('.summaryHeader div').should('have.text', '1110 - Jessica Jones');
- cy.get('.summary .header').eq(0).invoke('text').should('include', 'Basic data');
- cy.get('.summary .header').eq(1).should('have.text', 'User data');
+ cy.get('.summary .header-link').eq(0).invoke('text').should('include', 'Basic data');
+ cy.get('.summary .header-link').eq(1).should('have.text', 'User data');
});
});
diff --git a/test/vitest/__tests__/components/Paginate.spec.js b/test/vitest/__tests__/components/Paginate.spec.js
index 2a22ce438..cf5e5d2ea 100644
--- a/test/vitest/__tests__/components/Paginate.spec.js
+++ b/test/vitest/__tests__/components/Paginate.spec.js
@@ -49,6 +49,8 @@ describe('VnPaginate', () => {
],
});
vm.arrayData.hasMoreData.value = true;
+ await vm.$nextTick();
+
vm.store.data = [
{ id: 1, name: 'Tony Stark' },
{ id: 2, name: 'Jessica Jones' },
diff --git a/test/vitest/__tests__/composables/useSession.spec.js b/test/vitest/__tests__/composables/useSession.spec.js
index 4f900aca6..f9f3dcb80 100644
--- a/test/vitest/__tests__/composables/useSession.spec.js
+++ b/test/vitest/__tests__/composables/useSession.spec.js
@@ -54,7 +54,8 @@ describe('session', () => {
expect(localStorage.getItem('token')).toEqual('tokenToBeGone');
expect(user.value).toEqual(previousUser);
- session.destroy();
+ vi.spyOn(axios, 'post').mockResolvedValue({ data: true });
+ await session.destroy();
user = state.getUser();
expect(localStorage.getItem('token')).toBeNull();
@@ -92,9 +93,10 @@ describe('session', () => {
});
const expectedToken = 'mySessionToken';
+ const expectedTokenMultimedia = 'mySessionTokenMultimedia';
const keepLogin = false;
- await session.login(expectedToken, keepLogin);
+ await session.login(expectedToken,expectedTokenMultimedia, keepLogin);
const roles = state.getRoles();
const localToken = localStorage.getItem('token');
@@ -104,7 +106,7 @@ describe('session', () => {
expect(localToken).toBeNull();
expect(sessionToken).toEqual(expectedToken);
- session.destroy(); // this clears token and user for any other test
+ await session.destroy(); // this clears token and user for any other test
});
it('should fetch the user roles and then set token in the localStorage', async () => {
@@ -114,9 +116,10 @@ describe('session', () => {
});
const expectedToken = 'myLocalToken';
+ const expectedTokenMultimedia = 'myLocalTokenMultimedia';
const keepLogin = true;
- await session.login(expectedToken, keepLogin);
+ await session.login(expectedToken, expectedTokenMultimedia, keepLogin);
const roles = state.getRoles();
const localToken = localStorage.getItem('token');
@@ -126,7 +129,7 @@ describe('session', () => {
expect(localToken).toEqual(expectedToken);
expect(sessionToken).toBeNull();
- session.destroy(); // this clears token and user for any other test
+ await session.destroy(); // this clears token and user for any other test
});
});
});
diff --git a/test/vitest/__tests__/pages/Login/Login.spec.js b/test/vitest/__tests__/pages/Login/Login.spec.js
index fadfc898f..6e2de9870 100644
--- a/test/vitest/__tests__/pages/Login/Login.spec.js
+++ b/test/vitest/__tests__/pages/Login/Login.spec.js
@@ -22,9 +22,9 @@ describe('Login', () => {
darkMode: false,
},
};
- vi.spyOn(axios, 'post').mockResolvedValue({ data: { token: 'token' } });
+ vi.spyOn(axios, 'post').mockResolvedValueOnce({ data: { token: 'token' } });
vi.spyOn(axios, 'get').mockResolvedValue({
- data: { roles: [], user: expectedUser },
+ data: { roles: [], user: expectedUser , multimediaToken: {id:'multimediaToken' }},
});
vi.spyOn(vm.quasar, 'notify');
@@ -36,7 +36,7 @@ describe('Login', () => {
expect(vm.quasar.notify).toHaveBeenCalledWith(
expect.objectContaining({ type: 'positive' })
);
- vm.session.destroy();
+ await vm.session.destroy();
});
it('should not set the token into session if any error occurred', async () => {