Compare commits
5 Commits
dev
...
7385-addDe
Author | SHA1 | Date |
---|---|---|
|
ccbcaa13b7 | |
|
f4ecf9ad51 | |
|
c3f60c68bc | |
|
2f20abf388 | |
|
b25bd19bb5 |
|
@ -100,7 +100,7 @@ const $props = defineProps({
|
|||
},
|
||||
preventSubmit: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
default: true,
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(['onFetch', 'onDataSaved', 'submit']);
|
||||
|
@ -287,7 +287,7 @@ function updateAndEmit(evt, { val, res, old } = { val: null, res: null, old: nul
|
|||
state.set(modelValue, val);
|
||||
if (!$props.url) arrayData.store.data = val;
|
||||
|
||||
emit(evt, state.get(modelValue), res, old, formData);
|
||||
emit(evt, state.get(modelValue), res, old);
|
||||
}
|
||||
|
||||
function trimData(data) {
|
||||
|
|
|
@ -33,7 +33,7 @@ onBeforeRouteLeave(() => {
|
|||
});
|
||||
|
||||
onBeforeMount(async () => {
|
||||
if (props.visual) stateStore.cardDescriptorChangeValue(markRaw(props.descriptor));
|
||||
stateStore.cardDescriptorChangeValue(markRaw(props.descriptor));
|
||||
|
||||
const route = router.currentRoute.value;
|
||||
try {
|
||||
|
|
|
@ -4,7 +4,6 @@ import { useI18n } from 'vue-i18n';
|
|||
import { useRoute } from 'vue-router';
|
||||
import { useQuasar, QCheckbox, QBtn, QInput } from 'quasar';
|
||||
import axios from 'axios';
|
||||
import { usePrintService } from 'composables/usePrintService';
|
||||
|
||||
import VnUserLink from '../ui/VnUserLink.vue';
|
||||
import { downloadFile } from 'src/composables/downloadFile';
|
||||
|
@ -24,7 +23,6 @@ const rows = ref([]);
|
|||
const dmsRef = ref();
|
||||
const formDialog = ref({});
|
||||
const token = useSession().getTokenMultimedia();
|
||||
const { openReport } = usePrintService();
|
||||
|
||||
const $props = defineProps({
|
||||
model: {
|
||||
|
@ -201,7 +199,12 @@ const columns = computed(() => [
|
|||
color: 'primary',
|
||||
}),
|
||||
click: (prop) =>
|
||||
openReport(`dms/${prop.row.id}/downloadFile`, {}, '_blank'),
|
||||
downloadFile(
|
||||
prop.row.id,
|
||||
$props.downloadModel,
|
||||
undefined,
|
||||
prop.row.download,
|
||||
),
|
||||
},
|
||||
{
|
||||
component: QBtn,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, computed } from 'vue';
|
||||
import { ref, onMounted, onUnmounted, watch, computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import axios from 'axios';
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<script setup>
|
||||
import { watch, ref, onMounted } from 'vue';
|
||||
import { onBeforeMount, watch, computed, ref } from 'vue';
|
||||
import { useArrayData } from 'composables/useArrayData';
|
||||
import { useState } from 'src/composables/useState';
|
||||
import { useRoute } from 'vue-router';
|
||||
import VnDescriptor from './VnDescriptor.vue';
|
||||
|
||||
const $props = defineProps({
|
||||
|
@ -18,50 +20,39 @@ const $props = defineProps({
|
|||
},
|
||||
});
|
||||
|
||||
const state = useState();
|
||||
const route = useRoute();
|
||||
let arrayData;
|
||||
let store;
|
||||
const entity = ref();
|
||||
let entity;
|
||||
const isLoading = ref(false);
|
||||
const containerRef = ref(null);
|
||||
const isSameDataKey = computed(() => $props.dataKey === route.meta.moduleName);
|
||||
defineExpose({ getData });
|
||||
|
||||
onMounted(async () => {
|
||||
let isPopup;
|
||||
let el = containerRef.value.$el;
|
||||
while (el) {
|
||||
if (el.classList?.contains('q-menu')) {
|
||||
isPopup = true;
|
||||
break;
|
||||
}
|
||||
el = el.parentElement;
|
||||
}
|
||||
|
||||
arrayData = useArrayData($props.dataKey + (isPopup ? 'Proxy' : ''), {
|
||||
onBeforeMount(async () => {
|
||||
arrayData = useArrayData($props.dataKey, {
|
||||
url: $props.url,
|
||||
userFilter: $props.filter,
|
||||
skip: 0,
|
||||
oneRecord: true,
|
||||
});
|
||||
store = arrayData.store;
|
||||
entity = computed(() => {
|
||||
const data = store.data ?? {};
|
||||
if (data) emit('onFetch', data);
|
||||
return data;
|
||||
});
|
||||
|
||||
// It enables to load data only once if the module is the same as the dataKey
|
||||
if (!isSameDataKey.value || !route.params.id) await getData();
|
||||
watch(
|
||||
() => [$props.url, $props.filter],
|
||||
async () => {
|
||||
await getData();
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
watch(
|
||||
() => arrayData.store.data,
|
||||
(newValue) => {
|
||||
entity.value = newValue;
|
||||
if (!isSameDataKey.value) await getData();
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
defineExpose({ getData });
|
||||
const emit = defineEmits(['onFetch']);
|
||||
|
||||
async function getData() {
|
||||
store.url = $props.url;
|
||||
store.filter = $props.filter ?? {};
|
||||
|
@ -69,15 +60,18 @@ async function getData() {
|
|||
try {
|
||||
await arrayData.fetch({ append: false, updateRouter: false });
|
||||
const { data } = store;
|
||||
state.set($props.dataKey, data);
|
||||
emit('onFetch', data);
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
const emit = defineEmits(['onFetch']);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VnDescriptor v-model="entity" v-bind="$attrs" :module="dataKey" ref="containerRef">
|
||||
<VnDescriptor v-model="entity" v-bind="$attrs" :module="dataKey">
|
||||
<template v-for="(_, slotName) in $slots" #[slotName]="slotData" :key="slotName">
|
||||
<slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
|
||||
</template>
|
||||
|
|
|
@ -146,14 +146,14 @@ const addFilter = async (filter, params) => {
|
|||
};
|
||||
|
||||
async function fetch(params) {
|
||||
arrayData.setOptions(params);
|
||||
useArrayData(props.dataKey, params);
|
||||
arrayData.resetPagination();
|
||||
await arrayData.fetch({ append: false });
|
||||
return emitStoreData();
|
||||
}
|
||||
|
||||
async function update(params) {
|
||||
arrayData.setOptions(params);
|
||||
useArrayData(props.dataKey, params);
|
||||
const { limit, skip } = store;
|
||||
store.limit = limit + skip;
|
||||
store.skip = 0;
|
||||
|
|
|
@ -41,7 +41,7 @@ export function useArrayData(key, userOptions) {
|
|||
|
||||
if (key && userOptions) setOptions();
|
||||
|
||||
function setOptions(params = userOptions) {
|
||||
function setOptions() {
|
||||
const allowedOptions = [
|
||||
'url',
|
||||
'filter',
|
||||
|
@ -57,14 +57,14 @@ export function useArrayData(key, userOptions) {
|
|||
'mapKey',
|
||||
'oneRecord',
|
||||
];
|
||||
if (typeof params === 'object') {
|
||||
for (const option in params) {
|
||||
const isEmpty = params[option] == null || params[option] === '';
|
||||
if (typeof userOptions === 'object') {
|
||||
for (const option in userOptions) {
|
||||
const isEmpty = userOptions[option] == null || userOptions[option] === '';
|
||||
if (isEmpty || !allowedOptions.includes(option)) continue;
|
||||
|
||||
if (Object.hasOwn(store, option)) {
|
||||
const defaultOpts = params[option];
|
||||
store[option] = params.keepOpts?.includes(option)
|
||||
const defaultOpts = userOptions[option];
|
||||
store[option] = userOptions.keepOpts?.includes(option)
|
||||
? Object.assign(defaultOpts, store[option])
|
||||
: defaultOpts;
|
||||
if (option === 'userParams') store.defaultParams = store[option];
|
||||
|
@ -367,6 +367,5 @@ export function useArrayData(key, userOptions) {
|
|||
deleteOption,
|
||||
reset,
|
||||
resetPagination,
|
||||
setOptions,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -4,6 +4,11 @@ import AccountSummary from './AccountSummary.vue';
|
|||
</script>
|
||||
<template>
|
||||
<QPopupProxy style="max-width: 10px">
|
||||
<AccountDescriptor v-if="$attrs.id" v-bind="$attrs" :summary="AccountSummary" />
|
||||
<AccountDescriptor
|
||||
v-if="$attrs.id"
|
||||
v-bind="$attrs"
|
||||
:summary="AccountSummary"
|
||||
:proxy-render="true"
|
||||
/>
|
||||
</QPopupProxy>
|
||||
</template>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { toDateHourMinSec, toPercentage } from 'src/filters';
|
||||
|
@ -9,6 +9,7 @@ import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/Departme
|
|||
import EntityDescriptor from 'components/ui/EntityDescriptor.vue';
|
||||
import VnLv from 'src/components/ui/VnLv.vue';
|
||||
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
||||
import { getUrl } from 'src/composables/getUrl';
|
||||
import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
|
||||
import filter from './ClaimFilter.js';
|
||||
|
||||
|
@ -22,6 +23,7 @@ const $props = defineProps({
|
|||
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
const salixUrl = ref();
|
||||
const entityId = computed(() => {
|
||||
return $props.id || route.params.id;
|
||||
});
|
||||
|
@ -29,6 +31,10 @@ const entityId = computed(() => {
|
|||
function stateColor(entity) {
|
||||
return entity?.claimState?.classColor;
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
salixUrl.value = await getUrl('');
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -120,7 +126,7 @@ function stateColor(entity) {
|
|||
size="md"
|
||||
icon="assignment"
|
||||
color="primary"
|
||||
:to="{ name: 'TicketSaleTracking', params: { id: entity.ticketFk } }"
|
||||
:href="salixUrl + 'ticket/' + entity.ticketFk + '/sale-tracking'"
|
||||
>
|
||||
<QTooltip>{{ t('claim.saleTracking') }}</QTooltip>
|
||||
</QBtn>
|
||||
|
@ -128,7 +134,7 @@ function stateColor(entity) {
|
|||
size="md"
|
||||
icon="visibility"
|
||||
color="primary"
|
||||
:to="{ name: 'TicketTracking', params: { id: entity.ticketFk } }"
|
||||
:href="salixUrl + 'ticket/' + entity.ticketFk + '/tracking/index'"
|
||||
>
|
||||
<QTooltip>{{ t('claim.ticketTracking') }}</QTooltip>
|
||||
</QBtn>
|
||||
|
|
|
@ -4,6 +4,11 @@ import ClaimSummary from './ClaimSummary.vue';
|
|||
</script>
|
||||
<template>
|
||||
<QPopupProxy style="max-width: 10px">
|
||||
<ClaimDescriptor v-if="$attrs.id" v-bind="$attrs" :summary="ClaimSummary" />
|
||||
<ClaimDescriptor
|
||||
v-if="$attrs.id"
|
||||
v-bind="$attrs.id"
|
||||
:summary="ClaimSummary"
|
||||
:proxy-render="true"
|
||||
/>
|
||||
</QPopupProxy>
|
||||
</template>
|
||||
|
|
|
@ -68,6 +68,19 @@ onMounted(async () => {
|
|||
<template #menu="{ entity }">
|
||||
<RouteDescriptorMenu :route="entity" />
|
||||
</template>
|
||||
<template #actions="{ entity }">
|
||||
<QCardActions class="flex justify-center" style="padding-inline: 0">
|
||||
<QBtn
|
||||
size="md"
|
||||
icon="vn:delivery"
|
||||
color="primary"
|
||||
:href="`https://grafana.verdnatura.es/d/edkvyi479dbeob/pronostico-de-entregas?orgId=1&var-vRouteFk=${entity.id}`"
|
||||
target="_blank"
|
||||
>
|
||||
<QTooltip>{{ $t('route.deliveryForecast') }}</QTooltip>
|
||||
</QBtn>
|
||||
</QCardActions>
|
||||
</template>
|
||||
</EntityDescriptor>
|
||||
</template>
|
||||
<i18n>
|
||||
|
|
|
@ -80,6 +80,20 @@ const ticketColumns = ref([
|
|||
sortable: false,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'delivered',
|
||||
label: t('route.delivered'),
|
||||
field: (row) => dashIfEmpty(toDate(row?.delivered)),
|
||||
sortable: false,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
name: 'forecast',
|
||||
label: t('route.forecast'),
|
||||
field: (row) => dashIfEmpty(toDate(row?.forecast)),
|
||||
sortable: false,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
name: 'packages',
|
||||
label: t('route.summary.packages'),
|
||||
|
@ -267,61 +281,3 @@ const ticketColumns = ref([
|
|||
</CardSummary>
|
||||
</div>
|
||||
</template>
|
||||
<i18n>
|
||||
en:
|
||||
route:
|
||||
summary:
|
||||
date: Date
|
||||
agency: Agency
|
||||
vehicle: Vehicle
|
||||
driver: Driver
|
||||
cost: Cost
|
||||
started: Started time
|
||||
finished: Finished time
|
||||
kmStart: Km start
|
||||
kmEnd: Km end
|
||||
volume: Volume
|
||||
packages: Packages
|
||||
description: Description
|
||||
tickets: Tickets
|
||||
order: Order
|
||||
street: Street
|
||||
city: City
|
||||
pc: PC
|
||||
client: Client
|
||||
state: State
|
||||
m3: m³
|
||||
packaging: Packaging
|
||||
ticket: Ticket
|
||||
closed: Closed
|
||||
open: Open
|
||||
yes: Yes
|
||||
no: No
|
||||
es:
|
||||
route:
|
||||
summary:
|
||||
date: Fecha
|
||||
agency: Agencia
|
||||
vehicle: Vehículo
|
||||
driver: Conductor
|
||||
cost: Costo
|
||||
started: Hora inicio
|
||||
finished: Hora fin
|
||||
kmStart: Km inicio
|
||||
kmEnd: Km fin
|
||||
volume: Volumen
|
||||
packages: Bultos
|
||||
description: Descripción
|
||||
tickets: Tickets
|
||||
order: Orden
|
||||
street: Dirección fiscal
|
||||
city: Población
|
||||
pc: CP
|
||||
client: Cliente
|
||||
state: Estado
|
||||
packaging: Encajado
|
||||
closed: Cerrada
|
||||
open: Abierta
|
||||
yes: Sí
|
||||
no: No
|
||||
</i18n>
|
||||
|
|
|
@ -24,49 +24,63 @@ const selectedRows = ref([]);
|
|||
const columns = computed(() => [
|
||||
{
|
||||
name: 'order',
|
||||
label: t('Order'),
|
||||
label: t('route.ticket.order'),
|
||||
field: (row) => dashIfEmpty(row?.priority),
|
||||
sortable: false,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
name: 'client',
|
||||
label: t('Client'),
|
||||
label: t('route.ticket.client'),
|
||||
field: (row) => row?.nickname,
|
||||
sortable: false,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'street',
|
||||
label: t('Street'),
|
||||
label: t('route.ticket.street'),
|
||||
field: (row) => row?.street,
|
||||
sortable: false,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'pc',
|
||||
label: t('PC'),
|
||||
label: t('route.ticket.PC'),
|
||||
field: (row) => row?.postalCode,
|
||||
sortable: false,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
name: 'city',
|
||||
label: t('City'),
|
||||
label: t('route.ticket.city'),
|
||||
field: (row) => row?.city,
|
||||
sortable: false,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'warehouse',
|
||||
label: t('Warehouse'),
|
||||
label: t('route.ticket.warehouse'),
|
||||
field: (row) => row?.warehouseName,
|
||||
sortable: false,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'delivered',
|
||||
label: t('route.ticket.delivered'),
|
||||
field: (row) => dashIfEmpty(row?.delivered),
|
||||
sortable: false,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'estimated',
|
||||
label: t('route.ticket.estimated'),
|
||||
field: (row) => dashIfEmpty(row?.estimated),
|
||||
sortable: false,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'packages',
|
||||
label: t('Packages'),
|
||||
label: t('route.ticket.packages'),
|
||||
field: (row) => row?.packages,
|
||||
sortable: false,
|
||||
align: 'center',
|
||||
|
@ -80,14 +94,14 @@ const columns = computed(() => [
|
|||
},
|
||||
{
|
||||
name: 'packaging',
|
||||
label: t('Packaging'),
|
||||
label: t('route.ticket.packaging'),
|
||||
field: (row) => row?.ipt,
|
||||
sortable: false,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
name: 'ticket',
|
||||
label: t('Ticket'),
|
||||
label: t('route.ticket.ticket'),
|
||||
field: (row) => row?.id,
|
||||
sortable: false,
|
||||
align: 'center',
|
||||
|
@ -188,8 +202,8 @@ const confirmRemove = (ticket) => {
|
|||
.dialog({
|
||||
component: VnConfirm,
|
||||
componentProps: {
|
||||
title: t('Confirm removal from route'),
|
||||
message: t('Are you sure you want to remove this ticket from the route?'),
|
||||
title: t('route.ticket.confirmRemoval'),
|
||||
message: t('route.ticket.confirmRemovalConfirmation'),
|
||||
promise: () => removeTicket(ticket),
|
||||
},
|
||||
})
|
||||
|
@ -219,7 +233,7 @@ const openSmsDialog = async () => {
|
|||
quasar.dialog({
|
||||
component: SendSmsDialog,
|
||||
componentProps: {
|
||||
title: t('Send SMS to the selected tickets'),
|
||||
title: t('route.ticket.sendSmsTickets'),
|
||||
url: 'Routes/sendSms',
|
||||
destinationFk: clientsId.toString(),
|
||||
destination: clientsPhone.toString(),
|
||||
|
@ -240,18 +254,18 @@ const openSmsDialog = async () => {
|
|||
<QDialog v-model="confirmationDialog">
|
||||
<QCard style="min-width: 350px">
|
||||
<QCardSection>
|
||||
<p class="text-h6 q-ma-none">{{ t('Select the starting date') }}</p>
|
||||
<p class="text-h6 q-ma-none">{{ t('route.ticket.selectStartingDate') }}</p>
|
||||
</QCardSection>
|
||||
|
||||
<QCardSection class="q-pt-none">
|
||||
<VnInputDate
|
||||
:label="t('Stating date')"
|
||||
:label="t('route.ticket.startingDate')"
|
||||
v-model="startingDate"
|
||||
autofocus
|
||||
/>
|
||||
</QCardSection>
|
||||
<QCardActions align="right">
|
||||
<QBtn flat :label="t('Cancel')" v-close-popup class="text-primary" />
|
||||
<QBtn flat :label="t('globals.cancel')" v-close-popup class="text-primary" />
|
||||
<QBtn color="primary" v-close-popup @click="cloneRoutes">
|
||||
{{ t('globals.clone') }}
|
||||
</QBtn>
|
||||
|
@ -262,7 +276,7 @@ const openSmsDialog = async () => {
|
|||
<QToolbar class="justify-end">
|
||||
<div id="st-actions" class="q-pa-sm">
|
||||
<QBtn icon="vn:wand" color="primary" class="q-mr-sm" @click="sortRoutes">
|
||||
<QTooltip>{{ t('Sort routes') }}</QTooltip>
|
||||
<QTooltip>{{ t('route.ticket.sortRoutes') }}</QTooltip>
|
||||
</QBtn>
|
||||
<QBtn
|
||||
icon="vn:buscaman"
|
||||
|
@ -271,7 +285,7 @@ const openSmsDialog = async () => {
|
|||
:disable="!selectedRows?.length"
|
||||
@click="goToBuscaman()"
|
||||
>
|
||||
<QTooltip>{{ t('Open buscaman') }}</QTooltip>
|
||||
<QTooltip>{{ t('route.ticket.openBuscaman') }}</QTooltip>
|
||||
</QBtn>
|
||||
<QBtn
|
||||
icon="filter_alt"
|
||||
|
@ -280,7 +294,7 @@ const openSmsDialog = async () => {
|
|||
:disable="!selectedRows?.length"
|
||||
@click="deletePriorities"
|
||||
>
|
||||
<QTooltip>{{ t('Delete priority') }}</QTooltip>
|
||||
<QTooltip>{{ t('route.ticket.deletePriority') }}</QTooltip>
|
||||
</QBtn>
|
||||
<QBtn
|
||||
icon="format_list_numbered"
|
||||
|
@ -290,7 +304,7 @@ const openSmsDialog = async () => {
|
|||
>
|
||||
<QTooltip
|
||||
>{{
|
||||
t('Renumber all tickets in the order you see on the screen')
|
||||
t('route.ticket.renumberAllTickets')
|
||||
}}
|
||||
</QTooltip>
|
||||
</QBtn>
|
||||
|
@ -301,7 +315,7 @@ const openSmsDialog = async () => {
|
|||
:disable="!selectedRows?.length"
|
||||
@click="openSmsDialog"
|
||||
>
|
||||
<QTooltip>{{ t('Send SMS to all clients') }}</QTooltip>
|
||||
<QTooltip>{{ t('route.ticket.sendSmsClients') }}</QTooltip>
|
||||
</QBtn>
|
||||
</div>
|
||||
</QToolbar>
|
||||
|
@ -339,7 +353,7 @@ const openSmsDialog = async () => {
|
|||
@click="setHighestPriority(row, rows)"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('Assign highest priority') }}
|
||||
{{ t('route.ticket.assignHighestPriority') }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
<VnInput
|
||||
|
@ -354,7 +368,7 @@ const openSmsDialog = async () => {
|
|||
<QTd>
|
||||
<span class="link" @click="goToBuscaman(row)">
|
||||
{{ value }}
|
||||
<QTooltip>{{ t('Open buscaman') }}</QTooltip>
|
||||
<QTooltip>{{ t('route.ticket.openBuscaman') }}</QTooltip>
|
||||
</span>
|
||||
</QTd>
|
||||
</template>
|
||||
|
@ -411,7 +425,7 @@ const openSmsDialog = async () => {
|
|||
@click="openTicketsDialog"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('Add ticket') }}
|
||||
{{ t('route.ticket.addTicket') }}
|
||||
</QTooltip>
|
||||
</QBtn>
|
||||
</QPageSticky>
|
||||
|
@ -432,24 +446,3 @@ const openSmsDialog = async () => {
|
|||
gap: 12px;
|
||||
}
|
||||
</style>
|
||||
<i18n>
|
||||
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
|
||||
</i18n>
|
||||
|
|
|
@ -1,6 +1,33 @@
|
|||
route:
|
||||
filter:
|
||||
Served: Served
|
||||
summary:
|
||||
date: Date
|
||||
agency: Agency
|
||||
vehicle: Vehicle
|
||||
driver: Driver
|
||||
cost: Cost
|
||||
started: Started time
|
||||
finished: Finished time
|
||||
kmStart: Km start
|
||||
kmEnd: Km end
|
||||
volume: Volume
|
||||
packages: Packages
|
||||
description: Description
|
||||
tickets: Tickets
|
||||
order: Order
|
||||
street: Street
|
||||
city: City
|
||||
pc: PC
|
||||
client: Client
|
||||
state: State
|
||||
m3: m³
|
||||
packaging: Packaging
|
||||
ticket: Ticket
|
||||
closed: Closed
|
||||
open: Open
|
||||
yes: Yes
|
||||
no: No
|
||||
extendedList:
|
||||
selectStartingDate: Select the starting date
|
||||
startingDate: Starting date
|
||||
|
@ -75,3 +102,47 @@ route:
|
|||
searchInfo: You can search by route reference
|
||||
dated: Dated
|
||||
preview: Preview
|
||||
delivered: Delivered
|
||||
forecast: Forecast
|
||||
cmr:
|
||||
search: Search Cmr
|
||||
searchInfo: You can search Cmr by Id
|
||||
params:
|
||||
results: results
|
||||
cmrFk: CMR id
|
||||
hasCmrDms: Attached in gestdoc
|
||||
'true': 'Yes'
|
||||
'false': 'No'
|
||||
ticketFk: Ticketd id
|
||||
routeFk: Route id
|
||||
countryFk: Country
|
||||
clientFk: Client id
|
||||
warehouseFk: Warehouse
|
||||
shipped: Preparation date
|
||||
viewCmr: View CMR
|
||||
downloadCmrs: Download CMRs
|
||||
search: General search
|
||||
ticket:
|
||||
order: Order
|
||||
street: Street
|
||||
city: City
|
||||
PC: PC
|
||||
client: Client
|
||||
warehouse: Warehouse
|
||||
delivered: Delivered
|
||||
estimated: Estimated
|
||||
packages: Packages
|
||||
packaging: Packaging
|
||||
ticket: Ticket
|
||||
confirmRemoval: Confirm removal from route
|
||||
confirmRemovalConfirmation: Are you sure you want to remove this ticket from the route?
|
||||
selectStartingDate: Select the starting date
|
||||
startingDate: Starting date
|
||||
sortRoutes: Sort routes
|
||||
openBuscaman: Open buscaman
|
||||
deletePriority: Delete priority
|
||||
renumberAllTickets: Renumber all tickets in the order you see on the screen
|
||||
assignHighest: Assign highest priority
|
||||
sendSmsTickets: Send SMS to the selected tickets
|
||||
sendSmsClients: Send SMS to all clients
|
||||
addTicket: Add ticket
|
||||
|
|
|
@ -1,6 +1,31 @@
|
|||
route:
|
||||
filter:
|
||||
Served: Servida
|
||||
summary:
|
||||
date: Fecha
|
||||
agency: Agencia
|
||||
vehicle: Vehículo
|
||||
driver: Conductor
|
||||
cost: Costo
|
||||
started: Hora inicio
|
||||
finished: Hora fin
|
||||
kmStart: Km inicio
|
||||
kmEnd: Km fin
|
||||
volume: Volumen
|
||||
packages: Bultos
|
||||
description: Descripción
|
||||
tickets: Tickets
|
||||
order: Orden
|
||||
street: Dirección fiscal
|
||||
city: Población
|
||||
pc: CP
|
||||
client: Cliente
|
||||
state: Estado
|
||||
packaging: Encajado
|
||||
closed: Cerrada
|
||||
open: Abierta
|
||||
yes: Sí
|
||||
no: No
|
||||
extendedList:
|
||||
selectStartingDate: Seleccione la fecha de inicio
|
||||
statingDate: Fecha de inicio
|
||||
|
@ -76,6 +101,8 @@ route:
|
|||
searchInfo: Puedes buscar por referencia de la ruta
|
||||
dated: Fecha
|
||||
preview: Vista previa
|
||||
delivered: Entregado
|
||||
forecast: Pronóstico
|
||||
cmr:
|
||||
list:
|
||||
results: resultados
|
||||
|
@ -90,3 +117,27 @@ route:
|
|||
shipped: Fecha preparación
|
||||
viewCmr: Ver CMR
|
||||
downloadCmrs: Descargar CMRs
|
||||
ticket:
|
||||
order: Orden
|
||||
street: Dirección fiscal
|
||||
city: Población
|
||||
PC: CP
|
||||
client: Cliente
|
||||
warehouse: Almacén
|
||||
delivered: Entregado
|
||||
estimated: Pronóstico
|
||||
packages: Bultos
|
||||
packaging: Encajado
|
||||
ticket: Ticket
|
||||
confirmRemoval: Quitar de la ruta
|
||||
confirmRemovalConfirmation: ¿Seguro que quieres quitar este ticket de la ruta?
|
||||
selectStartingDate: Seleccionar fecha de inicio
|
||||
startingDate: F. Inicio
|
||||
sortRoutes: Ordenar rutas
|
||||
openBuscaman: Abrir buscaman
|
||||
deletePriority: Borrar orden
|
||||
renumberAllTickets: Renumerar todos los tickets con el orden que ves por pantalla
|
||||
assignHighest: Asignar máxima prioridad
|
||||
sendSmsTickets: Enviar SMS a los tickets seleccionados
|
||||
sendSmsClients: Mandar sms a todos los clientes de las rutas
|
||||
addTicket: Añadir ticket
|
||||
|
|
|
@ -4,6 +4,11 @@ import ParkingSummary from './ParkingSummary.vue';
|
|||
</script>
|
||||
<template>
|
||||
<QPopupProxy style="max-width: 10px">
|
||||
<ParkingDescriptor v-if="$attrs.id" v-bind="$attrs" :summary="ParkingSummary" />
|
||||
<ParkingDescriptor
|
||||
v-if="$attrs.id"
|
||||
v-bind="$attrs.id"
|
||||
:summary="ParkingSummary"
|
||||
:proxy-render="true"
|
||||
/>
|
||||
</QPopupProxy>
|
||||
</template>
|
||||
|
|
|
@ -70,6 +70,8 @@ async function getDate(query, params) {
|
|||
for (const param in params) {
|
||||
if (!params[param]) return;
|
||||
}
|
||||
|
||||
formData.value.zoneFk = null;
|
||||
zonesOptions.value = [];
|
||||
const { data } = await axios.get(query, { params });
|
||||
if (!data) return notify(t('basicData.noDeliveryZoneAvailable'), 'negative');
|
||||
|
@ -77,7 +79,7 @@ async function getDate(query, params) {
|
|||
formData.value.zoneFk = data.zoneFk;
|
||||
formData.value.landed = data.landed;
|
||||
const shippedDate = new Date(params.shipped);
|
||||
const landedDate = new Date(data.hour);
|
||||
const landedDate = new Date(data.landed);
|
||||
shippedDate.setHours(
|
||||
landedDate.getHours(),
|
||||
landedDate.getMinutes(),
|
||||
|
@ -425,14 +427,6 @@ async function getZone(options) {
|
|||
:rules="validate('ticketList.shipped')"
|
||||
@update:model-value="setShipped"
|
||||
/>
|
||||
<VnInputTime
|
||||
:label="t('basicData.shippedHour')"
|
||||
v-model="formData.shipped"
|
||||
:required="true"
|
||||
:rules="validate('basicData.shippedHour')"
|
||||
disabled
|
||||
@update:model-value="setShipped"
|
||||
/>
|
||||
<VnInputDate
|
||||
:label="t('basicData.landed')"
|
||||
v-model="formData.landed"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<script setup>
|
||||
import { reactive } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
|
@ -29,29 +30,31 @@ const { t } = useI18n();
|
|||
const router = useRouter();
|
||||
const { notify } = useNotify();
|
||||
|
||||
const newTicketFormData = reactive({});
|
||||
const date = new Date();
|
||||
|
||||
async function createTicket(formData) {
|
||||
const createTicket = async () => {
|
||||
const expeditionIds = $props.selectedExpeditions.map((expedition) => expedition.id);
|
||||
const params = {
|
||||
clientId: $props.ticket.clientFk,
|
||||
landed: formData.landed,
|
||||
landed: newTicketFormData.landed,
|
||||
warehouseId: $props.ticket.warehouseFk,
|
||||
addressId: $props.ticket.addressFk,
|
||||
agencyModeId: $props.ticket.agencyModeFk,
|
||||
routeId: formData.routeFk,
|
||||
routeId: newTicketFormData.routeFk,
|
||||
expeditionIds: expeditionIds,
|
||||
};
|
||||
|
||||
const { data } = await axios.post('Expeditions/moveExpeditions', params);
|
||||
notify(t('globals.dataSaved'), 'positive');
|
||||
router.push({ name: 'TicketSummary', params: { id: data.id } });
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FormModelPopup
|
||||
model="expeditionNewTicket"
|
||||
:form-initial-data="{}"
|
||||
:form-initial-data="newTicketFormData"
|
||||
:save-fn="createTicket"
|
||||
>
|
||||
<template #form-inputs="{ data }">
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<script setup>
|
||||
import { ref, nextTick } from 'vue';
|
||||
import { ref, nextTick, onMounted } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
|
@ -8,23 +9,21 @@ import VnRow from 'components/ui/VnRow.vue';
|
|||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import { useAdvancedSummary } from 'src/composables/useAdvancedSummary';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
const { t } = useI18n();
|
||||
const form = ref();
|
||||
const educationLevels = ref([]);
|
||||
const countries = ref([]);
|
||||
const model = 'Worker';
|
||||
const maritalStatus = [
|
||||
{ code: 'M', name: t('Married') },
|
||||
{ code: 'S', name: t('Single') },
|
||||
];
|
||||
const route = useRoute();
|
||||
async function addAdvancedData(data) {
|
||||
const advanced = await useAdvancedSummary('Workers', route.params.id);
|
||||
data.value = { ...data.value, ...advanced };
|
||||
|
||||
onMounted(async () => {
|
||||
const advanced = await useAdvancedSummary('Workers', useRoute().params.id);
|
||||
Object.assign(form.value.formData, advanced);
|
||||
nextTick(() => (form.value.hasChanges = false));
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
|
@ -43,8 +42,7 @@ async function addAdvancedData(data) {
|
|||
ref="form"
|
||||
:url-update="`Workers/${$route.params.id}`"
|
||||
auto-load
|
||||
:model
|
||||
@on-fetch="(data, res, old, formData) => addAdvancedData(formData)"
|
||||
model="Worker"
|
||||
>
|
||||
<template #form="{ data }">
|
||||
<VnRow>
|
||||
|
|
|
@ -4,11 +4,9 @@ import VnCard from 'src/components/common/VnCard.vue';
|
|||
</script>
|
||||
<template>
|
||||
<VnCard
|
||||
:data-key="$attrs['data-key'] ?? 'Worker'"
|
||||
data-key="Worker"
|
||||
url="Workers/summary"
|
||||
:id-in-where="true"
|
||||
:descriptor="WorkerDescriptor"
|
||||
v-bind="$attrs"
|
||||
v-on="$attrs"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
import { computed, ref } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import EntityDescriptor from 'src/components/ui/EntityDescriptor.vue';
|
||||
import VnLv from 'src/components/ui/VnLv.vue';
|
||||
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
|
||||
import VnChangePassword from 'src/components/common/VnChangePassword.vue';
|
||||
|
@ -10,8 +11,6 @@ import VnImg from 'src/components/ui/VnImg.vue';
|
|||
import EditPictureForm from 'components/EditPictureForm.vue';
|
||||
import WorkerDescriptorMenu from './WorkerDescriptorMenu.vue';
|
||||
import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/DepartmentDescriptorProxy.vue';
|
||||
import CardDescriptor from 'src/components/ui/CardDescriptor.vue';
|
||||
import WorkerCard from './WorkerCard.vue';
|
||||
|
||||
const $props = defineProps({
|
||||
id: {
|
||||
|
@ -53,17 +52,14 @@ const handlePhotoUpdated = (evt = false) => {
|
|||
};
|
||||
</script>
|
||||
<template>
|
||||
<CardDescriptor
|
||||
v-bind="$attrs"
|
||||
<EntityDescriptor
|
||||
ref="cardDescriptorRef"
|
||||
:data-key="dataKey"
|
||||
:summary="$props.summary"
|
||||
:card="WorkerCard"
|
||||
:id="entityId"
|
||||
url="Workers/summary"
|
||||
:filter="{ where: { id: entityId } }"
|
||||
title="user.nickname"
|
||||
@on-fetch="getIsExcluded"
|
||||
module="Worker"
|
||||
>
|
||||
<template #menu="{ entity }">
|
||||
<WorkerDescriptorMenu
|
||||
|
@ -169,7 +165,7 @@ const handlePhotoUpdated = (evt = false) => {
|
|||
</QBtn>
|
||||
</QCardActions>
|
||||
</template>
|
||||
</CardDescriptor>
|
||||
</EntityDescriptor>
|
||||
<VnChangePassword
|
||||
ref="changePassRef"
|
||||
:submit-fn="
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { onMounted, ref, computed, onBeforeMount, nextTick, reactive } from 'vue';
|
||||
import { axiosNoError } from 'src/boot/axios';
|
||||
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import WorkerTimeHourChip from 'pages/Worker/Card/WorkerTimeHourChip.vue';
|
||||
|
@ -280,11 +281,11 @@ const fetchWeekData = async () => {
|
|||
week: selectedWeekNumber.value,
|
||||
};
|
||||
try {
|
||||
const [{ data: mailData }, { data: countData }] = await Promise.allS([
|
||||
axios.get(`Workers/${route.params.id}/mail`, {
|
||||
const [{ data: mailData }, { data: countData }] = await Promise.all([
|
||||
axiosNoError.get(`Workers/${route.params.id}/mail`, {
|
||||
params: { filter: { where } },
|
||||
}),
|
||||
axios.get('WorkerTimeControlMails/count', { params: { where } }),
|
||||
axiosNoError.get('WorkerTimeControlMails/count', { params: { where } }),
|
||||
]);
|
||||
|
||||
const mail = mailData[0];
|
||||
|
|
Loading…
Reference in New Issue