Merge branch 'dev' into 8555-AddNewFilterField
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
commit
b386041f8e
3095
CHANGELOG.md
3095
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
|
@ -9,19 +9,19 @@ export default {
|
||||||
if (!form) return;
|
if (!form) return;
|
||||||
try {
|
try {
|
||||||
const inputsFormCard = form.querySelectorAll(
|
const inputsFormCard = form.querySelectorAll(
|
||||||
`input:not([disabled]):not([type="checkbox"])`
|
`input:not([disabled]):not([type="checkbox"])`,
|
||||||
);
|
);
|
||||||
if (inputsFormCard.length) {
|
if (inputsFormCard.length) {
|
||||||
focusFirstInput(inputsFormCard[0]);
|
focusFirstInput(inputsFormCard[0]);
|
||||||
}
|
}
|
||||||
const textareas = document.querySelectorAll(
|
const textareas = document.querySelectorAll(
|
||||||
'textarea:not([disabled]), [contenteditable]:not([disabled])'
|
'textarea:not([disabled]), [contenteditable]:not([disabled])',
|
||||||
);
|
);
|
||||||
if (textareas.length) {
|
if (textareas.length) {
|
||||||
focusFirstInput(textareas[textareas.length - 1]);
|
focusFirstInput(textareas[textareas.length - 1]);
|
||||||
}
|
}
|
||||||
const inputs = document.querySelectorAll(
|
const inputs = document.querySelectorAll(
|
||||||
'form#formModel input:not([disabled]):not([type="checkbox"])'
|
'form#formModel input:not([disabled]):not([type="checkbox"])',
|
||||||
);
|
);
|
||||||
const input = inputs[0];
|
const input = inputs[0];
|
||||||
if (!input) return;
|
if (!input) return;
|
||||||
|
|
|
@ -51,4 +51,5 @@ export default boot(({ app }) => {
|
||||||
|
|
||||||
await useCau(response, message);
|
await useCau(response, message);
|
||||||
};
|
};
|
||||||
|
app.provide('app', app);
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
|
||||||
import VnRow from 'components/ui/VnRow.vue';
|
import VnRow from 'components/ui/VnRow.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import VnSelectProvince from 'src/components/VnSelectProvince.vue';
|
import VnSelectProvince from 'src/components/VnSelectProvince.vue';
|
||||||
|
@ -21,14 +20,11 @@ const postcodeFormData = reactive({
|
||||||
provinceFk: null,
|
provinceFk: null,
|
||||||
townFk: null,
|
townFk: null,
|
||||||
});
|
});
|
||||||
const townsFetchDataRef = ref(false);
|
|
||||||
const townFilter = ref({});
|
const townFilter = ref({});
|
||||||
|
|
||||||
const countriesRef = ref(false);
|
const countriesRef = ref(false);
|
||||||
const provincesOptions = ref([]);
|
const provincesOptions = ref([]);
|
||||||
const townsOptions = ref([]);
|
|
||||||
const town = ref({});
|
const town = ref({});
|
||||||
const countryFilter = ref({});
|
|
||||||
|
|
||||||
function onDataSaved(formData) {
|
function onDataSaved(formData) {
|
||||||
const newPostcode = {
|
const newPostcode = {
|
||||||
|
@ -51,7 +47,6 @@ async function setCountry(countryFk, data) {
|
||||||
data.townFk = null;
|
data.townFk = null;
|
||||||
data.provinceFk = null;
|
data.provinceFk = null;
|
||||||
data.countryFk = countryFk;
|
data.countryFk = countryFk;
|
||||||
await fetchTowns();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Province
|
// Province
|
||||||
|
@ -60,22 +55,11 @@ async function setProvince(id, data) {
|
||||||
const newProvince = provincesOptions.value.find((province) => province.id == id);
|
const newProvince = provincesOptions.value.find((province) => province.id == id);
|
||||||
if (newProvince) data.countryFk = newProvince.countryFk;
|
if (newProvince) data.countryFk = newProvince.countryFk;
|
||||||
postcodeFormData.provinceFk = id;
|
postcodeFormData.provinceFk = id;
|
||||||
await fetchTowns();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onProvinceCreated(data) {
|
async function onProvinceCreated(data) {
|
||||||
postcodeFormData.provinceFk = data.id;
|
postcodeFormData.provinceFk = data.id;
|
||||||
}
|
}
|
||||||
function provinceByCountry(countryFk = postcodeFormData.countryFk) {
|
|
||||||
return provincesOptions.value
|
|
||||||
.filter((province) => province.countryFk === countryFk)
|
|
||||||
.map(({ id }) => id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Town
|
|
||||||
async function handleTowns(data) {
|
|
||||||
townsOptions.value = data;
|
|
||||||
}
|
|
||||||
function setTown(newTown, data) {
|
function setTown(newTown, data) {
|
||||||
town.value = newTown;
|
town.value = newTown;
|
||||||
data.provinceFk = newTown?.provinceFk ?? newTown;
|
data.provinceFk = newTown?.provinceFk ?? newTown;
|
||||||
|
@ -88,18 +72,6 @@ async function onCityCreated(newTown, formData) {
|
||||||
formData.townFk = newTown;
|
formData.townFk = newTown;
|
||||||
setTown(newTown, formData);
|
setTown(newTown, formData);
|
||||||
}
|
}
|
||||||
async function fetchTowns(countryFk = postcodeFormData.countryFk) {
|
|
||||||
if (!countryFk) return;
|
|
||||||
const provinces = postcodeFormData.provinceFk
|
|
||||||
? [postcodeFormData.provinceFk]
|
|
||||||
: provinceByCountry();
|
|
||||||
townFilter.value.where = {
|
|
||||||
provinceFk: {
|
|
||||||
inq: provinces,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
await townsFetchDataRef.value?.fetch();
|
|
||||||
}
|
|
||||||
|
|
||||||
async function filterTowns(name) {
|
async function filterTowns(name) {
|
||||||
if (name !== '') {
|
if (name !== '') {
|
||||||
|
@ -108,22 +80,11 @@ async function filterTowns(name) {
|
||||||
like: `%${name}%`,
|
like: `%${name}%`,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
await townsFetchDataRef.value?.fetch();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
ref="townsFetchDataRef"
|
|
||||||
:sort-by="['name ASC']"
|
|
||||||
:limit="30"
|
|
||||||
:filter="townFilter"
|
|
||||||
@on-fetch="handleTowns"
|
|
||||||
auto-load
|
|
||||||
url="Towns/location"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<FormModelPopup
|
<FormModelPopup
|
||||||
url-create="postcodes"
|
url-create="postcodes"
|
||||||
model="postcode"
|
model="postcode"
|
||||||
|
@ -149,14 +110,13 @@ async function filterTowns(name) {
|
||||||
@filter="filterTowns"
|
@filter="filterTowns"
|
||||||
:tooltip="t('Create city')"
|
:tooltip="t('Create city')"
|
||||||
v-model="data.townFk"
|
v-model="data.townFk"
|
||||||
:options="townsOptions"
|
url="Towns/location"
|
||||||
option-label="name"
|
|
||||||
option-value="id"
|
|
||||||
:rules="validate('postcode.city')"
|
:rules="validate('postcode.city')"
|
||||||
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
||||||
:emit-value="false"
|
:emit-value="false"
|
||||||
required
|
required
|
||||||
data-cy="locationTown"
|
data-cy="locationTown"
|
||||||
|
sort-by="name ASC"
|
||||||
>
|
>
|
||||||
<template #option="{ itemProps, opt }">
|
<template #option="{ itemProps, opt }">
|
||||||
<QItem v-bind="itemProps">
|
<QItem v-bind="itemProps">
|
||||||
|
@ -197,16 +157,12 @@ async function filterTowns(name) {
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
ref="countriesRef"
|
ref="countriesRef"
|
||||||
:limit="30"
|
|
||||||
:filter="countryFilter"
|
|
||||||
:sort-by="['name ASC']"
|
:sort-by="['name ASC']"
|
||||||
auto-load
|
auto-load
|
||||||
url="Countries"
|
url="Countries"
|
||||||
required
|
required
|
||||||
:label="t('Country')"
|
:label="t('Country')"
|
||||||
hide-selected
|
hide-selected
|
||||||
option-label="name"
|
|
||||||
option-value="id"
|
|
||||||
v-model="data.countryFk"
|
v-model="data.countryFk"
|
||||||
:rules="validate('postcode.countryFk')"
|
:rules="validate('postcode.countryFk')"
|
||||||
@update:model-value="(value) => setCountry(value, data)"
|
@update:model-value="(value) => setCountry(value, data)"
|
||||||
|
|
|
@ -62,12 +62,9 @@ const where = computed(() => {
|
||||||
auto-load
|
auto-load
|
||||||
:where="where"
|
:where="where"
|
||||||
url="Autonomies/location"
|
url="Autonomies/location"
|
||||||
:sort-by="['name ASC']"
|
sort-by="name ASC"
|
||||||
:limit="30"
|
|
||||||
:label="t('Autonomy')"
|
:label="t('Autonomy')"
|
||||||
hide-selected
|
hide-selected
|
||||||
option-label="name"
|
|
||||||
option-value="id"
|
|
||||||
v-model="data.autonomyFk"
|
v-model="data.autonomyFk"
|
||||||
:rules="validate('province.autonomyFk')"
|
:rules="validate('province.autonomyFk')"
|
||||||
>
|
>
|
||||||
|
|
|
@ -64,6 +64,10 @@ const $props = defineProps({
|
||||||
type: Function,
|
type: Function,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
beforeSaveFn: {
|
||||||
|
type: Function,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
goTo: {
|
goTo: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
|
@ -176,7 +180,11 @@ async function saveChanges(data) {
|
||||||
hasChanges.value = false;
|
hasChanges.value = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const changes = data || getChanges();
|
let changes = data || getChanges();
|
||||||
|
if ($props.beforeSaveFn) {
|
||||||
|
changes = await $props.beforeSaveFn(changes, getChanges);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await axios.post($props.saveUrl || $props.url + '/crud', changes);
|
await axios.post($props.saveUrl || $props.url + '/crud', changes);
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -229,12 +237,12 @@ async function remove(data) {
|
||||||
componentProps: {
|
componentProps: {
|
||||||
title: t('globals.confirmDeletion'),
|
title: t('globals.confirmDeletion'),
|
||||||
message: t('globals.confirmDeletionMessage'),
|
message: t('globals.confirmDeletionMessage'),
|
||||||
newData,
|
data: { deletes: ids },
|
||||||
ids,
|
ids,
|
||||||
|
promise: saveChanges,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.onOk(async () => {
|
.onOk(async () => {
|
||||||
await saveChanges({ deletes: ids });
|
|
||||||
newData = newData.filter((form) => !ids.some((id) => id == form[pk]));
|
newData = newData.filter((form) => !ids.some((id) => id == form[pk]));
|
||||||
fetch(newData);
|
fetch(newData);
|
||||||
});
|
});
|
||||||
|
@ -374,6 +382,8 @@ watch(formUrl, async () => {
|
||||||
@click="onSubmit"
|
@click="onSubmit"
|
||||||
:disable="!hasChanges"
|
:disable="!hasChanges"
|
||||||
:title="t('globals.save')"
|
:title="t('globals.save')"
|
||||||
|
v-shortcut="'s'"
|
||||||
|
shortcut="s"
|
||||||
data-cy="crudModelDefaultSaveBtn"
|
data-cy="crudModelDefaultSaveBtn"
|
||||||
/>
|
/>
|
||||||
<slot name="moreAfterActions" />
|
<slot name="moreAfterActions" />
|
||||||
|
|
|
@ -42,7 +42,6 @@ const itemFilter = {
|
||||||
const itemFilterParams = reactive({});
|
const itemFilterParams = reactive({});
|
||||||
const closeButton = ref(null);
|
const closeButton = ref(null);
|
||||||
const isLoading = ref(false);
|
const isLoading = ref(false);
|
||||||
const producersOptions = ref([]);
|
|
||||||
const ItemTypesOptions = ref([]);
|
const ItemTypesOptions = ref([]);
|
||||||
const InksOptions = ref([]);
|
const InksOptions = ref([]);
|
||||||
const tableRows = ref([]);
|
const tableRows = ref([]);
|
||||||
|
@ -121,23 +120,17 @@ const selectItem = ({ id }) => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
url="Producers"
|
|
||||||
@on-fetch="(data) => (producersOptions = data)"
|
|
||||||
:filter="{ fields: ['id', 'name'], order: 'name ASC', limit: 30 }"
|
|
||||||
auto-load
|
|
||||||
/>
|
|
||||||
<FetchData
|
<FetchData
|
||||||
url="ItemTypes"
|
url="ItemTypes"
|
||||||
:filter="{ fields: ['id', 'name'], order: 'name ASC', limit: 30 }"
|
:filter="{ fields: ['id', 'name'], order: 'name ASC' }"
|
||||||
order="name"
|
order="name ASC"
|
||||||
@on-fetch="(data) => (ItemTypesOptions = data)"
|
@on-fetch="(data) => (ItemTypesOptions = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<FetchData
|
<FetchData
|
||||||
url="Inks"
|
url="Inks"
|
||||||
:filter="{ fields: ['id', 'name'], order: 'name ASC', limit: 30 }"
|
:filter="{ fields: ['id', 'name'], order: 'name ASC' }"
|
||||||
order="name"
|
order="name ASC"
|
||||||
@on-fetch="(data) => (InksOptions = data)"
|
@on-fetch="(data) => (InksOptions = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
|
@ -152,11 +145,11 @@ const selectItem = ({ id }) => {
|
||||||
<VnInput :label="t('entry.buys.size')" v-model="itemFilterParams.size" />
|
<VnInput :label="t('entry.buys.size')" v-model="itemFilterParams.size" />
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('globals.producer')"
|
:label="t('globals.producer')"
|
||||||
:options="producersOptions"
|
|
||||||
hide-selected
|
hide-selected
|
||||||
option-label="name"
|
|
||||||
option-value="id"
|
|
||||||
v-model="itemFilterParams.producerFk"
|
v-model="itemFilterParams.producerFk"
|
||||||
|
url="Producers"
|
||||||
|
:fields="['id', 'name']"
|
||||||
|
sort-by="name ASC"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('globals.type')"
|
:label="t('globals.type')"
|
||||||
|
|
|
@ -124,7 +124,7 @@ const selectTravel = ({ id }) => {
|
||||||
<FetchData
|
<FetchData
|
||||||
url="AgencyModes"
|
url="AgencyModes"
|
||||||
@on-fetch="(data) => (agenciesOptions = data)"
|
@on-fetch="(data) => (agenciesOptions = data)"
|
||||||
:filter="{ fields: ['id', 'name'], order: 'name ASC', limit: 30 }"
|
:filter="{ fields: ['id', 'name'], order: 'name ASC' }"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
@ -181,6 +181,7 @@ const selectTravel = ({ id }) => {
|
||||||
color="primary"
|
color="primary"
|
||||||
:disabled="isLoading"
|
:disabled="isLoading"
|
||||||
:loading="isLoading"
|
:loading="isLoading"
|
||||||
|
data-cy="save-filter-travel-form"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<QTable
|
<QTable
|
||||||
|
@ -191,9 +192,10 @@ const selectTravel = ({ id }) => {
|
||||||
:no-data-label="t('Enter a new search')"
|
:no-data-label="t('Enter a new search')"
|
||||||
class="q-mt-lg"
|
class="q-mt-lg"
|
||||||
@row-click="(_, row) => selectTravel(row)"
|
@row-click="(_, row) => selectTravel(row)"
|
||||||
|
data-cy="table-filter-travel-form"
|
||||||
>
|
>
|
||||||
<template #body-cell-id="{ row }">
|
<template #body-cell-id="{ row }">
|
||||||
<QTd auto-width @click.stop>
|
<QTd auto-width @click.stop data-cy="travelFk-travel-form">
|
||||||
<QBtn flat color="blue">{{ row.id }}</QBtn>
|
<QBtn flat color="blue">{{ row.id }}</QBtn>
|
||||||
<TravelDescriptorProxy :id="row.id" />
|
<TravelDescriptorProxy :id="row.id" />
|
||||||
</QTd>
|
</QTd>
|
||||||
|
|
|
@ -113,7 +113,7 @@ const defaultButtons = computed(() => ({
|
||||||
color: 'primary',
|
color: 'primary',
|
||||||
icon: 'save',
|
icon: 'save',
|
||||||
label: 'globals.save',
|
label: 'globals.save',
|
||||||
click: () => myForm.value.submit(),
|
click: () => myForm.value.onSubmit(false),
|
||||||
type: 'submit',
|
type: 'submit',
|
||||||
},
|
},
|
||||||
reset: {
|
reset: {
|
||||||
|
@ -134,7 +134,8 @@ onMounted(async () => {
|
||||||
|
|
||||||
if (!$props.formInitialData) {
|
if (!$props.formInitialData) {
|
||||||
if ($props.autoLoad && $props.url) await fetch();
|
if ($props.autoLoad && $props.url) await fetch();
|
||||||
else if (arrayData.store.data) updateAndEmit('onFetch', arrayData.store.data);
|
else if (arrayData.store.data)
|
||||||
|
updateAndEmit('onFetch', { val: arrayData.store.data });
|
||||||
}
|
}
|
||||||
if ($props.observeFormChanges) {
|
if ($props.observeFormChanges) {
|
||||||
watch(
|
watch(
|
||||||
|
@ -154,7 +155,7 @@ onMounted(async () => {
|
||||||
if (!$props.url)
|
if (!$props.url)
|
||||||
watch(
|
watch(
|
||||||
() => arrayData.store.data,
|
() => arrayData.store.data,
|
||||||
(val) => updateAndEmit('onFetch', val),
|
(val) => updateAndEmit('onFetch', { val }),
|
||||||
);
|
);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
|
@ -200,14 +201,15 @@ async function fetch() {
|
||||||
});
|
});
|
||||||
if (Array.isArray(data)) data = data[0] ?? {};
|
if (Array.isArray(data)) data = data[0] ?? {};
|
||||||
|
|
||||||
updateAndEmit('onFetch', data);
|
updateAndEmit('onFetch', { val: data });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
state.set(modelValue, {});
|
state.set(modelValue, {});
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function save() {
|
async function save(prevent = false) {
|
||||||
|
if (prevent) return;
|
||||||
if ($props.observeFormChanges && !hasChanges.value)
|
if ($props.observeFormChanges && !hasChanges.value)
|
||||||
return notify('globals.noChanges', 'negative');
|
return notify('globals.noChanges', 'negative');
|
||||||
|
|
||||||
|
@ -227,7 +229,11 @@ async function save() {
|
||||||
|
|
||||||
if ($props.urlCreate) notify('globals.dataCreated', 'positive');
|
if ($props.urlCreate) notify('globals.dataCreated', 'positive');
|
||||||
|
|
||||||
updateAndEmit('onDataSaved', formData.value, response?.data);
|
updateAndEmit('onDataSaved', {
|
||||||
|
val: formData.value,
|
||||||
|
res: response?.data,
|
||||||
|
old: originalData.value,
|
||||||
|
});
|
||||||
if ($props.reload) await arrayData.fetch({});
|
if ($props.reload) await arrayData.fetch({});
|
||||||
hasChanges.value = false;
|
hasChanges.value = false;
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -241,8 +247,7 @@ async function saveAndGo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function reset() {
|
function reset() {
|
||||||
formData.value = JSON.parse(JSON.stringify(originalData.value));
|
updateAndEmit('onFetch', { val: originalData.value });
|
||||||
updateAndEmit('onFetch', originalData.value);
|
|
||||||
if ($props.observeFormChanges) {
|
if ($props.observeFormChanges) {
|
||||||
hasChanges.value = false;
|
hasChanges.value = false;
|
||||||
isResetting.value = true;
|
isResetting.value = true;
|
||||||
|
@ -264,11 +269,11 @@ function filter(value, update, filterOptions) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateAndEmit(evt, val, res) {
|
function updateAndEmit(evt, { val, res, old } = { val: null, res: null, old: null }) {
|
||||||
state.set(modelValue, val);
|
state.set(modelValue, val);
|
||||||
if (!$props.url) arrayData.store.data = val;
|
if (!$props.url) arrayData.store.data = val;
|
||||||
|
|
||||||
emit(evt, state.get(modelValue), res);
|
emit(evt, state.get(modelValue), res, old);
|
||||||
}
|
}
|
||||||
|
|
||||||
function trimData(data) {
|
function trimData(data) {
|
||||||
|
@ -293,7 +298,7 @@ defineExpose({
|
||||||
<QForm
|
<QForm
|
||||||
ref="myForm"
|
ref="myForm"
|
||||||
v-if="formData"
|
v-if="formData"
|
||||||
@submit="save"
|
@submit="save(!!$event)"
|
||||||
@reset="reset"
|
@reset="reset"
|
||||||
class="q-pa-md"
|
class="q-pa-md"
|
||||||
:style="maxWidth ? 'max-width: ' + maxWidth : ''"
|
:style="maxWidth ? 'max-width: ' + maxWidth : ''"
|
||||||
|
|
|
@ -15,23 +15,30 @@ defineProps({
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
|
showSaveAndContinueBtn: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
const formModelRef = ref(null);
|
const formModelRef = ref(null);
|
||||||
const closeButton = ref(null);
|
const closeButton = ref(null);
|
||||||
|
const isSaveAndContinue = ref(false);
|
||||||
const onDataSaved = (formData, requestResponse) => {
|
const onDataSaved = (formData, requestResponse) => {
|
||||||
if (closeButton.value) closeButton.value.click();
|
if (closeButton.value && isSaveAndContinue) closeButton.value.click();
|
||||||
emit('onDataSaved', formData, requestResponse);
|
emit('onDataSaved', formData, requestResponse);
|
||||||
};
|
};
|
||||||
|
|
||||||
const isLoading = computed(() => formModelRef.value?.isLoading);
|
const isLoading = computed(() => formModelRef.value?.isLoading);
|
||||||
|
const reset = computed(() => formModelRef.value?.reset);
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
isLoading,
|
isLoading,
|
||||||
onDataSaved,
|
onDataSaved,
|
||||||
|
isSaveAndContinue,
|
||||||
|
reset,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -59,15 +66,22 @@ defineExpose({
|
||||||
flat
|
flat
|
||||||
:disabled="isLoading"
|
:disabled="isLoading"
|
||||||
:loading="isLoading"
|
:loading="isLoading"
|
||||||
@click="emit('onDataCanceled')"
|
|
||||||
v-close-popup
|
|
||||||
data-cy="FormModelPopup_cancel"
|
data-cy="FormModelPopup_cancel"
|
||||||
|
v-close-popup
|
||||||
z-max
|
z-max
|
||||||
|
@click="
|
||||||
|
isSaveAndContinue = false;
|
||||||
|
emit('onDataCanceled');
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
:flat="showSaveAndContinueBtn"
|
||||||
:label="t('globals.save')"
|
:label="t('globals.save')"
|
||||||
:title="t('globals.save')"
|
:title="t('globals.save')"
|
||||||
type="submit"
|
@click="
|
||||||
|
formModelRef.save();
|
||||||
|
isSaveAndContinue = false;
|
||||||
|
"
|
||||||
color="primary"
|
color="primary"
|
||||||
class="q-ml-sm"
|
class="q-ml-sm"
|
||||||
:disabled="isLoading"
|
:disabled="isLoading"
|
||||||
|
@ -75,6 +89,21 @@ defineExpose({
|
||||||
data-cy="FormModelPopup_save"
|
data-cy="FormModelPopup_save"
|
||||||
z-max
|
z-max
|
||||||
/>
|
/>
|
||||||
|
<QBtn
|
||||||
|
v-if="showSaveAndContinueBtn"
|
||||||
|
:label="t('globals.isSaveAndContinue')"
|
||||||
|
:title="t('globals.isSaveAndContinue')"
|
||||||
|
color="primary"
|
||||||
|
class="q-ml-sm"
|
||||||
|
:disabled="isLoading"
|
||||||
|
:loading="isLoading"
|
||||||
|
data-cy="FormModelPopup_isSaveAndContinue"
|
||||||
|
z-max
|
||||||
|
@click="
|
||||||
|
isSaveAndContinue = true;
|
||||||
|
formModelRef.save();
|
||||||
|
"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</FormModel>
|
</FormModel>
|
||||||
|
|
|
@ -121,23 +121,25 @@ const removeTag = (index, params, search) => {
|
||||||
applyTags(params, search);
|
applyTags(params, search);
|
||||||
};
|
};
|
||||||
const setCategoryList = (data) => {
|
const setCategoryList = (data) => {
|
||||||
categoryList.value = (data || [])
|
categoryList.value = (data || []).map((category) => ({
|
||||||
.filter((category) => category.display)
|
...category,
|
||||||
.map((category) => ({
|
icon: `vn:${(category.icon || '').split('-')[1]}`,
|
||||||
...category,
|
}));
|
||||||
icon: `vn:${(category.icon || '').split('-')[1]}`,
|
|
||||||
}));
|
|
||||||
fetchItemTypes();
|
fetchItemTypes();
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData url="ItemCategories" limit="30" auto-load @on-fetch="setCategoryList" />
|
<FetchData
|
||||||
|
url="ItemCategories"
|
||||||
|
auto-load
|
||||||
|
@on-fetch="setCategoryList"
|
||||||
|
:where="{ display: { neq: 0 } }"
|
||||||
|
/>
|
||||||
<FetchData
|
<FetchData
|
||||||
url="Tags"
|
url="Tags"
|
||||||
:filter="{ fields: ['id', 'name', 'isFree'] }"
|
:filter="{ fields: ['id', 'name', 'isFree'] }"
|
||||||
auto-load
|
auto-load
|
||||||
limit="30"
|
|
||||||
@on-fetch="(data) => (tagOptions = data)"
|
@on-fetch="(data) => (tagOptions = data)"
|
||||||
/>
|
/>
|
||||||
<VnFilterPanel
|
<VnFilterPanel
|
||||||
|
@ -195,8 +197,6 @@ const setCategoryList = (data) => {
|
||||||
:label="t('components.itemsFilterPanel.typeFk')"
|
:label="t('components.itemsFilterPanel.typeFk')"
|
||||||
v-model="params.typeFk"
|
v-model="params.typeFk"
|
||||||
:options="itemTypesOptions"
|
:options="itemTypesOptions"
|
||||||
option-value="id"
|
|
||||||
option-label="name"
|
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
@ -234,7 +234,6 @@ const setCategoryList = (data) => {
|
||||||
:label="t('globals.tag')"
|
:label="t('globals.tag')"
|
||||||
v-model="value.selectedTag"
|
v-model="value.selectedTag"
|
||||||
:options="tagOptions"
|
:options="tagOptions"
|
||||||
option-label="name"
|
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
|
|
@ -26,6 +26,7 @@ const itemComputed = computed(() => {
|
||||||
:to="{ name: itemComputed.name }"
|
:to="{ name: itemComputed.name }"
|
||||||
clickable
|
clickable
|
||||||
v-ripple
|
v-ripple
|
||||||
|
:data-cy="`${itemComputed.name}-menu-item`"
|
||||||
>
|
>
|
||||||
<QItemSection avatar v-if="itemComputed.icon">
|
<QItemSection avatar v-if="itemComputed.icon">
|
||||||
<QIcon :name="itemComputed.icon" />
|
<QIcon :name="itemComputed.icon" />
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { toCurrency } from 'src/filters';
|
||||||
|
|
||||||
defineProps({ row: { type: Object, required: true } });
|
defineProps({ row: { type: Object, required: true } });
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
@ -10,7 +12,8 @@ defineProps({ row: { type: Object, required: true } });
|
||||||
size="xs"
|
size="xs"
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ $t('salesTicketsTable.risk') }}: {{ row.risk - row.credit }}
|
{{ $t('salesTicketsTable.risk') }}:
|
||||||
|
{{ toCurrency(row.risk - row.credit) }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { markRaw, computed } from 'vue';
|
import { markRaw, computed } from 'vue';
|
||||||
import { QIcon, QCheckbox } from 'quasar';
|
import { QIcon, QCheckbox, QToggle } from 'quasar';
|
||||||
import { dashIfEmpty } from 'src/filters';
|
import { dashIfEmpty } from 'src/filters';
|
||||||
|
|
||||||
/* basic input */
|
|
||||||
import VnSelect from 'components/common/VnSelect.vue';
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
import VnSelectCache from 'components/common/VnSelectCache.vue';
|
import VnSelectCache from 'components/common/VnSelectCache.vue';
|
||||||
import VnInput from 'components/common/VnInput.vue';
|
import VnInput from 'components/common/VnInput.vue';
|
||||||
|
@ -12,8 +11,11 @@ import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
import VnInputTime from 'components/common/VnInputTime.vue';
|
import VnInputTime from 'components/common/VnInputTime.vue';
|
||||||
import VnComponent from 'components/common/VnComponent.vue';
|
import VnComponent from 'components/common/VnComponent.vue';
|
||||||
import VnUserLink from 'components/ui/VnUserLink.vue';
|
import VnUserLink from 'components/ui/VnUserLink.vue';
|
||||||
|
import VnSelectEnum from '../common/VnSelectEnum.vue';
|
||||||
|
import VnCheckbox from '../common/VnCheckbox.vue';
|
||||||
|
|
||||||
const model = defineModel(undefined, { required: true });
|
const model = defineModel(undefined, { required: true });
|
||||||
|
const emit = defineEmits(['blur']);
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
column: {
|
column: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
@ -39,10 +41,18 @@ const $props = defineProps({
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
autofocus: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
showLabel: {
|
showLabel: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
eventHandlers: {
|
||||||
|
type: Object,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const defaultSelect = {
|
const defaultSelect = {
|
||||||
|
@ -99,7 +109,8 @@ const defaultComponents = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
checkbox: {
|
checkbox: {
|
||||||
component: markRaw(QCheckbox),
|
ref: 'checkbox',
|
||||||
|
component: markRaw(VnCheckbox),
|
||||||
attrs: ({ model }) => {
|
attrs: ({ model }) => {
|
||||||
const defaultAttrs = {
|
const defaultAttrs = {
|
||||||
disable: !$props.isEditable,
|
disable: !$props.isEditable,
|
||||||
|
@ -115,6 +126,10 @@ const defaultComponents = {
|
||||||
},
|
},
|
||||||
forceAttrs: {
|
forceAttrs: {
|
||||||
label: $props.showLabel && $props.column.label,
|
label: $props.showLabel && $props.column.label,
|
||||||
|
autofocus: true,
|
||||||
|
},
|
||||||
|
events: {
|
||||||
|
blur: () => emit('blur'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
|
@ -125,12 +140,19 @@ const defaultComponents = {
|
||||||
component: markRaw(VnSelect),
|
component: markRaw(VnSelect),
|
||||||
...defaultSelect,
|
...defaultSelect,
|
||||||
},
|
},
|
||||||
|
selectEnum: {
|
||||||
|
component: markRaw(VnSelectEnum),
|
||||||
|
...defaultSelect,
|
||||||
|
},
|
||||||
icon: {
|
icon: {
|
||||||
component: markRaw(QIcon),
|
component: markRaw(QIcon),
|
||||||
},
|
},
|
||||||
userLink: {
|
userLink: {
|
||||||
component: markRaw(VnUserLink),
|
component: markRaw(VnUserLink),
|
||||||
},
|
},
|
||||||
|
toggle: {
|
||||||
|
component: markRaw(QToggle),
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const value = computed(() => {
|
const value = computed(() => {
|
||||||
|
@ -160,7 +182,28 @@ const col = computed(() => {
|
||||||
return newColumn;
|
return newColumn;
|
||||||
});
|
});
|
||||||
|
|
||||||
const components = computed(() => $props.components ?? defaultComponents);
|
const components = computed(() => {
|
||||||
|
const sourceComponents = $props.components ?? defaultComponents;
|
||||||
|
|
||||||
|
return Object.keys(sourceComponents).reduce((acc, key) => {
|
||||||
|
const component = sourceComponents[key];
|
||||||
|
|
||||||
|
if (!component || typeof component !== 'object') {
|
||||||
|
acc[key] = component;
|
||||||
|
return acc;
|
||||||
|
}
|
||||||
|
|
||||||
|
acc[key] = {
|
||||||
|
...component,
|
||||||
|
attrs: {
|
||||||
|
...(component.attrs || {}),
|
||||||
|
autofocus: $props.autofocus,
|
||||||
|
},
|
||||||
|
event: { ...component?.event, ...$props?.eventHandlers },
|
||||||
|
};
|
||||||
|
return acc;
|
||||||
|
}, {});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="row no-wrap">
|
<div class="row no-wrap">
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { markRaw, computed } from 'vue';
|
import { markRaw, computed } from 'vue';
|
||||||
import { QCheckbox } from 'quasar';
|
import { QCheckbox, QToggle } from 'quasar';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
|
|
||||||
/* basic input */
|
|
||||||
import VnSelect from 'components/common/VnSelect.vue';
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
import VnInput from 'components/common/VnInput.vue';
|
import VnInput from 'components/common/VnInput.vue';
|
||||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
import VnInputTime from 'components/common/VnInputTime.vue';
|
import VnInputTime from 'components/common/VnInputTime.vue';
|
||||||
import VnTableColumn from 'components/VnTable/VnColumn.vue';
|
import VnColumn from 'components/VnTable/VnColumn.vue';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
column: {
|
column: {
|
||||||
|
@ -27,6 +25,10 @@ const $props = defineProps({
|
||||||
type: String,
|
type: String,
|
||||||
default: 'table',
|
default: 'table',
|
||||||
},
|
},
|
||||||
|
customClass: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
defineExpose({ addFilter, props: $props });
|
defineExpose({ addFilter, props: $props });
|
||||||
|
@ -34,7 +36,7 @@ defineExpose({ addFilter, props: $props });
|
||||||
const model = defineModel(undefined, { required: true });
|
const model = defineModel(undefined, { required: true });
|
||||||
const arrayData = useArrayData(
|
const arrayData = useArrayData(
|
||||||
$props.dataKey,
|
$props.dataKey,
|
||||||
$props.searchUrl ? { searchUrl: $props.searchUrl } : null
|
$props.searchUrl ? { searchUrl: $props.searchUrl } : null,
|
||||||
);
|
);
|
||||||
const columnFilter = computed(() => $props.column?.columnFilter);
|
const columnFilter = computed(() => $props.column?.columnFilter);
|
||||||
|
|
||||||
|
@ -46,19 +48,18 @@ const enterEvent = {
|
||||||
|
|
||||||
const defaultAttrs = {
|
const defaultAttrs = {
|
||||||
filled: !$props.showTitle,
|
filled: !$props.showTitle,
|
||||||
class: 'q-px-xs q-pb-xs q-pt-none fit',
|
|
||||||
dense: true,
|
dense: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
const forceAttrs = {
|
const forceAttrs = {
|
||||||
label: $props.showTitle ? '' : columnFilter.value?.label ?? $props.column.label,
|
label: $props.showTitle ? '' : (columnFilter.value?.label ?? $props.column.label),
|
||||||
};
|
};
|
||||||
|
|
||||||
const selectComponent = {
|
const selectComponent = {
|
||||||
component: markRaw(VnSelect),
|
component: markRaw(VnSelect),
|
||||||
event: updateEvent,
|
event: updateEvent,
|
||||||
attrs: {
|
attrs: {
|
||||||
class: 'q-px-sm q-pb-xs q-pt-none fit',
|
class: `q-pt-none fit ${$props.customClass}`,
|
||||||
dense: true,
|
dense: true,
|
||||||
filled: !$props.showTitle,
|
filled: !$props.showTitle,
|
||||||
},
|
},
|
||||||
|
@ -109,14 +110,24 @@ const components = {
|
||||||
component: markRaw(QCheckbox),
|
component: markRaw(QCheckbox),
|
||||||
event: updateEvent,
|
event: updateEvent,
|
||||||
attrs: {
|
attrs: {
|
||||||
dense: true,
|
class: $props.showTitle ? 'q-py-sm' : 'q-px-md q-py-xs fit',
|
||||||
class: $props.showTitle ? 'q-py-sm q-mt-md' : 'q-px-md q-py-xs fit',
|
|
||||||
'toggle-indeterminate': true,
|
'toggle-indeterminate': true,
|
||||||
|
size: 'sm',
|
||||||
},
|
},
|
||||||
forceAttrs,
|
forceAttrs,
|
||||||
},
|
},
|
||||||
select: selectComponent,
|
select: selectComponent,
|
||||||
rawSelect: selectComponent,
|
rawSelect: selectComponent,
|
||||||
|
toggle: {
|
||||||
|
component: markRaw(QToggle),
|
||||||
|
event: updateEvent,
|
||||||
|
attrs: {
|
||||||
|
class: $props.showTitle ? 'q-py-sm' : 'q-px-md q-py-xs fit',
|
||||||
|
'toggle-indeterminate': true,
|
||||||
|
size: 'sm',
|
||||||
|
},
|
||||||
|
forceAttrs,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
async function addFilter(value, name) {
|
async function addFilter(value, name) {
|
||||||
|
@ -132,19 +143,8 @@ async function addFilter(value, name) {
|
||||||
await arrayData.addFilter({ params: { [field]: value } });
|
await arrayData.addFilter({ params: { [field]: value } });
|
||||||
}
|
}
|
||||||
|
|
||||||
function alignRow() {
|
|
||||||
switch ($props.column.align) {
|
|
||||||
case 'left':
|
|
||||||
return 'justify-start items-start';
|
|
||||||
case 'right':
|
|
||||||
return 'justify-end items-end';
|
|
||||||
default:
|
|
||||||
return 'flex-center';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const showFilter = computed(
|
const showFilter = computed(
|
||||||
() => $props.column?.columnFilter !== false && $props.column.name != 'tableActions'
|
() => $props.column?.columnFilter !== false && $props.column.name != 'tableActions',
|
||||||
);
|
);
|
||||||
|
|
||||||
const onTabPressed = async () => {
|
const onTabPressed = async () => {
|
||||||
|
@ -152,13 +152,8 @@ const onTabPressed = async () => {
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div v-if="showFilter" class="full-width flex-center" style="overflow: hidden">
|
||||||
v-if="showFilter"
|
<VnColumn
|
||||||
class="full-width"
|
|
||||||
:class="alignRow()"
|
|
||||||
style="max-height: 45px; overflow: hidden"
|
|
||||||
>
|
|
||||||
<VnTableColumn
|
|
||||||
:column="$props.column"
|
:column="$props.column"
|
||||||
default="input"
|
default="input"
|
||||||
v-model="model"
|
v-model="model"
|
||||||
|
@ -168,3 +163,8 @@ const onTabPressed = async () => {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
label.vn-label-padding > .q-field__inner > .q-field__control {
|
||||||
|
padding: inherit !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
@ -41,6 +41,7 @@ async function orderBy(name, direction) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!direction) return await arrayData.deleteOrder(name);
|
if (!direction) return await arrayData.deleteOrder(name);
|
||||||
|
|
||||||
await arrayData.addOrder(name, direction);
|
await arrayData.addOrder(name, direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,45 +52,60 @@ defineExpose({ orderBy });
|
||||||
@mouseenter="hover = true"
|
@mouseenter="hover = true"
|
||||||
@mouseleave="hover = false"
|
@mouseleave="hover = false"
|
||||||
@click="orderBy(name, model?.direction)"
|
@click="orderBy(name, model?.direction)"
|
||||||
class="row items-center no-wrap cursor-pointer"
|
class="row items-center no-wrap cursor-pointer title"
|
||||||
>
|
>
|
||||||
<span :title="label">{{ label }}</span>
|
<span :title="label">{{ label }}</span>
|
||||||
<QChip
|
<sup v-if="name && model?.index">
|
||||||
v-if="name"
|
<QChip
|
||||||
:label="!vertical ? model?.index : ''"
|
:label="!vertical ? model?.index : ''"
|
||||||
:icon="
|
:icon="
|
||||||
(model?.index || hover) && !vertical
|
(model?.index || hover) && !vertical
|
||||||
? model?.direction == 'DESC'
|
? model?.direction == 'DESC'
|
||||||
? 'arrow_downward'
|
? 'arrow_downward'
|
||||||
: 'arrow_upward'
|
: 'arrow_upward'
|
||||||
: undefined
|
: undefined
|
||||||
"
|
"
|
||||||
:size="vertical ? '' : 'sm'"
|
:size="vertical ? '' : 'sm'"
|
||||||
:class="[
|
:class="[
|
||||||
model?.index ? 'color-vn-text' : 'bg-transparent',
|
model?.index ? 'color-vn-text' : 'bg-transparent',
|
||||||
vertical ? 'q-px-none' : '',
|
vertical ? 'q-px-none' : '',
|
||||||
]"
|
]"
|
||||||
class="no-box-shadow"
|
class="no-box-shadow"
|
||||||
:clickable="true"
|
:clickable="true"
|
||||||
style="min-width: 40px"
|
style="min-width: 40px; max-height: 30px"
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="column flex-center"
|
|
||||||
v-if="vertical"
|
|
||||||
:style="!model?.index && 'color: #5d5d5d'"
|
|
||||||
>
|
>
|
||||||
{{ model?.index }}
|
<div
|
||||||
<QIcon
|
class="column flex-center"
|
||||||
:name="
|
v-if="vertical"
|
||||||
model?.index
|
:style="!model?.index && 'color: #5d5d5d'"
|
||||||
? model?.direction == 'DESC'
|
>
|
||||||
? 'arrow_downward'
|
{{ model?.index }}
|
||||||
: 'arrow_upward'
|
<QIcon
|
||||||
: 'swap_vert'
|
:name="
|
||||||
"
|
model?.index
|
||||||
size="xs"
|
? model?.direction == 'DESC'
|
||||||
/>
|
? 'arrow_downward'
|
||||||
</div>
|
: 'arrow_upward'
|
||||||
</QChip>
|
: 'swap_vert'
|
||||||
|
"
|
||||||
|
size="xs"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</QChip>
|
||||||
|
</sup>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.title {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 30px;
|
||||||
|
width: 100%;
|
||||||
|
color: var(--vn-label-color);
|
||||||
|
}
|
||||||
|
sup {
|
||||||
|
vertical-align: super; /* Valor predeterminado */
|
||||||
|
/* También puedes usar otros valores como "baseline", "top", "text-top", etc. */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
@ -1,22 +1,37 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onBeforeMount, onMounted, computed, watch, useAttrs } from 'vue';
|
import {
|
||||||
|
ref,
|
||||||
|
onBeforeMount,
|
||||||
|
onMounted,
|
||||||
|
onUnmounted,
|
||||||
|
computed,
|
||||||
|
watch,
|
||||||
|
h,
|
||||||
|
render,
|
||||||
|
inject,
|
||||||
|
useAttrs,
|
||||||
|
} from 'vue';
|
||||||
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
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 { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { useFilterParams } from 'src/composables/useFilterParams';
|
import { useFilterParams } from 'src/composables/useFilterParams';
|
||||||
|
import { dashIfEmpty } from 'src/filters';
|
||||||
|
|
||||||
import CrudModel from 'src/components/CrudModel.vue';
|
import CrudModel from 'src/components/CrudModel.vue';
|
||||||
import FormModelPopup from 'components/FormModelPopup.vue';
|
import FormModelPopup from 'components/FormModelPopup.vue';
|
||||||
|
|
||||||
import VnTableColumn from 'components/VnTable/VnColumn.vue';
|
import VnColumn from 'components/VnTable/VnColumn.vue';
|
||||||
import VnFilter from 'components/VnTable/VnFilter.vue';
|
import VnFilter from 'components/VnTable/VnFilter.vue';
|
||||||
import VnTableChip from 'components/VnTable/VnChip.vue';
|
import VnTableChip from 'components/VnTable/VnChip.vue';
|
||||||
import VnVisibleColumn from 'src/components/VnTable/VnVisibleColumn.vue';
|
import VnVisibleColumn from 'src/components/VnTable/VnVisibleColumn.vue';
|
||||||
import VnLv from 'components/ui/VnLv.vue';
|
import VnLv from 'components/ui/VnLv.vue';
|
||||||
import VnTableOrder from 'src/components/VnTable/VnOrder.vue';
|
import VnTableOrder from 'src/components/VnTable/VnOrder.vue';
|
||||||
import VnTableFilter from './VnTableFilter.vue';
|
import VnTableFilter from './VnTableFilter.vue';
|
||||||
|
import { getColAlign } from 'src/composables/getColAlign';
|
||||||
|
|
||||||
|
const arrayData = useArrayData(useAttrs()['data-key']);
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
columns: {
|
columns: {
|
||||||
type: Array,
|
type: Array,
|
||||||
|
@ -42,10 +57,6 @@ const $props = defineProps({
|
||||||
type: [Function, Boolean],
|
type: [Function, Boolean],
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
rowCtrlClick: {
|
|
||||||
type: [Function, Boolean],
|
|
||||||
default: null,
|
|
||||||
},
|
|
||||||
redirect: {
|
redirect: {
|
||||||
type: String,
|
type: String,
|
||||||
default: null,
|
default: null,
|
||||||
|
@ -114,7 +125,19 @@ const $props = defineProps({
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
withFilters: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
|
overlay: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
createComplement: {
|
||||||
|
type: Object,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -132,10 +155,18 @@ const showForm = ref(false);
|
||||||
const splittedColumns = ref({ columns: [] });
|
const splittedColumns = ref({ columns: [] });
|
||||||
const columnsVisibilitySkipped = ref();
|
const columnsVisibilitySkipped = ref();
|
||||||
const createForm = ref();
|
const createForm = ref();
|
||||||
|
const createRef = ref(null);
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const params = ref(useFilterParams($attrs['data-key']).params);
|
const params = ref(useFilterParams($attrs['data-key']).params);
|
||||||
const orders = ref(useFilterParams($attrs['data-key']).orders);
|
const orders = ref(useFilterParams($attrs['data-key']).orders);
|
||||||
|
const app = inject('app');
|
||||||
|
|
||||||
|
const editingRow = ref(null);
|
||||||
|
const editingField = ref(null);
|
||||||
|
const isTableMode = computed(() => mode.value == TABLE_MODE);
|
||||||
|
const showRightIcon = computed(() => $props.rightSearch || $props.rightSearchIcon);
|
||||||
|
const selectRegex = /select/;
|
||||||
|
const emit = defineEmits(['onFetch', 'update:selected', 'saveChanges']);
|
||||||
const tableModes = [
|
const tableModes = [
|
||||||
{
|
{
|
||||||
icon: 'view_column',
|
icon: 'view_column',
|
||||||
|
@ -156,7 +187,8 @@ onBeforeMount(() => {
|
||||||
hasParams.value = urlParams && Object.keys(urlParams).length !== 0;
|
hasParams.value = urlParams && Object.keys(urlParams).length !== 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
|
if ($props.isEditable) document.addEventListener('click', clickHandler);
|
||||||
mode.value =
|
mode.value =
|
||||||
quasar.platform.is.mobile && !$props.disableOption?.card
|
quasar.platform.is.mobile && !$props.disableOption?.card
|
||||||
? CARD_MODE
|
? CARD_MODE
|
||||||
|
@ -178,14 +210,25 @@ onMounted(() => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onUnmounted(async () => {
|
||||||
|
if ($props.isEditable) document.removeEventListener('click', clickHandler);
|
||||||
|
});
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => $props.columns,
|
() => $props.columns,
|
||||||
(value) => splitColumns(value),
|
(value) => splitColumns(value),
|
||||||
{ immediate: true },
|
{ immediate: true },
|
||||||
);
|
);
|
||||||
|
|
||||||
const isTableMode = computed(() => mode.value == TABLE_MODE);
|
defineExpose({
|
||||||
const showRightIcon = computed(() => $props.rightSearch || $props.rightSearchIcon);
|
create: createForm,
|
||||||
|
reload,
|
||||||
|
redirect: redirectFn,
|
||||||
|
selected,
|
||||||
|
CrudModelRef,
|
||||||
|
params,
|
||||||
|
tableRef,
|
||||||
|
});
|
||||||
|
|
||||||
function splitColumns(columns) {
|
function splitColumns(columns) {
|
||||||
splittedColumns.value = {
|
splittedColumns.value = {
|
||||||
|
@ -231,16 +274,6 @@ const rowClickFunction = computed(() => {
|
||||||
return () => {};
|
return () => {};
|
||||||
});
|
});
|
||||||
|
|
||||||
const rowCtrlClickFunction = computed(() => {
|
|
||||||
if ($props.rowCtrlClick != undefined) return $props.rowCtrlClick;
|
|
||||||
if ($props.redirect)
|
|
||||||
return (evt, { id }) => {
|
|
||||||
stopEventPropagation(evt);
|
|
||||||
window.open(`/#/${$props.redirect}/${id}`, '_blank');
|
|
||||||
};
|
|
||||||
return () => {};
|
|
||||||
});
|
|
||||||
|
|
||||||
function redirectFn(id) {
|
function redirectFn(id) {
|
||||||
router.push({ path: `/${$props.redirect}/${id}` });
|
router.push({ path: `/${$props.redirect}/${id}` });
|
||||||
}
|
}
|
||||||
|
@ -262,21 +295,6 @@ function columnName(col) {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getColAlign(col) {
|
|
||||||
return 'text-' + (col.align ?? 'left');
|
|
||||||
}
|
|
||||||
|
|
||||||
const emit = defineEmits(['onFetch', 'update:selected', 'saveChanges']);
|
|
||||||
defineExpose({
|
|
||||||
create: createForm,
|
|
||||||
reload,
|
|
||||||
redirect: redirectFn,
|
|
||||||
selected,
|
|
||||||
CrudModelRef,
|
|
||||||
params,
|
|
||||||
tableRef,
|
|
||||||
});
|
|
||||||
|
|
||||||
function handleOnDataSaved(_) {
|
function handleOnDataSaved(_) {
|
||||||
if (_.onDataSaved) _.onDataSaved({ CrudModelRef: CrudModelRef.value });
|
if (_.onDataSaved) _.onDataSaved({ CrudModelRef: CrudModelRef.value });
|
||||||
else $props.create.onDataSaved(_);
|
else $props.create.onDataSaved(_);
|
||||||
|
@ -304,6 +322,219 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isEditableColumn(column) {
|
||||||
|
const isEditableCol = column?.isEditable ?? true;
|
||||||
|
const isVisible = column?.visible ?? true;
|
||||||
|
const hasComponent = column?.component;
|
||||||
|
|
||||||
|
return $props.isEditable && isVisible && hasComponent && isEditableCol;
|
||||||
|
}
|
||||||
|
|
||||||
|
function hasEditableFormat(column) {
|
||||||
|
if (isEditableColumn(column)) return 'editable-text';
|
||||||
|
}
|
||||||
|
|
||||||
|
const clickHandler = async (event) => {
|
||||||
|
const clickedElement = event.target.closest('td');
|
||||||
|
|
||||||
|
const isDateElement = event.target.closest('.q-date');
|
||||||
|
const isTimeElement = event.target.closest('.q-time');
|
||||||
|
const isQselectDropDown = event.target.closest('.q-select__dropdown-icon');
|
||||||
|
|
||||||
|
if (isDateElement || isTimeElement || isQselectDropDown) return;
|
||||||
|
|
||||||
|
if (clickedElement === null) {
|
||||||
|
destroyInput(editingRow.value, editingField.value);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const rowIndex = clickedElement.getAttribute('data-row-index');
|
||||||
|
const colField = clickedElement.getAttribute('data-col-field');
|
||||||
|
const column = $props.columns.find((col) => col.name === colField);
|
||||||
|
|
||||||
|
if (editingRow.value !== null && editingField.value !== null) {
|
||||||
|
if (editingRow.value == rowIndex && editingField.value == colField) return;
|
||||||
|
|
||||||
|
destroyInput(editingRow.value, editingField.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isEditableColumn(column)) {
|
||||||
|
await renderInput(Number(rowIndex), colField, clickedElement);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
async function handleTabKey(event, rowIndex, colField) {
|
||||||
|
if (editingRow.value == rowIndex && editingField.value == colField)
|
||||||
|
destroyInput(editingRow.value, editingField.value);
|
||||||
|
|
||||||
|
const direction = event.shiftKey ? -1 : 1;
|
||||||
|
const { nextRowIndex, nextColumnName } = await handleTabNavigation(
|
||||||
|
rowIndex,
|
||||||
|
colField,
|
||||||
|
direction,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (nextRowIndex < 0 || nextRowIndex >= arrayData.store.data.length) return;
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
await renderInput(nextRowIndex, nextColumnName, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function renderInput(rowId, field, clickedElement) {
|
||||||
|
editingField.value = field;
|
||||||
|
editingRow.value = rowId;
|
||||||
|
|
||||||
|
const originalColumn = $props.columns.find((col) => col.name === field);
|
||||||
|
const column = { ...originalColumn, ...{ label: '' } };
|
||||||
|
const row = CrudModelRef.value.formData[rowId];
|
||||||
|
const oldValue = CrudModelRef.value.formData[rowId][column?.name];
|
||||||
|
|
||||||
|
if (!clickedElement)
|
||||||
|
clickedElement = document.querySelector(
|
||||||
|
`[data-row-index="${rowId}"][data-col-field="${field}"]`,
|
||||||
|
);
|
||||||
|
|
||||||
|
Array.from(clickedElement.childNodes).forEach((child) => {
|
||||||
|
child.style.visibility = 'hidden';
|
||||||
|
child.style.position = 'relative';
|
||||||
|
});
|
||||||
|
|
||||||
|
const isSelect = selectRegex.test(column?.component);
|
||||||
|
if (isSelect) column.attrs = { ...column.attrs, 'emit-value': false };
|
||||||
|
|
||||||
|
const node = h(VnColumn, {
|
||||||
|
row: row,
|
||||||
|
class: 'temp-input',
|
||||||
|
column: column,
|
||||||
|
modelValue: row[column.name],
|
||||||
|
componentProp: 'columnField',
|
||||||
|
autofocus: true,
|
||||||
|
focusOnMount: true,
|
||||||
|
eventHandlers: {
|
||||||
|
'update:modelValue': async (value) => {
|
||||||
|
if (isSelect && value) {
|
||||||
|
row[column.name] = value[column.attrs?.optionValue ?? 'id'];
|
||||||
|
row[column?.name + 'TextValue'] =
|
||||||
|
value[column.attrs?.optionLabel ?? 'name'];
|
||||||
|
await column?.cellEvent?.['update:modelValue']?.(
|
||||||
|
value,
|
||||||
|
oldValue,
|
||||||
|
row,
|
||||||
|
);
|
||||||
|
} else row[column.name] = value;
|
||||||
|
await column?.cellEvent?.['update:modelValue']?.(value, oldValue, row);
|
||||||
|
},
|
||||||
|
keyup: async (event) => {
|
||||||
|
if (event.key === 'Enter') handleBlur(rowId, field, clickedElement);
|
||||||
|
},
|
||||||
|
keydown: async (event) => {
|
||||||
|
switch (event.key) {
|
||||||
|
case 'Tab':
|
||||||
|
await handleTabKey(event, rowId, field);
|
||||||
|
event.stopPropagation();
|
||||||
|
break;
|
||||||
|
case 'Escape':
|
||||||
|
destroyInput(rowId, field, clickedElement);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
click: (event) => {
|
||||||
|
column?.cellEvent?.['click']?.(event, row);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
node.appContext = app._context;
|
||||||
|
render(node, clickedElement);
|
||||||
|
|
||||||
|
if (['toggle'].includes(column?.component))
|
||||||
|
node.el?.querySelector('span > div').focus();
|
||||||
|
|
||||||
|
if (['checkbox', undefined].includes(column?.component))
|
||||||
|
node.el?.querySelector('span > div > div').focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
function destroyInput(rowIndex, field, clickedElement) {
|
||||||
|
if (!clickedElement)
|
||||||
|
clickedElement = document.querySelector(
|
||||||
|
`[data-row-index="${rowIndex}"][data-col-field="${field}"]`,
|
||||||
|
);
|
||||||
|
if (clickedElement) {
|
||||||
|
render(null, clickedElement);
|
||||||
|
Array.from(clickedElement.childNodes).forEach((child) => {
|
||||||
|
child.style.visibility = 'visible';
|
||||||
|
child.style.position = '';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (editingRow.value !== rowIndex || editingField.value !== field) return;
|
||||||
|
editingRow.value = null;
|
||||||
|
editingField.value = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleBlur(rowIndex, field, clickedElement) {
|
||||||
|
destroyInput(rowIndex, field, clickedElement);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleTabNavigation(rowIndex, colName, direction) {
|
||||||
|
const columns = $props.columns;
|
||||||
|
const totalColumns = columns.length;
|
||||||
|
let currentColumnIndex = columns.findIndex((col) => col.name === colName);
|
||||||
|
|
||||||
|
let iterations = 0;
|
||||||
|
let newColumnIndex = currentColumnIndex;
|
||||||
|
|
||||||
|
do {
|
||||||
|
iterations++;
|
||||||
|
newColumnIndex = (newColumnIndex + direction + totalColumns) % totalColumns;
|
||||||
|
|
||||||
|
if (isEditableColumn(columns[newColumnIndex])) break;
|
||||||
|
} while (iterations < totalColumns);
|
||||||
|
|
||||||
|
if (iterations >= totalColumns + 1) return;
|
||||||
|
|
||||||
|
if (direction === 1 && newColumnIndex <= currentColumnIndex) {
|
||||||
|
rowIndex++;
|
||||||
|
} else if (direction === -1 && newColumnIndex >= currentColumnIndex) {
|
||||||
|
rowIndex--;
|
||||||
|
}
|
||||||
|
return { nextRowIndex: rowIndex, nextColumnName: columns[newColumnIndex].name };
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCheckboxIcon(value) {
|
||||||
|
switch (typeof value) {
|
||||||
|
case 'boolean':
|
||||||
|
return value ? 'check' : 'close';
|
||||||
|
case 'number':
|
||||||
|
return value === 0 ? 'close' : 'check';
|
||||||
|
case 'undefined':
|
||||||
|
return 'indeterminate_check_box';
|
||||||
|
default:
|
||||||
|
return 'indeterminate_check_box';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getToggleIcon(value) {
|
||||||
|
if (value === null) return 'help_outline';
|
||||||
|
return value ? 'toggle_on' : 'toggle_off';
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatColumnValue(col, row, dashIfEmpty) {
|
||||||
|
if (col?.format) {
|
||||||
|
if (selectRegex.test(col?.component) && row[col?.name + 'TextValue']) {
|
||||||
|
return dashIfEmpty(row[col?.name + 'TextValue']);
|
||||||
|
} else {
|
||||||
|
return col.format(row, dashIfEmpty);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return dashIfEmpty(row[col?.name]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const checkbox = ref(null);
|
||||||
|
function cardClick(_, row) {
|
||||||
|
if ($props.redirect) router.push({ path: `/${$props.redirect}/${row.id}` });
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<QDrawer
|
<QDrawer
|
||||||
|
@ -311,7 +542,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
v-model="stateStore.rightDrawer"
|
v-model="stateStore.rightDrawer"
|
||||||
side="right"
|
side="right"
|
||||||
:width="256"
|
:width="256"
|
||||||
show-if-above
|
:overlay="$props.overlay"
|
||||||
>
|
>
|
||||||
<QScrollArea class="fit">
|
<QScrollArea class="fit">
|
||||||
<VnTableFilter
|
<VnTableFilter
|
||||||
|
@ -332,7 +563,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
<CrudModel
|
<CrudModel
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
:class="$attrs['class'] ?? 'q-px-md'"
|
:class="$attrs['class'] ?? 'q-px-md'"
|
||||||
:limit="$attrs['limit'] ?? 20"
|
:limit="$attrs['limit'] ?? 100"
|
||||||
ref="CrudModelRef"
|
ref="CrudModelRef"
|
||||||
@on-fetch="(...args) => emit('onFetch', ...args)"
|
@on-fetch="(...args) => emit('onFetch', ...args)"
|
||||||
:search-url="searchUrl"
|
:search-url="searchUrl"
|
||||||
|
@ -348,8 +579,12 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
<QTable
|
<QTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
v-bind="table"
|
v-bind="table"
|
||||||
class="vnTable"
|
:class="[
|
||||||
:class="{ 'last-row-sticky': $props.footer }"
|
'vnTable',
|
||||||
|
table ? 'selection-cell' : '',
|
||||||
|
$props.footer ? 'last-row-sticky' : '',
|
||||||
|
]"
|
||||||
|
wrap-cells
|
||||||
:columns="splittedColumns.columns"
|
:columns="splittedColumns.columns"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
v-model:selected="selected"
|
v-model:selected="selected"
|
||||||
|
@ -363,9 +598,10 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
@row-click="(_, row) => rowClickFunction && rowClickFunction(row)"
|
@row-click="(_, row) => rowClickFunction && rowClickFunction(row)"
|
||||||
@update:selected="emit('update:selected', $event)"
|
@update:selected="emit('update:selected', $event)"
|
||||||
@selection="(details) => handleSelection(details, rows)"
|
@selection="(details) => handleSelection(details, rows)"
|
||||||
|
:hide-selected-banner="true"
|
||||||
>
|
>
|
||||||
<template #top-left v-if="!$props.withoutHeader">
|
<template #top-left v-if="!$props.withoutHeader">
|
||||||
<slot name="top-left"></slot>
|
<slot name="top-left"> </slot>
|
||||||
</template>
|
</template>
|
||||||
<template #top-right v-if="!$props.withoutHeader">
|
<template #top-right v-if="!$props.withoutHeader">
|
||||||
<slot name="top-right"></slot>
|
<slot name="top-right"></slot>
|
||||||
|
@ -382,6 +618,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
dense
|
dense
|
||||||
:options="tableModes.filter((mode) => !mode.disable)"
|
:options="tableModes.filter((mode) => !mode.disable)"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<QBtn
|
<QBtn
|
||||||
v-if="showRightIcon"
|
v-if="showRightIcon"
|
||||||
icon="filter_alt"
|
icon="filter_alt"
|
||||||
|
@ -393,32 +630,39 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
<template #header-cell="{ col }">
|
<template #header-cell="{ col }">
|
||||||
<QTh
|
<QTh
|
||||||
v-if="col.visible ?? true"
|
v-if="col.visible ?? true"
|
||||||
:style="col.headerStyle"
|
v-bind:class="col.headerClass"
|
||||||
:class="col.headerClass"
|
class="body-cell"
|
||||||
|
:style="col?.width ? `max-width: ${col?.width}` : ''"
|
||||||
|
style="padding: inherit"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="column ellipsis"
|
class="no-padding"
|
||||||
:class="`text-${col?.align ?? 'left'}`"
|
:style="
|
||||||
:style="$props.columnSearch ? 'height: 75px' : ''"
|
withFilters && $props.columnSearch ? 'height: 75px' : ''
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<div class="row items-center no-wrap" style="height: 30px">
|
<div class="text-center" style="height: 30px">
|
||||||
<QTooltip v-if="col.toolTip">{{ col.toolTip }}</QTooltip>
|
<QTooltip v-if="col.toolTip">{{ col.toolTip }}</QTooltip>
|
||||||
<VnTableOrder
|
<VnTableOrder
|
||||||
v-model="orders[col.orderBy ?? col.name]"
|
v-model="orders[col.orderBy ?? col.name]"
|
||||||
:name="col.orderBy ?? col.name"
|
:name="col.orderBy ?? col.name"
|
||||||
:label="col?.label"
|
:label="col?.labelAbbreviation ?? col?.label"
|
||||||
:data-key="$attrs['data-key']"
|
:data-key="$attrs['data-key']"
|
||||||
:search-url="searchUrl"
|
:search-url="searchUrl"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<VnFilter
|
<VnFilter
|
||||||
v-if="$props.columnSearch"
|
v-if="
|
||||||
|
$props.columnSearch &&
|
||||||
|
col.columnSearch !== false &&
|
||||||
|
withFilters
|
||||||
|
"
|
||||||
:column="col"
|
:column="col"
|
||||||
:show-title="true"
|
:show-title="true"
|
||||||
:data-key="$attrs['data-key']"
|
:data-key="$attrs['data-key']"
|
||||||
v-model="params[columnName(col)]"
|
v-model="params[columnName(col)]"
|
||||||
:search-url="searchUrl"
|
:search-url="searchUrl"
|
||||||
class="full-width"
|
customClass="header-filter"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</QTh>
|
</QTh>
|
||||||
|
@ -436,32 +680,63 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell="{ col, row, rowIndex }">
|
<template #body-cell="{ col, row, rowIndex }">
|
||||||
<!-- Columns -->
|
|
||||||
<QTd
|
<QTd
|
||||||
auto-width
|
class="no-margin q-px-xs"
|
||||||
class="no-margin"
|
|
||||||
:class="[getColAlign(col), col.columnClass]"
|
|
||||||
:style="col.style"
|
|
||||||
v-if="col.visible ?? true"
|
v-if="col.visible ?? true"
|
||||||
@click.ctrl="
|
:style="{
|
||||||
($event) =>
|
'max-width': col?.width ?? false,
|
||||||
rowCtrlClickFunction && rowCtrlClickFunction($event, row)
|
position: 'relative',
|
||||||
"
|
}"
|
||||||
|
:class="[
|
||||||
|
col.columnClass,
|
||||||
|
'body-cell no-margin no-padding',
|
||||||
|
getColAlign(col),
|
||||||
|
]"
|
||||||
|
:data-row-index="rowIndex"
|
||||||
|
:data-col-field="col?.name"
|
||||||
>
|
>
|
||||||
<slot
|
<div
|
||||||
:name="`column-${col.name}`"
|
class="no-padding no-margin peter"
|
||||||
:col="col"
|
style="
|
||||||
:row="row"
|
overflow: hidden;
|
||||||
:row-index="rowIndex"
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<VnTableColumn
|
<slot
|
||||||
:column="col"
|
:name="`column-${col.name}`"
|
||||||
|
:col="col"
|
||||||
:row="row"
|
:row="row"
|
||||||
:is-editable="col.isEditable ?? isEditable"
|
:row-index="rowIndex"
|
||||||
v-model="row[col.name]"
|
>
|
||||||
component-prop="columnField"
|
<QIcon
|
||||||
/>
|
v-if="col?.component === 'toggle'"
|
||||||
</slot>
|
:name="
|
||||||
|
col?.getIcon
|
||||||
|
? col.getIcon(row[col?.name])
|
||||||
|
: getToggleIcon(row[col?.name])
|
||||||
|
"
|
||||||
|
style="color: var(--vn-text-color)"
|
||||||
|
:class="hasEditableFormat(col)"
|
||||||
|
size="14px"
|
||||||
|
/>
|
||||||
|
<QIcon
|
||||||
|
v-else-if="col?.component === 'checkbox'"
|
||||||
|
:name="getCheckboxIcon(row[col?.name])"
|
||||||
|
style="color: var(--vn-text-color)"
|
||||||
|
:class="hasEditableFormat(col)"
|
||||||
|
size="14px"
|
||||||
|
/>
|
||||||
|
<span
|
||||||
|
v-else
|
||||||
|
:class="hasEditableFormat(col)"
|
||||||
|
:style="col?.style ? col.style(row) : null"
|
||||||
|
style="bottom: 0"
|
||||||
|
>
|
||||||
|
{{ formatColumnValue(col, row, dashIfEmpty) }}
|
||||||
|
</span>
|
||||||
|
</slot>
|
||||||
|
</div>
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-tableActions="{ col, row }">
|
<template #body-cell-tableActions="{ col, row }">
|
||||||
|
@ -482,7 +757,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
flat
|
flat
|
||||||
dense
|
dense
|
||||||
:class="
|
:class="
|
||||||
btn.isPrimary ? 'text-primary-light' : 'color-vn-text '
|
btn.isPrimary ? 'text-primary-light' : 'color-vn-label'
|
||||||
"
|
"
|
||||||
:style="`visibility: ${
|
:style="`visibility: ${
|
||||||
((btn.show && btn.show(row)) ?? true)
|
((btn.show && btn.show(row)) ?? true)
|
||||||
|
@ -490,29 +765,25 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
: 'hidden'
|
: 'hidden'
|
||||||
}`"
|
}`"
|
||||||
@click="btn.action(row)"
|
@click="btn.action(row)"
|
||||||
|
:data-cy="btn?.name ?? `tableAction-${index}`"
|
||||||
/>
|
/>
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #item="{ row, colsMap }">
|
<template #item="{ row, colsMap }">
|
||||||
<component
|
<component
|
||||||
:is="$props.redirect ? 'router-link' : 'span'"
|
v-bind:is="'div'"
|
||||||
:to="`/${$props.redirect}/` + row.id"
|
@click="(event) => cardClick(event, row)"
|
||||||
>
|
>
|
||||||
<QCard
|
<QCard
|
||||||
bordered
|
bordered
|
||||||
flat
|
flat
|
||||||
class="row no-wrap justify-between cursor-pointer q-pa-sm"
|
class="row no-wrap justify-between cursor-pointer q-pa-sm"
|
||||||
@click="
|
|
||||||
(_, row) => {
|
|
||||||
$props.rowClick && $props.rowClick(row);
|
|
||||||
}
|
|
||||||
"
|
|
||||||
style="height: 100%"
|
style="height: 100%"
|
||||||
>
|
>
|
||||||
<QCardSection
|
<QCardSection
|
||||||
vertical
|
vertical
|
||||||
class="no-margin no-padding"
|
class="no-margin no-padding"
|
||||||
:class="colsMap.tableActions ? 'w-80' : 'fit'"
|
:class="colsMap.tableActions ? '' : 'fit'"
|
||||||
>
|
>
|
||||||
<!-- Chips -->
|
<!-- Chips -->
|
||||||
<QCardSection
|
<QCardSection
|
||||||
|
@ -543,7 +814,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<!-- Fields -->
|
<!-- Fields -->
|
||||||
<QCardSection
|
<QCardSection
|
||||||
class="q-pl-sm q-pr-lg q-py-xs"
|
class="q-pl-sm q-py-xs"
|
||||||
:class="$props.cardClass"
|
:class="$props.cardClass"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
|
@ -551,11 +822,11 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
col, index
|
col, index
|
||||||
) of splittedColumns.cardVisible"
|
) of splittedColumns.cardVisible"
|
||||||
:key="col.name"
|
:key="col.name"
|
||||||
class="fields"
|
|
||||||
>
|
>
|
||||||
<VnLv :label="col.label + ':'">
|
<VnLv :label="col.label + ':'">
|
||||||
<template #value>
|
<template #value>
|
||||||
<span
|
<span
|
||||||
|
class="q-pl-xs"
|
||||||
@click="stopEventPropagation($event)"
|
@click="stopEventPropagation($event)"
|
||||||
>
|
>
|
||||||
<slot
|
<slot
|
||||||
|
@ -564,7 +835,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
:row="row"
|
:row="row"
|
||||||
:row-index="index"
|
:row-index="index"
|
||||||
>
|
>
|
||||||
<VnTableColumn
|
<VnColumn
|
||||||
:column="col"
|
:column="col"
|
||||||
:row="row"
|
:row="row"
|
||||||
:is-editable="false"
|
:is-editable="false"
|
||||||
|
@ -590,13 +861,14 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
:key="index"
|
:key="index"
|
||||||
:title="btn.title"
|
:title="btn.title"
|
||||||
:icon="btn.icon"
|
:icon="btn.icon"
|
||||||
|
data-cy="cardBtn"
|
||||||
class="q-pa-xs"
|
class="q-pa-xs"
|
||||||
flat
|
|
||||||
:class="
|
:class="
|
||||||
btn.isPrimary
|
btn.isPrimary
|
||||||
? 'text-primary-light'
|
? 'text-primary-light'
|
||||||
: 'color-vn-text '
|
: 'color-vn-label'
|
||||||
"
|
"
|
||||||
|
flat
|
||||||
@click="btn.action(row)"
|
@click="btn.action(row)"
|
||||||
/>
|
/>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
|
@ -604,14 +876,17 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
</component>
|
</component>
|
||||||
</template>
|
</template>
|
||||||
<template #bottom-row="{ cols }" v-if="$props.footer">
|
<template #bottom-row="{ cols }" v-if="$props.footer">
|
||||||
<QTr v-if="rows.length" style="height: 30px">
|
<QTr v-if="rows.length" style="height: 45px">
|
||||||
|
<QTh v-if="table.selection" />
|
||||||
<QTh
|
<QTh
|
||||||
v-for="col of cols.filter((cols) => cols.visible ?? true)"
|
v-for="col of cols.filter((cols) => cols.visible ?? true)"
|
||||||
:key="col?.id"
|
:key="col?.id"
|
||||||
class="text-center"
|
|
||||||
:class="getColAlign(col)"
|
:class="getColAlign(col)"
|
||||||
>
|
>
|
||||||
<slot :name="`column-footer-${col.name}`" />
|
<slot
|
||||||
|
:name="`column-footer-${col.name}`"
|
||||||
|
:isEditableColumn="isEditableColumn(col)"
|
||||||
|
/>
|
||||||
</QTh>
|
</QTh>
|
||||||
</QTr>
|
</QTr>
|
||||||
</template>
|
</template>
|
||||||
|
@ -655,32 +930,53 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
{{ createForm?.title }}
|
{{ createForm?.title }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QPageSticky>
|
</QPageSticky>
|
||||||
<QDialog v-model="showForm" transition-show="scale" transition-hide="scale">
|
<QDialog
|
||||||
|
v-model="showForm"
|
||||||
|
transition-show="scale"
|
||||||
|
transition-hide="scale"
|
||||||
|
:full-width="createComplement?.isFullWidth ?? false"
|
||||||
|
@before-hide="
|
||||||
|
() => {
|
||||||
|
if (createRef.isSaveAndContinue) {
|
||||||
|
showForm = true;
|
||||||
|
createForm.formInitialData = { ...create.formInitialData };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"
|
||||||
|
data-cy="vn-table-create-dialog"
|
||||||
|
>
|
||||||
<FormModelPopup
|
<FormModelPopup
|
||||||
|
ref="createRef"
|
||||||
v-bind="createForm"
|
v-bind="createForm"
|
||||||
:model="$attrs['data-key'] + 'Create'"
|
:model="$attrs['data-key'] + 'Create'"
|
||||||
@on-data-saved="(_, res) => createForm.onDataSaved(res)"
|
@on-data-saved="(_, res) => createForm.onDataSaved(res)"
|
||||||
>
|
>
|
||||||
<template #form-inputs="{ data }">
|
<template #form-inputs="{ data }">
|
||||||
<div class="grid-create">
|
<div :style="createComplement?.containerStyle">
|
||||||
<slot
|
<div>
|
||||||
v-for="column of splittedColumns.create"
|
<slot name="previous-create-dialog" :data="data" />
|
||||||
:key="column.name"
|
</div>
|
||||||
:name="`column-create-${column.name}`"
|
<div class="grid-create" :style="createComplement?.columnGridStyle">
|
||||||
:data="data"
|
<slot
|
||||||
:column-name="column.name"
|
v-for="column of splittedColumns.create"
|
||||||
:label="column.label"
|
:key="column.name"
|
||||||
>
|
:name="`column-create-${column.name}`"
|
||||||
<VnTableColumn
|
:data="data"
|
||||||
:column="column"
|
:column-name="column.name"
|
||||||
:row="{}"
|
:label="column.label"
|
||||||
default="input"
|
>
|
||||||
v-model="data[column.name]"
|
<VnColumn
|
||||||
:show-label="true"
|
:column="column"
|
||||||
component-prop="columnCreate"
|
:row="{}"
|
||||||
/>
|
default="input"
|
||||||
</slot>
|
v-model="data[column.name]"
|
||||||
<slot name="more-create-dialog" :data="data" />
|
:show-label="true"
|
||||||
|
component-prop="columnCreate"
|
||||||
|
:data-cy="`${column.name}-create-popup`"
|
||||||
|
/>
|
||||||
|
</slot>
|
||||||
|
<slot name="more-create-dialog" :data="data" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</FormModelPopup>
|
</FormModelPopup>
|
||||||
|
@ -698,6 +994,42 @@ es:
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
.selection-cell {
|
||||||
|
table td:first-child {
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.side-padding {
|
||||||
|
padding-left: 1px;
|
||||||
|
padding-right: 1px;
|
||||||
|
}
|
||||||
|
.editable-text:hover {
|
||||||
|
border-bottom: 1px dashed var(--q-primary);
|
||||||
|
@extend .side-padding;
|
||||||
|
}
|
||||||
|
.editable-text {
|
||||||
|
border-bottom: 1px dashed var(--vn-label-color);
|
||||||
|
@extend .side-padding;
|
||||||
|
}
|
||||||
|
.cell-input {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
padding-top: 0px !important;
|
||||||
|
}
|
||||||
|
.q-field--labeled .q-field__native,
|
||||||
|
.q-field--labeled .q-field__prefix,
|
||||||
|
.q-field--labeled .q-field__suffix {
|
||||||
|
padding-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.body-cell {
|
||||||
|
padding-left: 2px !important;
|
||||||
|
padding-right: 2px !important;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
.bg-chip-secondary {
|
.bg-chip-secondary {
|
||||||
background-color: var(--vn-page-color);
|
background-color: var(--vn-page-color);
|
||||||
color: var(--vn-text-color);
|
color: var(--vn-text-color);
|
||||||
|
@ -714,8 +1046,8 @@ es:
|
||||||
|
|
||||||
.grid-three {
|
.grid-three {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(350px, max-content));
|
grid-template-columns: repeat(auto-fit, minmax(300px, max-content));
|
||||||
max-width: 100%;
|
width: 100%;
|
||||||
grid-gap: 20px;
|
grid-gap: 20px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
@ -723,7 +1055,6 @@ es:
|
||||||
.grid-create {
|
.grid-create {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(150px, max-content));
|
grid-template-columns: repeat(auto-fit, minmax(150px, max-content));
|
||||||
max-width: 100%;
|
|
||||||
grid-gap: 20px;
|
grid-gap: 20px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
@ -739,7 +1070,9 @@ es:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.q-table tbody tr td {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
.q-table {
|
.q-table {
|
||||||
th {
|
th {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
@ -788,6 +1121,7 @@ es:
|
||||||
.vn-label-value {
|
.vn-label-value {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
color: var(--vn-text-color);
|
color: var(--vn-text-color);
|
||||||
.value {
|
.value {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
@ -839,4 +1173,15 @@ es:
|
||||||
.q-table__middle.q-virtual-scroll.q-virtual-scroll--vertical.scroll {
|
.q-table__middle.q-virtual-scroll.q-virtual-scroll--vertical.scroll {
|
||||||
background-color: var(--vn-section-color);
|
background-color: var(--vn-section-color);
|
||||||
}
|
}
|
||||||
|
.temp-input {
|
||||||
|
top: 0;
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
label.header-filter > .q-field__inner > .q-field__control {
|
||||||
|
padding: inherit;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -29,25 +29,29 @@ function columnName(col) {
|
||||||
<VnFilterPanel v-bind="$attrs" :search-button="true" :disable-submit-event="true">
|
<VnFilterPanel v-bind="$attrs" :search-button="true" :disable-submit-event="true">
|
||||||
<template #body="{ params, orders, searchFn }">
|
<template #body="{ params, orders, searchFn }">
|
||||||
<div
|
<div
|
||||||
class="row no-wrap flex-center"
|
class="container"
|
||||||
v-for="col of columns.filter((c) => c.columnFilter ?? true)"
|
v-for="col of columns.filter((c) => c.columnFilter ?? true)"
|
||||||
:key="col.id"
|
:key="col.id"
|
||||||
>
|
>
|
||||||
<VnFilter
|
<div class="filter">
|
||||||
ref="tableFilterRef"
|
<VnFilter
|
||||||
:column="col"
|
ref="tableFilterRef"
|
||||||
:data-key="$attrs['data-key']"
|
:column="col"
|
||||||
v-model="params[columnName(col)]"
|
:data-key="$attrs['data-key']"
|
||||||
:search-url="searchUrl"
|
v-model="params[columnName(col)]"
|
||||||
/>
|
:search-url="searchUrl"
|
||||||
<VnTableOrder
|
/>
|
||||||
v-if="col?.columnFilter !== false && col?.name !== 'tableActions'"
|
</div>
|
||||||
v-model="orders[col.orderBy ?? col.name]"
|
<div class="order">
|
||||||
:name="col.orderBy ?? col.name"
|
<VnTableOrder
|
||||||
:data-key="$attrs['data-key']"
|
v-if="col?.columnFilter !== false && col?.name !== 'tableActions'"
|
||||||
:search-url="searchUrl"
|
v-model="orders[col.orderBy ?? col.name]"
|
||||||
:vertical="true"
|
:name="col.orderBy ?? col.name"
|
||||||
/>
|
:data-key="$attrs['data-key']"
|
||||||
|
:search-url="searchUrl"
|
||||||
|
:vertical="true"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<slot
|
<slot
|
||||||
name="moreFilterPanel"
|
name="moreFilterPanel"
|
||||||
|
@ -68,3 +72,21 @@ function columnName(col) {
|
||||||
</template>
|
</template>
|
||||||
</VnFilterPanel>
|
</VnFilterPanel>
|
||||||
</template>
|
</template>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 45px;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.filter {
|
||||||
|
width: 70%;
|
||||||
|
height: 40px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.order {
|
||||||
|
width: 10%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
@ -32,16 +32,21 @@ const areAllChecksMarked = computed(() => {
|
||||||
|
|
||||||
function setUserConfigViewData(data, isLocal) {
|
function setUserConfigViewData(data, isLocal) {
|
||||||
if (!data) return;
|
if (!data) return;
|
||||||
// Importante: El name de las columnas de la tabla debe conincidir con el name de las variables que devuelve la view config
|
|
||||||
if (!isLocal) localColumns.value = [];
|
if (!isLocal) localColumns.value = [];
|
||||||
// Array to Object
|
|
||||||
const skippeds = $props.skip.reduce((a, v) => ({ ...a, [v]: v }), {});
|
const skippeds = $props.skip.reduce((a, v) => ({ ...a, [v]: v }), {});
|
||||||
|
|
||||||
for (let column of columns.value) {
|
for (let column of columns.value) {
|
||||||
const { label, name } = column;
|
const { label, name, labelAbbreviation } = column;
|
||||||
if (skippeds[name]) continue;
|
if (skippeds[name]) continue;
|
||||||
column.visible = data[name] ?? true;
|
column.visible = data[name] ?? true;
|
||||||
if (!isLocal) localColumns.value.push({ name, label, visible: column.visible });
|
if (!isLocal)
|
||||||
|
localColumns.value.push({
|
||||||
|
name,
|
||||||
|
label,
|
||||||
|
labelAbbreviation,
|
||||||
|
visible: column.visible,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,7 +157,11 @@ onMounted(async () => {
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
v-for="col in localColumns"
|
v-for="col in localColumns"
|
||||||
:key="col.name"
|
:key="col.name"
|
||||||
:label="col.label ?? col.name"
|
:label="
|
||||||
|
col?.labelAbbreviation
|
||||||
|
? col.labelAbbreviation + ` (${col.label ?? col.name})`
|
||||||
|
: (col.label ?? col.name)
|
||||||
|
"
|
||||||
v-model="col.visible"
|
v-model="col.visible"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,61 +1,65 @@
|
||||||
import { vi, describe, expect, it, beforeEach, beforeAll, afterEach } from 'vitest';
|
import { vi, describe, expect, it, beforeEach, afterEach } from 'vitest';
|
||||||
import { createWrapper } from 'app/test/vitest/helper';
|
import { createWrapper } from 'app/test/vitest/helper';
|
||||||
import UserPanel from 'src/components/UserPanel.vue';
|
import UserPanel from 'src/components/UserPanel.vue';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
|
|
||||||
|
vi.mock('src/utils/quasarLang', () => ({
|
||||||
|
default: vi.fn(),
|
||||||
|
}));
|
||||||
|
|
||||||
describe('UserPanel', () => {
|
describe('UserPanel', () => {
|
||||||
let wrapper;
|
let wrapper;
|
||||||
let vm;
|
let vm;
|
||||||
let state;
|
let state;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
wrapper = createWrapper(UserPanel, {});
|
wrapper = createWrapper(UserPanel, {});
|
||||||
state = useState();
|
state = useState();
|
||||||
state.setUser({
|
state.setUser({
|
||||||
id: 115,
|
id: 115,
|
||||||
name: 'itmanagement',
|
name: 'itmanagement',
|
||||||
nickname: 'itManagementNick',
|
nickname: 'itManagementNick',
|
||||||
lang: 'en',
|
lang: 'en',
|
||||||
darkMode: false,
|
darkMode: false,
|
||||||
companyFk: 442,
|
companyFk: 442,
|
||||||
warehouseFk: 1,
|
warehouseFk: 1,
|
||||||
});
|
|
||||||
wrapper = wrapper.wrapper;
|
|
||||||
vm = wrapper.vm;
|
|
||||||
});
|
});
|
||||||
|
wrapper = wrapper.wrapper;
|
||||||
|
vm = wrapper.vm;
|
||||||
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
vi.clearAllMocks();
|
vi.clearAllMocks();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should fetch warehouses data on mounted', async () => {
|
it('should fetch warehouses data on mounted', async () => {
|
||||||
const fetchData = wrapper.findComponent({ name: 'FetchData' });
|
const fetchData = wrapper.findComponent({ name: 'FetchData' });
|
||||||
expect(fetchData.props('url')).toBe('Warehouses');
|
expect(fetchData.props('url')).toBe('Warehouses');
|
||||||
expect(fetchData.props('autoLoad')).toBe(true);
|
expect(fetchData.props('autoLoad')).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should toggle dark mode correctly and update preferences', async () => {
|
it('should toggle dark mode correctly and update preferences', async () => {
|
||||||
await vm.saveDarkMode(true);
|
await vm.saveDarkMode(true);
|
||||||
expect(axios.patch).toHaveBeenCalledWith('/UserConfigs/115', { darkMode: true });
|
expect(axios.patch).toHaveBeenCalledWith('/UserConfigs/115', { darkMode: true });
|
||||||
expect(vm.user.darkMode).toBe(true);
|
expect(vm.user.darkMode).toBe(true);
|
||||||
vm.updatePreferences();
|
await vm.updatePreferences();
|
||||||
expect(vm.darkMode).toBe(true);
|
expect(vm.darkMode).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should change user language and update preferences', async () => {
|
it('should change user language and update preferences', async () => {
|
||||||
const userLanguage = 'es';
|
const userLanguage = 'es';
|
||||||
await vm.saveLanguage(userLanguage);
|
await vm.saveLanguage(userLanguage);
|
||||||
expect(axios.patch).toHaveBeenCalledWith('/VnUsers/115', { lang: userLanguage });
|
expect(axios.patch).toHaveBeenCalledWith('/VnUsers/115', { lang: userLanguage });
|
||||||
expect(vm.user.lang).toBe(userLanguage);
|
expect(vm.user.lang).toBe(userLanguage);
|
||||||
vm.updatePreferences();
|
await vm.updatePreferences();
|
||||||
expect(vm.locale).toBe(userLanguage);
|
expect(vm.locale).toBe(userLanguage);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should update user data', async () => {
|
it('should update user data', async () => {
|
||||||
const key = 'name';
|
const key = 'name';
|
||||||
const value = 'itboss';
|
const value = 'itboss';
|
||||||
await vm.saveUserData(key, value);
|
await vm.saveUserData(key, value);
|
||||||
expect(axios.post).toHaveBeenCalledWith('UserConfigs/setUserConfig', { [key]: value });
|
expect(axios.post).toHaveBeenCalledWith('UserConfigs/setUserConfig', { [key]: value });
|
||||||
});
|
});
|
||||||
});
|
});
|
|
@ -39,6 +39,13 @@ onBeforeMount(async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
onBeforeRouteUpdate(async (to, from) => {
|
onBeforeRouteUpdate(async (to, from) => {
|
||||||
|
if (hasRouteParam(to.params)) {
|
||||||
|
const { matched } = router.currentRoute.value;
|
||||||
|
const { name } = matched.at(-3);
|
||||||
|
if (name) {
|
||||||
|
router.push({ name, params: to.params });
|
||||||
|
}
|
||||||
|
}
|
||||||
const id = to.params.id;
|
const id = to.params.id;
|
||||||
if (id !== from.params.id) await fetch(id, true);
|
if (id !== from.params.id) await fetch(id, true);
|
||||||
});
|
});
|
||||||
|
@ -50,6 +57,9 @@ async function fetch(id, append = false) {
|
||||||
else arrayData.store.url = props.url.replace(regex, `/${id}`);
|
else arrayData.store.url = props.url.replace(regex, `/${id}`);
|
||||||
await arrayData.fetch({ append, updateRouter: false });
|
await arrayData.fetch({ append, updateRouter: false });
|
||||||
}
|
}
|
||||||
|
function hasRouteParam(params, valueToCheck = ':addressId') {
|
||||||
|
return Object.values(params).includes(valueToCheck);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<Teleport to="#left-panel" v-if="stateStore.isHeaderMounted()">
|
<Teleport to="#left-panel" v-if="stateStore.isHeaderMounted()">
|
||||||
|
|
|
@ -1,23 +1,33 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { defineModel } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
const modelValue = defineModel({ type: Boolean, default: false });
|
|
||||||
|
|
||||||
|
const model = defineModel({ type: [Number, Boolean] });
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
info: {
|
info: {
|
||||||
type: String,
|
type: String,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
|
||||||
|
|
||||||
|
const checkboxModel = computed({
|
||||||
|
get() {
|
||||||
|
if (typeof model.value === 'number') {
|
||||||
|
return model.value !== 0;
|
||||||
|
}
|
||||||
|
return model.value;
|
||||||
|
},
|
||||||
|
set(value) {
|
||||||
|
if (typeof model.value === 'number') {
|
||||||
|
model.value = value ? 1 : 0;
|
||||||
|
} else {
|
||||||
|
model.value = value;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<QCheckbox
|
<QCheckbox v-bind="$attrs" v-on="$attrs" v-model="checkboxModel" />
|
||||||
v-bind="$attrs"
|
|
||||||
v-on="$attrs"
|
|
||||||
v-model="modelValue"
|
|
||||||
/>
|
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="info"
|
v-if="info"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
<script setup>
|
||||||
|
const $props = defineProps({
|
||||||
|
colors: {
|
||||||
|
type: String,
|
||||||
|
default: '{"value": []}',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const colorArray = JSON.parse($props.colors)?.value;
|
||||||
|
const maxHeight = 30;
|
||||||
|
const colorHeight = maxHeight / colorArray?.length;
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<div v-if="colors" class="color-div" :style="{ height: `${maxHeight}px` }">
|
||||||
|
<div
|
||||||
|
v-for="(color, index) in colorArray"
|
||||||
|
:key="index"
|
||||||
|
:style="{
|
||||||
|
backgroundColor: `#${color}`,
|
||||||
|
height: `${colorHeight}px`,
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<style scoped>
|
||||||
|
.color-div {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -17,6 +17,8 @@ const $props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const emit = defineEmits(['blur']);
|
||||||
|
|
||||||
const componentArray = computed(() => {
|
const componentArray = computed(() => {
|
||||||
if (typeof $props.prop === 'object') return [$props.prop];
|
if (typeof $props.prop === 'object') return [$props.prop];
|
||||||
return $props.prop;
|
return $props.prop;
|
||||||
|
@ -54,6 +56,7 @@ function toValueAttrs(attrs) {
|
||||||
v-bind="mix(toComponent).attrs"
|
v-bind="mix(toComponent).attrs"
|
||||||
v-on="mix(toComponent).event ?? {}"
|
v-on="mix(toComponent).event ?? {}"
|
||||||
v-model="model"
|
v-model="model"
|
||||||
|
@blur="emit('blur')"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -11,6 +11,7 @@ const emit = defineEmits([
|
||||||
'update:options',
|
'update:options',
|
||||||
'keyup.enter',
|
'keyup.enter',
|
||||||
'remove',
|
'remove',
|
||||||
|
'blur',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
|
@ -136,6 +137,7 @@ const handleUppercase = () => {
|
||||||
:type="$attrs.type"
|
:type="$attrs.type"
|
||||||
:class="{ required: isRequired }"
|
:class="{ required: isRequired }"
|
||||||
@keyup.enter="emit('keyup.enter')"
|
@keyup.enter="emit('keyup.enter')"
|
||||||
|
@blur="emit('blur')"
|
||||||
@keydown="handleKeydown"
|
@keydown="handleKeydown"
|
||||||
:clearable="false"
|
:clearable="false"
|
||||||
:rules="mixinRules"
|
:rules="mixinRules"
|
||||||
|
@ -143,7 +145,7 @@ const handleUppercase = () => {
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:data-cy="$attrs.dataCy ?? $attrs.label + '_input'"
|
:data-cy="$attrs.dataCy ?? $attrs.label + '_input'"
|
||||||
>
|
>
|
||||||
<template #prepend>
|
<template #prepend v-if="$slots.prepend">
|
||||||
<slot name="prepend" />
|
<slot name="prepend" />
|
||||||
</template>
|
</template>
|
||||||
<template #append>
|
<template #append>
|
||||||
|
@ -172,7 +174,7 @@ const handleUppercase = () => {
|
||||||
<QIcon
|
<QIcon
|
||||||
name="match_case"
|
name="match_case"
|
||||||
size="xs"
|
size="xs"
|
||||||
v-if="!$attrs.disabled && !($attrs.readonly) && $props.uppercase"
|
v-if="!$attrs.disabled && !$attrs.readonly && $props.uppercase"
|
||||||
@click="handleUppercase"
|
@click="handleUppercase"
|
||||||
class="uppercase-icon"
|
class="uppercase-icon"
|
||||||
>
|
>
|
||||||
|
@ -194,13 +196,15 @@ const handleUppercase = () => {
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.uppercase-icon {
|
.uppercase-icon {
|
||||||
transition: color 0.3s, transform 0.2s;
|
transition:
|
||||||
cursor: pointer;
|
color 0.3s,
|
||||||
|
transform 0.2s;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.uppercase-icon:hover {
|
.uppercase-icon:hover {
|
||||||
color: #ed9937;
|
color: #ed9937;
|
||||||
transform: scale(1.2);
|
transform: scale(1.2);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<i18n>
|
<i18n>
|
||||||
|
|
|
@ -42,7 +42,7 @@ const formattedDate = computed({
|
||||||
if (value.at(2) == '/') value = value.split('/').reverse().join('/');
|
if (value.at(2) == '/') value = value.split('/').reverse().join('/');
|
||||||
value = date.formatDate(
|
value = date.formatDate(
|
||||||
new Date(value).toISOString(),
|
new Date(value).toISOString(),
|
||||||
'YYYY-MM-DDTHH:mm:ss.SSSZ'
|
'YYYY-MM-DDTHH:mm:ss.SSSZ',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
const [year, month, day] = value.split('-').map((e) => parseInt(e));
|
const [year, month, day] = value.split('-').map((e) => parseInt(e));
|
||||||
|
@ -55,7 +55,7 @@ const formattedDate = computed({
|
||||||
orgDate.getHours(),
|
orgDate.getHours(),
|
||||||
orgDate.getMinutes(),
|
orgDate.getMinutes(),
|
||||||
orgDate.getSeconds(),
|
orgDate.getSeconds(),
|
||||||
orgDate.getMilliseconds()
|
orgDate.getMilliseconds(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ const formattedDate = computed({
|
||||||
});
|
});
|
||||||
|
|
||||||
const popupDate = computed(() =>
|
const popupDate = computed(() =>
|
||||||
model.value ? date.formatDate(new Date(model.value), 'YYYY/MM/DD') : model.value
|
model.value ? date.formatDate(new Date(model.value), 'YYYY/MM/DD') : model.value,
|
||||||
);
|
);
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// fix quasar bug
|
// fix quasar bug
|
||||||
|
@ -73,7 +73,7 @@ onMounted(() => {
|
||||||
watch(
|
watch(
|
||||||
() => model.value,
|
() => model.value,
|
||||||
(val) => (formattedDate.value = val),
|
(val) => (formattedDate.value = val),
|
||||||
{ immediate: true }
|
{ immediate: true },
|
||||||
);
|
);
|
||||||
|
|
||||||
const styleAttrs = computed(() => {
|
const styleAttrs = computed(() => {
|
||||||
|
|
|
@ -8,6 +8,7 @@ defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
const model = defineModel({ type: [Number, String] });
|
const model = defineModel({ type: [Number, String] });
|
||||||
|
const emit = defineEmits(['blur']);
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnInput
|
<VnInput
|
||||||
|
@ -24,5 +25,6 @@ const model = defineModel({ type: [Number, String] });
|
||||||
model = parseFloat(val).toFixed(decimalPlaces);
|
model = parseFloat(val).toFixed(decimalPlaces);
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
|
@blur="emit('blur')"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -85,6 +85,7 @@ const handleModelValue = (data) => {
|
||||||
:tooltip="t('Create new location')"
|
:tooltip="t('Create new location')"
|
||||||
:rules="mixinRules"
|
:rules="mixinRules"
|
||||||
:lazy-rules="true"
|
:lazy-rules="true"
|
||||||
|
required
|
||||||
>
|
>
|
||||||
<template #form>
|
<template #form>
|
||||||
<CreateNewPostcode
|
<CreateNewPostcode
|
||||||
|
|
|
@ -14,7 +14,7 @@ const $props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const options = ref([]);
|
const options = ref([]);
|
||||||
|
const emit = defineEmits(['blur']);
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
const { url, optionValue, optionLabel } = useAttrs();
|
const { url, optionValue, optionLabel } = useAttrs();
|
||||||
const findBy = $props.find ?? url?.charAt(0)?.toLocaleLowerCase() + url?.slice(1, -1);
|
const findBy = $props.find ?? url?.charAt(0)?.toLocaleLowerCase() + url?.slice(1, -1);
|
||||||
|
@ -35,5 +35,5 @@ onBeforeMount(async () => {
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnSelect v-bind="$attrs" :options="$attrs.options ?? options" />
|
<VnSelect v-bind="$attrs" :options="$attrs.options ?? options" @blur="emit('blur')" />
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -37,7 +37,6 @@ const isAllowedToCreate = computed(() => {
|
||||||
|
|
||||||
defineExpose({ vnSelectDialogRef: select });
|
defineExpose({ vnSelectDialogRef: select });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
ref="select"
|
ref="select"
|
||||||
|
@ -67,7 +66,6 @@ defineExpose({ vnSelectDialogRef: select });
|
||||||
</template>
|
</template>
|
||||||
</VnSelect>
|
</VnSelect>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.default-icon {
|
.default-icon {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
<script setup>
|
||||||
|
import VnSelectDialog from './VnSelectDialog.vue';
|
||||||
|
import FilterTravelForm from 'src/components/FilterTravelForm.vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { toDate } from 'src/filters';
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
const $props = defineProps({
|
||||||
|
data: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
onFilterTravelSelected: {
|
||||||
|
type: Function,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<VnSelectDialog
|
||||||
|
:label="t('entry.basicData.travel')"
|
||||||
|
v-bind="$attrs"
|
||||||
|
url="Travels/filter"
|
||||||
|
:fields="['id', 'warehouseInName']"
|
||||||
|
option-value="id"
|
||||||
|
option-label="warehouseInName"
|
||||||
|
map-options
|
||||||
|
hide-selected
|
||||||
|
:required="true"
|
||||||
|
action-icon="filter_alt"
|
||||||
|
:roles-allowed-to-create="['buyer']"
|
||||||
|
>
|
||||||
|
<template #form>
|
||||||
|
<FilterTravelForm @travel-selected="onFilterTravelSelected(data, $event)" />
|
||||||
|
</template>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>
|
||||||
|
{{ scope.opt?.agencyModeName }} -
|
||||||
|
{{ scope.opt?.warehouseInName }}
|
||||||
|
({{ toDate(scope.opt?.shipped) }}) →
|
||||||
|
{{ scope.opt?.warehouseOutName }}
|
||||||
|
({{ toDate(scope.opt?.landed) }})
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelectDialog>
|
||||||
|
</template>
|
|
@ -6,6 +6,7 @@ import { useArrayData } from 'composables/useArrayData';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
import { useClipboard } from 'src/composables/useClipboard';
|
||||||
import VnMoreOptions from './VnMoreOptions.vue';
|
import VnMoreOptions from './VnMoreOptions.vue';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
|
@ -29,10 +30,6 @@ const $props = defineProps({
|
||||||
type: String,
|
type: String,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
module: {
|
|
||||||
type: String,
|
|
||||||
default: null,
|
|
||||||
},
|
|
||||||
summary: {
|
summary: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null,
|
default: null,
|
||||||
|
@ -46,6 +43,7 @@ const $props = defineProps({
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const { copyText } = useClipboard();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
let arrayData;
|
let arrayData;
|
||||||
let store;
|
let store;
|
||||||
|
@ -103,6 +101,14 @@ function getValueFromPath(path) {
|
||||||
return current;
|
return current;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function copyIdText(id) {
|
||||||
|
copyText(id, {
|
||||||
|
component: {
|
||||||
|
copyValue: id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const emit = defineEmits(['onFetch']);
|
const emit = defineEmits(['onFetch']);
|
||||||
|
|
||||||
const iconModule = computed(() => route.matched[1].meta.icon);
|
const iconModule = computed(() => route.matched[1].meta.icon);
|
||||||
|
@ -148,7 +154,9 @@ const toModule = computed(() =>
|
||||||
{{ t('components.smartCard.openSummary') }}
|
{{ t('components.smartCard.openSummary') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
<RouterLink :to="{ name: `${module}Summary`, params: { id: entity.id } }">
|
<RouterLink
|
||||||
|
:to="{ name: `${dataKey}Summary`, params: { id: entity.id } }"
|
||||||
|
>
|
||||||
<QBtn
|
<QBtn
|
||||||
class="link"
|
class="link"
|
||||||
color="white"
|
color="white"
|
||||||
|
@ -184,9 +192,22 @@ const toModule = computed(() =>
|
||||||
</slot>
|
</slot>
|
||||||
</div>
|
</div>
|
||||||
</QItemLabel>
|
</QItemLabel>
|
||||||
<QItem dense>
|
<QItem>
|
||||||
<QItemLabel class="subtitle" caption>
|
<QItemLabel class="subtitle" caption>
|
||||||
#{{ getValueFromPath(subtitle) ?? entity.id }}
|
#{{ getValueFromPath(subtitle) ?? entity.id }}
|
||||||
|
<QBtn
|
||||||
|
round
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
size="sm"
|
||||||
|
icon="content_copy"
|
||||||
|
color="primary"
|
||||||
|
@click.stop="copyIdText(entity.id)"
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('globals.copyId') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QBtn>
|
||||||
</QItemLabel>
|
</QItemLabel>
|
||||||
</QItem>
|
</QItem>
|
||||||
</QList>
|
</QList>
|
||||||
|
@ -294,3 +315,11 @@ const toModule = computed(() =>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<i18n>
|
||||||
|
en:
|
||||||
|
globals:
|
||||||
|
copyId: Copy ID
|
||||||
|
es:
|
||||||
|
globals:
|
||||||
|
copyId: Copiar ID
|
||||||
|
</i18n>
|
||||||
|
|
|
@ -1,53 +1,32 @@
|
||||||
|
<script setup>
|
||||||
|
defineProps({
|
||||||
|
hasImage: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div id="descriptor-skeleton">
|
<div id="descriptor-skeleton" class="bg-vn-page">
|
||||||
<div class="row justify-between q-pa-sm">
|
<div class="row justify-between q-pa-sm">
|
||||||
<QSkeleton square size="40px" />
|
<QSkeleton square size="30px" v-for="i in 3" :key="i" />
|
||||||
<QSkeleton square size="40px" />
|
|
||||||
<QSkeleton square height="40px" width="20px" />
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col justify-between q-pa-sm q-gutter-y-xs">
|
<div class="q-pa-xs" v-if="hasImage">
|
||||||
<QSkeleton square height="40px" width="150px" />
|
<QSkeleton square height="200px" width="100%" />
|
||||||
<QSkeleton square height="30px" width="70px" />
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col q-pl-sm q-pa-sm q-mb-md">
|
<div class="col justify-between q-pa-md q-gutter-y-xs">
|
||||||
<div class="row justify-between">
|
<QSkeleton square height="25px" width="150px" />
|
||||||
<QSkeleton type="text" square height="30px" width="20%" />
|
<QSkeleton square height="15px" width="70px" />
|
||||||
<QSkeleton type="text" square height="30px" width="60%" />
|
</div>
|
||||||
</div>
|
<div class="q-pl-sm q-pa-sm q-mb-md">
|
||||||
<div class="row justify-between">
|
<div class="row q-gutter-x-sm q-pa-none q-ma-none" v-for="i in 5" :key="i">
|
||||||
<QSkeleton type="text" square height="30px" width="20%" />
|
<QSkeleton type="text" square height="20px" width="30%" />
|
||||||
<QSkeleton type="text" square height="30px" width="60%" />
|
<QSkeleton type="text" square height="20px" width="60%" />
|
||||||
</div>
|
|
||||||
<div class="row justify-between">
|
|
||||||
<QSkeleton type="text" square height="30px" width="20%" />
|
|
||||||
<QSkeleton type="text" square height="30px" width="60%" />
|
|
||||||
</div>
|
|
||||||
<div class="row justify-between">
|
|
||||||
<QSkeleton type="text" square height="30px" width="20%" />
|
|
||||||
<QSkeleton type="text" square height="30px" width="60%" />
|
|
||||||
</div>
|
|
||||||
<div class="row justify-between">
|
|
||||||
<QSkeleton type="text" square height="30px" width="20%" />
|
|
||||||
<QSkeleton type="text" square height="30px" width="60%" />
|
|
||||||
</div>
|
|
||||||
<div class="row justify-between">
|
|
||||||
<QSkeleton type="text" square height="30px" width="20%" />
|
|
||||||
<QSkeleton type="text" square height="30px" width="60%" />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<QCardActions>
|
<QCardActions class="q-gutter-x-sm justify-between">
|
||||||
<QSkeleton size="40px" />
|
<QSkeleton size="40px" v-for="i in 5" :key="i" />
|
||||||
<QSkeleton size="40px" />
|
|
||||||
<QSkeleton size="40px" />
|
|
||||||
<QSkeleton size="40px" />
|
|
||||||
<QSkeleton size="40px" />
|
|
||||||
</QCardActions>
|
</QCardActions>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
#descriptor-skeleton .q-card__actions {
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
|
@ -82,7 +82,7 @@ function cancel() {
|
||||||
@click="cancel()"
|
@click="cancel()"
|
||||||
/>
|
/>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<QCardSection class="q-pb-none">
|
<QCardSection class="q-pb-none" data-cy="VnConfirm_message">
|
||||||
<span v-if="message !== false" v-html="message" />
|
<span v-if="message !== false" v-html="message" />
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<QCardSection class="row items-center q-pt-none">
|
<QCardSection class="row items-center q-pt-none">
|
||||||
|
@ -95,6 +95,7 @@ function cancel() {
|
||||||
:disable="isLoading"
|
:disable="isLoading"
|
||||||
flat
|
flat
|
||||||
@click="cancel()"
|
@click="cancel()"
|
||||||
|
data-cy="VnConfirm_cancel"
|
||||||
/>
|
/>
|
||||||
<QBtn
|
<QBtn
|
||||||
:label="t('globals.confirm')"
|
:label="t('globals.confirm')"
|
||||||
|
|
|
@ -293,6 +293,9 @@ const getLocale = (label) => {
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.q-field__label.no-pointer-events.absolute.ellipsis {
|
||||||
|
margin-left: 6px !important;
|
||||||
|
}
|
||||||
.list {
|
.list {
|
||||||
width: 256px;
|
width: 256px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ $t('components.cardDescriptor.moreOptions') }}
|
{{ $t('components.cardDescriptor.moreOptions') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
<QMenu ref="menuRef">
|
<QMenu ref="menuRef" data-cy="descriptor-more-opts-menu">
|
||||||
<QList>
|
<QList>
|
||||||
<slot name="menu" :menu-ref="$refs.menuRef" />
|
<slot name="menu" :menu-ref="$refs.menuRef" />
|
||||||
</QList>
|
</QList>
|
||||||
|
|
|
@ -53,3 +53,8 @@ const manaCode = ref(props.manaCode);
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<i18n>
|
||||||
|
es:
|
||||||
|
Promotion mana: Maná promoción
|
||||||
|
Claim mana: Maná reclamación
|
||||||
|
</i18n>
|
||||||
|
|
|
@ -0,0 +1,66 @@
|
||||||
|
import { describe, it, expect, vi } from 'vitest';
|
||||||
|
import { useRequired } from '../useRequired';
|
||||||
|
|
||||||
|
vi.mock('../useValidator', () => ({
|
||||||
|
useValidator: () => ({
|
||||||
|
validations: () => ({
|
||||||
|
required: vi.fn((isRequired, val) => {
|
||||||
|
if (!isRequired) return true;
|
||||||
|
return val !== null && val !== undefined && val !== '';
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
}));
|
||||||
|
|
||||||
|
describe('useRequired', () => {
|
||||||
|
it('should detect required when attr is boolean true', () => {
|
||||||
|
const attrs = { required: true };
|
||||||
|
const { isRequired } = useRequired(attrs);
|
||||||
|
expect(isRequired).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should detect required when attr is boolean false', () => {
|
||||||
|
const attrs = { required: false };
|
||||||
|
const { isRequired } = useRequired(attrs);
|
||||||
|
expect(isRequired).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should detect required when attr exists without value', () => {
|
||||||
|
const attrs = { required: '' };
|
||||||
|
const { isRequired } = useRequired(attrs);
|
||||||
|
expect(isRequired).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return false when required attr does not exist', () => {
|
||||||
|
const attrs = { someOtherAttr: 'value' };
|
||||||
|
const { isRequired } = useRequired(attrs);
|
||||||
|
expect(isRequired).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('requiredFieldRule', () => {
|
||||||
|
it('should validate required field with value', () => {
|
||||||
|
const attrs = { required: true };
|
||||||
|
const { requiredFieldRule } = useRequired(attrs);
|
||||||
|
expect(requiredFieldRule('some value')).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should validate required field with empty value', () => {
|
||||||
|
const attrs = { required: true };
|
||||||
|
const { requiredFieldRule } = useRequired(attrs);
|
||||||
|
expect(requiredFieldRule('')).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should pass validation when field is not required', () => {
|
||||||
|
const attrs = { required: false };
|
||||||
|
const { requiredFieldRule } = useRequired(attrs);
|
||||||
|
expect(requiredFieldRule('')).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should handle null and undefined values', () => {
|
||||||
|
const attrs = { required: true };
|
||||||
|
const { requiredFieldRule } = useRequired(attrs);
|
||||||
|
expect(requiredFieldRule(null)).toBe(false);
|
||||||
|
expect(requiredFieldRule(undefined)).toBe(false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,65 @@
|
||||||
|
import { useQuasar } from 'quasar';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
import axios from 'axios';
|
||||||
|
import VnConfirm from 'components/ui/VnConfirm.vue';
|
||||||
|
|
||||||
|
export async function checkEntryLock(entryFk, userFk) {
|
||||||
|
const { t } = useI18n();
|
||||||
|
const quasar = useQuasar();
|
||||||
|
const { push } = useRouter();
|
||||||
|
const { data } = await axios.get(`Entries/${entryFk}`, {
|
||||||
|
params: {
|
||||||
|
filter: JSON.stringify({
|
||||||
|
fields: ['id', 'locked', 'lockerUserFk'],
|
||||||
|
include: { relation: 'user', scope: { fields: ['id', 'nickname'] } },
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const entryConfig = await axios.get('EntryConfigs/findOne');
|
||||||
|
|
||||||
|
if (data?.lockerUserFk && data?.locked) {
|
||||||
|
const now = new Date(Date.vnNow()).getTime();
|
||||||
|
const lockedTime = new Date(data.locked).getTime();
|
||||||
|
const timeDiff = (now - lockedTime) / 1000;
|
||||||
|
const isMaxTimeLockExceeded = entryConfig.data.maxLockTime > timeDiff;
|
||||||
|
|
||||||
|
if (data?.lockerUserFk !== userFk && isMaxTimeLockExceeded) {
|
||||||
|
quasar
|
||||||
|
.dialog({
|
||||||
|
component: VnConfirm,
|
||||||
|
componentProps: {
|
||||||
|
'data-cy': 'entry-lock-confirm',
|
||||||
|
title: t('entry.lock.title'),
|
||||||
|
message: t('entry.lock.message', {
|
||||||
|
userName: data?.user?.nickname,
|
||||||
|
time: timeDiff / 60,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.onOk(
|
||||||
|
async () =>
|
||||||
|
await axios.patch(`Entries/${entryFk}`, {
|
||||||
|
locked: Date.vnNow(),
|
||||||
|
lockerUserFk: userFk,
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
.onCancel(() => {
|
||||||
|
push({ path: `summary` });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
await axios
|
||||||
|
.patch(`Entries/${entryFk}`, {
|
||||||
|
locked: Date.vnNow(),
|
||||||
|
lockerUserFk: userFk,
|
||||||
|
})
|
||||||
|
.then(
|
||||||
|
quasar.notify({
|
||||||
|
message: t('entry.lock.success'),
|
||||||
|
color: 'positive',
|
||||||
|
group: false,
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
export function getColAlign(col) {
|
||||||
|
let align;
|
||||||
|
switch (col.component) {
|
||||||
|
case 'select':
|
||||||
|
align = 'left';
|
||||||
|
break;
|
||||||
|
case 'number':
|
||||||
|
align = 'right';
|
||||||
|
break;
|
||||||
|
case 'date':
|
||||||
|
case 'checkbox':
|
||||||
|
align = 'center';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
align = col?.align;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (/^is[A-Z]/.test(col.name) || /^has[A-Z]/.test(col.name)) align = 'center';
|
||||||
|
|
||||||
|
return 'text-' + (align ?? 'center');
|
||||||
|
}
|
|
@ -11,6 +11,7 @@ export async function useCau(res, message) {
|
||||||
const { config, headers, request, status, statusText, data } = res || {};
|
const { config, headers, request, status, statusText, data } = res || {};
|
||||||
const { params, url, method, signal, headers: confHeaders } = config || {};
|
const { params, url, method, signal, headers: confHeaders } = config || {};
|
||||||
const { message: resMessage, code, name } = data?.error || {};
|
const { message: resMessage, code, name } = data?.error || {};
|
||||||
|
delete confHeaders.Authorization;
|
||||||
|
|
||||||
const additionalData = {
|
const additionalData = {
|
||||||
path: location.hash,
|
path: location.hash,
|
||||||
|
@ -40,7 +41,7 @@ export async function useCau(res, message) {
|
||||||
handler: async () => {
|
handler: async () => {
|
||||||
const locale = i18n.global.t;
|
const locale = i18n.global.t;
|
||||||
const reason = ref(
|
const reason = ref(
|
||||||
code == 'ACCESS_DENIED' ? locale('cau.askPrivileges') : ''
|
code == 'ACCESS_DENIED' ? locale('cau.askPrivileges') : '',
|
||||||
);
|
);
|
||||||
openConfirmationModal(
|
openConfirmationModal(
|
||||||
locale('cau.title'),
|
locale('cau.title'),
|
||||||
|
@ -59,10 +60,9 @@ export async function useCau(res, message) {
|
||||||
'onUpdate:modelValue': (val) => (reason.value = val),
|
'onUpdate:modelValue': (val) => (reason.value = val),
|
||||||
label: locale('cau.inputLabel'),
|
label: locale('cau.inputLabel'),
|
||||||
class: 'full-width',
|
class: 'full-width',
|
||||||
required: true,
|
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,14 +2,10 @@ import { useValidator } from 'src/composables/useValidator';
|
||||||
|
|
||||||
export function useRequired($attrs) {
|
export function useRequired($attrs) {
|
||||||
const { validations } = useValidator();
|
const { validations } = useValidator();
|
||||||
const hasRequired = Object.keys($attrs).includes('required');
|
const isRequired =
|
||||||
let isRequired = false;
|
typeof $attrs['required'] === 'boolean'
|
||||||
if (hasRequired) {
|
? $attrs['required']
|
||||||
const required = $attrs['required'];
|
: Object.keys($attrs).includes('required');
|
||||||
if (typeof required === 'boolean') {
|
|
||||||
isRequired = required;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const requiredFieldRule = (val) => validations().required(isRequired, val);
|
const requiredFieldRule = (val) => validations().required(isRequired, val);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -21,7 +21,10 @@ body.body--light {
|
||||||
.q-header .q-toolbar {
|
.q-header .q-toolbar {
|
||||||
color: var(--vn-text-color);
|
color: var(--vn-text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
--vn-color-negative: $negative;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.body--dark {
|
body.body--dark {
|
||||||
--vn-header-color: #5d5d5d;
|
--vn-header-color: #5d5d5d;
|
||||||
--vn-page-color: #222;
|
--vn-page-color: #222;
|
||||||
|
@ -37,6 +40,8 @@ body.body--dark {
|
||||||
--vn-text-color-contrast: black;
|
--vn-text-color-contrast: black;
|
||||||
|
|
||||||
background-color: var(--vn-page-color);
|
background-color: var(--vn-page-color);
|
||||||
|
|
||||||
|
--vn-color-negative: $negative;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
|
@ -75,7 +80,6 @@ a {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Removes chrome autofill background
|
|
||||||
input:-webkit-autofill,
|
input:-webkit-autofill,
|
||||||
select:-webkit-autofill {
|
select:-webkit-autofill {
|
||||||
color: var(--vn-text-color);
|
color: var(--vn-text-color);
|
||||||
|
@ -149,11 +153,6 @@ select:-webkit-autofill {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vn-table-separation-row {
|
|
||||||
height: 16px !important;
|
|
||||||
background-color: var(--vn-section-color) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Estilo para el asterisco en campos requeridos */
|
/* Estilo para el asterisco en campos requeridos */
|
||||||
.q-field.required .q-field__label:after {
|
.q-field.required .q-field__label:after {
|
||||||
content: ' *';
|
content: ' *';
|
||||||
|
@ -276,8 +275,6 @@ input::-webkit-inner-spin-button {
|
||||||
font-size: 11pt;
|
font-size: 11pt;
|
||||||
}
|
}
|
||||||
td {
|
td {
|
||||||
font-size: 11pt;
|
|
||||||
border-top: 1px solid var(--vn-page-color);
|
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -321,9 +318,6 @@ input::-webkit-inner-spin-button {
|
||||||
max-width: fit-content;
|
max-width: fit-content;
|
||||||
}
|
}
|
||||||
|
|
||||||
.row > .column:has(.q-checkbox) {
|
|
||||||
max-width: fit-content;
|
|
||||||
}
|
|
||||||
.q-field__inner {
|
.q-field__inner {
|
||||||
.q-field__control {
|
.q-field__control {
|
||||||
min-height: auto !important;
|
min-height: auto !important;
|
||||||
|
|
|
@ -30,7 +30,9 @@ $color-spacer: #7979794d;
|
||||||
$border-thin-light: 1px solid $color-spacer-light;
|
$border-thin-light: 1px solid $color-spacer-light;
|
||||||
$primary-light: #f5b351;
|
$primary-light: #f5b351;
|
||||||
$dark-shadow-color: black;
|
$dark-shadow-color: black;
|
||||||
$layout-shadow-dark: 0 0 10px 2px #00000033, 0 0px 10px #0000003d;
|
$layout-shadow-dark:
|
||||||
|
0 0 10px 2px #00000033,
|
||||||
|
0 0px 10px #0000003d;
|
||||||
$spacing-md: 16px;
|
$spacing-md: 16px;
|
||||||
$color-font-secondary: #777;
|
$color-font-secondary: #777;
|
||||||
$width-xs: 400px;
|
$width-xs: 400px;
|
||||||
|
|
|
@ -33,6 +33,7 @@ globals:
|
||||||
reset: Reset
|
reset: Reset
|
||||||
close: Close
|
close: Close
|
||||||
cancel: Cancel
|
cancel: Cancel
|
||||||
|
isSaveAndContinue: Save and continue
|
||||||
clone: Clone
|
clone: Clone
|
||||||
confirm: Confirm
|
confirm: Confirm
|
||||||
assign: Assign
|
assign: Assign
|
||||||
|
@ -155,6 +156,7 @@ globals:
|
||||||
changeState: Change state
|
changeState: Change state
|
||||||
raid: 'Raid {daysInForward} days'
|
raid: 'Raid {daysInForward} days'
|
||||||
isVies: Vies
|
isVies: Vies
|
||||||
|
noData: No data available
|
||||||
pageTitles:
|
pageTitles:
|
||||||
logIn: Login
|
logIn: Login
|
||||||
addressEdit: Update address
|
addressEdit: Update address
|
||||||
|
@ -408,6 +410,106 @@ cau:
|
||||||
subtitle: By sending this ticket, all the data related to the error, the section, the user, etc., are already sent.
|
subtitle: By sending this ticket, all the data related to the error, the section, the user, etc., are already sent.
|
||||||
inputLabel: Explain why this error should not appear
|
inputLabel: Explain why this error should not appear
|
||||||
askPrivileges: Ask for privileges
|
askPrivileges: Ask for privileges
|
||||||
|
entry:
|
||||||
|
list:
|
||||||
|
newEntry: New entry
|
||||||
|
tableVisibleColumns:
|
||||||
|
isExcludedFromAvailable: Exclude from inventory
|
||||||
|
isOrdered: Ordered
|
||||||
|
isConfirmed: Ready to label
|
||||||
|
isReceived: Received
|
||||||
|
isRaid: Raid
|
||||||
|
landed: Date
|
||||||
|
supplierFk: Supplier
|
||||||
|
reference: Ref/Alb/Guide
|
||||||
|
invoiceNumber: Invoice
|
||||||
|
agencyModeId: Agency
|
||||||
|
isBooked: Booked
|
||||||
|
companyFk: Company
|
||||||
|
evaNotes: Notes
|
||||||
|
warehouseOutFk: Origin
|
||||||
|
warehouseInFk: Destiny
|
||||||
|
entryTypeDescription: Entry type
|
||||||
|
invoiceAmount: Import
|
||||||
|
travelFk: Travel
|
||||||
|
summary:
|
||||||
|
invoiceAmount: Amount
|
||||||
|
commission: Commission
|
||||||
|
currency: Currency
|
||||||
|
invoiceNumber: Invoice number
|
||||||
|
ordered: Ordered
|
||||||
|
booked: Booked
|
||||||
|
excludedFromAvailable: Inventory
|
||||||
|
travelReference: Reference
|
||||||
|
travelAgency: Agency
|
||||||
|
travelShipped: Shipped
|
||||||
|
travelDelivered: Delivered
|
||||||
|
travelLanded: Landed
|
||||||
|
travelReceived: Received
|
||||||
|
buys: Buys
|
||||||
|
stickers: Stickers
|
||||||
|
package: Package
|
||||||
|
packing: Pack.
|
||||||
|
grouping: Group.
|
||||||
|
buyingValue: Buying value
|
||||||
|
import: Import
|
||||||
|
pvp: PVP
|
||||||
|
basicData:
|
||||||
|
travel: Travel
|
||||||
|
currency: Currency
|
||||||
|
commission: Commission
|
||||||
|
observation: Observation
|
||||||
|
booked: Booked
|
||||||
|
excludedFromAvailable: Inventory
|
||||||
|
buys:
|
||||||
|
observations: Observations
|
||||||
|
packagingFk: Box
|
||||||
|
color: Color
|
||||||
|
printedStickers: Printed stickers
|
||||||
|
notes:
|
||||||
|
observationType: Observation type
|
||||||
|
latestBuys:
|
||||||
|
tableVisibleColumns:
|
||||||
|
image: Picture
|
||||||
|
itemFk: Item ID
|
||||||
|
weightByPiece: Weight/Piece
|
||||||
|
isActive: Active
|
||||||
|
family: Family
|
||||||
|
entryFk: Entry
|
||||||
|
freightValue: Freight value
|
||||||
|
comissionValue: Commission value
|
||||||
|
packageValue: Package value
|
||||||
|
isIgnored: Is ignored
|
||||||
|
price2: Grouping
|
||||||
|
price3: Packing
|
||||||
|
minPrice: Min
|
||||||
|
ektFk: Ekt
|
||||||
|
packingOut: Package out
|
||||||
|
landing: Landing
|
||||||
|
isExcludedFromAvailable: Exclude from inventory
|
||||||
|
isRaid: Raid
|
||||||
|
invoiceNumber: Invoice
|
||||||
|
reference: Ref/Alb/Guide
|
||||||
|
params:
|
||||||
|
isExcludedFromAvailable: Excluir del inventario
|
||||||
|
isOrdered: Pedida
|
||||||
|
isConfirmed: Lista para etiquetar
|
||||||
|
isReceived: Recibida
|
||||||
|
isRaid: Redada
|
||||||
|
landed: Fecha
|
||||||
|
supplierFk: Proveedor
|
||||||
|
invoiceNumber: Nº Factura
|
||||||
|
reference: Ref/Alb/Guía
|
||||||
|
agencyModeId: Agencia
|
||||||
|
isBooked: Asentado
|
||||||
|
companyFk: Empresa
|
||||||
|
travelFk: Envio
|
||||||
|
evaNotes: Notas
|
||||||
|
warehouseOutFk: Origen
|
||||||
|
warehouseInFk: Destino
|
||||||
|
entryTypeDescription: Tipo entrada
|
||||||
|
invoiceAmount: Importe
|
||||||
|
dated: Fecha
|
||||||
ticket:
|
ticket:
|
||||||
params:
|
params:
|
||||||
ticketFk: Ticket ID
|
ticketFk: Ticket ID
|
||||||
|
@ -728,6 +830,8 @@ travel:
|
||||||
CloneTravelAndEntries: Clone travel and his entries
|
CloneTravelAndEntries: Clone travel and his entries
|
||||||
deleteTravel: Delete travel
|
deleteTravel: Delete travel
|
||||||
AddEntry: Add entry
|
AddEntry: Add entry
|
||||||
|
availabled: Availabled
|
||||||
|
availabledHour: Availabled hour
|
||||||
thermographs: Thermographs
|
thermographs: Thermographs
|
||||||
hb: HB
|
hb: HB
|
||||||
basicData:
|
basicData:
|
||||||
|
|
|
@ -33,6 +33,7 @@ globals:
|
||||||
reset: Restaurar
|
reset: Restaurar
|
||||||
close: Cerrar
|
close: Cerrar
|
||||||
cancel: Cancelar
|
cancel: Cancelar
|
||||||
|
isSaveAndContinue: Guardar y continuar
|
||||||
clone: Clonar
|
clone: Clonar
|
||||||
confirm: Confirmar
|
confirm: Confirmar
|
||||||
assign: Asignar
|
assign: Asignar
|
||||||
|
@ -57,8 +58,8 @@ globals:
|
||||||
today: Hoy
|
today: Hoy
|
||||||
yesterday: Ayer
|
yesterday: Ayer
|
||||||
dateFormat: es-ES
|
dateFormat: es-ES
|
||||||
microsip: Abrir en MicroSIP
|
|
||||||
noSelectedRows: No tienes ninguna línea seleccionada
|
noSelectedRows: No tienes ninguna línea seleccionada
|
||||||
|
microsip: Abrir en MicroSIP
|
||||||
downloadCSVSuccess: Descarga de CSV exitosa
|
downloadCSVSuccess: Descarga de CSV exitosa
|
||||||
reference: Referencia
|
reference: Referencia
|
||||||
agency: Agencia
|
agency: Agencia
|
||||||
|
@ -159,6 +160,7 @@ globals:
|
||||||
changeState: Cambiar estado
|
changeState: Cambiar estado
|
||||||
raid: 'Redada {daysInForward} días'
|
raid: 'Redada {daysInForward} días'
|
||||||
isVies: Vies
|
isVies: Vies
|
||||||
|
noData: Datos no disponibles
|
||||||
pageTitles:
|
pageTitles:
|
||||||
logIn: Inicio de sesión
|
logIn: Inicio de sesión
|
||||||
addressEdit: Modificar consignatario
|
addressEdit: Modificar consignatario
|
||||||
|
@ -402,6 +404,87 @@ cau:
|
||||||
subtitle: Al enviar este cau ya se envían todos los datos relacionados con el error, la sección, el usuario, etc
|
subtitle: Al enviar este cau ya se envían todos los datos relacionados con el error, la sección, el usuario, etc
|
||||||
inputLabel: Explique el motivo por el que no deberia aparecer este fallo
|
inputLabel: Explique el motivo por el que no deberia aparecer este fallo
|
||||||
askPrivileges: Solicitar permisos
|
askPrivileges: Solicitar permisos
|
||||||
|
entry:
|
||||||
|
list:
|
||||||
|
newEntry: Nueva entrada
|
||||||
|
tableVisibleColumns:
|
||||||
|
isExcludedFromAvailable: Excluir del inventario
|
||||||
|
isOrdered: Pedida
|
||||||
|
isConfirmed: Lista para etiquetar
|
||||||
|
isReceived: Recibida
|
||||||
|
isRaid: Redada
|
||||||
|
landed: Fecha
|
||||||
|
supplierFk: Proveedor
|
||||||
|
invoiceNumber: Nº Factura
|
||||||
|
reference: Ref/Alb/Guía
|
||||||
|
agencyModeId: Agencia
|
||||||
|
isBooked: Asentado
|
||||||
|
companyFk: Empresa
|
||||||
|
travelFk: Envio
|
||||||
|
evaNotes: Notas
|
||||||
|
warehouseOutFk: Origen
|
||||||
|
warehouseInFk: Destino
|
||||||
|
entryTypeDescription: Tipo entrada
|
||||||
|
invoiceAmount: Importe
|
||||||
|
summary:
|
||||||
|
invoiceAmount: Importe
|
||||||
|
commission: Comisión
|
||||||
|
currency: Moneda
|
||||||
|
invoiceNumber: Núm. factura
|
||||||
|
ordered: Pedida
|
||||||
|
booked: Contabilizada
|
||||||
|
excludedFromAvailable: Inventario
|
||||||
|
travelReference: Referencia
|
||||||
|
travelAgency: Agencia
|
||||||
|
travelShipped: F. envio
|
||||||
|
travelWarehouseOut: Alm. salida
|
||||||
|
travelDelivered: Enviada
|
||||||
|
travelLanded: F. entrega
|
||||||
|
travelReceived: Recibida
|
||||||
|
buys: Compras
|
||||||
|
stickers: Etiquetas
|
||||||
|
package: Embalaje
|
||||||
|
packing: Pack.
|
||||||
|
grouping: Group.
|
||||||
|
buyingValue: Coste
|
||||||
|
import: Importe
|
||||||
|
pvp: PVP
|
||||||
|
basicData:
|
||||||
|
travel: Envío
|
||||||
|
currency: Moneda
|
||||||
|
observation: Observación
|
||||||
|
commission: Comisión
|
||||||
|
booked: Asentado
|
||||||
|
excludedFromAvailable: Inventario
|
||||||
|
buys:
|
||||||
|
observations: Observaciónes
|
||||||
|
packagingFk: Embalaje
|
||||||
|
color: Color
|
||||||
|
printedStickers: Etiquetas impresas
|
||||||
|
notes:
|
||||||
|
observationType: Tipo de observación
|
||||||
|
latestBuys:
|
||||||
|
tableVisibleColumns:
|
||||||
|
image: Foto
|
||||||
|
itemFk: Id Artículo
|
||||||
|
weightByPiece: Peso (gramos)/tallo
|
||||||
|
isActive: Activo
|
||||||
|
family: Familia
|
||||||
|
entryFk: Entrada
|
||||||
|
freightValue: Porte
|
||||||
|
comissionValue: Comisión
|
||||||
|
packageValue: Embalaje
|
||||||
|
isIgnored: Ignorado
|
||||||
|
price2: Grouping
|
||||||
|
price3: Packing
|
||||||
|
minPrice: Min
|
||||||
|
ektFk: Ekt
|
||||||
|
packingOut: Embalaje envíos
|
||||||
|
landing: Llegada
|
||||||
|
isExcludedFromAvailable: Excluir del inventario
|
||||||
|
isRaid: Redada
|
||||||
|
invoiceNumber: Nº Factura
|
||||||
|
reference: Ref/Alb/Guía
|
||||||
ticket:
|
ticket:
|
||||||
params:
|
params:
|
||||||
ticketFk: ID de ticket
|
ticketFk: ID de ticket
|
||||||
|
@ -493,15 +576,11 @@ ticket:
|
||||||
consigneeStreet: Dirección
|
consigneeStreet: Dirección
|
||||||
create:
|
create:
|
||||||
address: Dirección
|
address: Dirección
|
||||||
order:
|
invoiceOut:
|
||||||
field:
|
card:
|
||||||
salesPersonFk: Comercial
|
issued: Fecha emisión
|
||||||
form:
|
customerCard: Ficha del cliente
|
||||||
clientFk: Cliente
|
ticketList: Listado de tickets
|
||||||
addressFk: Dirección
|
|
||||||
agencyModeFk: Agencia
|
|
||||||
list:
|
|
||||||
newOrder: Nuevo Pedido
|
|
||||||
summary:
|
summary:
|
||||||
issued: Fecha
|
issued: Fecha
|
||||||
dued: Fecha límite
|
dued: Fecha límite
|
||||||
|
@ -512,6 +591,71 @@ order:
|
||||||
fee: Cuota
|
fee: Cuota
|
||||||
tickets: Tickets
|
tickets: Tickets
|
||||||
totalWithVat: Importe
|
totalWithVat: Importe
|
||||||
|
globalInvoices:
|
||||||
|
errors:
|
||||||
|
chooseValidClient: Selecciona un cliente válido
|
||||||
|
chooseValidCompany: Selecciona una empresa válida
|
||||||
|
chooseValidPrinter: Selecciona una impresora válida
|
||||||
|
chooseValidSerialType: Selecciona una tipo de serie válida
|
||||||
|
fillDates: La fecha de la factura y la fecha máxima deben estar completas
|
||||||
|
invoiceDateLessThanMaxDate: La fecha de la factura no puede ser menor que la fecha máxima
|
||||||
|
invoiceWithFutureDate: Existe una factura con una fecha futura
|
||||||
|
noTicketsToInvoice: No existen tickets para facturar
|
||||||
|
criticalInvoiceError: Error crítico en la facturación proceso detenido
|
||||||
|
invalidSerialTypeForAll: El tipo de serie debe ser global cuando se facturan todos los clientes
|
||||||
|
table:
|
||||||
|
addressId: Id dirección
|
||||||
|
streetAddress: Dirección fiscal
|
||||||
|
statusCard:
|
||||||
|
percentageText: '{getPercentage}% {getAddressNumber} de {getNAddresses}'
|
||||||
|
pdfsNumberText: '{nPdfs} de {totalPdfs} PDFs'
|
||||||
|
negativeBases:
|
||||||
|
clientId: Id cliente
|
||||||
|
base: Base
|
||||||
|
active: Activo
|
||||||
|
hasToInvoice: Facturar
|
||||||
|
verifiedData: Datos comprobados
|
||||||
|
comercial: Comercial
|
||||||
|
errors:
|
||||||
|
downloadCsvFailed: Error al descargar CSV
|
||||||
|
order:
|
||||||
|
field:
|
||||||
|
salesPersonFk: Comercial
|
||||||
|
form:
|
||||||
|
clientFk: Cliente
|
||||||
|
addressFk: Dirección
|
||||||
|
agencyModeFk: Agencia
|
||||||
|
list:
|
||||||
|
newOrder: Nuevo Pedido
|
||||||
|
summary:
|
||||||
|
basket: Cesta
|
||||||
|
notConfirmed: No confirmada
|
||||||
|
created: Creado
|
||||||
|
createdFrom: Creado desde
|
||||||
|
address: Dirección
|
||||||
|
total: Total
|
||||||
|
vat: IVA
|
||||||
|
state: Estado
|
||||||
|
alias: Alias
|
||||||
|
items: Artículos
|
||||||
|
orderTicketList: Tickets del pedido
|
||||||
|
amount: Monto
|
||||||
|
confirm: Confirmar
|
||||||
|
confirmLines: Confirmar lineas
|
||||||
|
shelving:
|
||||||
|
list:
|
||||||
|
parking: Parking
|
||||||
|
priority: Prioridad
|
||||||
|
newShelving: Nuevo Carro
|
||||||
|
summary:
|
||||||
|
recyclable: Reciclable
|
||||||
|
parking:
|
||||||
|
pickingOrder: Orden de recogida
|
||||||
|
row: Fila
|
||||||
|
column: Columna
|
||||||
|
searchBar:
|
||||||
|
info: Puedes buscar por código de parking
|
||||||
|
label: Buscar parking...
|
||||||
department:
|
department:
|
||||||
chat: Chat
|
chat: Chat
|
||||||
bossDepartment: Jefe de departamento
|
bossDepartment: Jefe de departamento
|
||||||
|
@ -695,6 +839,7 @@ supplier:
|
||||||
verified: Verificado
|
verified: Verificado
|
||||||
isActive: Está activo
|
isActive: Está activo
|
||||||
billingData: Forma de pago
|
billingData: Forma de pago
|
||||||
|
financialData: Datos financieros
|
||||||
payDeadline: Plazo de pago
|
payDeadline: Plazo de pago
|
||||||
payDay: Día de pago
|
payDay: Día de pago
|
||||||
account: Cuenta
|
account: Cuenta
|
||||||
|
@ -772,6 +917,8 @@ travel:
|
||||||
deleteTravel: Eliminar envío
|
deleteTravel: Eliminar envío
|
||||||
AddEntry: Añadir entrada
|
AddEntry: Añadir entrada
|
||||||
thermographs: Termógrafos
|
thermographs: Termógrafos
|
||||||
|
availabled: F. Disponible
|
||||||
|
availabledHour: Hora Disponible
|
||||||
hb: HB
|
hb: HB
|
||||||
basicData:
|
basicData:
|
||||||
daysInForward: Desplazamiento automatico (redada)
|
daysInForward: Desplazamiento automatico (redada)
|
||||||
|
|
|
@ -51,7 +51,6 @@ const removeAlias = () => {
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
ref="descriptor"
|
ref="descriptor"
|
||||||
:url="`MailAliases/${entityId}`"
|
:url="`MailAliases/${entityId}`"
|
||||||
module="Alias"
|
|
||||||
data-key="Alias"
|
data-key="Alias"
|
||||||
title="alias"
|
title="alias"
|
||||||
>
|
>
|
||||||
|
|
|
@ -24,7 +24,6 @@ onMounted(async () => {
|
||||||
ref="descriptor"
|
ref="descriptor"
|
||||||
:url="`VnUsers/preview`"
|
:url="`VnUsers/preview`"
|
||||||
:filter="{ ...filter, where: { id: entityId } }"
|
:filter="{ ...filter, where: { id: entityId } }"
|
||||||
module="Account"
|
|
||||||
data-key="Account"
|
data-key="Account"
|
||||||
title="nickname"
|
title="nickname"
|
||||||
>
|
>
|
||||||
|
|
|
@ -35,6 +35,12 @@ account.value.hasAccount = hasAccount.value;
|
||||||
const entityId = computed(() => +route.params.id);
|
const entityId = computed(() => +route.params.id);
|
||||||
const hasitManagementAccess = ref();
|
const hasitManagementAccess = ref();
|
||||||
const hasSysadminAccess = ref();
|
const hasSysadminAccess = ref();
|
||||||
|
const isHimself = computed(() => user.value.id === account.value.id);
|
||||||
|
const url = computed(() =>
|
||||||
|
isHimself.value
|
||||||
|
? 'Accounts/change-password'
|
||||||
|
: `Accounts/${entityId.value}/setPassword`
|
||||||
|
);
|
||||||
|
|
||||||
async function updateStatusAccount(active) {
|
async function updateStatusAccount(active) {
|
||||||
if (active) {
|
if (active) {
|
||||||
|
@ -107,11 +113,8 @@ onMounted(() => {
|
||||||
:ask-old-pass="askOldPass"
|
:ask-old-pass="askOldPass"
|
||||||
:submit-fn="
|
:submit-fn="
|
||||||
async (newPassword, oldPassword) => {
|
async (newPassword, oldPassword) => {
|
||||||
await axios.patch(`Accounts/change-password`, {
|
const body = isHimself ? { userId: entityId, oldPassword } : {};
|
||||||
userId: entityId,
|
await axios.patch(url, { ...body, newPassword });
|
||||||
newPassword,
|
|
||||||
oldPassword,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
|
@ -155,16 +158,10 @@ onMounted(() => {
|
||||||
>
|
>
|
||||||
<QItemSection>{{ t('globals.delete') }}</QItemSection>
|
<QItemSection>{{ t('globals.delete') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem
|
<QItem v-if="hasSysadminAccess || isHimself" v-ripple clickable>
|
||||||
v-if="hasSysadminAccess"
|
<QItemSection @click="onChangePass(isHimself)">
|
||||||
v-ripple
|
{{ isHimself ? t('globals.changePass') : t('globals.setPass') }}
|
||||||
clickable
|
|
||||||
@click="user.id === account.id ? onChangePass(true) : onChangePass(false)"
|
|
||||||
>
|
|
||||||
<QItemSection v-if="user.id === account.id">
|
|
||||||
{{ t('globals.changePass') }}
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QItemSection v-else>{{ t('globals.setPass') }}</QItemSection>
|
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem
|
<QItem
|
||||||
v-if="!account.hasAccount && hasSysadminAccess"
|
v-if="!account.hasAccount && hasSysadminAccess"
|
||||||
|
|
|
@ -35,7 +35,6 @@ const removeRole = async () => {
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
url="VnRoles"
|
url="VnRoles"
|
||||||
:filter="{ where: { id: entityId } }"
|
:filter="{ where: { id: entityId } }"
|
||||||
module="Role"
|
|
||||||
data-key="Role"
|
data-key="Role"
|
||||||
:summary="$props.summary"
|
:summary="$props.summary"
|
||||||
>
|
>
|
||||||
|
|
|
@ -46,7 +46,6 @@ onMounted(async () => {
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
:url="`Claims/${entityId}`"
|
:url="`Claims/${entityId}`"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
module="Claim"
|
|
||||||
title="client.name"
|
title="client.name"
|
||||||
data-key="Claim"
|
data-key="Claim"
|
||||||
>
|
>
|
||||||
|
|
|
@ -190,7 +190,7 @@ async function saveWhenHasChanges() {
|
||||||
ref="claimLinesForm"
|
ref="claimLinesForm"
|
||||||
:url="`Claims/${route.params.id}/lines`"
|
:url="`Claims/${route.params.id}/lines`"
|
||||||
save-url="ClaimBeginnings/crud"
|
save-url="ClaimBeginnings/crud"
|
||||||
:filter="linesFilter"
|
:user-filter="linesFilter"
|
||||||
@on-fetch="onFetch"
|
@on-fetch="onFetch"
|
||||||
v-model:selected="selected"
|
v-model:selected="selected"
|
||||||
:default-save="false"
|
:default-save="false"
|
||||||
|
|
|
@ -156,7 +156,6 @@ function onDrag() {
|
||||||
url="Claims"
|
url="Claims"
|
||||||
:filter="claimDmsFilter"
|
:filter="claimDmsFilter"
|
||||||
@on-fetch="([data]) => setClaimDms(data)"
|
@on-fetch="([data]) => setClaimDms(data)"
|
||||||
limit="20"
|
|
||||||
auto-load
|
auto-load
|
||||||
ref="claimDmsRef"
|
ref="claimDmsRef"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
|
||||||
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||||
import VnSelect from 'components/common/VnSelect.vue';
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
@ -14,15 +12,14 @@ const props = defineProps({
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
states: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const states = ref([]);
|
|
||||||
|
|
||||||
defineExpose({ states });
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData url="ClaimStates" @on-fetch="(data) => (states = data)" auto-load />
|
|
||||||
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
||||||
<template #tags="{ tag, formatFn }">
|
<template #tags="{ tag, formatFn }">
|
||||||
<div class="q-gutter-x-xs">
|
<div class="q-gutter-x-xs">
|
||||||
|
|
|
@ -10,12 +10,13 @@ import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
import ZoneDescriptorProxy from '../Zone/Card/ZoneDescriptorProxy.vue';
|
import ZoneDescriptorProxy from '../Zone/Card/ZoneDescriptorProxy.vue';
|
||||||
import VnSection from 'src/components/common/VnSection.vue';
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
const dataKey = 'ClaimList';
|
const dataKey = 'ClaimList';
|
||||||
|
|
||||||
const claimFilterRef = ref();
|
const states = ref([]);
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -81,8 +82,7 @@ const columns = computed(() => [
|
||||||
align: 'left',
|
align: 'left',
|
||||||
label: t('claim.state'),
|
label: t('claim.state'),
|
||||||
format: ({ stateCode }) =>
|
format: ({ stateCode }) =>
|
||||||
claimFilterRef.value?.states.find(({ code }) => code === stateCode)
|
states.value?.find(({ code }) => code === stateCode)?.description,
|
||||||
?.description,
|
|
||||||
name: 'stateCode',
|
name: 'stateCode',
|
||||||
chip: {
|
chip: {
|
||||||
condition: () => true,
|
condition: () => true,
|
||||||
|
@ -92,7 +92,7 @@ const columns = computed(() => [
|
||||||
name: 'claimStateFk',
|
name: 'claimStateFk',
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
options: claimFilterRef.value?.states,
|
options: states.value,
|
||||||
optionLabel: 'description',
|
optionLabel: 'description',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -125,6 +125,7 @@ const STATE_COLOR = {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<FetchData url="ClaimStates" @on-fetch="(data) => (states = data)" auto-load />
|
||||||
<VnSection
|
<VnSection
|
||||||
:data-key="dataKey"
|
:data-key="dataKey"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
|
@ -135,7 +136,7 @@ const STATE_COLOR = {
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<template #advanced-menu>
|
<template #advanced-menu>
|
||||||
<ClaimFilter data-key="ClaimList" ref="claimFilterRef" />
|
<ClaimFilter :data-key ref="claimFilterRef" :states />
|
||||||
</template>
|
</template>
|
||||||
<template #body>
|
<template #body>
|
||||||
<VnTable
|
<VnTable
|
||||||
|
|
|
@ -17,8 +17,7 @@ const bankEntitiesRef = ref(null);
|
||||||
|
|
||||||
const filter = {
|
const filter = {
|
||||||
fields: ['id', 'bic', 'name'],
|
fields: ['id', 'bic', 'name'],
|
||||||
order: 'bic ASC',
|
order: 'bic ASC'
|
||||||
limit: 30,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const getBankEntities = (data, formData) => {
|
const getBankEntities = (data, formData) => {
|
||||||
|
|
|
@ -218,7 +218,7 @@ const updateDateParams = (value, params) => {
|
||||||
<div v-if="row.subName" class="subName">
|
<div v-if="row.subName" class="subName">
|
||||||
{{ row.subName }}
|
{{ row.subName }}
|
||||||
</div>
|
</div>
|
||||||
<FetchedTags :item="row" :max-length="3" />
|
<FetchedTags :item="row" />
|
||||||
</template>
|
</template>
|
||||||
<template #moreFilterPanel="{ params }">
|
<template #moreFilterPanel="{ params }">
|
||||||
<div class="column no-wrap flex-center q-gutter-y-md q-mt-xs q-pr-xl">
|
<div class="column no-wrap flex-center q-gutter-y-md q-mt-xs q-pr-xl">
|
||||||
|
@ -232,7 +232,6 @@ const updateDateParams = (value, params) => {
|
||||||
:include="'category'"
|
:include="'category'"
|
||||||
:sortBy="'name ASC'"
|
:sortBy="'name ASC'"
|
||||||
dense
|
dense
|
||||||
@update:model-value="(data) => updateDateParams(data, params)"
|
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
<QItem v-bind="scope.itemProps">
|
<QItem v-bind="scope.itemProps">
|
||||||
|
@ -254,7 +253,6 @@ const updateDateParams = (value, params) => {
|
||||||
:fields="['id', 'name']"
|
:fields="['id', 'name']"
|
||||||
:sortBy="'name ASC'"
|
:sortBy="'name ASC'"
|
||||||
dense
|
dense
|
||||||
@update:model-value="(data) => updateDateParams(data, params)"
|
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
v-model="params.campaign"
|
v-model="params.campaign"
|
||||||
|
@ -303,12 +301,14 @@ en:
|
||||||
valentinesDay: Valentine's Day
|
valentinesDay: Valentine's Day
|
||||||
mothersDay: Mother's Day
|
mothersDay: Mother's Day
|
||||||
allSaints: All Saints' Day
|
allSaints: All Saints' Day
|
||||||
|
frenchMothersDay: Mother's Day in France
|
||||||
es:
|
es:
|
||||||
Enter a new search: Introduce una nueva búsqueda
|
Enter a new search: Introduce una nueva búsqueda
|
||||||
Group by items: Agrupar por artículos
|
Group by items: Agrupar por artículos
|
||||||
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
|
||||||
|
frenchMothersDay: (Francia) Día de la Madre
|
||||||
Campaign consumption: Consumo campaña
|
Campaign consumption: Consumo campaña
|
||||||
Campaign: Campaña
|
Campaign: Campaña
|
||||||
From: Desde
|
From: Desde
|
||||||
|
|
|
@ -55,7 +55,6 @@ const debtWarning = computed(() => {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
module="Customer"
|
|
||||||
:url="`Clients/${entityId}/getCard`"
|
:url="`Clients/${entityId}/getCard`"
|
||||||
:summary="$props.summary"
|
:summary="$props.summary"
|
||||||
data-key="Customer"
|
data-key="Customer"
|
||||||
|
|
|
@ -2,7 +2,10 @@
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
import { useQuasar } from 'quasar';
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import FormModel from 'components/FormModel.vue';
|
import FormModel from 'components/FormModel.vue';
|
||||||
import VnRow from 'components/ui/VnRow.vue';
|
import VnRow from 'components/ui/VnRow.vue';
|
||||||
|
@ -10,9 +13,13 @@ import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import VnLocation from 'src/components/common/VnLocation.vue';
|
import VnLocation from 'src/components/common/VnLocation.vue';
|
||||||
import VnCheckbox from 'src/components/common/VnCheckbox.vue';
|
import VnCheckbox from 'src/components/common/VnCheckbox.vue';
|
||||||
|
import { getDifferences, getUpdatedValues } from 'src/filters';
|
||||||
|
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
||||||
|
|
||||||
|
const quasar = useQuasar();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
const { notify } = useNotify();
|
||||||
|
|
||||||
const typesTaxes = ref([]);
|
const typesTaxes = ref([]);
|
||||||
const typesTransactions = ref([]);
|
const typesTransactions = ref([]);
|
||||||
|
@ -24,6 +31,37 @@ function handleLocation(data, location) {
|
||||||
data.provinceFk = provinceFk;
|
data.provinceFk = provinceFk;
|
||||||
data.countryFk = countryFk;
|
data.countryFk = countryFk;
|
||||||
}
|
}
|
||||||
|
function onBeforeSave(formData, originalData) {
|
||||||
|
return getUpdatedValues(
|
||||||
|
Object.keys(getDifferences(formData, originalData)),
|
||||||
|
formData,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function checkEtChanges(data, _, originalData) {
|
||||||
|
const equalizatedHasChanged = originalData.isEqualizated != data.isEqualizated;
|
||||||
|
const hasToInvoiceByAddress =
|
||||||
|
originalData.hasToInvoiceByAddress || data.hasToInvoiceByAddress;
|
||||||
|
if (equalizatedHasChanged && hasToInvoiceByAddress) {
|
||||||
|
quasar.dialog({
|
||||||
|
component: VnConfirm,
|
||||||
|
componentProps: {
|
||||||
|
title: t('You changed the equalization tax'),
|
||||||
|
message: t('Do you want to spread the change?'),
|
||||||
|
promise: () => acceptPropagate(data),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else if (equalizatedHasChanged) {
|
||||||
|
await acceptPropagate(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function acceptPropagate({ isEqualizated }) {
|
||||||
|
await axios.patch(`Clients/${route.params.id}/addressesPropagateRe`, {
|
||||||
|
isEqualizated,
|
||||||
|
});
|
||||||
|
notify(t('Equivalent tax spreaded'), 'warning');
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -37,6 +75,9 @@ function handleLocation(data, location) {
|
||||||
:url-update="`Clients/${route.params.id}/updateFiscalData`"
|
:url-update="`Clients/${route.params.id}/updateFiscalData`"
|
||||||
auto-load
|
auto-load
|
||||||
model="Customer"
|
model="Customer"
|
||||||
|
:mapper="onBeforeSave"
|
||||||
|
observe-form-changes
|
||||||
|
@on-data-saved="checkEtChanges"
|
||||||
>
|
>
|
||||||
<template #form="{ data, validate }">
|
<template #form="{ data, validate }">
|
||||||
<VnRow>
|
<VnRow>
|
||||||
|
@ -172,6 +213,9 @@ es:
|
||||||
whenActivatingIt: Al activarlo, no informar el código del país en el campo nif
|
whenActivatingIt: Al activarlo, no informar el código del país en el campo nif
|
||||||
inOrderToInvoice: Para facturar no se consulta este campo, sino el RE de consignatario. Al modificar este campo si no esta marcada la casilla Facturar por consignatario, se propagará automaticamente el cambio a todos lo consignatarios, en caso contrario preguntará al usuario si quiere o no propagar
|
inOrderToInvoice: Para facturar no se consulta este campo, sino el RE de consignatario. Al modificar este campo si no esta marcada la casilla Facturar por consignatario, se propagará automaticamente el cambio a todos lo consignatarios, en caso contrario preguntará al usuario si quiere o no propagar
|
||||||
Daily invoice: Facturación diaria
|
Daily invoice: Facturación diaria
|
||||||
|
Equivalent tax spreaded: Recargo de equivalencia propagado
|
||||||
|
You changed the equalization tax: Has cambiado el recargo de equivalencia
|
||||||
|
Do you want to spread the change?: ¿Deseas propagar el cambio a sus consignatarios?
|
||||||
en:
|
en:
|
||||||
onlyLetters: Only letters, numbers and spaces can be used
|
onlyLetters: Only letters, numbers and spaces can be used
|
||||||
whenActivatingIt: When activating it, do not enter the country code in the ID field
|
whenActivatingIt: When activating it, do not enter the country code in the ID field
|
||||||
|
|
|
@ -270,7 +270,7 @@ const sumRisk = ({ clientRisks }) => {
|
||||||
<VnTitle
|
<VnTitle
|
||||||
target="_blank"
|
target="_blank"
|
||||||
:url="`${grafanaUrl}/d/40buzE4Vk/comportamiento-pagos-clientes?orgId=1&var-clientFk=${entityId}`"
|
:url="`${grafanaUrl}/d/40buzE4Vk/comportamiento-pagos-clientes?orgId=1&var-clientFk=${entityId}`"
|
||||||
:text="t('customer.summary.payMethodFk')"
|
:text="t('customer.summary.financialData')"
|
||||||
icon="vn:grafana"
|
icon="vn:grafana"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
|
|
|
@ -264,6 +264,7 @@ const columns = computed(() => [
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'isActive',
|
name: 'isActive',
|
||||||
label: t('customer.summary.isActive'),
|
label: t('customer.summary.isActive'),
|
||||||
|
component: 'checkbox',
|
||||||
chip: {
|
chip: {
|
||||||
color: null,
|
color: null,
|
||||||
condition: (value) => !value,
|
condition: (value) => !value,
|
||||||
|
@ -302,6 +303,7 @@ const columns = computed(() => [
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'isFreezed',
|
name: 'isFreezed',
|
||||||
label: t('customer.extendedList.tableVisibleColumns.isFreezed'),
|
label: t('customer.extendedList.tableVisibleColumns.isFreezed'),
|
||||||
|
component: 'checkbox',
|
||||||
chip: {
|
chip: {
|
||||||
color: null,
|
color: null,
|
||||||
condition: (value) => value,
|
condition: (value) => value,
|
||||||
|
|
|
@ -9,7 +9,7 @@ import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.v
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import CustomerDefaulterAddObservation from './CustomerDefaulterAddObservation.vue';
|
import CustomerDefaulterAddObservation from './CustomerDefaulterAddObservation.vue';
|
||||||
import DepartmentDescriptorProxy from 'src/pages/Department/Card/DepartmentDescriptorProxy.vue';
|
import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/DepartmentDescriptorProxy.vue';
|
||||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ onMounted(async () => {
|
||||||
<FetchData
|
<FetchData
|
||||||
url="Campaigns/latest"
|
url="Campaigns/latest"
|
||||||
@on-fetch="(data) => (campaignsOptions = data)"
|
@on-fetch="(data) => (campaignsOptions = data)"
|
||||||
:filter="{ fields: ['id', 'code', 'dated'], order: 'code ASC', limit: 30 }"
|
:filter="{ fields: ['id', 'code', 'dated'], order: 'code ASC' }"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
|
|
@ -98,7 +98,6 @@ function onAgentCreated({ id, fiscalName }, data) {
|
||||||
:rules="validate('Worker.postcode')"
|
:rules="validate('Worker.postcode')"
|
||||||
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
|
||||||
v-model="data.location"
|
v-model="data.location"
|
||||||
:required="true"
|
|
||||||
@update:model-value="(location) => handleLocation(data, location)"
|
@update:model-value="(location) => handleLocation(data, location)"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
|
@ -96,11 +96,11 @@ const updateObservations = async (payload) => {
|
||||||
await axios.post('AddressObservations/crud', payload);
|
await axios.post('AddressObservations/crud', payload);
|
||||||
notes.value = [];
|
notes.value = [];
|
||||||
deletes.value = [];
|
deletes.value = [];
|
||||||
toCustomerAddress();
|
|
||||||
};
|
};
|
||||||
async function updateAll({ data, payload }) {
|
async function updateAll({ data, payload }) {
|
||||||
await updateObservations(payload);
|
await updateObservations(payload);
|
||||||
await updateAddress(data);
|
await updateAddress(data);
|
||||||
|
toCustomerAddress();
|
||||||
}
|
}
|
||||||
function getPayload() {
|
function getPayload() {
|
||||||
return {
|
return {
|
||||||
|
@ -137,15 +137,12 @@ async function handleDialog(data) {
|
||||||
.onOk(async () => {
|
.onOk(async () => {
|
||||||
await updateAddressTicket();
|
await updateAddressTicket();
|
||||||
await updateAll(body);
|
await updateAll(body);
|
||||||
toCustomerAddress();
|
|
||||||
})
|
})
|
||||||
.onCancel(async () => {
|
.onCancel(async () => {
|
||||||
await updateAll(body);
|
await updateAll(body);
|
||||||
toCustomerAddress();
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
updateAll(body);
|
await updateAll(body);
|
||||||
toCustomerAddress();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ function setPaymentType(accounting) {
|
||||||
viewReceipt.value = isCash.value;
|
viewReceipt.value = isCash.value;
|
||||||
if (accountingType.value.daysInFuture)
|
if (accountingType.value.daysInFuture)
|
||||||
initialData.payed.setDate(
|
initialData.payed.setDate(
|
||||||
initialData.payed.getDate() + accountingType.value.daysInFuture
|
initialData.payed.getDate() + accountingType.value.daysInFuture,
|
||||||
);
|
);
|
||||||
maxAmount.value = accountingType.value && accountingType.value.maxAmount;
|
maxAmount.value = accountingType.value && accountingType.value.maxAmount;
|
||||||
|
|
||||||
|
|
|
@ -1,30 +1,32 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRole } from 'src/composables/useRole';
|
import { useRole } from 'src/composables/useRole';
|
||||||
|
import { useState } from 'src/composables/useState';
|
||||||
|
import { checkEntryLock } from 'src/composables/checkEntryLock';
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import FormModel from 'components/FormModel.vue';
|
import FormModel from 'components/FormModel.vue';
|
||||||
import VnRow from 'components/ui/VnRow.vue';
|
import VnRow from 'components/ui/VnRow.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
|
|
||||||
import FilterTravelForm from 'src/components/FilterTravelForm.vue';
|
|
||||||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||||
import { toDate } from 'src/filters';
|
import VnSelectTravelExtended from 'src/components/common/VnSelectTravelExtended.vue';
|
||||||
import VnSelectSupplier from 'src/components/common/VnSelectSupplier.vue';
|
import VnSelectSupplier from 'src/components/common/VnSelectSupplier.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { hasAny } = useRole();
|
const { hasAny } = useRole();
|
||||||
const isAdministrative = () => hasAny(['administrative']);
|
const isAdministrative = () => hasAny(['administrative']);
|
||||||
|
const state = useState();
|
||||||
|
const user = state.getUser().fn();
|
||||||
|
|
||||||
const companiesOptions = ref([]);
|
const companiesOptions = ref([]);
|
||||||
const currenciesOptions = ref([]);
|
const currenciesOptions = ref([]);
|
||||||
|
|
||||||
const onFilterTravelSelected = (formData, id) => {
|
onMounted(() => {
|
||||||
formData.travelFk = id;
|
checkEntryLock(route.params.id, user.id);
|
||||||
};
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -52,46 +54,24 @@ const onFilterTravelSelected = (formData, id) => {
|
||||||
>
|
>
|
||||||
<template #form="{ data }">
|
<template #form="{ data }">
|
||||||
<VnRow>
|
<VnRow>
|
||||||
|
<VnSelectTravelExtended
|
||||||
|
:data="data"
|
||||||
|
v-model="data.travelFk"
|
||||||
|
:onFilterTravelSelected="(data, result) => (data.travelFk = result)"
|
||||||
|
/>
|
||||||
<VnSelectSupplier
|
<VnSelectSupplier
|
||||||
v-model="data.supplierFk"
|
v-model="data.supplierFk"
|
||||||
hide-selected
|
hide-selected
|
||||||
:required="true"
|
:required="true"
|
||||||
map-options
|
|
||||||
/>
|
/>
|
||||||
<VnSelectDialog
|
|
||||||
:label="t('entry.basicData.travel')"
|
|
||||||
v-model="data.travelFk"
|
|
||||||
url="Travels/filter"
|
|
||||||
:fields="['id', 'warehouseInName']"
|
|
||||||
option-value="id"
|
|
||||||
option-label="warehouseInName"
|
|
||||||
map-options
|
|
||||||
hide-selected
|
|
||||||
:required="true"
|
|
||||||
action-icon="filter_alt"
|
|
||||||
>
|
|
||||||
<template #form>
|
|
||||||
<FilterTravelForm
|
|
||||||
@travel-selected="onFilterTravelSelected(data, $event)"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<template #option="scope">
|
|
||||||
<QItem v-bind="scope.itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>
|
|
||||||
{{ scope.opt?.agencyModeName }} -
|
|
||||||
{{ scope.opt?.warehouseInName }}
|
|
||||||
({{ toDate(scope.opt?.shipped) }}) →
|
|
||||||
{{ scope.opt?.warehouseOutName }}
|
|
||||||
({{ toDate(scope.opt?.landed) }})
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelectDialog>
|
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnInput v-model="data.reference" :label="t('globals.reference')" />
|
<VnInput v-model="data.reference" :label="t('globals.reference')" />
|
||||||
|
<VnInputNumber
|
||||||
|
v-model="data.invoiceAmount"
|
||||||
|
:label="t('entry.summary.invoiceAmount')"
|
||||||
|
:positive="false"
|
||||||
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
|
@ -113,8 +93,7 @@ const onFilterTravelSelected = (formData, id) => {
|
||||||
<VnInputNumber
|
<VnInputNumber
|
||||||
:label="t('entry.summary.commission')"
|
:label="t('entry.summary.commission')"
|
||||||
v-model="data.commission"
|
v-model="data.commission"
|
||||||
step="1"
|
:step="1"
|
||||||
autofocus
|
|
||||||
:positive="false"
|
:positive="false"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
@ -161,7 +140,7 @@ const onFilterTravelSelected = (formData, id) => {
|
||||||
:label="t('entry.summary.excludedFromAvailable')"
|
:label="t('entry.summary.excludedFromAvailable')"
|
||||||
/>
|
/>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
v-if="isAdministrative()"
|
:disable="!isAdministrative()"
|
||||||
v-model="data.isBooked"
|
v-model="data.isBooked"
|
||||||
:label="t('entry.basicData.booked')"
|
:label="t('entry.basicData.booked')"
|
||||||
/>
|
/>
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,12 +1,19 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onMounted } from 'vue';
|
import { ref, computed, onMounted } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
|
||||||
import { toDate } from 'src/filters';
|
import { toDate } from 'src/filters';
|
||||||
import { getUrl } from 'src/composables/getUrl';
|
import { getUrl } from 'src/composables/getUrl';
|
||||||
import EntryDescriptorMenu from './EntryDescriptorMenu.vue';
|
import { useQuasar } from 'quasar';
|
||||||
|
import { usePrintService } from 'composables/usePrintService';
|
||||||
|
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
||||||
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
|
import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.vue';
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
const quasar = useQuasar();
|
||||||
|
const { push } = useRouter();
|
||||||
|
const { openReport } = usePrintService();
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
@ -83,12 +90,63 @@ const getEntryRedirectionFilter = (entry) => {
|
||||||
to,
|
to,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function showEntryReport() {
|
||||||
|
openReport(`Entries/${entityId.value}/entry-order-pdf`);
|
||||||
|
}
|
||||||
|
|
||||||
|
function showNotification(type, message) {
|
||||||
|
quasar.notify({
|
||||||
|
type: type,
|
||||||
|
message: t(message),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function recalculateRates(entity) {
|
||||||
|
try {
|
||||||
|
const entryConfig = await axios.get('EntryConfigs/findOne');
|
||||||
|
if (entryConfig.data?.inventorySupplierFk === entity.supplierFk) {
|
||||||
|
showNotification(
|
||||||
|
'negative',
|
||||||
|
'Cannot recalculate prices because this is an inventory entry',
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await axios.post(`Entries/${entityId.value}/recalcEntryPrices`);
|
||||||
|
showNotification('positive', 'Entry prices recalculated');
|
||||||
|
} catch (error) {
|
||||||
|
showNotification('negative', 'Failed to recalculate rates');
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function cloneEntry() {
|
||||||
|
try {
|
||||||
|
const response = await axios.post(`Entries/${entityId.value}/cloneEntry`);
|
||||||
|
push({ path: `/entry/${response.data}` });
|
||||||
|
showNotification('positive', 'Entry cloned');
|
||||||
|
} catch (error) {
|
||||||
|
showNotification('negative', 'Failed to clone entry');
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function deleteEntry() {
|
||||||
|
try {
|
||||||
|
await axios.post(`Entries/${entityId.value}/deleteEntry`);
|
||||||
|
push({ path: `/entry/list` });
|
||||||
|
showNotification('positive', 'Entry deleted');
|
||||||
|
} catch (error) {
|
||||||
|
showNotification('negative', 'Failed to delete entry');
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
ref="entryDescriptorRef"
|
ref="entryDescriptorRef"
|
||||||
module="Entry"
|
|
||||||
:url="`Entries/${entityId}`"
|
:url="`Entries/${entityId}`"
|
||||||
:userFilter="entryFilter"
|
:userFilter="entryFilter"
|
||||||
title="supplier.nickname"
|
title="supplier.nickname"
|
||||||
|
@ -96,15 +154,56 @@ const getEntryRedirectionFilter = (entry) => {
|
||||||
width="lg-width"
|
width="lg-width"
|
||||||
>
|
>
|
||||||
<template #menu="{ entity }">
|
<template #menu="{ entity }">
|
||||||
<EntryDescriptorMenu :id="entity.id" />
|
<QItem
|
||||||
|
v-ripple
|
||||||
|
clickable
|
||||||
|
@click="showEntryReport(entity)"
|
||||||
|
data-cy="show-entry-report"
|
||||||
|
>
|
||||||
|
<QItemSection>{{ t('Show entry report') }}</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem
|
||||||
|
v-ripple
|
||||||
|
clickable
|
||||||
|
@click="recalculateRates(entity)"
|
||||||
|
data-cy="recalculate-rates"
|
||||||
|
>
|
||||||
|
<QItemSection>{{ t('Recalculate rates') }}</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem v-ripple clickable @click="cloneEntry(entity)" data-cy="clone-entry">
|
||||||
|
<QItemSection>{{ t('Clone') }}</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem v-ripple clickable @click="deleteEntry(entity)" data-cy="delete-entry">
|
||||||
|
<QItemSection>{{ t('Delete') }}</QItemSection>
|
||||||
|
</QItem>
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv :label="t('globals.agency')" :value="entity.travel?.agency?.name" />
|
<VnLv :label="t('Travel')">
|
||||||
<VnLv :label="t('shipped')" :value="toDate(entity.travel?.shipped)" />
|
<template #value>
|
||||||
<VnLv :label="t('landed')" :value="toDate(entity.travel?.landed)" />
|
<span class="link" v-if="entity?.travelFk">
|
||||||
|
{{ entity.travel?.agency?.name }}
|
||||||
|
{{ entity.travel?.warehouseOut?.code }} →
|
||||||
|
{{ entity.travel?.warehouseIn?.code }}
|
||||||
|
<TravelDescriptorProxy :id="entity?.travelFk" />
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</VnLv>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('globals.warehouseOut')"
|
:label="t('entry.summary.travelShipped')"
|
||||||
:value="entity.travel?.warehouseOut?.name"
|
:value="toDate(entity.travel?.shipped)"
|
||||||
|
/>
|
||||||
|
<VnLv
|
||||||
|
:label="t('entry.summary.travelLanded')"
|
||||||
|
:value="toDate(entity.travel?.landed)"
|
||||||
|
/>
|
||||||
|
<VnLv :label="t('entry.summary.currency')" :value="entity?.currency?.code" />
|
||||||
|
<VnLv
|
||||||
|
:label="t('entry.summary.invoiceAmount')"
|
||||||
|
:value="entity?.invoiceAmount"
|
||||||
|
/>
|
||||||
|
<VnLv
|
||||||
|
:label="t('entry.summary.entryType')"
|
||||||
|
:value="entity?.entryType?.description"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #icons="{ entity }">
|
<template #icons="{ entity }">
|
||||||
|
@ -131,6 +230,14 @@ const getEntryRedirectionFilter = (entry) => {
|
||||||
}}</QTooltip
|
}}</QTooltip
|
||||||
>
|
>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
|
<QIcon
|
||||||
|
v-if="!entity?.travelFk"
|
||||||
|
name="vn:deletedTicket"
|
||||||
|
size="xs"
|
||||||
|
color="primary"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ t('This entry is deleted') }}</QTooltip>
|
||||||
|
</QIcon>
|
||||||
</QCardActions>
|
</QCardActions>
|
||||||
</template>
|
</template>
|
||||||
<template #actions="{ entity }">
|
<template #actions="{ entity }">
|
||||||
|
@ -143,21 +250,6 @@ const getEntryRedirectionFilter = (entry) => {
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('Supplier card') }}</QTooltip>
|
<QTooltip>{{ t('Supplier card') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
<QBtn
|
|
||||||
:to="{
|
|
||||||
name: 'TravelMain',
|
|
||||||
query: {
|
|
||||||
params: JSON.stringify({
|
|
||||||
agencyModeFk: entity.travel?.agencyModeFk,
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
}"
|
|
||||||
size="md"
|
|
||||||
icon="local_airport"
|
|
||||||
color="primary"
|
|
||||||
>
|
|
||||||
<QTooltip>{{ t('All travels with current agency') }}</QTooltip>
|
|
||||||
</QBtn>
|
|
||||||
<QBtn
|
<QBtn
|
||||||
:to="{
|
:to="{
|
||||||
name: 'EntryMain',
|
name: 'EntryMain',
|
||||||
|
@ -177,10 +269,24 @@ const getEntryRedirectionFilter = (entry) => {
|
||||||
</template>
|
</template>
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
|
Travel: Envío
|
||||||
Supplier card: Ficha del proveedor
|
Supplier card: Ficha del proveedor
|
||||||
All travels with current agency: Todos los envíos con la agencia actual
|
All travels with current agency: Todos los envíos con la agencia actual
|
||||||
All entries with current supplier: Todas las entradas con el proveedor actual
|
All entries with current supplier: Todas las entradas con el proveedor actual
|
||||||
Show entry report: Ver informe del pedido
|
Show entry report: Ver informe del pedido
|
||||||
Inventory entry: Es inventario
|
Inventory entry: Es inventario
|
||||||
Virtual entry: Es una redada
|
Virtual entry: Es una redada
|
||||||
|
shipped: Enviado
|
||||||
|
landed: Recibido
|
||||||
|
This entry is deleted: Esta entrada está eliminada
|
||||||
|
Cannot recalculate prices because this is an inventory entry: No se pueden recalcular los precios porque es una entrada de inventario
|
||||||
|
Entry deleted: Entrada eliminada
|
||||||
|
Entry cloned: Entrada clonada
|
||||||
|
Entry prices recalculated: Precios de la entrada recalculados
|
||||||
|
Failed to recalculate rates: No se pudieron recalcular las tarifas
|
||||||
|
Failed to clone entry: No se pudo clonar la entrada
|
||||||
|
Failed to delete entry: No se pudo eliminar la entrada
|
||||||
|
Recalculate rates: Recalcular tarifas
|
||||||
|
Clone: Clonar
|
||||||
|
Delete: Eliminar
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -9,6 +9,7 @@ export default {
|
||||||
'shipped',
|
'shipped',
|
||||||
'agencyModeFk',
|
'agencyModeFk',
|
||||||
'warehouseOutFk',
|
'warehouseOutFk',
|
||||||
|
'warehouseInFk',
|
||||||
'daysInForward',
|
'daysInForward',
|
||||||
],
|
],
|
||||||
include: [
|
include: [
|
||||||
|
@ -21,13 +22,13 @@ export default {
|
||||||
{
|
{
|
||||||
relation: 'warehouseOut',
|
relation: 'warehouseOut',
|
||||||
scope: {
|
scope: {
|
||||||
fields: ['name'],
|
fields: ['name', 'code'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
relation: 'warehouseIn',
|
relation: 'warehouseIn',
|
||||||
scope: {
|
scope: {
|
||||||
fields: ['name'],
|
fields: ['name', 'code'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -39,5 +40,17 @@ export default {
|
||||||
fields: ['id', 'nickname'],
|
fields: ['id', 'nickname'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
relation: 'currency',
|
||||||
|
scope: {
|
||||||
|
fields: ['id', 'code'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
relation: 'entryType',
|
||||||
|
scope: {
|
||||||
|
fields: ['code', 'description'],
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,19 +2,17 @@
|
||||||
import { onMounted, ref, computed } from 'vue';
|
import { onMounted, ref, computed } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { toDate } from 'src/filters';
|
||||||
|
import { getUrl } from 'src/composables/getUrl';
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
import CardSummary from 'components/ui/CardSummary.vue';
|
import CardSummary from 'components/ui/CardSummary.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.vue';
|
import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.vue';
|
||||||
|
import EntryBuys from './EntryBuys.vue';
|
||||||
import { toDate, toCurrency, toCelsius } from 'src/filters';
|
|
||||||
import { getUrl } from 'src/composables/getUrl';
|
|
||||||
import axios from 'axios';
|
|
||||||
import FetchedTags from 'src/components/ui/FetchedTags.vue';
|
|
||||||
import VnToSummary from 'src/components/ui/VnToSummary.vue';
|
|
||||||
import EntryDescriptorMenu from './EntryDescriptorMenu.vue';
|
|
||||||
import VnRow from 'src/components/ui/VnRow.vue';
|
|
||||||
import VnTitle from 'src/components/common/VnTitle.vue';
|
import VnTitle from 'src/components/common/VnTitle.vue';
|
||||||
|
import VnCheckbox from 'src/components/common/VnCheckbox.vue';
|
||||||
|
import VnToSummary from 'src/components/ui/VnToSummary.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -33,117 +31,6 @@ const entry = ref();
|
||||||
const entryBuys = ref([]);
|
const entryBuys = ref([]);
|
||||||
const entryUrl = ref();
|
const entryUrl = ref();
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
entryUrl.value = (await getUrl('entry/')) + entityId.value;
|
|
||||||
});
|
|
||||||
|
|
||||||
const tableColumnComponents = {
|
|
||||||
quantity: {
|
|
||||||
component: () => 'span',
|
|
||||||
props: () => {},
|
|
||||||
},
|
|
||||||
stickers: {
|
|
||||||
component: () => 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
packagingFk: {
|
|
||||||
component: () => 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
weight: {
|
|
||||||
component: () => 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
packing: {
|
|
||||||
component: () => 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
grouping: {
|
|
||||||
component: () => 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
buyingValue: {
|
|
||||||
component: () => 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
amount: {
|
|
||||||
component: () => 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
pvp: {
|
|
||||||
component: () => 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const entriesTableColumns = computed(() => {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
label: t('globals.quantity'),
|
|
||||||
field: 'quantity',
|
|
||||||
name: 'quantity',
|
|
||||||
align: 'left',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('entry.summary.stickers'),
|
|
||||||
field: 'stickers',
|
|
||||||
name: 'stickers',
|
|
||||||
align: 'left',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('entry.summary.package'),
|
|
||||||
field: 'packagingFk',
|
|
||||||
name: 'packagingFk',
|
|
||||||
align: 'left',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('globals.weight'),
|
|
||||||
field: 'weight',
|
|
||||||
name: 'weight',
|
|
||||||
align: 'left',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('entry.summary.packing'),
|
|
||||||
field: 'packing',
|
|
||||||
name: 'packing',
|
|
||||||
align: 'left',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('entry.summary.grouping'),
|
|
||||||
field: 'grouping',
|
|
||||||
name: 'grouping',
|
|
||||||
align: 'left',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('entry.summary.buyingValue'),
|
|
||||||
field: 'buyingValue',
|
|
||||||
name: 'buyingValue',
|
|
||||||
align: 'left',
|
|
||||||
format: (value) => toCurrency(value),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('entry.summary.import'),
|
|
||||||
name: 'amount',
|
|
||||||
align: 'left',
|
|
||||||
format: (_, row) => toCurrency(row.buyingValue * row.quantity),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('entry.summary.pvp'),
|
|
||||||
name: 'pvp',
|
|
||||||
align: 'left',
|
|
||||||
format: (_, row) => toCurrency(row.price2) + ' / ' + toCurrency(row.price3),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
async function setEntryData(data) {
|
async function setEntryData(data) {
|
||||||
if (data) entry.value = data;
|
if (data) entry.value = data;
|
||||||
await fetchEntryBuys();
|
await fetchEntryBuys();
|
||||||
|
@ -153,14 +40,18 @@ const fetchEntryBuys = async () => {
|
||||||
const { data } = await axios.get(`Entries/${entry.value.id}/getBuys`);
|
const { data } = await axios.get(`Entries/${entry.value.id}/getBuys`);
|
||||||
if (data) entryBuys.value = data;
|
if (data) entryBuys.value = data;
|
||||||
};
|
};
|
||||||
</script>
|
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
entryUrl.value = (await getUrl('entry/')) + entityId.value;
|
||||||
|
});
|
||||||
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<CardSummary
|
<CardSummary
|
||||||
ref="summaryRef"
|
ref="summaryRef"
|
||||||
:url="`Entries/${entityId}/getEntry`"
|
:url="`Entries/${entityId}/getEntry`"
|
||||||
@on-fetch="(data) => setEntryData(data)"
|
@on-fetch="(data) => setEntryData(data)"
|
||||||
data-key="EntrySummary"
|
data-key="EntrySummary"
|
||||||
|
data-cy="entry-summary"
|
||||||
>
|
>
|
||||||
<template #header-left>
|
<template #header-left>
|
||||||
<VnToSummary
|
<VnToSummary
|
||||||
|
@ -173,159 +64,154 @@ const fetchEntryBuys = async () => {
|
||||||
<template #header>
|
<template #header>
|
||||||
<span>{{ entry.id }} - {{ entry.supplier.nickname }}</span>
|
<span>{{ entry.id }} - {{ entry.supplier.nickname }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template #menu="{ entity }">
|
|
||||||
<EntryDescriptorMenu :id="entity.id" />
|
|
||||||
</template>
|
|
||||||
<template #body>
|
<template #body>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<VnTitle
|
<VnTitle
|
||||||
:url="`#/entry/${entityId}/basic-data`"
|
:url="`#/entry/${entityId}/basic-data`"
|
||||||
:text="t('globals.summary.basicData')"
|
:text="t('globals.summary.basicData')"
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('entry.summary.commission')" :value="entry.commission" />
|
<div class="card-group">
|
||||||
<VnLv
|
<div class="card-content">
|
||||||
:label="t('entry.summary.currency')"
|
<VnLv
|
||||||
:value="entry.currency?.name"
|
:label="t('entry.summary.commission')"
|
||||||
/>
|
:value="entry?.commission"
|
||||||
<VnLv :label="t('globals.company')" :value="entry.company.code" />
|
/>
|
||||||
<VnLv :label="t('globals.reference')" :value="entry.reference" />
|
<VnLv
|
||||||
<VnLv
|
:label="t('entry.summary.currency')"
|
||||||
:label="t('entry.summary.invoiceNumber')"
|
:value="entry?.currency?.name"
|
||||||
:value="entry.invoiceNumber"
|
/>
|
||||||
/>
|
<VnLv
|
||||||
<VnLv
|
:label="t('globals.company')"
|
||||||
:label="t('entry.basicData.initialTemperature')"
|
:value="entry?.company?.code"
|
||||||
:value="toCelsius(entry.initialTemperature)"
|
/>
|
||||||
/>
|
<VnLv :label="t('globals.reference')" :value="entry?.reference" />
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('entry.basicData.finalTemperature')"
|
:label="t('entry.summary.invoiceNumber')"
|
||||||
:value="toCelsius(entry.finalTemperature)"
|
:value="entry?.invoiceNumber"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="card-content">
|
||||||
|
<VnCheckbox
|
||||||
|
:label="t('entry.summary.ordered')"
|
||||||
|
v-model="entry.isOrdered"
|
||||||
|
:disable="true"
|
||||||
|
size="xs"
|
||||||
|
/>
|
||||||
|
<VnCheckbox
|
||||||
|
:label="t('globals.confirmed')"
|
||||||
|
v-model="entry.isConfirmed"
|
||||||
|
:disable="true"
|
||||||
|
size="xs"
|
||||||
|
/>
|
||||||
|
<VnCheckbox
|
||||||
|
:label="t('entry.summary.booked')"
|
||||||
|
v-model="entry.isBooked"
|
||||||
|
:disable="true"
|
||||||
|
size="xs"
|
||||||
|
/>
|
||||||
|
<VnCheckbox
|
||||||
|
:label="t('entry.summary.excludedFromAvailable')"
|
||||||
|
v-model="entry.isExcludedFromAvailable"
|
||||||
|
:disable="true"
|
||||||
|
size="xs"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one" v-if="entry?.travelFk">
|
||||||
<VnTitle
|
<VnTitle
|
||||||
:url="`#/entry/${entityId}/basic-data`"
|
:url="`#/travel/${entry.travel.id}/summary`"
|
||||||
:text="t('globals.summary.basicData')"
|
:text="t('Travel')"
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('entry.summary.travelReference')">
|
<div class="card-group">
|
||||||
<template #value>
|
<div class="card-content">
|
||||||
<span class="link">
|
<VnLv :label="t('entry.summary.travelReference')">
|
||||||
{{ entry.travel.ref }}
|
<template #value>
|
||||||
<TravelDescriptorProxy :id="entry.travel.id" />
|
<span class="link">
|
||||||
</span>
|
{{ entry.travel.ref }}
|
||||||
</template>
|
<TravelDescriptorProxy :id="entry.travel.id" />
|
||||||
</VnLv>
|
</span>
|
||||||
<VnLv
|
</template>
|
||||||
:label="t('entry.summary.travelAgency')"
|
</VnLv>
|
||||||
:value="entry.travel.agency?.name"
|
<VnLv
|
||||||
/>
|
:label="t('entry.summary.travelAgency')"
|
||||||
<VnLv
|
:value="entry.travel.agency?.name"
|
||||||
:label="t('globals.shipped')"
|
/>
|
||||||
:value="toDate(entry.travel.shipped)"
|
<VnLv
|
||||||
/>
|
:label="t('entry.summary.travelShipped')"
|
||||||
<VnLv
|
:value="toDate(entry.travel.shipped)"
|
||||||
:label="t('globals.warehouseOut')"
|
/>
|
||||||
:value="entry.travel.warehouseOut?.name"
|
<VnLv
|
||||||
/>
|
:label="t('globals.warehouseOut')"
|
||||||
<VnLv
|
:value="entry.travel.warehouseOut?.name"
|
||||||
:label="t('entry.summary.travelDelivered')"
|
/>
|
||||||
:value="entry.travel.isDelivered"
|
<VnLv
|
||||||
/>
|
:label="t('entry.summary.travelLanded')"
|
||||||
<VnLv :label="t('globals.landed')" :value="toDate(entry.travel.landed)" />
|
:value="toDate(entry.travel.landed)"
|
||||||
<VnLv
|
/>
|
||||||
:label="t('globals.warehouseIn')"
|
<VnLv
|
||||||
:value="entry.travel.warehouseIn?.name"
|
:label="t('globals.warehouseIn')"
|
||||||
/>
|
:value="entry.travel.warehouseIn?.name"
|
||||||
<VnLv
|
/>
|
||||||
:label="t('entry.summary.travelReceived')"
|
</div>
|
||||||
:value="entry.travel.isReceived"
|
<div class="card-content">
|
||||||
/>
|
<VnCheckbox
|
||||||
</QCard>
|
:label="t('entry.summary.travelDelivered')"
|
||||||
<QCard class="vn-one">
|
v-model="entry.travel.isDelivered"
|
||||||
<VnTitle :url="`#/travel/${entityId}/summary`" :text="t('Travel data')" />
|
:disable="true"
|
||||||
<VnRow class="block">
|
size="xs"
|
||||||
<VnLv :label="t('entry.summary.ordered')" :value="entry.isOrdered" />
|
/>
|
||||||
<VnLv :label="t('globals.confirmed')" :value="entry.isConfirmed" />
|
<VnCheckbox
|
||||||
<VnLv :label="t('entry.summary.booked')" :value="entry.isBooked" />
|
:label="t('entry.summary.travelReceived')"
|
||||||
<VnLv
|
v-model="entry.travel.isReceived"
|
||||||
:label="t('entry.summary.excludedFromAvailable')"
|
:disable="true"
|
||||||
:value="entry.isExcludedFromAvailable"
|
size="xs"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</div>
|
||||||
|
</div>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-max">
|
<QCard class="vn-max">
|
||||||
<VnTitle
|
<VnTitle
|
||||||
:url="`#/entry/${entityId}/buys`"
|
:url="`#/entry/${entityId}/buys`"
|
||||||
:text="t('entry.summary.buys')"
|
:text="t('entry.summary.buys')"
|
||||||
/>
|
/>
|
||||||
<QTable
|
<EntryBuys
|
||||||
:rows="entryBuys"
|
v-if="entityId"
|
||||||
:columns="entriesTableColumns"
|
:id="Number(entityId)"
|
||||||
row-key="index"
|
:editable-mode="false"
|
||||||
class="full-width q-mt-md"
|
table-height="49vh"
|
||||||
:no-data-label="t('globals.noResults')"
|
/>
|
||||||
>
|
|
||||||
<template #body="{ cols, row, rowIndex }">
|
|
||||||
<QTr no-hover>
|
|
||||||
<QTd v-for="col in cols" :key="col?.name">
|
|
||||||
<component
|
|
||||||
:is="tableColumnComponents[col?.name].component()"
|
|
||||||
v-bind="tableColumnComponents[col?.name].props()"
|
|
||||||
@click="tableColumnComponents[col?.name].event()"
|
|
||||||
class="col-content"
|
|
||||||
>
|
|
||||||
<template
|
|
||||||
v-if="
|
|
||||||
col?.name !== 'observation' &&
|
|
||||||
col?.name !== 'isConfirmed'
|
|
||||||
"
|
|
||||||
>{{ col.value }}</template
|
|
||||||
>
|
|
||||||
<QTooltip v-if="col.toolTip">{{
|
|
||||||
col.toolTip
|
|
||||||
}}</QTooltip>
|
|
||||||
</component>
|
|
||||||
</QTd>
|
|
||||||
</QTr>
|
|
||||||
<QTr no-hover>
|
|
||||||
<QTd>
|
|
||||||
<span>{{ row.item.itemType.code }}</span>
|
|
||||||
</QTd>
|
|
||||||
<QTd>
|
|
||||||
<span>{{ row.item.id }}</span>
|
|
||||||
</QTd>
|
|
||||||
<QTd>
|
|
||||||
<span>{{ row.item.size }}</span>
|
|
||||||
</QTd>
|
|
||||||
<QTd>
|
|
||||||
<span>{{ toCurrency(row.item.minPrice) }}</span>
|
|
||||||
</QTd>
|
|
||||||
<QTd colspan="6">
|
|
||||||
<span>{{ row.item.concept }}</span>
|
|
||||||
<span v-if="row.item.subName" class="subName">
|
|
||||||
{{ row.item.subName }}
|
|
||||||
</span>
|
|
||||||
<FetchedTags :item="row.item" />
|
|
||||||
</QTd>
|
|
||||||
</QTr>
|
|
||||||
<!-- Esta última row es utilizada para agregar un espaciado y así marcar una diferencia visual entre los diferentes buys -->
|
|
||||||
<QTr v-if="rowIndex !== entryBuys.length - 1">
|
|
||||||
<QTd colspan="10" class="vn-table-separation-row" />
|
|
||||||
</QTr>
|
|
||||||
</template>
|
|
||||||
</QTable>
|
|
||||||
</QCard>
|
</QCard>
|
||||||
</template>
|
</template>
|
||||||
</CardSummary>
|
</CardSummary>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.separation-row {
|
.card-group {
|
||||||
background-color: var(--vn-section-color) !important;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
> div {
|
||||||
|
max-height: 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 1010px) {
|
||||||
|
.card-group {
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
.card-content {
|
||||||
|
flex: 1;
|
||||||
|
margin-right: 16px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
Travel data: Datos envío
|
Travel: Envío
|
||||||
|
InvoiceIn data: Datos factura
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -19,6 +19,7 @@ const props = defineProps({
|
||||||
|
|
||||||
const currenciesOptions = ref([]);
|
const currenciesOptions = ref([]);
|
||||||
const companiesOptions = ref([]);
|
const companiesOptions = ref([]);
|
||||||
|
const entryFilterPanel = ref();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -38,7 +39,7 @@ const companiesOptions = ref([]);
|
||||||
@on-fetch="(data) => (currenciesOptions = data)"
|
@on-fetch="(data) => (currenciesOptions = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
<VnFilterPanel ref="entryFilterPanel" :data-key="props.dataKey" :search-button="true">
|
||||||
<template #tags="{ tag, formatFn }">
|
<template #tags="{ tag, formatFn }">
|
||||||
<div class="q-gutter-x-xs">
|
<div class="q-gutter-x-xs">
|
||||||
<strong>{{ t(`entryFilter.params.${tag.label}`) }}: </strong>
|
<strong>{{ t(`entryFilter.params.${tag.label}`) }}: </strong>
|
||||||
|
@ -48,70 +49,65 @@ const companiesOptions = ref([]);
|
||||||
<template #body="{ params, searchFn }">
|
<template #body="{ params, searchFn }">
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput
|
<QCheckbox
|
||||||
v-model="params.search"
|
:label="t('params.isExcludedFromAvailable')"
|
||||||
:label="t('entryFilter.params.search')"
|
v-model="params.isExcludedFromAvailable"
|
||||||
is-outlined
|
toggle-indeterminate
|
||||||
/>
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('params.isExcludedFromAvailable') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QCheckbox>
|
||||||
|
</QItemSection>
|
||||||
|
<QItemSection>
|
||||||
|
<QCheckbox
|
||||||
|
:label="t('params.isOrdered')"
|
||||||
|
v-model="params.isOrdered"
|
||||||
|
toggle-indeterminate
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('entry.list.tableVisibleColumns.isOrdered') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QCheckbox>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput
|
<QCheckbox
|
||||||
v-model="params.reference"
|
:label="t('params.isReceived')"
|
||||||
:label="t('entryFilter.params.reference')"
|
v-model="params.isReceived"
|
||||||
is-outlined
|
toggle-indeterminate
|
||||||
/>
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('entry.list.tableVisibleColumns.isReceived') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QCheckbox>
|
||||||
|
</QItemSection>
|
||||||
|
<QItemSection>
|
||||||
|
<QCheckbox
|
||||||
|
:label="t('entry.list.tableVisibleColumns.isConfirmed')"
|
||||||
|
v-model="params.isConfirmed"
|
||||||
|
toggle-indeterminate
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('entry.list.tableVisibleColumns.isConfirmed') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QCheckbox>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput
|
<VnInputDate
|
||||||
v-model="params.invoiceNumber"
|
:label="t('params.landed')"
|
||||||
:label="t('entryFilter.params.invoiceNumber')"
|
v-model="params.landed"
|
||||||
is-outlined
|
|
||||||
/>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QItem>
|
|
||||||
<QItemSection>
|
|
||||||
<VnInput
|
|
||||||
v-model="params.travelFk"
|
|
||||||
:label="t('entryFilter.params.travelFk')"
|
|
||||||
is-outlined
|
|
||||||
/>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QItem>
|
|
||||||
<QItemSection>
|
|
||||||
<VnSelect
|
|
||||||
:label="t('entryFilter.params.companyFk')"
|
|
||||||
v-model="params.companyFk"
|
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
:options="companiesOptions"
|
is-outlined
|
||||||
option-value="id"
|
|
||||||
option-label="code"
|
|
||||||
hide-selected
|
|
||||||
dense
|
|
||||||
outlined
|
|
||||||
rounded
|
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelect
|
<VnInput v-model="params.id" label="Id" is-outlined />
|
||||||
:label="t('entryFilter.params.currencyFk')"
|
|
||||||
v-model="params.currencyFk"
|
|
||||||
@update:model-value="searchFn()"
|
|
||||||
:options="currenciesOptions"
|
|
||||||
option-value="id"
|
|
||||||
option-label="name"
|
|
||||||
hide-selected
|
|
||||||
dense
|
|
||||||
outlined
|
|
||||||
rounded
|
|
||||||
/>
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
|
@ -125,62 +121,165 @@ const companiesOptions = ref([]);
|
||||||
rounded
|
rounded
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
|
||||||
<QItem>
|
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInputDate
|
<VnInput
|
||||||
:label="t('entryFilter.params.created')"
|
v-model="params.invoiceNumber"
|
||||||
v-model="params.created"
|
:label="t('params.invoiceNumber')"
|
||||||
@update:model-value="searchFn()"
|
|
||||||
is-outlined
|
is-outlined
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInputDate
|
<VnInput
|
||||||
:label="t('entryFilter.params.from')"
|
v-model="params.reference"
|
||||||
v-model="params.from"
|
:label="t('entry.list.tableVisibleColumns.reference')"
|
||||||
@update:model-value="searchFn()"
|
|
||||||
is-outlined
|
is-outlined
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInputDate
|
<VnSelect
|
||||||
:label="t('entryFilter.params.to')"
|
:label="t('params.agencyModeId')"
|
||||||
v-model="params.to"
|
v-model="params.agencyModeId"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
|
url="AgencyModes"
|
||||||
|
:fields="['id', 'name']"
|
||||||
|
hide-selected
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnInput
|
||||||
|
v-model="params.evaNotes"
|
||||||
|
:label="t('params.evaNotes')"
|
||||||
is-outlined
|
is-outlined
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QCheckbox
|
<VnSelect
|
||||||
:label="t('entryFilter.params.isBooked')"
|
:label="t('params.warehouseOutFk')"
|
||||||
v-model="params.isBooked"
|
v-model="params.warehouseOutFk"
|
||||||
toggle-indeterminate
|
@update:model-value="searchFn()"
|
||||||
/>
|
url="Warehouses"
|
||||||
</QItemSection>
|
:fields="['id', 'name']"
|
||||||
<QItemSection>
|
hide-selected
|
||||||
<QCheckbox
|
dense
|
||||||
:label="t('entryFilter.params.isConfirmed')"
|
outlined
|
||||||
v-model="params.isConfirmed"
|
rounded
|
||||||
toggle-indeterminate
|
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QCheckbox
|
<VnSelect
|
||||||
:label="t('entryFilter.params.isOrdered')"
|
:label="t('params.warehouseInFk')"
|
||||||
v-model="params.isOrdered"
|
v-model="params.warehouseInFk"
|
||||||
toggle-indeterminate
|
@update:model-value="searchFn()"
|
||||||
|
url="Warehouses"
|
||||||
|
:fields="['id', 'name']"
|
||||||
|
hide-selected
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>
|
||||||
|
{{ scope.opt?.name }}
|
||||||
|
</QItemLabel>
|
||||||
|
<QItemLabel caption>
|
||||||
|
{{ `#${scope.opt?.id} , ${scope.opt?.nickname}` }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnInput
|
||||||
|
v-model="params.invoiceNumber"
|
||||||
|
:label="t('params.invoiceNumber')"
|
||||||
|
is-outlined
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelect
|
||||||
|
:label="t('params.entryTypeCode')"
|
||||||
|
v-model="params.entryTypeCode"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
|
url="EntryTypes"
|
||||||
|
:fields="['code', 'description']"
|
||||||
|
option-value="code"
|
||||||
|
option-label="description"
|
||||||
|
hide-selected
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnInput
|
||||||
|
v-model="params.evaNotes"
|
||||||
|
:label="t('params.evaNotes')"
|
||||||
|
is-outlined
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
</template>
|
</template>
|
||||||
</VnFilterPanel>
|
</VnFilterPanel>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<i18n>
|
||||||
|
en:
|
||||||
|
params:
|
||||||
|
isExcludedFromAvailable: Inventory
|
||||||
|
isOrdered: Ordered
|
||||||
|
isReceived: Received
|
||||||
|
isConfirmed: Confirmed
|
||||||
|
isRaid: Raid
|
||||||
|
landed: Date
|
||||||
|
id: Id
|
||||||
|
supplierFk: Supplier
|
||||||
|
invoiceNumber: Invoice number
|
||||||
|
reference: Ref/Alb/Guide
|
||||||
|
agencyModeId: Agency mode
|
||||||
|
evaNotes: Notes
|
||||||
|
warehouseOutFk: Origin
|
||||||
|
warehouseInFk: Destiny
|
||||||
|
entryTypeCode: Entry type
|
||||||
|
hasToShowDeletedEntries: Show deleted entries
|
||||||
|
es:
|
||||||
|
params:
|
||||||
|
isExcludedFromAvailable: Inventario
|
||||||
|
isOrdered: Pedida
|
||||||
|
isConfirmed: Confirmado
|
||||||
|
isReceived: Recibida
|
||||||
|
isRaid: Raid
|
||||||
|
landed: Fecha
|
||||||
|
id: Id
|
||||||
|
supplierFk: Proveedor
|
||||||
|
invoiceNumber: Núm. factura
|
||||||
|
reference: Ref/Alb/Guía
|
||||||
|
agencyModeId: Modo agencia
|
||||||
|
evaNotes: Notas
|
||||||
|
warehouseOutFk: Origen
|
||||||
|
warehouseInFk: Destino
|
||||||
|
entryTypeCode: Tipo de entrada
|
||||||
|
hasToShowDeletedEntries: Mostrar entradas eliminadas
|
||||||
|
</i18n>
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
|
||||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
import VnInput from 'components/common/VnInput.vue';
|
import VnInput from 'components/common/VnInput.vue';
|
||||||
import VnSelect from 'components/common/VnSelect.vue';
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
|
@ -18,18 +16,10 @@ defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const itemTypeWorkersOptions = ref([]);
|
|
||||||
const tagValues = ref([]);
|
const tagValues = ref([]);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
url="TicketRequests/getItemTypeWorker"
|
|
||||||
limit="30"
|
|
||||||
auto-load
|
|
||||||
:filter="{ fields: ['id', 'nickname'], order: 'nickname ASC', limit: 30 }"
|
|
||||||
@on-fetch="(data) => (itemTypeWorkersOptions = data)"
|
|
||||||
/>
|
|
||||||
<ItemsFilterPanel :data-key="dataKey" :custom-tags="['tags']">
|
<ItemsFilterPanel :data-key="dataKey" :custom-tags="['tags']">
|
||||||
<template #body="{ params, searchFn }">
|
<template #body="{ params, searchFn }">
|
||||||
<QItem class="q-my-md">
|
<QItem class="q-my-md">
|
||||||
|
@ -37,9 +27,10 @@ const tagValues = ref([]);
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('components.itemsFilterPanel.salesPersonFk')"
|
:label="t('components.itemsFilterPanel.salesPersonFk')"
|
||||||
v-model="params.salesPersonFk"
|
v-model="params.salesPersonFk"
|
||||||
:options="itemTypeWorkersOptions"
|
url="TicketRequests/getItemTypeWorker"
|
||||||
option-value="id"
|
|
||||||
option-label="nickname"
|
option-label="nickname"
|
||||||
|
:fields="['id', 'nickname']"
|
||||||
|
sort-by="nickname ASC"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
@ -52,8 +43,9 @@ const tagValues = ref([]);
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelectSupplier
|
<VnSelectSupplier
|
||||||
v-model="params.supplierFk"
|
v-model="params.supplierFk"
|
||||||
@update:model-value="searchFn()"
|
url="Suppliers"
|
||||||
hide-selected
|
:fields="['id', 'name', 'nickname']"
|
||||||
|
sort-by="name ASC"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
|
|
@ -1,21 +1,25 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import axios from 'axios';
|
||||||
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useState } from 'src/composables/useState';
|
||||||
|
import { onBeforeMount } from 'vue';
|
||||||
|
|
||||||
import EntryFilter from './EntryFilter.vue';
|
import EntryFilter from './EntryFilter.vue';
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import { toCelsius, toDate } from 'src/filters';
|
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
|
||||||
import EntrySummary from './Card/EntrySummary.vue';
|
|
||||||
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
||||||
import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.vue';
|
import VnSelectTravelExtended from 'src/components/common/VnSelectTravelExtended.vue';
|
||||||
import VnSection from 'src/components/common/VnSection.vue';
|
import { toDate } from 'src/filters';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
|
const defaultEntry = ref({});
|
||||||
|
const state = useState();
|
||||||
|
const user = state.getUser();
|
||||||
const dataKey = 'EntryList';
|
const dataKey = 'EntryList';
|
||||||
|
|
||||||
const { viewSummary } = useSummaryDialog();
|
const entryQueryFilter = {
|
||||||
const entryFilter = {
|
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
relation: 'suppliers',
|
relation: 'suppliers',
|
||||||
|
@ -40,44 +44,58 @@ const entryFilter = {
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
name: 'status',
|
labelAbbreviation: 'Ex',
|
||||||
columnFilter: false,
|
label: t('entry.list.tableVisibleColumns.isExcludedFromAvailable'),
|
||||||
|
toolTip: t('entry.list.tableVisibleColumns.isExcludedFromAvailable'),
|
||||||
|
name: 'isExcludedFromAvailable',
|
||||||
|
component: 'checkbox',
|
||||||
|
width: '35px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
labelAbbreviation: 'Pe',
|
||||||
label: t('globals.id'),
|
label: t('entry.list.tableVisibleColumns.isOrdered'),
|
||||||
name: 'id',
|
toolTip: t('entry.list.tableVisibleColumns.isOrdered'),
|
||||||
isId: true,
|
name: 'isOrdered',
|
||||||
chip: {
|
component: 'checkbox',
|
||||||
condition: () => true,
|
width: '35px',
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
labelAbbreviation: 'LE',
|
||||||
label: t('globals.reference'),
|
label: t('entry.list.tableVisibleColumns.isConfirmed'),
|
||||||
name: 'reference',
|
toolTip: t('entry.list.tableVisibleColumns.isConfirmed'),
|
||||||
isTitle: true,
|
name: 'isConfirmed',
|
||||||
component: 'input',
|
component: 'checkbox',
|
||||||
columnField: {
|
width: '35px',
|
||||||
component: null,
|
|
||||||
},
|
|
||||||
create: true,
|
|
||||||
cardVisible: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
labelAbbreviation: 'Re',
|
||||||
label: t('entry.list.tableVisibleColumns.created'),
|
label: t('entry.list.tableVisibleColumns.isReceived'),
|
||||||
name: 'created',
|
toolTip: t('entry.list.tableVisibleColumns.isReceived'),
|
||||||
create: true,
|
name: 'isReceived',
|
||||||
cardVisible: true,
|
component: 'checkbox',
|
||||||
|
width: '35px',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('entry.list.tableVisibleColumns.landed'),
|
||||||
|
name: 'landed',
|
||||||
component: 'date',
|
component: 'date',
|
||||||
columnField: {
|
columnField: {
|
||||||
component: null,
|
component: null,
|
||||||
},
|
},
|
||||||
format: (row, dashIfEmpty) => dashIfEmpty(toDate(row.created)),
|
format: (row, dashIfEmpty) => dashIfEmpty(toDate(row.landed)),
|
||||||
|
width: '105px',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('globals.id'),
|
||||||
|
name: 'id',
|
||||||
|
isId: true,
|
||||||
|
component: 'number',
|
||||||
|
chip: {
|
||||||
|
condition: () => true,
|
||||||
|
},
|
||||||
|
width: '50px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
|
||||||
label: t('entry.list.tableVisibleColumns.supplierFk'),
|
label: t('entry.list.tableVisibleColumns.supplierFk'),
|
||||||
name: 'supplierFk',
|
name: 'supplierFk',
|
||||||
create: true,
|
create: true,
|
||||||
|
@ -86,165 +104,214 @@ const columns = computed(() => [
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'suppliers',
|
url: 'suppliers',
|
||||||
fields: ['id', 'name'],
|
fields: ['id', 'name'],
|
||||||
},
|
where: { order: 'name DESC' },
|
||||||
columnField: {
|
|
||||||
component: null,
|
|
||||||
},
|
},
|
||||||
format: (row, dashIfEmpty) => dashIfEmpty(row.supplierName),
|
format: (row, dashIfEmpty) => dashIfEmpty(row.supplierName),
|
||||||
|
width: '110px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
label: t('entry.list.tableVisibleColumns.isBooked'),
|
label: t('entry.list.tableVisibleColumns.invoiceNumber'),
|
||||||
name: 'isBooked',
|
name: 'invoiceNumber',
|
||||||
|
component: 'input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('entry.list.tableVisibleColumns.reference'),
|
||||||
|
name: 'reference',
|
||||||
|
isTitle: true,
|
||||||
|
component: 'input',
|
||||||
|
columnField: {
|
||||||
|
component: null,
|
||||||
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
|
||||||
component: 'checkbox',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
label: t('entry.list.tableVisibleColumns.isConfirmed'),
|
label: 'AWB',
|
||||||
name: 'isConfirmed',
|
name: 'awbCode',
|
||||||
|
component: 'input',
|
||||||
|
width: '100px',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('entry.list.tableVisibleColumns.agencyModeId'),
|
||||||
|
name: 'agencyModeId',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
component: 'select',
|
||||||
component: 'checkbox',
|
attrs: {
|
||||||
|
url: 'agencyModes',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
},
|
||||||
|
columnField: {
|
||||||
|
component: null,
|
||||||
|
},
|
||||||
|
format: (row, dashIfEmpty) => dashIfEmpty(row.agencyModeName),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
label: t('entry.list.tableVisibleColumns.isOrdered'),
|
label: t('entry.list.tableVisibleColumns.evaNotes'),
|
||||||
name: 'isOrdered',
|
name: 'evaNotes',
|
||||||
|
component: 'input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('entry.list.tableVisibleColumns.warehouseOutFk'),
|
||||||
|
name: 'warehouseOutFk',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
component: 'select',
|
||||||
component: 'checkbox',
|
attrs: {
|
||||||
|
url: 'warehouses',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
},
|
||||||
|
columnField: {
|
||||||
|
component: null,
|
||||||
|
},
|
||||||
|
format: (row, dashIfEmpty) => dashIfEmpty(row.warehouseOutName),
|
||||||
|
width: '65px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
label: t('entry.list.tableVisibleColumns.companyFk'),
|
label: t('entry.list.tableVisibleColumns.warehouseInFk'),
|
||||||
|
name: 'warehouseInFk',
|
||||||
|
cardVisible: true,
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'warehouses',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
},
|
||||||
|
columnField: {
|
||||||
|
component: null,
|
||||||
|
},
|
||||||
|
format: (row, dashIfEmpty) => dashIfEmpty(row.warehouseInName),
|
||||||
|
width: '65px',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
labelAbbreviation: t('Type'),
|
||||||
|
label: t('entry.list.tableVisibleColumns.entryTypeDescription'),
|
||||||
|
toolTip: t('entry.list.tableVisibleColumns.entryTypeDescription'),
|
||||||
|
name: 'entryTypeCode',
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'entryTypes',
|
||||||
|
fields: ['code', 'description'],
|
||||||
|
optionValue: 'code',
|
||||||
|
optionLabel: 'description',
|
||||||
|
},
|
||||||
|
cardVisible: true,
|
||||||
|
width: '65px',
|
||||||
|
format: (row, dashIfEmpty) => dashIfEmpty(row.entryTypeDescription),
|
||||||
|
},
|
||||||
|
{
|
||||||
name: 'companyFk',
|
name: 'companyFk',
|
||||||
|
label: t('entry.list.tableVisibleColumns.companyFk'),
|
||||||
|
cardVisible: false,
|
||||||
|
visible: false,
|
||||||
|
create: true,
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'companies',
|
optionValue: 'id',
|
||||||
fields: ['id', 'code'],
|
|
||||||
optionLabel: 'code',
|
optionLabel: 'code',
|
||||||
optionValue: 'id',
|
url: 'Companies',
|
||||||
},
|
},
|
||||||
columnField: {
|
|
||||||
component: null,
|
|
||||||
},
|
|
||||||
create: true,
|
|
||||||
|
|
||||||
format: (row, dashIfEmpty) => dashIfEmpty(row.companyCode),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
|
||||||
label: t('entry.list.tableVisibleColumns.travelFk'),
|
|
||||||
name: 'travelFk',
|
name: 'travelFk',
|
||||||
component: 'select',
|
label: t('entry.list.tableVisibleColumns.travelFk'),
|
||||||
attrs: {
|
cardVisible: false,
|
||||||
url: 'travels',
|
visible: false,
|
||||||
fields: ['id', 'ref'],
|
|
||||||
optionLabel: 'ref',
|
|
||||||
optionValue: 'id',
|
|
||||||
},
|
|
||||||
columnField: {
|
|
||||||
component: null,
|
|
||||||
},
|
|
||||||
create: true,
|
create: true,
|
||||||
format: (row, dashIfEmpty) => dashIfEmpty(row.travelRef),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: 'left',
|
|
||||||
label: t('entry.list.tableVisibleColumns.invoiceAmount'),
|
|
||||||
name: 'invoiceAmount',
|
|
||||||
cardVisible: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: 'left',
|
|
||||||
name: 'initialTemperature',
|
|
||||||
label: t('entry.basicData.initialTemperature'),
|
|
||||||
field: 'initialTemperature',
|
|
||||||
format: (row) => toCelsius(row.initialTemperature),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: 'left',
|
|
||||||
name: 'finalTemperature',
|
|
||||||
label: t('entry.basicData.finalTemperature'),
|
|
||||||
field: 'finalTemperature',
|
|
||||||
format: (row) => toCelsius(row.finalTemperature),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('entry.list.tableVisibleColumns.isExcludedFromAvailable'),
|
|
||||||
name: 'isExcludedFromAvailable',
|
|
||||||
columnFilter: {
|
|
||||||
inWhere: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: 'right',
|
|
||||||
name: 'tableActions',
|
|
||||||
actions: [
|
|
||||||
{
|
|
||||||
title: t('components.smartCard.viewSummary'),
|
|
||||||
icon: 'preview',
|
|
||||||
action: (row) => viewSummary(row.id, EntrySummary),
|
|
||||||
isPrimary: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
function getBadgeAttrs(row) {
|
||||||
|
const date = row.landed;
|
||||||
|
let today = Date.vnNew();
|
||||||
|
today.setHours(0, 0, 0, 0);
|
||||||
|
let timeTicket = new Date(date);
|
||||||
|
timeTicket.setHours(0, 0, 0, 0);
|
||||||
|
|
||||||
|
let timeDiff = today - timeTicket;
|
||||||
|
|
||||||
|
if (timeDiff > 0) return { color: 'info', 'text-color': 'black' };
|
||||||
|
if (timeDiff < 0) return { color: 'warning', 'text-color': 'black' };
|
||||||
|
switch (row.entryTypeCode) {
|
||||||
|
case 'regularization':
|
||||||
|
case 'life':
|
||||||
|
case 'internal':
|
||||||
|
case 'inventory':
|
||||||
|
if (!row.isOrdered || !row.isConfirmed)
|
||||||
|
return { color: 'negative', 'text-color': 'black' };
|
||||||
|
break;
|
||||||
|
case 'product':
|
||||||
|
case 'packaging':
|
||||||
|
case 'devaluation':
|
||||||
|
case 'payment':
|
||||||
|
case 'transport':
|
||||||
|
if (
|
||||||
|
row.invoiceAmount === null ||
|
||||||
|
(row.invoiceNumber === null && row.reference === null) ||
|
||||||
|
!row.isOrdered ||
|
||||||
|
!row.isConfirmed
|
||||||
|
)
|
||||||
|
return { color: 'negative', 'text-color': 'black' };
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return { color: 'transparent' };
|
||||||
|
}
|
||||||
|
|
||||||
|
onBeforeMount(async () => {
|
||||||
|
defaultEntry.value = (await axios.get('EntryConfigs/findOne')).data;
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnSection
|
<VnSection
|
||||||
:data-key="dataKey"
|
:data-key="dataKey"
|
||||||
:columns="columns"
|
|
||||||
prefix="entry"
|
prefix="entry"
|
||||||
url="Entries/filter"
|
url="Entries/filter"
|
||||||
:array-data-props="{
|
:array-data-props="{
|
||||||
url: 'Entries/filter',
|
url: 'Entries/filter',
|
||||||
order: 'id DESC',
|
order: 'landed DESC',
|
||||||
userFilter: entryFilter,
|
userFilter: EntryFilter,
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<template #advanced-menu>
|
<template #advanced-menu>
|
||||||
<EntryFilter data-key="EntryList" />
|
<EntryFilter :data-key="dataKey" />
|
||||||
</template>
|
</template>
|
||||||
<template #body>
|
<template #body>
|
||||||
<VnTable
|
<VnTable
|
||||||
|
v-if="defaultEntry.defaultSupplierFk"
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
:data-key="dataKey"
|
:data-key="dataKey"
|
||||||
|
url="Entries/filter"
|
||||||
|
:filter="entryQueryFilter"
|
||||||
|
order="landed DESC"
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: 'Entries',
|
urlCreate: 'Entries',
|
||||||
title: t('entry.list.newEntry'),
|
title: t('Create entry'),
|
||||||
onDataSaved: ({ id }) => tableRef.redirect(id),
|
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||||
formInitialData: {},
|
formInitialData: {
|
||||||
|
supplierFk: defaultEntry.defaultSupplierFk,
|
||||||
|
dated: Date.vnNew(),
|
||||||
|
companyFk: user?.companyFk,
|
||||||
|
},
|
||||||
}"
|
}"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
redirect="entry"
|
redirect="entry"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
>
|
>
|
||||||
<template #column-status="{ row }">
|
<template #column-landed="{ row }">
|
||||||
<div class="row q-gutter-xs">
|
<QBadge
|
||||||
<QIcon
|
v-if="row?.travelFk"
|
||||||
v-if="!!row.isExcludedFromAvailable"
|
v-bind="getBadgeAttrs(row)"
|
||||||
name="vn:inventory"
|
class="q-pa-sm"
|
||||||
color="primary"
|
style="font-size: 14px"
|
||||||
>
|
>
|
||||||
<QTooltip>{{
|
{{ toDate(row.landed) }}
|
||||||
t(
|
</QBadge>
|
||||||
'entry.list.tableVisibleColumns.isExcludedFromAvailable',
|
|
||||||
)
|
|
||||||
}}</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon v-if="!!row.isRaid" name="vn:net" color="primary">
|
|
||||||
<QTooltip>
|
|
||||||
{{
|
|
||||||
t('globals.raid', {
|
|
||||||
daysInForward: row.daysInForward,
|
|
||||||
})
|
|
||||||
}}</QTooltip
|
|
||||||
>
|
|
||||||
</QIcon>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<template #column-supplierFk="{ row }">
|
<template #column-supplierFk="{ row }">
|
||||||
<span class="link" @click.stop>
|
<span class="link" @click.stop>
|
||||||
|
@ -252,13 +319,27 @@ const columns = computed(() => [
|
||||||
<SupplierDescriptorProxy :id="row.supplierFk" />
|
<SupplierDescriptorProxy :id="row.supplierFk" />
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template #column-travelFk="{ row }">
|
<template #column-create-travelFk="{ data }">
|
||||||
<span class="link" @click.stop>
|
<VnSelectTravelExtended
|
||||||
{{ row.travelRef }}
|
:data="data"
|
||||||
<TravelDescriptorProxy :id="row.travelFk" />
|
v-model="data.travelFk"
|
||||||
</span>
|
:onFilterTravelSelected="
|
||||||
|
(data, result) => (data.travelFk = result)
|
||||||
|
"
|
||||||
|
data-cy="entry-travel-select"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnTable>
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
</VnSection>
|
</VnSection>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<i18n>
|
||||||
|
es:
|
||||||
|
Inventory entry: Es inventario
|
||||||
|
Virtual entry: Es una redada
|
||||||
|
Search entries: Buscar entradas
|
||||||
|
You can search by entry reference: Puedes buscar por referencia de la entrada
|
||||||
|
Create entry: Crear entrada
|
||||||
|
Type: Tipo
|
||||||
|
</i18n>
|
||||||
|
|
|
@ -34,18 +34,20 @@ const columns = computed(() => [
|
||||||
label: t('entryStockBought.buyer'),
|
label: t('entryStockBought.buyer'),
|
||||||
isTitle: true,
|
isTitle: true,
|
||||||
component: 'select',
|
component: 'select',
|
||||||
|
isEditable: false,
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'Workers/activeWithInheritedRole',
|
url: 'Workers/activeWithInheritedRole',
|
||||||
fields: ['id', 'name'],
|
fields: ['id', 'name', 'nickname'],
|
||||||
where: { role: 'buyer' },
|
where: { role: 'buyer' },
|
||||||
optionFilter: 'firstName',
|
optionFilter: 'firstName',
|
||||||
optionLabel: 'name',
|
optionLabel: 'nickname',
|
||||||
optionValue: 'id',
|
optionValue: 'id',
|
||||||
useLike: false,
|
useLike: false,
|
||||||
},
|
},
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
|
width: '70px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
@ -55,6 +57,7 @@ const columns = computed(() => [
|
||||||
create: true,
|
create: true,
|
||||||
component: 'number',
|
component: 'number',
|
||||||
summation: true,
|
summation: true,
|
||||||
|
width: '60px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
@ -78,6 +81,7 @@ const columns = computed(() => [
|
||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
title: t('entryStockBought.viewMoreDetails'),
|
title: t('entryStockBought.viewMoreDetails'),
|
||||||
|
name: 'searchBtn',
|
||||||
icon: 'search',
|
icon: 'search',
|
||||||
isPrimary: true,
|
isPrimary: true,
|
||||||
action: (row) => {
|
action: (row) => {
|
||||||
|
@ -91,6 +95,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
'data-cy': 'table-actions',
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -158,7 +163,7 @@ function round(value) {
|
||||||
@on-fetch="
|
@on-fetch="
|
||||||
(data) => {
|
(data) => {
|
||||||
travel = data.find(
|
travel = data.find(
|
||||||
(data) => data.warehouseIn?.code.toLowerCase() === 'vnh'
|
(data) => data.warehouseIn?.code.toLowerCase() === 'vnh',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
|
@ -179,6 +184,7 @@ function round(value) {
|
||||||
@click="openDialog()"
|
@click="openDialog()"
|
||||||
:title="t('entryStockBought.editTravel')"
|
:title="t('entryStockBought.editTravel')"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
data-cy="edit-travel"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
@ -239,10 +245,11 @@ function round(value) {
|
||||||
table-height="80vh"
|
table-height="80vh"
|
||||||
auto-load
|
auto-load
|
||||||
:column-search="false"
|
:column-search="false"
|
||||||
|
:without-header="true"
|
||||||
>
|
>
|
||||||
<template #column-workerFk="{ row }">
|
<template #column-workerFk="{ row }">
|
||||||
<span class="link" @click.stop>
|
<span class="link" @click.stop>
|
||||||
{{ row?.worker?.user?.name }}
|
{{ row?.worker?.user?.nickname }}
|
||||||
<WorkerDescriptorProxy :id="row?.workerFk" />
|
<WorkerDescriptorProxy :id="row?.workerFk" />
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
@ -279,10 +286,11 @@ function round(value) {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
.column {
|
.column {
|
||||||
|
min-width: 30%;
|
||||||
|
margin-top: 5%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
min-width: 35%;
|
|
||||||
}
|
}
|
||||||
.text-negative {
|
.text-negative {
|
||||||
color: $negative !important;
|
color: $negative !important;
|
||||||
|
|
|
@ -21,7 +21,7 @@ const $props = defineProps({
|
||||||
const customUrl = `StockBoughts/getStockBoughtDetail?workerFk=${$props.workerFk}&dated=${$props.dated}`;
|
const customUrl = `StockBoughts/getStockBoughtDetail?workerFk=${$props.workerFk}&dated=${$props.dated}`;
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'right',
|
||||||
label: t('Entry'),
|
label: t('Entry'),
|
||||||
name: 'entryFk',
|
name: 'entryFk',
|
||||||
isTitle: true,
|
isTitle: true,
|
||||||
|
@ -29,7 +29,7 @@ const columns = [
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'right',
|
||||||
name: 'itemFk',
|
name: 'itemFk',
|
||||||
label: t('Item'),
|
label: t('Item'),
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
|
@ -44,21 +44,21 @@ const columns = [
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'right',
|
||||||
name: 'volume',
|
name: 'volume',
|
||||||
label: t('Volume'),
|
label: t('Volume'),
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'right',
|
||||||
label: t('Packaging'),
|
label: t('Packaging'),
|
||||||
name: 'packagingFk',
|
name: 'packagingFk',
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'right',
|
||||||
label: 'Packing',
|
label: 'Packing',
|
||||||
name: 'packing',
|
name: 'packing',
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
|
@ -73,12 +73,14 @@ const columns = [
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="StockBoughtsDetail"
|
data-key="StockBoughtsDetail"
|
||||||
:url="customUrl"
|
:url="customUrl"
|
||||||
order="itemName DESC"
|
order="volume DESC"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
:disable-infinite-scroll="true"
|
:disable-infinite-scroll="true"
|
||||||
:disable-option="{ card: true }"
|
:disable-option="{ card: true }"
|
||||||
:limit="0"
|
:limit="0"
|
||||||
|
:without-header="true"
|
||||||
|
:with-filters="false"
|
||||||
auto-load
|
auto-load
|
||||||
>
|
>
|
||||||
<template #column-entryFk="{ row }">
|
<template #column-entryFk="{ row }">
|
||||||
|
@ -105,7 +107,7 @@ const columns = [
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
background-color: var(--vn-section-color);
|
background-color: var(--vn-section-color);
|
||||||
padding: 4px;
|
padding: 2%;
|
||||||
}
|
}
|
||||||
.container > div > div > .q-table__top.relative-position.row.items-center {
|
.container > div > div > .q-table__top.relative-position.row.items-center {
|
||||||
background-color: red !important;
|
background-color: red !important;
|
||||||
|
|
|
@ -1,21 +1,36 @@
|
||||||
entry:
|
entry:
|
||||||
|
lock:
|
||||||
|
title: Lock entry
|
||||||
|
message: This entry has been locked by {userName} for {time} minutes. Do you want to unlock it?
|
||||||
|
success: The entry has been locked successfully
|
||||||
list:
|
list:
|
||||||
newEntry: New entry
|
newEntry: New entry
|
||||||
tableVisibleColumns:
|
tableVisibleColumns:
|
||||||
created: Creation
|
isExcludedFromAvailable: Exclude from inventory
|
||||||
supplierFk: Supplier
|
|
||||||
isBooked: Booked
|
|
||||||
isConfirmed: Confirmed
|
|
||||||
isOrdered: Ordered
|
isOrdered: Ordered
|
||||||
|
isConfirmed: Ready to label
|
||||||
|
isReceived: Received
|
||||||
|
isRaid: Raid
|
||||||
|
landed: Date
|
||||||
|
supplierFk: Supplier
|
||||||
|
reference: Ref/Alb/Guide
|
||||||
|
invoiceNumber: Invoice
|
||||||
|
agencyModeId: Agency
|
||||||
|
isBooked: Booked
|
||||||
companyFk: Company
|
companyFk: Company
|
||||||
travelFk: Travel
|
evaNotes: Notes
|
||||||
isExcludedFromAvailable: Inventory
|
warehouseOutFk: Origin
|
||||||
|
warehouseInFk: Destiny
|
||||||
|
entryTypeDescription: Entry type
|
||||||
invoiceAmount: Import
|
invoiceAmount: Import
|
||||||
|
travelFk: Travel
|
||||||
|
dated: Dated
|
||||||
inventoryEntry: Inventory entry
|
inventoryEntry: Inventory entry
|
||||||
summary:
|
summary:
|
||||||
commission: Commission
|
commission: Commission
|
||||||
currency: Currency
|
currency: Currency
|
||||||
invoiceNumber: Invoice number
|
invoiceNumber: Invoice number
|
||||||
|
invoiceAmount: Invoice amount
|
||||||
ordered: Ordered
|
ordered: Ordered
|
||||||
booked: Booked
|
booked: Booked
|
||||||
excludedFromAvailable: Inventory
|
excludedFromAvailable: Inventory
|
||||||
|
@ -33,6 +48,7 @@ entry:
|
||||||
buyingValue: Buying value
|
buyingValue: Buying value
|
||||||
import: Import
|
import: Import
|
||||||
pvp: PVP
|
pvp: PVP
|
||||||
|
entryType: Entry type
|
||||||
basicData:
|
basicData:
|
||||||
travel: Travel
|
travel: Travel
|
||||||
currency: Currency
|
currency: Currency
|
||||||
|
@ -69,17 +85,55 @@ entry:
|
||||||
landing: Landing
|
landing: Landing
|
||||||
isExcludedFromAvailable: Es inventory
|
isExcludedFromAvailable: Es inventory
|
||||||
params:
|
params:
|
||||||
toShipped: To
|
isExcludedFromAvailable: Exclude from inventory
|
||||||
fromShipped: From
|
isOrdered: Ordered
|
||||||
daysOnward: Days onward
|
isConfirmed: Ready to label
|
||||||
daysAgo: Days ago
|
isReceived: Received
|
||||||
warehouseInFk: Warehouse in
|
isIgnored: Ignored
|
||||||
|
isRaid: Raid
|
||||||
|
landed: Date
|
||||||
|
supplierFk: Supplier
|
||||||
|
reference: Ref/Alb/Guide
|
||||||
|
invoiceNumber: Invoice
|
||||||
|
agencyModeId: Agency
|
||||||
|
isBooked: Booked
|
||||||
|
companyFk: Company
|
||||||
|
evaNotes: Notes
|
||||||
|
warehouseOutFk: Origin
|
||||||
|
warehouseInFk: Destiny
|
||||||
|
entryTypeDescription: Entry type
|
||||||
|
invoiceAmount: Import
|
||||||
|
travelFk: Travel
|
||||||
|
dated: Dated
|
||||||
|
itemFk: Item id
|
||||||
|
hex: Color
|
||||||
|
name: Item name
|
||||||
|
size: Size
|
||||||
|
stickers: Stickers
|
||||||
|
packagingFk: Packaging
|
||||||
|
weight: Kg
|
||||||
|
groupingMode: Grouping selector
|
||||||
|
grouping: Grouping
|
||||||
|
quantity: Quantity
|
||||||
|
buyingValue: Buying value
|
||||||
|
price2: Package
|
||||||
|
price3: Box
|
||||||
|
minPrice: Minumum price
|
||||||
|
hasMinPrice: Has minimum price
|
||||||
|
packingOut: Packing out
|
||||||
|
comment: Comment
|
||||||
|
subName: Supplier name
|
||||||
|
tags: Tags
|
||||||
|
company_name: Company name
|
||||||
|
itemTypeFk: Item type
|
||||||
|
workerFk: Worker id
|
||||||
search: Search entries
|
search: Search entries
|
||||||
searchInfo: You can search by entry reference
|
searchInfo: You can search by entry reference
|
||||||
descriptorMenu:
|
descriptorMenu:
|
||||||
showEntryReport: Show entry report
|
showEntryReport: Show entry report
|
||||||
entryFilter:
|
entryFilter:
|
||||||
params:
|
params:
|
||||||
|
isExcludedFromAvailable: Exclude from inventory
|
||||||
invoiceNumber: Invoice number
|
invoiceNumber: Invoice number
|
||||||
travelFk: Travel
|
travelFk: Travel
|
||||||
companyFk: Company
|
companyFk: Company
|
||||||
|
@ -91,8 +145,16 @@ entryFilter:
|
||||||
isBooked: Booked
|
isBooked: Booked
|
||||||
isConfirmed: Confirmed
|
isConfirmed: Confirmed
|
||||||
isOrdered: Ordered
|
isOrdered: Ordered
|
||||||
|
isReceived: Received
|
||||||
search: General search
|
search: General search
|
||||||
reference: Reference
|
reference: Reference
|
||||||
|
landed: Landed
|
||||||
|
id: Id
|
||||||
|
agencyModeId: Agency
|
||||||
|
evaNotes: Notes
|
||||||
|
warehouseOutFk: Origin
|
||||||
|
warehouseInFk: Destiny
|
||||||
|
entryTypeCode: Entry type
|
||||||
myEntries:
|
myEntries:
|
||||||
id: ID
|
id: ID
|
||||||
landed: Landed
|
landed: Landed
|
||||||
|
|
|
@ -1,21 +1,36 @@
|
||||||
entry:
|
entry:
|
||||||
|
lock:
|
||||||
|
title: Entrada bloqueada
|
||||||
|
message: Esta entrada ha sido bloqueada por {userName} hace {time} minutos. ¿Quieres desbloquearla?
|
||||||
|
success: La entrada ha sido bloqueada correctamente
|
||||||
list:
|
list:
|
||||||
newEntry: Nueva entrada
|
newEntry: Nueva entrada
|
||||||
tableVisibleColumns:
|
tableVisibleColumns:
|
||||||
created: Creación
|
isExcludedFromAvailable: Excluir del inventario
|
||||||
supplierFk: Proveedor
|
|
||||||
isBooked: Asentado
|
|
||||||
isConfirmed: Confirmado
|
|
||||||
isOrdered: Pedida
|
isOrdered: Pedida
|
||||||
|
isConfirmed: Lista para etiquetar
|
||||||
|
isReceived: Recibida
|
||||||
|
isRaid: Redada
|
||||||
|
landed: Fecha
|
||||||
|
supplierFk: Proveedor
|
||||||
|
invoiceNumber: Nº Factura
|
||||||
|
reference: Ref/Alb/Guía
|
||||||
|
agencyModeId: Agencia
|
||||||
|
isBooked: Asentado
|
||||||
companyFk: Empresa
|
companyFk: Empresa
|
||||||
travelFk: Envio
|
travelFk: Envio
|
||||||
isExcludedFromAvailable: Inventario
|
evaNotes: Notas
|
||||||
|
warehouseOutFk: Origen
|
||||||
|
warehouseInFk: Destino
|
||||||
|
entryTypeDescription: Tipo entrada
|
||||||
invoiceAmount: Importe
|
invoiceAmount: Importe
|
||||||
|
dated: Fecha
|
||||||
inventoryEntry: Es inventario
|
inventoryEntry: Es inventario
|
||||||
summary:
|
summary:
|
||||||
commission: Comisión
|
commission: Comisión
|
||||||
currency: Moneda
|
currency: Moneda
|
||||||
invoiceNumber: Núm. factura
|
invoiceNumber: Núm. factura
|
||||||
|
invoiceAmount: Importe
|
||||||
ordered: Pedida
|
ordered: Pedida
|
||||||
booked: Contabilizada
|
booked: Contabilizada
|
||||||
excludedFromAvailable: Inventario
|
excludedFromAvailable: Inventario
|
||||||
|
@ -34,12 +49,13 @@ entry:
|
||||||
buyingValue: Coste
|
buyingValue: Coste
|
||||||
import: Importe
|
import: Importe
|
||||||
pvp: PVP
|
pvp: PVP
|
||||||
|
entryType: Tipo entrada
|
||||||
basicData:
|
basicData:
|
||||||
travel: Envío
|
travel: Envío
|
||||||
currency: Moneda
|
currency: Moneda
|
||||||
observation: Observación
|
observation: Observación
|
||||||
commission: Comisión
|
commission: Comisión
|
||||||
booked: Asentado
|
booked: Contabilizada
|
||||||
excludedFromAvailable: Inventario
|
excludedFromAvailable: Inventario
|
||||||
initialTemperature: Ini °C
|
initialTemperature: Ini °C
|
||||||
finalTemperature: Fin °C
|
finalTemperature: Fin °C
|
||||||
|
@ -69,31 +85,70 @@ entry:
|
||||||
packingOut: Embalaje envíos
|
packingOut: Embalaje envíos
|
||||||
landing: Llegada
|
landing: Llegada
|
||||||
isExcludedFromAvailable: Es inventario
|
isExcludedFromAvailable: Es inventario
|
||||||
params:
|
|
||||||
toShipped: Hasta
|
|
||||||
fromShipped: Desde
|
|
||||||
warehouseInFk: Alm. entrada
|
|
||||||
daysOnward: Días adelante
|
|
||||||
daysAgo: Días atras
|
|
||||||
descriptorMenu:
|
|
||||||
showEntryReport: Ver informe del pedido
|
|
||||||
search: Buscar entradas
|
search: Buscar entradas
|
||||||
searchInfo: Puedes buscar por referencia de entrada
|
searchInfo: Puedes buscar por referencia de entrada
|
||||||
|
params:
|
||||||
|
isExcludedFromAvailable: Excluir del inventario
|
||||||
|
isOrdered: Pedida
|
||||||
|
isConfirmed: Lista para etiquetar
|
||||||
|
isReceived: Recibida
|
||||||
|
isRaid: Redada
|
||||||
|
isIgnored: Ignorado
|
||||||
|
landed: Fecha
|
||||||
|
supplierFk: Proveedor
|
||||||
|
invoiceNumber: Nº Factura
|
||||||
|
reference: Ref/Alb/Guía
|
||||||
|
agencyModeId: Agencia
|
||||||
|
isBooked: Asentado
|
||||||
|
companyFk: Empresa
|
||||||
|
travelFk: Envio
|
||||||
|
evaNotes: Notas
|
||||||
|
warehouseOutFk: Origen
|
||||||
|
warehouseInFk: Destino
|
||||||
|
entryTypeDescription: Tipo entrada
|
||||||
|
invoiceAmount: Importe
|
||||||
|
dated: Fecha
|
||||||
|
itemFk: Id artículo
|
||||||
|
hex: Color
|
||||||
|
name: Nombre artículo
|
||||||
|
size: Medida
|
||||||
|
stickers: Etiquetas
|
||||||
|
packagingFk: Embalaje
|
||||||
|
weight: Kg
|
||||||
|
groupinMode: Selector de grouping
|
||||||
|
grouping: Grouping
|
||||||
|
quantity: Quantity
|
||||||
|
buyingValue: Precio de compra
|
||||||
|
price2: Paquete
|
||||||
|
price3: Caja
|
||||||
|
minPrice: Precio mínimo
|
||||||
|
hasMinPrice: Tiene precio mínimo
|
||||||
|
packingOut: Packing out
|
||||||
|
comment: Referencia
|
||||||
|
subName: Nombre proveedor
|
||||||
|
tags: Etiquetas
|
||||||
|
company_name: Nombre empresa
|
||||||
|
itemTypeFk: Familia
|
||||||
|
workerFk: Comprador
|
||||||
entryFilter:
|
entryFilter:
|
||||||
params:
|
params:
|
||||||
invoiceNumber: Núm. factura
|
isExcludedFromAvailable: Inventario
|
||||||
travelFk: Envío
|
|
||||||
companyFk: Empresa
|
|
||||||
currencyFk: Moneda
|
|
||||||
supplierFk: Proveedor
|
|
||||||
from: Desde
|
|
||||||
to: Hasta
|
|
||||||
created: Fecha creación
|
|
||||||
isBooked: Asentado
|
|
||||||
isConfirmed: Confirmado
|
|
||||||
isOrdered: Pedida
|
isOrdered: Pedida
|
||||||
search: Búsqueda general
|
isConfirmed: Confirmado
|
||||||
reference: Referencia
|
isReceived: Recibida
|
||||||
|
isRaid: Raid
|
||||||
|
landed: Fecha
|
||||||
|
id: Id
|
||||||
|
supplierFk: Proveedor
|
||||||
|
invoiceNumber: Núm. factura
|
||||||
|
reference: Ref/Alb/Guía
|
||||||
|
agencyModeId: Modo agencia
|
||||||
|
evaNotes: Notas
|
||||||
|
warehouseOutFk: Origen
|
||||||
|
warehouseInFk: Destino
|
||||||
|
entryTypeCode: Tipo de entrada
|
||||||
|
hasToShowDeletedEntries: Mostrar entradas eliminadas
|
||||||
myEntries:
|
myEntries:
|
||||||
id: ID
|
id: ID
|
||||||
landed: F. llegada
|
landed: F. llegada
|
||||||
|
|
|
@ -90,7 +90,6 @@ async function setInvoiceCorrection(id) {
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
ref="cardDescriptorRef"
|
ref="cardDescriptorRef"
|
||||||
module="InvoiceIn"
|
|
||||||
data-key="InvoiceIn"
|
data-key="InvoiceIn"
|
||||||
:url="`InvoiceIns/${entityId}`"
|
:url="`InvoiceIns/${entityId}`"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
|
|
|
@ -7,7 +7,6 @@ import { toDate } from 'src/filters';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
import { getTotal } from 'src/composables/getTotal';
|
import { getTotal } from 'src/composables/getTotal';
|
||||||
import CrudModel from 'src/components/CrudModel.vue';
|
import CrudModel from 'src/components/CrudModel.vue';
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
|
@ -22,7 +21,6 @@ const invoiceIn = computed(() => arrayData.store.data);
|
||||||
const currency = computed(() => invoiceIn.value?.currency?.code);
|
const currency = computed(() => invoiceIn.value?.currency?.code);
|
||||||
|
|
||||||
const rowsSelected = ref([]);
|
const rowsSelected = ref([]);
|
||||||
const banks = ref([]);
|
|
||||||
const invoiceInFormRef = ref();
|
const invoiceInFormRef = ref();
|
||||||
const invoiceId = +route.params.id;
|
const invoiceId = +route.params.id;
|
||||||
const filter = { where: { invoiceInFk: invoiceId } };
|
const filter = { where: { invoiceInFk: invoiceId } };
|
||||||
|
@ -41,10 +39,9 @@ const columns = computed(() => [
|
||||||
name: 'bank',
|
name: 'bank',
|
||||||
label: t('Bank'),
|
label: t('Bank'),
|
||||||
field: (row) => row.bankFk,
|
field: (row) => row.bankFk,
|
||||||
options: banks.value,
|
|
||||||
model: 'bankFk',
|
model: 'bankFk',
|
||||||
optionValue: 'id',
|
|
||||||
optionLabel: 'bank',
|
optionLabel: 'bank',
|
||||||
|
url: 'Accountings',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
tabIndex: 2,
|
tabIndex: 2,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -82,12 +79,6 @@ onBeforeMount(async () => {
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
url="Accountings"
|
|
||||||
auto-load
|
|
||||||
limit="30"
|
|
||||||
@on-fetch="(data) => (banks = data)"
|
|
||||||
/>
|
|
||||||
<CrudModel
|
<CrudModel
|
||||||
v-if="invoiceIn"
|
v-if="invoiceIn"
|
||||||
ref="invoiceInFormRef"
|
ref="invoiceInFormRef"
|
||||||
|
@ -117,9 +108,9 @@ onBeforeMount(async () => {
|
||||||
<QTd>
|
<QTd>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
v-model="row[col.model]"
|
v-model="row[col.model]"
|
||||||
:options="col.options"
|
:url="col.url"
|
||||||
:option-value="col.optionValue"
|
|
||||||
:option-label="col.optionLabel"
|
:option-label="col.optionLabel"
|
||||||
|
:option-value="col.optionValue"
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
<QItem v-bind="scope.itemProps">
|
<QItem v-bind="scope.itemProps">
|
||||||
|
@ -193,8 +184,7 @@ onBeforeMount(async () => {
|
||||||
:label="t('Bank')"
|
:label="t('Bank')"
|
||||||
class="full-width"
|
class="full-width"
|
||||||
v-model="props.row['bankFk']"
|
v-model="props.row['bankFk']"
|
||||||
:options="banks"
|
url="Accountings"
|
||||||
option-value="id"
|
|
||||||
option-label="bank"
|
option-label="bank"
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
|
|
|
@ -29,6 +29,7 @@ const cols = computed(() => [
|
||||||
name: 'isBooked',
|
name: 'isBooked',
|
||||||
label: t('invoiceIn.isBooked'),
|
label: t('invoiceIn.isBooked'),
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
|
component: 'checkbox',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
|
|
@ -36,7 +36,6 @@ function ticketFilter(invoice) {
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
ref="descriptor"
|
ref="descriptor"
|
||||||
module="InvoiceOut"
|
|
||||||
:url="`InvoiceOuts/${entityId}`"
|
:url="`InvoiceOuts/${entityId}`"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
title="ref"
|
title="ref"
|
||||||
|
|
|
@ -125,7 +125,7 @@ const ticketsColumns = ref([
|
||||||
:value="toDate(invoiceOut.issued)"
|
:value="toDate(invoiceOut.issued)"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('invoiceOut.summary.dued')"
|
:label="t('invoiceOut.summary.expirationDate')"
|
||||||
:value="toDate(invoiceOut.dued)"
|
:value="toDate(invoiceOut.dued)"
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('globals.created')" :value="toDate(invoiceOut.created)" />
|
<VnLv :label="t('globals.created')" :value="toDate(invoiceOut.created)" />
|
||||||
|
|
|
@ -19,6 +19,7 @@ invoiceOut:
|
||||||
summary:
|
summary:
|
||||||
issued: Issued
|
issued: Issued
|
||||||
dued: Due
|
dued: Due
|
||||||
|
expirationDate: Expiration date
|
||||||
booked: Booked
|
booked: Booked
|
||||||
taxBreakdown: Tax breakdown
|
taxBreakdown: Tax breakdown
|
||||||
taxableBase: Taxable base
|
taxableBase: Taxable base
|
||||||
|
|
|
@ -19,6 +19,7 @@ invoiceOut:
|
||||||
summary:
|
summary:
|
||||||
issued: Fecha
|
issued: Fecha
|
||||||
dued: Fecha límite
|
dued: Fecha límite
|
||||||
|
expirationDate: Fecha vencimiento
|
||||||
booked: Contabilizada
|
booked: Contabilizada
|
||||||
taxBreakdown: Desglose impositivo
|
taxBreakdown: Desglose impositivo
|
||||||
taxableBase: Base imp.
|
taxableBase: Base imp.
|
||||||
|
|
|
@ -34,6 +34,10 @@ const $props = defineProps({
|
||||||
type: Number,
|
type: Number,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
proxyRender: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -88,7 +92,6 @@ const updateStock = async () => {
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
data-key="Item"
|
data-key="Item"
|
||||||
module="Item"
|
|
||||||
:summary="$props.summary"
|
:summary="$props.summary"
|
||||||
:url="`Items/${entityId}/getCard`"
|
:url="`Items/${entityId}/getCard`"
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
|
@ -112,7 +115,7 @@ const updateStock = async () => {
|
||||||
<template #value>
|
<template #value>
|
||||||
<span class="link">
|
<span class="link">
|
||||||
{{ entity.itemType?.worker?.user?.name }}
|
{{ entity.itemType?.worker?.user?.name }}
|
||||||
<WorkerDescriptorProxy :id="entity.itemType?.worker?.id" />
|
<WorkerDescriptorProxy :id="entity.itemType?.worker?.id ?? NaN" />
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
|
@ -147,7 +150,7 @@ const updateStock = async () => {
|
||||||
</QCardActions>
|
</QCardActions>
|
||||||
</template>
|
</template>
|
||||||
<template #actions="{}">
|
<template #actions="{}">
|
||||||
<QCardActions class="row justify-center">
|
<QCardActions class="row justify-center" v-if="proxyRender">
|
||||||
<QBtn
|
<QBtn
|
||||||
:to="{
|
:to="{
|
||||||
name: 'ItemDiary',
|
name: 'ItemDiary',
|
||||||
|
@ -160,6 +163,16 @@ const updateStock = async () => {
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('item.descriptor.itemDiary') }}</QTooltip>
|
<QTooltip>{{ t('item.descriptor.itemDiary') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
|
<QBtn
|
||||||
|
:to="{
|
||||||
|
name: 'ItemLastEntries',
|
||||||
|
}"
|
||||||
|
size="md"
|
||||||
|
icon="vn:regentry"
|
||||||
|
color="primary"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ t('item.descriptor.itemLastEntries') }}</QTooltip>
|
||||||
|
</QBtn>
|
||||||
</QCardActions>
|
</QCardActions>
|
||||||
</template>
|
</template>
|
||||||
</CardDescriptor>
|
</CardDescriptor>
|
||||||
|
|
|
@ -4,7 +4,7 @@ import ItemSummary from './ItemSummary.vue';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
type: Number,
|
type: [Number, String],
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
dated: {
|
dated: {
|
||||||
|
@ -21,9 +21,8 @@ const $props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QPopupProxy>
|
<QPopupProxy style="max-width: 10px">
|
||||||
<ItemDescriptor
|
<ItemDescriptor
|
||||||
v-if="$props.id"
|
v-if="$props.id"
|
||||||
:id="$props.id"
|
:id="$props.id"
|
||||||
|
@ -31,6 +30,7 @@ const $props = defineProps({
|
||||||
:dated="dated"
|
:dated="dated"
|
||||||
:sale-fk="saleFk"
|
:sale-fk="saleFk"
|
||||||
:warehouse-fk="warehouseFk"
|
:warehouse-fk="warehouseFk"
|
||||||
|
:proxy-render="true"
|
||||||
/>
|
/>
|
||||||
</QPopupProxy>
|
</QPopupProxy>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -110,10 +110,16 @@ const columns = computed(() => [
|
||||||
attrs: { inWhere: true },
|
attrs: { inWhere: true },
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: t('globals.visible'),
|
||||||
|
name: 'stock',
|
||||||
|
attrs: { inWhere: true },
|
||||||
|
align: 'left',
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const totalLabels = computed(() =>
|
const totalLabels = computed(() =>
|
||||||
rows.value.reduce((acc, row) => acc + row.stock / row.packing, 0).toFixed(2)
|
rows.value.reduce((acc, row) => acc + row.stock / row.packing, 0).toFixed(2),
|
||||||
);
|
);
|
||||||
|
|
||||||
const removeLines = async () => {
|
const removeLines = async () => {
|
||||||
|
@ -157,7 +163,7 @@ watchEffect(selectedRows);
|
||||||
openConfirmationModal(
|
openConfirmationModal(
|
||||||
t('shelvings.removeConfirmTitle'),
|
t('shelvings.removeConfirmTitle'),
|
||||||
t('shelvings.removeConfirmSubtitle'),
|
t('shelvings.removeConfirmSubtitle'),
|
||||||
removeLines
|
removeLines,
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
|
||||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
import VnSelect from 'components/common/VnSelect.vue';
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
import ItemsFilterPanel from 'src/components/ItemsFilterPanel.vue';
|
import ItemsFilterPanel from 'src/components/ItemsFilterPanel.vue';
|
||||||
|
@ -16,17 +14,9 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const itemTypeWorkersOptions = ref([]);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
url="TicketRequests/getItemTypeWorker"
|
|
||||||
limit="30"
|
|
||||||
auto-load
|
|
||||||
:filter="{ fields: ['id', 'nickname'], order: 'nickname ASC', limit: 30 }"
|
|
||||||
@on-fetch="(data) => (itemTypeWorkersOptions = data)"
|
|
||||||
/>
|
|
||||||
<ItemsFilterPanel :data-key="props.dataKey" :custom-tags="['tags']">
|
<ItemsFilterPanel :data-key="props.dataKey" :custom-tags="['tags']">
|
||||||
<template #body="{ params, searchFn }">
|
<template #body="{ params, searchFn }">
|
||||||
<QItem class="q-my-md">
|
<QItem class="q-my-md">
|
||||||
|
@ -34,14 +24,15 @@ const itemTypeWorkersOptions = ref([]);
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('params.buyerFk')"
|
:label="t('params.buyerFk')"
|
||||||
v-model="params.buyerFk"
|
v-model="params.buyerFk"
|
||||||
:options="itemTypeWorkersOptions"
|
url="TicketRequests/getItemTypeWorker"
|
||||||
option-value="id"
|
:fields="['id', 'nickname']"
|
||||||
option-label="nickname"
|
option-label="nickname"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
use-input
|
use-input
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
|
sort-by="nickname ASC"
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
@ -50,11 +41,10 @@ const itemTypeWorkersOptions = ref([]);
|
||||||
<VnSelect
|
<VnSelect
|
||||||
url="Warehouses"
|
url="Warehouses"
|
||||||
auto-load
|
auto-load
|
||||||
:filter="{ fields: ['id', 'name'], order: 'name ASC', limit: 30 }"
|
:fields="['id', 'name']"
|
||||||
|
sort-by="name ASC"
|
||||||
:label="t('params.warehouseFk')"
|
:label="t('params.warehouseFk')"
|
||||||
v-model="params.warehouseFk"
|
v-model="params.warehouseFk"
|
||||||
option-label="name"
|
|
||||||
option-value="id"
|
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
|
|
@ -26,7 +26,6 @@ const entityId = computed(() => {
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
module="ItemType"
|
|
||||||
:url="`ItemTypes/${entityId}`"
|
:url="`ItemTypes/${entityId}`"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
title="code"
|
title="code"
|
||||||
|
|
|
@ -112,6 +112,7 @@ item:
|
||||||
available: Available
|
available: Available
|
||||||
warehouseText: 'Calculated on the warehouse of { warehouseName }'
|
warehouseText: 'Calculated on the warehouse of { warehouseName }'
|
||||||
itemDiary: Item diary
|
itemDiary: Item diary
|
||||||
|
itemLastEntries: Last entries
|
||||||
producer: Producer
|
producer: Producer
|
||||||
clone:
|
clone:
|
||||||
title: All its properties will be copied
|
title: All its properties will be copied
|
||||||
|
|
|
@ -118,6 +118,7 @@ item:
|
||||||
available: Disponible
|
available: Disponible
|
||||||
warehouseText: 'Calculado sobre el almacén de { warehouseName }'
|
warehouseText: 'Calculado sobre el almacén de { warehouseName }'
|
||||||
itemDiary: Registro de compra-venta
|
itemDiary: Registro de compra-venta
|
||||||
|
itemLastEntries: Últimas entradas
|
||||||
producer: Productor
|
producer: Productor
|
||||||
clone:
|
clone:
|
||||||
title: Todas sus propiedades serán copiadas
|
title: Todas sus propiedades serán copiadas
|
||||||
|
|
|
@ -157,7 +157,7 @@ const openTab = (id) =>
|
||||||
openConfirmationModal(
|
openConfirmationModal(
|
||||||
$t('globals.deleteConfirmTitle'),
|
$t('globals.deleteConfirmTitle'),
|
||||||
$t('salesOrdersTable.deleteConfirmMessage'),
|
$t('salesOrdersTable.deleteConfirmMessage'),
|
||||||
removeOrders
|
removeOrders,
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
|
|
@ -61,6 +61,7 @@ function exprBuilder(param, value) {
|
||||||
case 'nickname':
|
case 'nickname':
|
||||||
return { [`t.nickname`]: { like: `%${value}%` } };
|
return { [`t.nickname`]: { like: `%${value}%` } };
|
||||||
case 'zoneFk':
|
case 'zoneFk':
|
||||||
|
return { 't.zoneFk': value };
|
||||||
case 'department':
|
case 'department':
|
||||||
return { 'd.name': value };
|
return { 'd.name': value };
|
||||||
case 'totalWithVat':
|
case 'totalWithVat':
|
||||||
|
|
|
@ -39,7 +39,7 @@ const addToOrder = async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const { data: orderTotal } = await axios.get(
|
const { data: orderTotal } = await axios.get(
|
||||||
`Orders/${Number(route.params.id)}/getTotal`
|
`Orders/${Number(route.params.id)}/getTotal`,
|
||||||
);
|
);
|
||||||
|
|
||||||
state.set('orderTotal', orderTotal);
|
state.set('orderTotal', orderTotal);
|
||||||
|
@ -56,7 +56,7 @@ const canAddToOrder = () => {
|
||||||
if (canAddToOrder) {
|
if (canAddToOrder) {
|
||||||
const excedQuantity = prices.value.reduce(
|
const excedQuantity = prices.value.reduce(
|
||||||
(acc, { quantity }) => acc + quantity,
|
(acc, { quantity }) => acc + quantity,
|
||||||
0
|
0,
|
||||||
);
|
);
|
||||||
if (excedQuantity > props.item.available) {
|
if (excedQuantity > props.item.available) {
|
||||||
canAddToOrder = false;
|
canAddToOrder = false;
|
||||||
|
|
|
@ -57,7 +57,6 @@ const total = ref(0);
|
||||||
ref="descriptor"
|
ref="descriptor"
|
||||||
:url="`Orders/${entityId}`"
|
:url="`Orders/${entityId}`"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
module="Order"
|
|
||||||
title="client.name"
|
title="client.name"
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
data-key="Order"
|
data-key="Order"
|
||||||
|
|
|
@ -71,8 +71,9 @@ const columns = computed(() => [
|
||||||
format: (row) => row?.name,
|
format: (row) => row?.name,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'center',
|
||||||
name: 'isConfirmed',
|
name: 'isConfirmed',
|
||||||
|
component: 'checkbox',
|
||||||
label: t('module.isConfirmed'),
|
label: t('module.isConfirmed'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -95,7 +96,9 @@ const columns = computed(() => [
|
||||||
columnField: {
|
columnField: {
|
||||||
component: null,
|
component: null,
|
||||||
},
|
},
|
||||||
style: 'color="positive"',
|
style: () => {
|
||||||
|
return { color: 'positive' };
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
|
|
@ -51,7 +51,6 @@ const columns = computed(() => [
|
||||||
name: 'isAnyVolumeAllowed',
|
name: 'isAnyVolumeAllowed',
|
||||||
component: 'checkbox',
|
component: 'checkbox',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
disable: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
@ -72,7 +71,7 @@ const columns = computed(() => [
|
||||||
:data-key
|
:data-key
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
prefix="agency"
|
prefix="agency"
|
||||||
:right-filter="false"
|
:right-filter="true"
|
||||||
:array-data-props="{
|
:array-data-props="{
|
||||||
url: 'Agencies',
|
url: 'Agencies',
|
||||||
order: 'name',
|
order: 'name',
|
||||||
|
@ -83,6 +82,7 @@ const columns = computed(() => [
|
||||||
<VnTable
|
<VnTable
|
||||||
:data-key
|
:data-key
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
|
is-editable="false"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
:use-model="true"
|
:use-model="true"
|
||||||
redirect="route/agency"
|
redirect="route/agency"
|
||||||
|
|
|
@ -22,7 +22,6 @@ const card = computed(() => store.data);
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
module="Agency"
|
|
||||||
data-key="Agency"
|
data-key="Agency"
|
||||||
:url="`Agencies/${entityId}`"
|
:url="`Agencies/${entityId}`"
|
||||||
:title="card?.name"
|
:title="card?.name"
|
||||||
|
|
|
@ -46,7 +46,6 @@ const exprBuilder = (param, value) => {
|
||||||
url="AgencyModes"
|
url="AgencyModes"
|
||||||
:filter="{ fields: ['id', 'name'] }"
|
:filter="{ fields: ['id', 'name'] }"
|
||||||
sort-by="name ASC"
|
sort-by="name ASC"
|
||||||
limit="30"
|
|
||||||
@on-fetch="(data) => (agencyList = data)"
|
@on-fetch="(data) => (agencyList = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
|
@ -54,7 +53,6 @@ const exprBuilder = (param, value) => {
|
||||||
url="Agencies"
|
url="Agencies"
|
||||||
:filter="{ fields: ['id', 'name'] }"
|
:filter="{ fields: ['id', 'name'] }"
|
||||||
sort-by="name ASC"
|
sort-by="name ASC"
|
||||||
limit="30"
|
|
||||||
@on-fetch="(data) => (agencyAgreementList = data)"
|
@on-fetch="(data) => (agencyAgreementList = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
|
@ -120,7 +118,11 @@ const exprBuilder = (param, value) => {
|
||||||
<VnSelectSupplier
|
<VnSelectSupplier
|
||||||
:label="t('Autonomous')"
|
:label="t('Autonomous')"
|
||||||
v-model="params.supplierFk"
|
v-model="params.supplierFk"
|
||||||
hide-selected
|
url="Suppliers"
|
||||||
|
:fields="['name']"
|
||||||
|
sort-by="name ASC"
|
||||||
|
option-value="name"
|
||||||
|
option-label="name"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue