0
0
Fork 0

fix: refs #7129 fix some issues on load and tools

This commit is contained in:
Pablo Natek 2024-06-07 07:52:50 +02:00
parent 15223971f1
commit 68e49e2ffa
6 changed files with 64 additions and 27 deletions

View File

@ -979,6 +979,18 @@ route:
shipped: Preparation date
viewCmr: View CMR
downloadCmrs: Download CMRs
columnLabels:
ID: Id
vehicle: Vehicle
description: Description
isServed: Served
worker: Worker
date: Date
started: Started
actions: Actions
agency: Agency
volume: Volume
finished: Finished
supplier:
pageTitles:
suppliers: Suppliers

View File

@ -101,6 +101,7 @@ globals:
zonesList: Zonas
deliveryList: Días de entrega
upcomingList: Próximos repartos
workers: Trabajadores
created: Fecha creación
worker: Trabajador
now: Ahora
@ -967,6 +968,18 @@ route:
shipped: Fecha preparación
viewCmr: Ver CMR
downloadCmrs: Descargar CMRs
columnLabels:
Id: Id
vehicle: Vehículo
description: Descripción
isServed: Servida
worker: Trabajador
date: Fecha
started: Iniciada
actions: Acciones
agency: Agencia
volume: Volumen
finished: Finalizada
supplier:
pageTitles:
suppliers: Proveedores

View File

@ -240,4 +240,5 @@ es:
From: Desde
To: Hasta
Served: Servida
Days Onward: Días en adelante
</i18n>

View File

@ -38,7 +38,7 @@ const selectedRows = ref([]);
const columns = computed(() => [
{
name: 'ID',
label: t('ID'),
label: 'Id',
field: (row) => row.routeFk,
sortable: true,
align: 'left',
@ -116,7 +116,11 @@ const columns = computed(() => [
const refreshKey = ref(0);
const total = computed(() => selectedRows.value.reduce((item) => item?.price || 0, 0));
const total = ref(() => {
console.log('selectedRows.value: ', selectedRows.value);
return selectedRows.value.reduce((item) => item?.price || 0, 0);
});
console.log('total: ', total);
const openDmsUploadDialog = async () => {
dmsDialog.value.rowsToCreateInvoiceIn = selectedRows.value
@ -225,6 +229,7 @@ function navigateToRouteSummary(event, row) {
</QBtn>
</QCard>
</div>
{{ total }}
<VnPaginate
:key="refreshKey"
data-key="RouteAutonomousList"
@ -324,6 +329,13 @@ function navigateToRouteSummary(event, row) {
cursor: pointer;
}
}
th:last-child,
td:last-child {
background-color: var(--vn-section-color);
position: sticky;
right: 0;
}
</style>
<i18n>
es:

View File

@ -22,18 +22,27 @@ import RouteListTicketsDialog from 'pages/Route/Card/RouteListTicketsDialog.vue'
import { useQuasar } from 'quasar';
import { useArrayData } from 'composables/useArrayData';
const stateStore = useStateStore();
const { t } = useI18n();
const { validate } = useValidator();
const { viewSummary } = useSummaryDialog();
const stateStore = useStateStore();
const quasar = useQuasar();
const session = useSession();
const { viewSummary } = useSummaryDialog();
const paginate = ref();
const visibleColumns = ref([]);
const selectedRows = ref([]);
const workers = ref([]);
const agencyList = ref([]);
const vehicleList = ref([]);
const allColumnNames = ref([]);
const confirmationDialog = ref(false);
const startingDate = ref(null);
const refreshKey = ref(0);
const columns = computed(() => [
{
name: 'ID',
label: t('ID'),
name: 'Id',
label: t('Id'),
field: (row) => row.id,
sortable: true,
align: 'center',
@ -108,14 +117,12 @@ const columns = computed(() => [
align: 'right',
},
]);
const arrayData = useArrayData('EntryLatestBuys', {
url: 'Buys/latestBuysFilter',
order: ['itemFk DESC'],
});
const refreshKey = ref(0);
const workers = ref([]);
const agencyList = ref([]);
const vehicleList = ref([]);
const updateRoute = async (route) => {
try {
return await axios.patch(`Routes/${route.id}`, route);
@ -123,9 +130,6 @@ const updateRoute = async (route) => {
return err;
}
};
const allColumnNames = ref([]);
const confirmationDialog = ref(false);
const startingDate = ref(null);
const cloneRoutes = () => {
axios.post('Routes/clone', {
@ -134,6 +138,7 @@ const cloneRoutes = () => {
});
refreshKey.value++;
startingDate.value = null;
paginate.value.fetch();
};
const showRouteReport = () => {
@ -153,15 +158,13 @@ const showRouteReport = () => {
window.open(url, '_blank');
};
const markAsServed = () => {
selectedRows.value.forEach((row) => {
if (row?.id) {
axios.patch(`Routes/${row?.id}`, { isOk: true });
}
function markAsServed() {
selectedRows.value.forEach(async (row) => {
if (row?.id) await axios.patch(`Routes/${row?.id}`, { isOk: true });
});
refreshKey.value++;
startingDate.value = null;
};
}
const openTicketsDialog = (id) => {
if (!id) {
@ -178,11 +181,9 @@ const openTicketsDialog = (id) => {
};
onMounted(async () => {
stateStore.rightDrawer = true;
allColumnNames.value = columns.value.map((col) => col.name);
await arrayData.fetch({ append: false });
});
onUnmounted(() => (stateStore.rightDrawer = false));
</script>
<template>
@ -246,7 +247,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
class="LeftIcon"
:all-columns="allColumnNames"
table-code="routesList"
labels-traductions-path="globals"
labels-traductions-path="route.columnLabels"
@on-config-saved="visibleColumns = [...$event]"
/>
</template>
@ -274,7 +275,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
color="primary"
class="q-mr-sm"
:disable="!selectedRows?.length"
@click="markAsServed"
@click="markAsServed()"
>
<QTooltip>{{ t('Mark as served') }}</QTooltip>
</QBtn>
@ -518,7 +519,6 @@ en:
hourStarted: Started hour
hourFinished: Finished hour
es:
ID: ID
Worker: Trabajador
Agency: Agencia
Vehicle: Vehículo
@ -539,4 +539,6 @@ es:
Summary: Resumen
Route is closed: La ruta está cerrada
Route is not served: La ruta no está servida
hourStarted: Hora de inicio
hourFinished: Hora de fin
</i18n>

View File

@ -15,14 +15,11 @@ import VnConfirm from 'components/ui/VnConfirm.vue';
import FetchData from 'components/FetchData.vue';
import { openBuscaman } from 'src/utils/buscaman';
import SendSmsDialog from 'components/common/SendSmsDialog.vue';
import RouteSearchbar from 'pages/Route/Card/RouteSearchbar.vue';
import { useStateStore } from 'stores/useStateStore';
const { t } = useI18n();
const quasar = useQuasar();
const route = useRoute();
const stateStore = useStateStore();
const selectedRows = ref([]);
const columns = computed(() => [
{