Compare commits
No commits in common. "dev" and "fix_vnselect_scroll" have entirely different histories.
dev
...
fix_vnsele
|
@ -34,7 +34,7 @@ import VnTableFilter from './VnTableFilter.vue';
|
||||||
import { getColAlign } from 'src/composables/getColAlign';
|
import { getColAlign } from 'src/composables/getColAlign';
|
||||||
import RightMenu from '../common/RightMenu.vue';
|
import RightMenu from '../common/RightMenu.vue';
|
||||||
import VnScroll from '../common/VnScroll.vue';
|
import VnScroll from '../common/VnScroll.vue';
|
||||||
import VnCheckboxMenu from '../common/VnCheckboxMenu.vue';
|
import VnMultiCheck from '../common/VnMultiCheck.vue';
|
||||||
|
|
||||||
const arrayData = useArrayData(useAttrs()['data-key']);
|
const arrayData = useArrayData(useAttrs()['data-key']);
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
|
@ -644,15 +644,21 @@ const rowCtrlClickFunction = computed(() => {
|
||||||
};
|
};
|
||||||
return () => {};
|
return () => {};
|
||||||
});
|
});
|
||||||
const handleHeaderSelection = (evt, data) => {
|
const handleMultiCheck = (value) => {
|
||||||
if (evt === 'selected' && data) {
|
if (value) {
|
||||||
selected.value = tableRef.value.rows;
|
selected.value = tableRef.value.rows;
|
||||||
} else if (evt === 'selectAll') {
|
} else {
|
||||||
|
selected.value = [];
|
||||||
|
}
|
||||||
|
emit('update:selected', selected.value);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSelectedAll = (data) => {
|
||||||
|
if (data) {
|
||||||
selected.value = data;
|
selected.value = data;
|
||||||
} else {
|
} else {
|
||||||
selected.value = [];
|
selected.value = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
emit('update:selected', selected.value);
|
emit('update:selected', selected.value);
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -718,14 +724,14 @@ const handleHeaderSelection = (evt, data) => {
|
||||||
:data-cy
|
:data-cy
|
||||||
>
|
>
|
||||||
<template #header-selection>
|
<template #header-selection>
|
||||||
<VnCheckboxMenu
|
<VnMultiCheck
|
||||||
:searchUrl="searchUrl"
|
:searchUrl="searchUrl"
|
||||||
:expand="$props.multiCheck.expand"
|
:expand="$props.multiCheck.expand"
|
||||||
v-model="selectAll"
|
v-model="selectAll"
|
||||||
:url="$attrs['url']"
|
:url="$attrs['url']"
|
||||||
@update:selected="handleHeaderSelection('selected', $event)"
|
@update:selected="handleMultiCheck"
|
||||||
@select:all="handleHeaderSelection('selectAll', $event)"
|
@select:all="handleSelectedAll"
|
||||||
/>
|
></VnMultiCheck>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #top-left v-if="!$props.withoutHeader">
|
<template #top-left v-if="!$props.withoutHeader">
|
||||||
|
|
|
@ -1,115 +0,0 @@
|
||||||
<script setup>
|
|
||||||
import { ref } from 'vue';
|
|
||||||
import VnCheckbox from './VnCheckbox.vue';
|
|
||||||
import axios from 'axios';
|
|
||||||
import { toRaw } from 'vue';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
import { useRoute } from 'vue-router';
|
|
||||||
const route = useRoute();
|
|
||||||
const { t } = useI18n();
|
|
||||||
const model = defineModel({ type: [Boolean] });
|
|
||||||
const props = defineProps({
|
|
||||||
expand: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
url: {
|
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
searchUrl: {
|
|
||||||
type: [String, Boolean],
|
|
||||||
default: 'table',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
const value = ref(false);
|
|
||||||
const menuRef = ref(null);
|
|
||||||
const errorMessage = ref(null);
|
|
||||||
const rows = ref(0);
|
|
||||||
const onClick = async () => {
|
|
||||||
errorMessage.value = null;
|
|
||||||
|
|
||||||
if (value.value) {
|
|
||||||
const { filter } = JSON.parse(route.query[props.searchUrl]);
|
|
||||||
filter.limit = 0;
|
|
||||||
const params = {
|
|
||||||
params: { filter: JSON.stringify(filter) },
|
|
||||||
};
|
|
||||||
try {
|
|
||||||
const { data } = await axios.get(props.url, params);
|
|
||||||
rows.value = data;
|
|
||||||
} catch (error) {
|
|
||||||
const response = error.response;
|
|
||||||
if (response.data.error.name === 'UserError') {
|
|
||||||
errorMessage.value = t('tooManyResults');
|
|
||||||
} else {
|
|
||||||
errorMessage.value = response.data.error.message;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
defineEmits(['update:selected', 'select:all']);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div class="flex items-center no-wrap" style="display: flex">
|
|
||||||
<VnCheckbox v-model="value" @click="$emit('update:selected', value)" />
|
|
||||||
<QIcon
|
|
||||||
style="margin-left: -10px"
|
|
||||||
data-cy="btnMultiCheck"
|
|
||||||
v-if="value && $props.expand"
|
|
||||||
name="expand_more"
|
|
||||||
@click="onClick"
|
|
||||||
class="cursor-pointer"
|
|
||||||
color="primary"
|
|
||||||
size="xs"
|
|
||||||
>
|
|
||||||
<QMenu
|
|
||||||
fit
|
|
||||||
anchor="bottom start"
|
|
||||||
self="top left"
|
|
||||||
ref="menuRef"
|
|
||||||
data-cy="menuMultiCheck"
|
|
||||||
>
|
|
||||||
<QList separator>
|
|
||||||
<QItem
|
|
||||||
data-cy="selectAll"
|
|
||||||
v-ripple
|
|
||||||
clickable
|
|
||||||
@click="
|
|
||||||
$refs.menuRef.hide();
|
|
||||||
$emit('select:all', toRaw(rows));
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>
|
|
||||||
<span v-text="t('Select all')" />
|
|
||||||
</QItemLabel>
|
|
||||||
<QItemLabel overline caption>
|
|
||||||
<span
|
|
||||||
v-if="errorMessage"
|
|
||||||
class="text-negative"
|
|
||||||
v-text="errorMessage"
|
|
||||||
/>
|
|
||||||
<span
|
|
||||||
v-else
|
|
||||||
v-text="t('records', { rows: rows.length })"
|
|
||||||
/>
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<slot name="more-options"></slot>
|
|
||||||
</QList>
|
|
||||||
</QMenu>
|
|
||||||
</QIcon>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<i18n lang="yml">
|
|
||||||
en:
|
|
||||||
tooManyResults: Too many results. Please narrow down your search.
|
|
||||||
records: '{rows} records'
|
|
||||||
es:
|
|
||||||
Select all: Seleccionar todo
|
|
||||||
tooManyResults: Demasiados registros. Restringe la búsqueda.
|
|
||||||
records: '{rows} registros'
|
|
||||||
</i18n>
|
|
|
@ -0,0 +1,80 @@
|
||||||
|
<script setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import VnCheckbox from './VnCheckbox.vue';
|
||||||
|
import axios from 'axios';
|
||||||
|
import { toRaw } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
const route = useRoute();
|
||||||
|
const { t } = useI18n();
|
||||||
|
const model = defineModel({ type: [Boolean] });
|
||||||
|
const props = defineProps({
|
||||||
|
expand: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
url: {
|
||||||
|
type: String,
|
||||||
|
default: null,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
searchUrl: {
|
||||||
|
type: [String, Boolean],
|
||||||
|
default: 'table',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const value = ref(false);
|
||||||
|
const rows = ref(0);
|
||||||
|
const onClick = () => {
|
||||||
|
if (value.value) {
|
||||||
|
const { filter } = JSON.parse(route.query[props.searchUrl]);
|
||||||
|
filter.limit = 0;
|
||||||
|
const params = {
|
||||||
|
params: { filter: JSON.stringify(filter) },
|
||||||
|
};
|
||||||
|
axios
|
||||||
|
.get(props.url, params)
|
||||||
|
.then(({ data }) => {
|
||||||
|
rows.value = data;
|
||||||
|
})
|
||||||
|
.catch(console.error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
defineEmits(['update:selected', 'select:all']);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div style="display: flex">
|
||||||
|
<VnCheckbox v-model="value" @click="$emit('update:selected', value)" />
|
||||||
|
<QBtn
|
||||||
|
v-if="value && $props.expand"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
icon="expand_more"
|
||||||
|
@click="onClick"
|
||||||
|
>
|
||||||
|
<QMenu anchor="bottom right" self="top right">
|
||||||
|
<QList>
|
||||||
|
<QItem v-ripple clickable @click="$emit('select:all', toRaw(rows))">
|
||||||
|
{{ t('Select all', { rows: rows.length }) }}
|
||||||
|
</QItem>
|
||||||
|
<slot name="more-options"></slot>
|
||||||
|
</QList>
|
||||||
|
</QMenu>
|
||||||
|
</QBtn>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<i18n lang="yml">
|
||||||
|
en:
|
||||||
|
Select all: 'Select all ({rows})'
|
||||||
|
fr:
|
||||||
|
Select all: 'Sélectionner tout ({rows})'
|
||||||
|
es:
|
||||||
|
Select all: 'Seleccionar todo ({rows})'
|
||||||
|
de:
|
||||||
|
Select all: 'Alle auswählen ({rows})'
|
||||||
|
it:
|
||||||
|
Select all: 'Seleziona tutto ({rows})'
|
||||||
|
pt:
|
||||||
|
Select all: 'Selecionar tudo ({rows})'
|
||||||
|
</i18n>
|
|
@ -19,7 +19,7 @@ export function useArrayData(key, userOptions) {
|
||||||
let canceller = null;
|
let canceller = null;
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
setOptions(userOptions ?? {});
|
setOptions();
|
||||||
reset(['skip']);
|
reset(['skip']);
|
||||||
|
|
||||||
const query = route.query;
|
const query = route.query;
|
||||||
|
@ -39,10 +39,9 @@ export function useArrayData(key, userOptions) {
|
||||||
setCurrentFilter();
|
setCurrentFilter();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (userOptions) setOptions(userOptions);
|
if (key && userOptions) setOptions();
|
||||||
|
|
||||||
function setOptions(params) {
|
function setOptions(params = userOptions) {
|
||||||
if (!params) return;
|
|
||||||
const allowedOptions = [
|
const allowedOptions = [
|
||||||
'url',
|
'url',
|
||||||
'filter',
|
'filter',
|
||||||
|
|
|
@ -6,7 +6,6 @@ import toDateHourMinSec from './toDateHourMinSec';
|
||||||
import toRelativeDate from './toRelativeDate';
|
import toRelativeDate from './toRelativeDate';
|
||||||
import toCurrency from './toCurrency';
|
import toCurrency from './toCurrency';
|
||||||
import toPercentage from './toPercentage';
|
import toPercentage from './toPercentage';
|
||||||
import toNumber from './toNumber';
|
|
||||||
import toLowerCamel from './toLowerCamel';
|
import toLowerCamel from './toLowerCamel';
|
||||||
import dashIfEmpty from './dashIfEmpty';
|
import dashIfEmpty from './dashIfEmpty';
|
||||||
import dateRange from './dateRange';
|
import dateRange from './dateRange';
|
||||||
|
@ -35,7 +34,6 @@ export {
|
||||||
toRelativeDate,
|
toRelativeDate,
|
||||||
toCurrency,
|
toCurrency,
|
||||||
toPercentage,
|
toPercentage,
|
||||||
toNumber,
|
|
||||||
dashIfEmpty,
|
dashIfEmpty,
|
||||||
dateRange,
|
dateRange,
|
||||||
getParamWhere,
|
getParamWhere,
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
export default function (value, fractionSize = 2) {
|
|
||||||
if (isNaN(value)) return value;
|
|
||||||
return new Intl.NumberFormat('es-ES', {
|
|
||||||
style: 'decimal',
|
|
||||||
minimumFractionDigits: 0,
|
|
||||||
maximumFractionDigits: fractionSize,
|
|
||||||
}).format(value);
|
|
||||||
}
|
|
|
@ -122,7 +122,6 @@ globals:
|
||||||
producer: Producer
|
producer: Producer
|
||||||
origin: Origin
|
origin: Origin
|
||||||
state: State
|
state: State
|
||||||
total: Total
|
|
||||||
subtotal: Subtotal
|
subtotal: Subtotal
|
||||||
visible: Visible
|
visible: Visible
|
||||||
price: Price
|
price: Price
|
||||||
|
|
|
@ -126,7 +126,6 @@ globals:
|
||||||
producer: Productor
|
producer: Productor
|
||||||
origin: Origen
|
origin: Origen
|
||||||
state: Estado
|
state: Estado
|
||||||
total: Total
|
|
||||||
subtotal: Subtotal
|
subtotal: Subtotal
|
||||||
visible: Visible
|
visible: Visible
|
||||||
price: Precio
|
price: Precio
|
||||||
|
|
|
@ -89,6 +89,7 @@ const columns = computed(() => [
|
||||||
<CustomerNotificationsCampaignConsumption
|
<CustomerNotificationsCampaignConsumption
|
||||||
:selected-rows="selected.length > 0"
|
:selected-rows="selected.length > 0"
|
||||||
:clients="selected"
|
:clients="selected"
|
||||||
|
:promise="refreshData"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnSubToolbar>
|
</VnSubToolbar>
|
||||||
|
|
|
@ -142,13 +142,13 @@ onMounted(async () => {
|
||||||
valentinesDay: Valentine's Day
|
valentinesDay: Valentine's Day
|
||||||
mothersDay: Mother's Day
|
mothersDay: Mother's Day
|
||||||
allSaints: All Saints' Day
|
allSaints: All Saints' Day
|
||||||
Campaign consumption: Campaign consumption - {rows} records
|
Campaign consumption: Campaign consumption ({rows})
|
||||||
es:
|
es:
|
||||||
params:
|
params:
|
||||||
valentinesDay: Día de San Valentín
|
valentinesDay: Día de San Valentín
|
||||||
mothersDay: Día de la Madre
|
mothersDay: Día de la Madre
|
||||||
allSaints: Día de Todos los Santos
|
allSaints: Día de Todos los Santos
|
||||||
Campaign consumption: Consumo campaña - {rows} registros
|
Campaign consumption: Consumo campaña ({rows})
|
||||||
Campaign: Campaña
|
Campaign: Campaña
|
||||||
From: Desde
|
From: Desde
|
||||||
To: Hasta
|
To: Hasta
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
|
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
|
|
||||||
import { usePrintService } from 'composables/usePrintService';
|
|
||||||
import { downloadFile } from 'src/composables/downloadFile';
|
import { downloadFile } from 'src/composables/downloadFile';
|
||||||
|
|
||||||
import CustomerFileManagementDelete from 'src/pages/Customer/components/CustomerFileManagementDelete.vue';
|
import CustomerFileManagementDelete from 'src/pages/Customer/components/CustomerFileManagementDelete.vue';
|
||||||
|
@ -12,7 +12,7 @@ const { t } = useI18n();
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { openReport } = usePrintService();
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
type: Number,
|
type: Number,
|
||||||
|
@ -24,7 +24,7 @@ const $props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const setDownloadFile = () => openReport(`dms/${$props.id}/downloadFile`, {}, '_blank');
|
const setDownloadFile = () => downloadFile($props.id);
|
||||||
|
|
||||||
const toCustomerFileManagementEdit = () => {
|
const toCustomerFileManagementEdit = () => {
|
||||||
router.push({
|
router.push({
|
||||||
|
|
|
@ -1,20 +1,22 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
import { computed, onMounted, onUnmounted, ref } from 'vue';
|
import { computed, onMounted, onUnmounted, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import axios from 'axios';
|
import FetchedTags from 'components/ui/FetchedTags.vue';
|
||||||
import { dateRange, toCurrency, toNumber, toDateHourMin } from 'src/filters';
|
import SendEmailDialog from 'components/common/SendEmailDialog.vue';
|
||||||
|
import SupplierConsumptionFilter from './SupplierConsumptionFilter.vue';
|
||||||
|
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
||||||
|
|
||||||
|
import { dateRange, toDate } from 'src/filters';
|
||||||
|
import { dashIfEmpty } from 'src/filters';
|
||||||
import { usePrintService } from 'composables/usePrintService';
|
import { usePrintService } from 'composables/usePrintService';
|
||||||
import useNotify from 'src/composables/useNotify';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
import axios from 'axios';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
import SendEmailDialog from 'components/common/SendEmailDialog.vue';
|
|
||||||
import SupplierConsumptionFilter from './SupplierConsumptionFilter.vue';
|
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
import EntryDescriptorProxy from 'src/pages/Entry/Card/EntryDescriptorProxy.vue';
|
|
||||||
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
|
||||||
|
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
|
@ -29,86 +31,7 @@ const arrayData = useArrayData('SupplierConsumption', {
|
||||||
order: ['itemTypeFk', 'itemName', 'itemSize'],
|
order: ['itemTypeFk', 'itemName', 'itemSize'],
|
||||||
userFilter: { where: { supplierFk: route.params.id } },
|
userFilter: { where: { supplierFk: route.params.id } },
|
||||||
});
|
});
|
||||||
const headerColumns = computed(() => [
|
|
||||||
{
|
|
||||||
name: 'id',
|
|
||||||
label: t('globals.entry'),
|
|
||||||
align: 'left',
|
|
||||||
field: 'id',
|
|
||||||
sortable: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'invoiceNumber',
|
|
||||||
label: t('globals.params.supplierRef'),
|
|
||||||
align: 'left',
|
|
||||||
field: 'invoiceNumber',
|
|
||||||
sortable: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'shipped',
|
|
||||||
label: t('globals.shipped'),
|
|
||||||
align: 'center',
|
|
||||||
field: 'shipped',
|
|
||||||
format: toDateHourMin,
|
|
||||||
sortable: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'quantity',
|
|
||||||
label: t('item.list.stems'),
|
|
||||||
align: 'center',
|
|
||||||
field: 'quantity',
|
|
||||||
format: (value) => toNumber(value),
|
|
||||||
sortable: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'total',
|
|
||||||
label: t('globals.total'),
|
|
||||||
align: 'center',
|
|
||||||
field: 'total',
|
|
||||||
format: (value) => toCurrency(value),
|
|
||||||
sortable: true,
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
const columns = computed(() => [
|
|
||||||
{
|
|
||||||
name: 'itemName',
|
|
||||||
label: t('globals.item'),
|
|
||||||
align: 'left',
|
|
||||||
field: 'itemName',
|
|
||||||
sortable: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'subName',
|
|
||||||
align: 'left',
|
|
||||||
field: 'subName',
|
|
||||||
sortable: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'quantity',
|
|
||||||
label: t('globals.quantity'),
|
|
||||||
align: 'right',
|
|
||||||
field: 'quantity',
|
|
||||||
format: (value) => toNumber(value),
|
|
||||||
sortable: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'price',
|
|
||||||
label: t('globals.price'),
|
|
||||||
align: 'right',
|
|
||||||
field: 'price',
|
|
||||||
format: (value) => toCurrency(value),
|
|
||||||
sortable: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'total',
|
|
||||||
label: t('globals.total'),
|
|
||||||
align: 'right',
|
|
||||||
field: 'total',
|
|
||||||
format: (value) => toCurrency(value),
|
|
||||||
sortable: true,
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
const store = arrayData.store;
|
const store = arrayData.store;
|
||||||
|
|
||||||
onUnmounted(() => state.unset('SupplierConsumption'));
|
onUnmounted(() => state.unset('SupplierConsumption'));
|
||||||
|
@ -117,11 +40,13 @@ const dateRanges = computed(() => {
|
||||||
return { from, to };
|
return { from, to };
|
||||||
});
|
});
|
||||||
|
|
||||||
const reportParams = computed(() => ({
|
const reportParams = computed(() => {
|
||||||
recipientId: Number(route.params.id),
|
return {
|
||||||
from: dateRange(dateRanges.value.from)[0].toISOString(),
|
recipientId: Number(route.params.id),
|
||||||
to: dateRange(dateRanges.value.to)[1].toISOString(),
|
to: dateRange(dateRanges.value.to)[1],
|
||||||
}));
|
from: dateRange(dateRanges.value.from)[1],
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
async function getSupplierConsumptionData() {
|
async function getSupplierConsumptionData() {
|
||||||
await arrayData.fetch({ append: false });
|
await arrayData.fetch({ append: false });
|
||||||
|
@ -177,34 +102,33 @@ const sendCampaignMetricsEmail = ({ address }) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const totalEntryPrice = (rows) => {
|
const totalEntryPrice = (rows) => {
|
||||||
if (!rows) return [];
|
let totalPrice = 0;
|
||||||
totalRows.value = rows.reduce(
|
let totalQuantity = 0;
|
||||||
(acc, row) => {
|
if (!rows) return totalPrice;
|
||||||
if (Array.isArray(row.buys)) {
|
for (const row of rows) {
|
||||||
const { total, quantity } = row.buys.reduce(
|
let total = 0;
|
||||||
(buyAcc, buy) => {
|
let quantity = 0;
|
||||||
buyAcc.total += buy.total || 0;
|
|
||||||
buyAcc.quantity += buy.quantity || 0;
|
if (row.buys) {
|
||||||
return buyAcc;
|
for (const buy of row.buys) {
|
||||||
},
|
total = total + buy.total;
|
||||||
{ total: 0, quantity: 0 },
|
quantity = quantity + buy.quantity;
|
||||||
);
|
|
||||||
row.total = total;
|
|
||||||
row.quantity = quantity;
|
|
||||||
acc.totalPrice += total;
|
|
||||||
acc.totalQuantity += quantity;
|
|
||||||
}
|
}
|
||||||
return acc;
|
}
|
||||||
},
|
|
||||||
{ totalPrice: 0, totalQuantity: 0 },
|
row.total = total;
|
||||||
);
|
row.quantity = quantity;
|
||||||
|
totalPrice = totalPrice + total;
|
||||||
|
totalQuantity = totalQuantity + quantity;
|
||||||
|
}
|
||||||
|
totalRows.value = { totalPrice, totalQuantity };
|
||||||
return rows;
|
return rows;
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
stateStore.rightDrawer = true;
|
stateStore.rightDrawer = true;
|
||||||
await getSupplierConsumptionData();
|
await getSupplierConsumptionData();
|
||||||
});
|
});
|
||||||
const expanded = ref([]);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -238,14 +162,14 @@ const expanded = ref([]);
|
||||||
<div>
|
<div>
|
||||||
{{ t('Total entries') }}:
|
{{ t('Total entries') }}:
|
||||||
<QChip :dense="$q.screen.lt.sm" text-color="white">
|
<QChip :dense="$q.screen.lt.sm" text-color="white">
|
||||||
{{ toCurrency(totalRows.totalPrice) }}
|
{{ totalRows.totalPrice }} €
|
||||||
</QChip>
|
</QChip>
|
||||||
</div>
|
</div>
|
||||||
<QSeparator dark vertical />
|
<QSeparator dark vertical />
|
||||||
<div>
|
<div>
|
||||||
{{ t('Total stems entries') }}:
|
{{ t('Total stems entries') }}:
|
||||||
<QChip :dense="$q.screen.lt.sm" text-color="white">
|
<QChip :dense="$q.screen.lt.sm" text-color="white">
|
||||||
{{ toNumber(totalRows.totalQuantity) }}
|
{{ totalRows.totalQuantity }}
|
||||||
</QChip>
|
</QChip>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -255,111 +179,59 @@ const expanded = ref([]);
|
||||||
<SupplierConsumptionFilter data-key="SupplierConsumption" />
|
<SupplierConsumptionFilter data-key="SupplierConsumption" />
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
</RightMenu>
|
||||||
<QCard class="full-width q-pa-md">
|
<QTable
|
||||||
<QTable
|
:rows="rows"
|
||||||
flat
|
row-key="id"
|
||||||
bordered
|
hide-header
|
||||||
:rows="rows"
|
class="full-width q-mt-md"
|
||||||
:columns="headerColumns"
|
:no-data-label="t('No results')"
|
||||||
row-key="id"
|
>
|
||||||
v-model:expanded="expanded"
|
<template #body="{ row }">
|
||||||
:grid="$q.screen.lt.md"
|
<QTr>
|
||||||
>
|
<QTd no-hover>
|
||||||
<template #header="props">
|
<span class="label">{{ t('supplier.consumption.entry') }}: </span>
|
||||||
<QTr :props="props">
|
<span>{{ row.id }}</span>
|
||||||
<QTh auto-width />
|
</QTd>
|
||||||
|
<QTd no-hover>
|
||||||
<QTh v-for="col in props.cols" :key="col.name" :props="props">
|
<span class="label">{{ t('globals.date') }}: </span>
|
||||||
<span v-text="col.label" class="tr-header" />
|
<span>{{ toDate(row.shipped) }}</span></QTd
|
||||||
</QTh>
|
|
||||||
</QTr>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template #body="props">
|
|
||||||
<QTr
|
|
||||||
:props="props"
|
|
||||||
:key="`movement_${props.row.id}`"
|
|
||||||
class="bg-vn-page cursor-pointer"
|
|
||||||
@click="props.expand = !props.expand"
|
|
||||||
>
|
>
|
||||||
<QTd auto-width>
|
<QTd colspan="6" no-hover>
|
||||||
<QIcon
|
<span class="label">{{ t('globals.reference') }}: </span>
|
||||||
:class="props.expand ? '' : 'rotate-270'"
|
<span>{{ row.invoiceNumber }}</span>
|
||||||
name="expand_circle_down"
|
</QTd>
|
||||||
size="md"
|
</QTr>
|
||||||
:color="props.expand ? 'primary' : 'white'"
|
<QTr v-for="(buy, index) in row.buys" :key="index">
|
||||||
/>
|
<QTd no-hover>
|
||||||
</QTd>
|
<QBtn flat class="link" dense no-caps>{{ buy.itemName }}</QBtn>
|
||||||
|
<ItemDescriptorProxy :id="buy.itemFk" />
|
||||||
|
</QTd>
|
||||||
|
|
||||||
<QTd v-for="col in props.cols" :key="col.name" :props="props">
|
<QTd no-hover>
|
||||||
<span @click.stop class="link" v-if="col.name === 'id'">
|
<span>{{ buy.subName }}</span>
|
||||||
{{ col.value }}
|
<FetchedTags :item="buy" />
|
||||||
<EntryDescriptorProxy :id="col.value" />
|
</QTd>
|
||||||
</span>
|
<QTd no-hover> {{ dashIfEmpty(buy.quantity) }}</QTd>
|
||||||
|
<QTd no-hover> {{ dashIfEmpty(buy.price) }}</QTd>
|
||||||
<span v-else v-text="col.value" />
|
<QTd colspan="2" no-hover> {{ dashIfEmpty(buy.total) }}</QTd>
|
||||||
</QTd>
|
</QTr>
|
||||||
</QTr>
|
<QTr>
|
||||||
|
<QTd colspan="5" no-hover>
|
||||||
<QTr
|
<span class="label">{{ t('Total entry') }}: </span>
|
||||||
v-show="props.expand"
|
<span>{{ row.total }} €</span>
|
||||||
:props="props"
|
</QTd>
|
||||||
:key="`expedition_${props.row.id}`"
|
<QTd no-hover>
|
||||||
>
|
<span class="label">{{ t('Total stems') }}: </span>
|
||||||
<QTd colspan="12" style="padding: 1px 0">
|
<span>{{ row.quantity }}</span>
|
||||||
<QTable
|
</QTd>
|
||||||
color="secondary"
|
</QTr>
|
||||||
card-class="bg-vn-page text-white "
|
</template>
|
||||||
style-class="height: 30px"
|
</QTable>
|
||||||
table-header-class="text-white"
|
|
||||||
:rows="props.row.buys"
|
|
||||||
:columns="columns"
|
|
||||||
row-key="id"
|
|
||||||
virtual-scroll
|
|
||||||
v-model:expanded="expanded"
|
|
||||||
>
|
|
||||||
<template #header="props">
|
|
||||||
<QTr :props="props">
|
|
||||||
<QTh
|
|
||||||
v-for="col in props.cols"
|
|
||||||
:key="col.name"
|
|
||||||
:props="props"
|
|
||||||
>
|
|
||||||
<span v-text="col.label" class="tr-header" />
|
|
||||||
</QTh>
|
|
||||||
</QTr>
|
|
||||||
</template>
|
|
||||||
<template #body="props">
|
|
||||||
<QTr :props="props" :key="`m_${props.row.id}`">
|
|
||||||
<QTd
|
|
||||||
v-for="col in props.cols"
|
|
||||||
:key="col.name"
|
|
||||||
:title="col.label"
|
|
||||||
:props="props"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
@click.stop
|
|
||||||
class="link"
|
|
||||||
v-if="col.name === 'itemName'"
|
|
||||||
>
|
|
||||||
{{ col.value }}
|
|
||||||
<ItemDescriptorProxy :id="props.row.itemFk" />
|
|
||||||
</span>
|
|
||||||
<span v-else v-text="col.value" />
|
|
||||||
</QTd>
|
|
||||||
</QTr>
|
|
||||||
</template>
|
|
||||||
</QTable>
|
|
||||||
</QTd>
|
|
||||||
</QTr>
|
|
||||||
</template>
|
|
||||||
</QTable>
|
|
||||||
</QCard>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.q-table thead tr,
|
.label {
|
||||||
.q-table tbody td {
|
color: var(--vn-label-color);
|
||||||
height: 30px;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
|
@ -294,7 +294,7 @@ async function getZone(options) {
|
||||||
</template>
|
</template>
|
||||||
</VnSelect>
|
</VnSelect>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('basicData.warehouse')"
|
:label="t('ticketList.warehouse')"
|
||||||
v-model="warehouseId"
|
v-model="warehouseId"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
|
@ -302,7 +302,7 @@ async function getZone(options) {
|
||||||
hide-selected
|
hide-selected
|
||||||
map-options
|
map-options
|
||||||
:required="true"
|
:required="true"
|
||||||
:rules="validate('basicData.warehouse')"
|
:rules="validate('ticketList.warehouse')"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md no-wrap">
|
<VnRow class="row q-gutter-md q-mb-md no-wrap">
|
||||||
|
|
|
@ -137,6 +137,8 @@ const setUserParams = (params) => {
|
||||||
($event) => onCategoryChange($event, searchFn)
|
($event) => onCategoryChange($event, searchFn)
|
||||||
"
|
"
|
||||||
:options="categoriesOptions"
|
:options="categoriesOptions"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
hide-selected
|
hide-selected
|
||||||
dense
|
dense
|
||||||
filled
|
filled
|
||||||
|
@ -150,7 +152,10 @@ const setUserParams = (params) => {
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('negative.type')"
|
:label="t('negative.type')"
|
||||||
v-model="params.typeFk"
|
v-model="params.typeFk"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
:options="itemTypesOptions"
|
:options="itemTypesOptions"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
hide-selected
|
hide-selected
|
||||||
dense
|
dense
|
||||||
filled
|
filled
|
||||||
|
|
|
@ -121,7 +121,7 @@ const ticketColumns = computed(() => [
|
||||||
format: (row, dashIfEmpty) => dashIfEmpty(row.lines),
|
format: (row, dashIfEmpty) => dashIfEmpty(row.lines),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'right',
|
align: 'left',
|
||||||
label: t('advanceTickets.import'),
|
label: t('advanceTickets.import'),
|
||||||
name: 'totalWithVat',
|
name: 'totalWithVat',
|
||||||
hidden: true,
|
hidden: true,
|
||||||
|
@ -172,15 +172,6 @@ const ticketColumns = computed(() => [
|
||||||
headerClass: 'horizontal-separator',
|
headerClass: 'horizontal-separator',
|
||||||
name: 'futureLiters',
|
name: 'futureLiters',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: t('advanceTickets.preparation'),
|
|
||||||
name: 'futurePreparation',
|
|
||||||
field: 'futurePreparation',
|
|
||||||
align: 'left',
|
|
||||||
sortable: true,
|
|
||||||
headerClass: 'horizontal-separator',
|
|
||||||
columnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
label: t('advanceTickets.futureZone'),
|
label: t('advanceTickets.futureZone'),
|
||||||
|
@ -205,17 +196,15 @@ const ticketColumns = computed(() => [
|
||||||
label: t('advanceTickets.notMovableLines'),
|
label: t('advanceTickets.notMovableLines'),
|
||||||
headerClass: 'horizontal-separator',
|
headerClass: 'horizontal-separator',
|
||||||
name: 'notMovableLines',
|
name: 'notMovableLines',
|
||||||
class: 'shrink',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
label: t('advanceTickets.futureLines'),
|
label: t('advanceTickets.futureLines'),
|
||||||
headerClass: 'horizontal-separator',
|
headerClass: 'horizontal-separator',
|
||||||
name: 'futureLines',
|
name: 'futureLines',
|
||||||
class: 'shrink',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'right',
|
align: 'left',
|
||||||
label: t('advanceTickets.futureImport'),
|
label: t('advanceTickets.futureImport'),
|
||||||
name: 'futureTotalWithVat',
|
name: 'futureTotalWithVat',
|
||||||
hidden: true,
|
hidden: true,
|
||||||
|
@ -410,10 +399,8 @@ watch(
|
||||||
destinationElRef.value.classList.add('text-uppercase', 'color-vn-label');
|
destinationElRef.value.classList.add('text-uppercase', 'color-vn-label');
|
||||||
originElRef.value.classList.add('text-uppercase', 'color-vn-label');
|
originElRef.value.classList.add('text-uppercase', 'color-vn-label');
|
||||||
|
|
||||||
originElRef.value.classList.add('advance-icon');
|
destinationElRef.value.setAttribute('colspan', '10');
|
||||||
|
originElRef.value.setAttribute('colspan', '10');
|
||||||
destinationElRef.value.setAttribute('colspan', '9');
|
|
||||||
originElRef.value.setAttribute('colspan', '11');
|
|
||||||
|
|
||||||
destinationElRef.value.textContent = `${t(
|
destinationElRef.value.textContent = `${t(
|
||||||
'advanceTickets.destination',
|
'advanceTickets.destination',
|
||||||
|
|
|
@ -68,7 +68,7 @@ onMounted(async () => await getItemPackingTypes());
|
||||||
<span>{{ formatFn(tag.value) }}</span>
|
<span>{{ formatFn(tag.value) }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ params }">
|
<template #body="{ params, searchFn }">
|
||||||
<QItem class="q-my-sm">
|
<QItem class="q-my-sm">
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInputDate
|
<VnInputDate
|
||||||
|
@ -96,10 +96,12 @@ onMounted(async () => await getItemPackingTypes());
|
||||||
option-value="code"
|
option-value="code"
|
||||||
option-label="description"
|
option-label="description"
|
||||||
:info="t('iptInfo')"
|
:info="t('iptInfo')"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
dense
|
dense
|
||||||
filled
|
filled
|
||||||
:use-like="false"
|
:use-like="false"
|
||||||
/>
|
>
|
||||||
|
</VnSelect>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
|
@ -111,10 +113,12 @@ onMounted(async () => await getItemPackingTypes());
|
||||||
option-value="code"
|
option-value="code"
|
||||||
option-label="description"
|
option-label="description"
|
||||||
:info="t('iptInfo')"
|
:info="t('iptInfo')"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
dense
|
dense
|
||||||
filled
|
filled
|
||||||
:use-like="false"
|
:use-like="false"
|
||||||
/>
|
>
|
||||||
|
</VnSelect>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
|
@ -133,6 +137,7 @@ onMounted(async () => await getItemPackingTypes());
|
||||||
:label="t('params.isFullMovable')"
|
:label="t('params.isFullMovable')"
|
||||||
v-model="params.isFullMovable"
|
v-model="params.isFullMovable"
|
||||||
toggle-indeterminate
|
toggle-indeterminate
|
||||||
|
@update:model-value="searchFn()"
|
||||||
dense
|
dense
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
@ -155,9 +160,13 @@ onMounted(async () => await getItemPackingTypes());
|
||||||
:label="t('params.warehouseFk')"
|
:label="t('params.warehouseFk')"
|
||||||
v-model="params.warehouseFk"
|
v-model="params.warehouseFk"
|
||||||
:options="warehousesOptions"
|
:options="warehousesOptions"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
dense
|
dense
|
||||||
filled
|
filled
|
||||||
/>
|
>
|
||||||
|
</VnSelect>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
|
@ -166,6 +175,7 @@ onMounted(async () => await getItemPackingTypes());
|
||||||
toggle-indeterminate
|
toggle-indeterminate
|
||||||
:label="t('params.onlyWithDestination')"
|
:label="t('params.onlyWithDestination')"
|
||||||
v-model="params.onlyWithDestination"
|
v-model="params.onlyWithDestination"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
dense
|
dense
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
|
|
@ -60,7 +60,7 @@ const groupedStates = ref([]);
|
||||||
<span>{{ formatFn(tag.value) }}</span>
|
<span>{{ formatFn(tag.value) }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ params }">
|
<template #body="{ params, searchFn }">
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput v-model="params.clientFk" :label="t('Customer ID')" filled />
|
<VnInput v-model="params.clientFk" :label="t('Customer ID')" filled />
|
||||||
|
@ -108,7 +108,10 @@ const groupedStates = ref([]);
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('State')"
|
:label="t('State')"
|
||||||
v-model="params.stateFk"
|
v-model="params.stateFk"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
:options="states"
|
:options="states"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
use-input
|
use-input
|
||||||
|
@ -125,6 +128,7 @@ const groupedStates = ref([]);
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('params.groupedStates')"
|
:label="t('params.groupedStates')"
|
||||||
v-model="params.groupedStates"
|
v-model="params.groupedStates"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
:options="groupedStates"
|
:options="groupedStates"
|
||||||
option-label="code"
|
option-label="code"
|
||||||
emit-value
|
emit-value
|
||||||
|
@ -159,6 +163,7 @@ const groupedStates = ref([]);
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
v-model="params.myTeam"
|
v-model="params.myTeam"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
:label="t('My team')"
|
:label="t('My team')"
|
||||||
toggle-indeterminate
|
toggle-indeterminate
|
||||||
/>
|
/>
|
||||||
|
@ -166,6 +171,7 @@ const groupedStates = ref([]);
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
v-model="params.pending"
|
v-model="params.pending"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
:label="t('Pending')"
|
:label="t('Pending')"
|
||||||
toggle-indeterminate
|
toggle-indeterminate
|
||||||
/>
|
/>
|
||||||
|
@ -175,6 +181,7 @@ const groupedStates = ref([]);
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
v-model="params.hasInvoice"
|
v-model="params.hasInvoice"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
:label="t('Invoiced')"
|
:label="t('Invoiced')"
|
||||||
toggle-indeterminate
|
toggle-indeterminate
|
||||||
/>
|
/>
|
||||||
|
@ -182,6 +189,7 @@ const groupedStates = ref([]);
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
v-model="params.hasRoute"
|
v-model="params.hasRoute"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
:label="t('Routed')"
|
:label="t('Routed')"
|
||||||
toggle-indeterminate
|
toggle-indeterminate
|
||||||
/>
|
/>
|
||||||
|
@ -195,7 +203,10 @@ const groupedStates = ref([]);
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Province')"
|
:label="t('Province')"
|
||||||
v-model="params.provinceFk"
|
v-model="params.provinceFk"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
:options="provinces"
|
:options="provinces"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
use-input
|
use-input
|
||||||
|
@ -212,6 +223,7 @@ const groupedStates = ref([]);
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Agency')"
|
:label="t('Agency')"
|
||||||
v-model="params.agencyModeFk"
|
v-model="params.agencyModeFk"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
:options="agencies"
|
:options="agencies"
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
|
@ -229,7 +241,10 @@ const groupedStates = ref([]);
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Warehouse')"
|
:label="t('Warehouse')"
|
||||||
v-model="params.warehouseFk"
|
v-model="params.warehouseFk"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
:options="warehouses"
|
:options="warehouses"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
use-input
|
use-input
|
||||||
|
|
|
@ -85,7 +85,6 @@ const ticketColumns = computed(() => [
|
||||||
label: t('advanceTickets.liters'),
|
label: t('advanceTickets.liters'),
|
||||||
name: 'liters',
|
name: 'liters',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
class: 'shrink',
|
|
||||||
headerClass: 'horizontal-separator',
|
headerClass: 'horizontal-separator',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -178,12 +177,7 @@ watch(
|
||||||
if (!$el) return;
|
if (!$el) return;
|
||||||
const head = $el.querySelector('thead');
|
const head = $el.querySelector('thead');
|
||||||
const firstRow = $el.querySelector('thead > tr');
|
const firstRow = $el.querySelector('thead > tr');
|
||||||
const headSelectionCol = $el.querySelector(
|
|
||||||
'thead tr.bg-header th.q-table--col-auto-width',
|
|
||||||
);
|
|
||||||
if (headSelectionCol) {
|
|
||||||
headSelectionCol.classList.add('horizontal-separator');
|
|
||||||
}
|
|
||||||
const newRow = document.createElement('tr');
|
const newRow = document.createElement('tr');
|
||||||
destinationElRef.value = document.createElement('th');
|
destinationElRef.value = document.createElement('th');
|
||||||
originElRef.value = document.createElement('th');
|
originElRef.value = document.createElement('th');
|
||||||
|
@ -191,10 +185,9 @@ watch(
|
||||||
newRow.classList.add('bg-header');
|
newRow.classList.add('bg-header');
|
||||||
destinationElRef.value.classList.add('text-uppercase', 'color-vn-label');
|
destinationElRef.value.classList.add('text-uppercase', 'color-vn-label');
|
||||||
originElRef.value.classList.add('text-uppercase', 'color-vn-label');
|
originElRef.value.classList.add('text-uppercase', 'color-vn-label');
|
||||||
originElRef.value.classList.add('advance-icon');
|
|
||||||
|
|
||||||
destinationElRef.value.setAttribute('colspan', '9');
|
destinationElRef.value.setAttribute('colspan', '7');
|
||||||
originElRef.value.setAttribute('colspan', '7');
|
originElRef.value.setAttribute('colspan', '9');
|
||||||
|
|
||||||
originElRef.value.textContent = `${t('advanceTickets.origin')}`;
|
originElRef.value.textContent = `${t('advanceTickets.origin')}`;
|
||||||
destinationElRef.value.textContent = `${t('advanceTickets.destination')}`;
|
destinationElRef.value.textContent = `${t('advanceTickets.destination')}`;
|
||||||
|
@ -378,12 +371,4 @@ watch(
|
||||||
:deep(.horizontal-bottom-separator) {
|
:deep(.horizontal-bottom-separator) {
|
||||||
border-bottom: 4px solid white !important;
|
border-bottom: 4px solid white !important;
|
||||||
}
|
}
|
||||||
:deep(th.advance-icon::after) {
|
|
||||||
content: '>>';
|
|
||||||
font-size: larger;
|
|
||||||
position: absolute;
|
|
||||||
text-align: center;
|
|
||||||
float: 0;
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -70,7 +70,7 @@ onMounted(async () => {
|
||||||
<span>{{ formatFn(tag.value) }}</span>
|
<span>{{ formatFn(tag.value) }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ params }">
|
<template #body="{ params, searchFn }">
|
||||||
<QItem class="q-my-sm">
|
<QItem class="q-my-sm">
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInputDate
|
<VnInputDate
|
||||||
|
@ -116,9 +116,11 @@ onMounted(async () => {
|
||||||
option-value="code"
|
option-value="code"
|
||||||
option-label="description"
|
option-label="description"
|
||||||
:info="t('iptInfo')"
|
:info="t('iptInfo')"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
dense
|
dense
|
||||||
filled
|
filled
|
||||||
/>
|
>
|
||||||
|
</VnSelect>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
|
@ -130,9 +132,11 @@ onMounted(async () => {
|
||||||
option-value="code"
|
option-value="code"
|
||||||
option-label="description"
|
option-label="description"
|
||||||
:info="t('iptInfo')"
|
:info="t('iptInfo')"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
dense
|
dense
|
||||||
filled
|
filled
|
||||||
/>
|
>
|
||||||
|
</VnSelect>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
|
@ -141,9 +145,13 @@ onMounted(async () => {
|
||||||
:label="t('params.state')"
|
:label="t('params.state')"
|
||||||
v-model="params.state"
|
v-model="params.state"
|
||||||
:options="stateOptions"
|
:options="stateOptions"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
dense
|
dense
|
||||||
filled
|
filled
|
||||||
/>
|
>
|
||||||
|
</VnSelect>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
|
@ -152,9 +160,13 @@ onMounted(async () => {
|
||||||
:label="t('params.futureState')"
|
:label="t('params.futureState')"
|
||||||
v-model="params.futureState"
|
v-model="params.futureState"
|
||||||
:options="stateOptions"
|
:options="stateOptions"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
dense
|
dense
|
||||||
filled
|
filled
|
||||||
/>
|
>
|
||||||
|
</VnSelect>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
|
||||||
|
@ -164,6 +176,7 @@ onMounted(async () => {
|
||||||
:label="t('params.problems')"
|
:label="t('params.problems')"
|
||||||
v-model="params.problems"
|
v-model="params.problems"
|
||||||
:toggle-indeterminate="false"
|
:toggle-indeterminate="false"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
@ -173,9 +186,13 @@ onMounted(async () => {
|
||||||
:label="t('params.warehouseFk')"
|
:label="t('params.warehouseFk')"
|
||||||
v-model="params.warehouseFk"
|
v-model="params.warehouseFk"
|
||||||
:options="warehousesOptions"
|
:options="warehousesOptions"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
dense
|
dense
|
||||||
filled
|
filled
|
||||||
/>
|
>
|
||||||
|
</VnSelect>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -120,7 +120,6 @@ basicData:
|
||||||
difference: Difference
|
difference: Difference
|
||||||
total: Total
|
total: Total
|
||||||
price: Price
|
price: Price
|
||||||
warehouse: Warehouse
|
|
||||||
newPrice: New price
|
newPrice: New price
|
||||||
chargeDifference: Charge difference to
|
chargeDifference: Charge difference to
|
||||||
withoutNegatives: Create without negatives
|
withoutNegatives: Create without negatives
|
||||||
|
|
|
@ -47,7 +47,6 @@ basicData:
|
||||||
difference: Diferencia
|
difference: Diferencia
|
||||||
total: Total
|
total: Total
|
||||||
price: Precio
|
price: Precio
|
||||||
warehouse: Almacén
|
|
||||||
newPrice: Nuevo precio
|
newPrice: Nuevo precio
|
||||||
chargeDifference: Cargar diferencia a
|
chargeDifference: Cargar diferencia a
|
||||||
withoutNegatives: Crear sin negativos
|
withoutNegatives: Crear sin negativos
|
||||||
|
|
|
@ -280,7 +280,7 @@ const fetchWeekData = async () => {
|
||||||
week: selectedWeekNumber.value,
|
week: selectedWeekNumber.value,
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
const [{ data: mailData }, { data: countData }] = await Promise.all([
|
const [{ data: mailData }, { data: countData }] = await Promise.allS([
|
||||||
axios.get(`Workers/${route.params.id}/mail`, {
|
axios.get(`Workers/${route.params.id}/mail`, {
|
||||||
params: { filter: { where } },
|
params: { filter: { where } },
|
||||||
}),
|
}),
|
||||||
|
@ -292,9 +292,8 @@ const fetchWeekData = async () => {
|
||||||
state.value = mail?.state;
|
state.value = mail?.state;
|
||||||
reason.value = mail?.reason;
|
reason.value = mail?.reason;
|
||||||
canResend.value = !!countData.count;
|
canResend.value = !!countData.count;
|
||||||
} catch (error) {
|
} catch {
|
||||||
state.value = null;
|
state.value = null;
|
||||||
if (error?.status != 403) throw error;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -76,8 +76,8 @@ describe('TicketList', () => {
|
||||||
});
|
});
|
||||||
}).as('ticket');
|
}).as('ticket');
|
||||||
|
|
||||||
cy.selectOption('[data-cy="Warehouse_select"]', 'Warehouse Five');
|
cy.get('[data-cy="Warehouse_select"]').type('Warehouse One');
|
||||||
cy.searchBtnFilterPanel();
|
cy.get('.q-menu .q-item').contains('Warehouse One').click();
|
||||||
cy.wait('@ticket').then((interception) => {
|
cy.wait('@ticket').then((interception) => {
|
||||||
const data = interception.response.body[0];
|
const data = interception.response.body[0];
|
||||||
expect(data.hasComponentLack).to.equal(1);
|
expect(data.hasComponentLack).to.equal(1);
|
||||||
|
|
Loading…
Reference in New Issue