7525-devToTest #419
|
@ -91,6 +91,10 @@ export default {
|
||||||
log: 'Logs',
|
log: 'Logs',
|
||||||
parkingList: 'Parkings list',
|
parkingList: 'Parkings list',
|
||||||
},
|
},
|
||||||
|
actions: 'Acciones',
|
||||||
|
started: 'Hora inicio',
|
||||||
|
finished: 'Hora fin',
|
||||||
|
volume: 'Volumen',
|
||||||
},
|
},
|
||||||
errors: {
|
errors: {
|
||||||
statusUnauthorized: 'Access denied',
|
statusUnauthorized: 'Access denied',
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import VnPaginate from 'components/ui/VnPaginate.vue';
|
import VnPaginate from 'components/ui/VnPaginate.vue';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { computed, onMounted, reactive, onUnmounted, ref } from 'vue';
|
import { computed, onMounted, onUnmounted, ref } from 'vue';
|
||||||
import { dashIfEmpty, toHour } from 'src/filters';
|
import { dashIfEmpty, toHour } from 'src/filters';
|
||||||
import VnSelectFilter from 'components/common/VnSelectFilter.vue';
|
import VnSelectFilter from 'components/common/VnSelectFilter.vue';
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
@ -37,15 +37,6 @@ const columns = computed(() => [
|
||||||
field: (row) => row.id,
|
field: (row) => row.id,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
columnFilter: {
|
|
||||||
component: 'VnInput',
|
|
||||||
type: 'text',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
|
||||||
dense: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'worker',
|
name: 'worker',
|
||||||
|
@ -53,18 +44,6 @@ const columns = computed(() => [
|
||||||
field: (row) => row.workerUserName,
|
field: (row) => row.workerUserName,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
columnFilter: {
|
|
||||||
component: 'VnSelectFilter',
|
|
||||||
type: 'select',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
|
||||||
options: workers,
|
|
||||||
'option-value': 'id',
|
|
||||||
'option-label': 'nickname',
|
|
||||||
dense: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'agency',
|
name: 'agency',
|
||||||
|
@ -72,18 +51,6 @@ const columns = computed(() => [
|
||||||
field: (row) => row.agencyName,
|
field: (row) => row.agencyName,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
columnFilter: {
|
|
||||||
component: 'VnSelectFilter',
|
|
||||||
type: 'select',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
|
||||||
options: agencyList,
|
|
||||||
'option-value': 'id',
|
|
||||||
'option-label': 'name',
|
|
||||||
dense: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'vehicle',
|
name: 'vehicle',
|
||||||
|
@ -91,18 +58,6 @@ const columns = computed(() => [
|
||||||
field: (row) => row.vehiclePlateNumber,
|
field: (row) => row.vehiclePlateNumber,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
columnFilter: {
|
|
||||||
component: 'VnSelectFilter',
|
|
||||||
type: 'select',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
attrs: {
|
|
||||||
options: vehicleList,
|
|
||||||
'option-value': 'id',
|
|
||||||
'option-label': 'numberPlate',
|
|
||||||
dense: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'date',
|
name: 'date',
|
||||||
|
@ -110,12 +65,6 @@ const columns = computed(() => [
|
||||||
field: (row) => row.created,
|
field: (row) => row.created,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
columnFilter: {
|
|
||||||
component: 'VnInputDate',
|
|
||||||
type: 'select',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'volume',
|
name: 'volume',
|
||||||
|
@ -130,38 +79,20 @@ const columns = computed(() => [
|
||||||
field: (row) => row.description,
|
field: (row) => row.description,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
columnFilter: {
|
|
||||||
component: 'VnInput',
|
|
||||||
type: 'select',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'hourStarted',
|
name: 'started',
|
||||||
label: t('hourStarted'),
|
label: t('hourStarted'),
|
||||||
field: (row) => toHour(row.started),
|
field: (row) => toHour(row.started),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
columnFilter: {
|
|
||||||
component: 'VnInputTime',
|
|
||||||
type: 'select',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'hourFinished',
|
name: 'finished',
|
||||||
label: t('hourFinished'),
|
label: t('hourFinished'),
|
||||||
field: (row) => toHour(row.finished),
|
field: (row) => toHour(row.finished),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
columnFilter: {
|
|
||||||
component: 'VnInputDate',
|
|
||||||
type: 'select',
|
|
||||||
filterValue: null,
|
|
||||||
event: getInputEvents,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'actions',
|
name: 'actions',
|
||||||
|
@ -170,7 +101,6 @@ const columns = computed(() => [
|
||||||
align: 'right',
|
align: 'right',
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const params = reactive({});
|
|
||||||
const arrayData = useArrayData('EntryLatestBuys', {
|
const arrayData = useArrayData('EntryLatestBuys', {
|
||||||
url: 'Buys/latestBuysFilter',
|
url: 'Buys/latestBuysFilter',
|
||||||
order: ['itemFk DESC'],
|
order: ['itemFk DESC'],
|
||||||
|
@ -190,23 +120,6 @@ const allColumnNames = ref([]);
|
||||||
const confirmationDialog = ref(false);
|
const confirmationDialog = ref(false);
|
||||||
const startingDate = ref(null);
|
const startingDate = ref(null);
|
||||||
|
|
||||||
const getInputEvents = (col) => {
|
|
||||||
return col.columnFilter.type === 'select'
|
|
||||||
? { 'update:modelValue': () => applyColumnFilter(col) }
|
|
||||||
: {
|
|
||||||
'keyup.enter': () => applyColumnFilter(col),
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const applyColumnFilter = async (col) => {
|
|
||||||
try {
|
|
||||||
params[col.field] = col.columnFilter.filterValue;
|
|
||||||
await arrayData.addFilter({ params });
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error applying column filter', err);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const cloneRoutes = () => {
|
const cloneRoutes = () => {
|
||||||
axios.post('Routes/clone', {
|
axios.post('Routes/clone', {
|
||||||
created: startingDate.value,
|
created: startingDate.value,
|
||||||
|
@ -260,7 +173,6 @@ const openTicketsDialog = (id) => {
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
stateStore.rightDrawer = true;
|
stateStore.rightDrawer = true;
|
||||||
allColumnNames.value = columns.value.map((col) => col.name);
|
allColumnNames.value = columns.value.map((col) => col.name);
|
||||||
console.log('les columnes', allColumnNames.value);
|
|
||||||
await arrayData.fetch({ append: false });
|
await arrayData.fetch({ append: false });
|
||||||
});
|
});
|
||||||
onUnmounted(() => (stateStore.rightDrawer = false));
|
onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
|
@ -435,7 +347,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-vehicle="{ row }">
|
<template #body-cell-vehicle="{ row }">
|
||||||
<QTd class="vehicle">
|
<QTd class="small-column">
|
||||||
<VnSelectFilter
|
<VnSelectFilter
|
||||||
:label="t('Vehicle')"
|
:label="t('Vehicle')"
|
||||||
v-model="row.vehicleFk"
|
v-model="row.vehicleFk"
|
||||||
|
@ -452,7 +364,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-date="{ row }">
|
<template #body-cell-date="{ row }">
|
||||||
<QTd class="table-input-cell">
|
<QTd class="table-input-cell small-column">
|
||||||
<VnInputDate
|
<VnInputDate
|
||||||
v-model="row.created"
|
v-model="row.created"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
|
@ -477,7 +389,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-started="{ row }">
|
<template #body-cell-started="{ row }">
|
||||||
<QTd class="table-input-cell">
|
<QTd class="table-input-cell small-column">
|
||||||
<VnInputTime
|
<VnInputTime
|
||||||
v-model="row.started"
|
v-model="row.started"
|
||||||
:label="t('hourStarted')"
|
:label="t('hourStarted')"
|
||||||
|
@ -490,7 +402,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-finished="{ row }">
|
<template #body-cell-finished="{ row }">
|
||||||
<QTd class="table-input-cell">
|
<QTd class="table-input-cell small-column">
|
||||||
<VnInputTime
|
<VnInputTime
|
||||||
v-model="row.finished"
|
v-model="row.finished"
|
||||||
autofocus
|
autofocus
|
||||||
|
@ -502,18 +414,6 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
@update:model-value="updateRoute(row)"
|
@update:model-value="updateRoute(row)"
|
||||||
/>
|
/>
|
||||||
</QTd>
|
</QTd>
|
||||||
<QTd class="table-input-cell">
|
|
||||||
<VnInputTime
|
|
||||||
v-model="row.finished"
|
|
||||||
autofocus
|
|
||||||
:label="t('Hour finished')"
|
|
||||||
:rules="validate('route.finished')"
|
|
||||||
:is-clearable="false"
|
|
||||||
hide-bottom-space
|
|
||||||
dense
|
|
||||||
@update:model-value="updateRoute(row)"
|
|
||||||
/>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-actions="props">
|
<template #body-cell-actions="props">
|
||||||
<QTd :props="props">
|
<QTd :props="props">
|
||||||
|
@ -585,7 +485,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vehicle {
|
.small-column {
|
||||||
max-width: 150px;
|
max-width: 150px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -594,12 +494,13 @@ td:last-child {
|
||||||
background-color: var(--vn-section-color);
|
background-color: var(--vn-section-color);
|
||||||
position: sticky;
|
position: sticky;
|
||||||
right: 0;
|
right: 0;
|
||||||
z-index: 1;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<i18n>
|
<i18n>
|
||||||
en:
|
en:
|
||||||
newRoute: New Route
|
newRoute: New Route
|
||||||
|
hourStarted: Started hour
|
||||||
|
hourFinished: Finished hour
|
||||||
es:
|
es:
|
||||||
ID: ID
|
ID: ID
|
||||||
Worker: Trabajador
|
Worker: Trabajador
|
||||||
|
|
Loading…
Reference in New Issue