0
0
Fork 0

Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6946-refactorEntryNotes

This commit is contained in:
Jorge Penadés 2024-04-12 13:27:14 +02:00
commit a27bdc37d5
171 changed files with 3817 additions and 1132 deletions

View File

@ -5,14 +5,29 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [2418.01]
## [2416.01] - 2024-04-18
### Added
### Fixed
- (General) => Se vuelven a mostrar los parámetros en la url al aplicar un filtro
## [2414.01] - 2024-04-04 ## [2414.01] - 2024-04-04
### Added ### Added
- (Tickets) => Se añade la opción de clonar ticket. #6951
- (Parking) => Se añade la sección Parking. #5186
### Changed ### Changed
### Fixed ### Fixed
- (General) => Se corrige la redirección cuando hay 1 solo registro y cuando se aplica un filtro diferente al id al hacer una búsqueda general. #6893
## [2400.01] - 2024-01-04 ## [2400.01] - 2024-01-04
### Added ### Added

View File

@ -3,6 +3,7 @@ const { defineConfig } = require('cypress');
module.exports = defineConfig({ module.exports = defineConfig({
e2e: { e2e: {
baseUrl: 'http://localhost:9000/', baseUrl: 'http://localhost:9000/',
experimentalStudio: true,
fixturesFolder: 'test/cypress/fixtures', fixturesFolder: 'test/cypress/fixtures',
screenshotsFolder: 'test/cypress/screenshots', screenshotsFolder: 'test/cypress/screenshots',
supportFile: 'test/cypress/support/index.js', supportFile: 'test/cypress/support/index.js',

View File

@ -1,6 +1,6 @@
{ {
"name": "salix-front", "name": "salix-front",
"version": "24.14.0", "version": "24.18.0",
"description": "Salix frontend", "description": "Salix frontend",
"productName": "Salix", "productName": "Salix",
"author": "Verdnatura", "author": "Verdnatura",

View File

@ -29,7 +29,7 @@ module.exports = configure(function (/* ctx */) {
// app boot file (/src/boot) // app boot file (/src/boot)
// --> boot files are part of "main.js" // --> boot files are part of "main.js"
// https://v2.quasar.dev/quasar-cli/boot-files // https://v2.quasar.dev/quasar-cli/boot-files
boot: ['i18n', 'axios', 'vnDate', 'validations'], boot: ['i18n', 'axios', 'vnDate', 'validations', 'quasar.defaults'],
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
css: ['app.scss'], css: ['app.scss'],
@ -117,6 +117,7 @@ module.exports = configure(function (/* ctx */) {
secure: false, secure: false,
}, },
}, },
open: false,
}, },
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#framework // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#framework

View File

@ -16,7 +16,7 @@ onMounted(() => {
if (availableLocales.includes(userLang)) { if (availableLocales.includes(userLang)) {
locale.value = userLang; locale.value = userLang;
} else { } else {
locale.value = fallbackLocale; locale.value = fallbackLocale.value;
} }
}); });

View File

@ -0,0 +1,5 @@
import { QTable } from 'quasar';
import setDefault from './setDefault';
setDefault(QTable, 'pagination', { rowsPerPage: 0 });
setDefault(QTable, 'hidePagination', true);

View File

@ -0,0 +1,18 @@
export default function (component, key, value) {
const prop = component.props[key];
switch (typeof prop) {
case 'object':
prop.default = value;
break;
case 'function':
component.props[key] = {
type: prop,
default: value,
};
break;
case 'undefined':
throw new Error('unknown prop: ' + key);
default:
throw new Error('unhandled type: ' + typeof prop);
}
}

21
src/boot/qformMixin.js Normal file
View File

@ -0,0 +1,21 @@
import { getCurrentInstance } from 'vue';
const filterAvailableInput = element => element.classList.contains('q-field__native') && !element.disabled
const filterAvailableText = element => element.__vueParentComponent.type.name === 'QInput' && element.__vueParentComponent?.attrs?.class !== 'vn-input-date';
export default {
mounted: function () {
const vm = getCurrentInstance();
if (vm.type.name === 'QForm')
if (!['searchbarForm','filterPanelForm'].includes(this.$el?.id)) {
// AUTOFOCUS
const elementsArray = Array.from(this.$el.elements);
const firstInputElement = elementsArray.filter(filterAvailableInput).find(filterAvailableText);
if (firstInputElement) {
firstInputElement.focus();
}
}
},
};

View File

@ -0,0 +1 @@
export * from './defaults/qTable';

6
src/boot/quasar.js Normal file
View File

@ -0,0 +1,6 @@
import { boot } from 'quasar/wrappers';
import qFormMixin from './qformMixin';
export default boot(({ app }) => {
app.mixin(qFormMixin);
});

View File

@ -0,0 +1,174 @@
<script setup>
import { reactive, ref, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import FetchData from 'components/FetchData.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
import VnInput from 'src/components/common/VnInput.vue';
import FormModelPopup from './FormModelPopup.vue';
import VnInputDate from './common/VnInputDate.vue';
const emit = defineEmits(['onDataSaved']);
const { t } = useI18n();
const router = useRouter();
const manualInvoiceFormData = reactive({
maxShipped: Date.vnNew(),
});
const formModelPopupRef = ref();
const invoiceOutSerialsOptions = ref([]);
const taxAreasOptions = ref([]);
const ticketsOptions = ref([]);
const clientsOptions = ref([]);
const isLoading = computed(() => formModelPopupRef.value?.isLoading);
const onDataSaved = async (formData, requestResponse) => {
emit('onDataSaved', formData, requestResponse);
if (requestResponse && requestResponse.id)
router.push({ name: 'InvoiceOutSummary', params: { id: requestResponse.id } });
};
</script>
<template>
<FetchData
url="InvoiceOutSerials"
:filter="{ where: { code: { neq: 'R' } }, order: ['code'] }"
@on-fetch="(data) => (invoiceOutSerialsOptions = data)"
auto-load
/>
<FetchData
url="TaxAreas"
:filter="{ order: ['code'] }"
@on-fetch="(data) => (taxAreasOptions = data)"
auto-load
/>
<FetchData
url="Tickets"
:filter="{ fields: ['id', 'nickname'], order: 'shipped DESC', limit: 30 }"
@on-fetch="(data) => (ticketsOptions = data)"
auto-load
/>
<FetchData
url="Clients"
:filter="{ fields: ['id', 'name'], order: 'name ASC', limit: 30 }"
@on-fetch="(data) => (clientsOptions = data)"
auto-load
/>
<FormModelPopup
ref="formModelPopupRef"
:title="t('Create manual invoice')"
url-create="InvoiceOuts/createManualInvoice"
model="invoiceOut"
:form-initial-data="manualInvoiceFormData"
@on-data-saved="onDataSaved"
>
<template #form-inputs="{ data }">
<span v-if="isLoading" class="text-primary invoicing-text">
<QIcon name="warning" class="fill-icon q-mr-sm" size="md" />
{{ t('Invoicing in progress...') }}
</span>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<VnSelectFilter
:label="t('Ticket')"
:options="ticketsOptions"
hide-selected
option-label="id"
option-value="id"
v-model="data.ticketFk"
@update:model-value="data.clientFk = null"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel> #{{ scope.opt?.id }} </QItemLabel>
<QItemLabel caption>{{
scope.opt?.nickname
}}</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelectFilter>
</div>
<span class="row items-center" style="max-width: max-content">{{
t('Or')
}}</span>
<div class="col">
<VnSelectFilter
:label="t('Client')"
:options="clientsOptions"
hide-selected
option-label="name"
option-value="id"
v-model="data.clientFk"
@update:model-value="data.ticketFk = null"
/>
</div>
<div class="col">
<VnInputDate :label="t('Max date')" v-model="data.maxShipped" />
</div>
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<VnSelectFilter
:label="t('Serial')"
:options="invoiceOutSerialsOptions"
hide-selected
option-label="description"
option-value="code"
v-model="data.serial"
:required="true"
/>
</div>
<div class="col">
<VnSelectFilter
:label="t('Area')"
:options="taxAreasOptions"
hide-selected
option-label="code"
option-value="code"
v-model="data.taxArea"
:required="true"
/>
</div>
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<VnInput
:label="t('Reference')"
type="textarea"
v-model="data.reference"
fill-input
autogrow
/>
</VnRow>
</template>
</FormModelPopup>
</template>
<style lang="scss" scoped>
.invoicing-text {
display: flex;
justify-content: center;
align-items: center;
color: $primary;
font-size: 24px;
margin-bottom: 8px;
}
</style>
<i18n>
es:
Create manual invoice: Crear factura manual
Ticket: Ticket
Client: Cliente
Max date: Fecha límite
Serial: Serie
Area: Area
Reference: Referencia
Or: O
Invoicing in progress...: Facturación en progreso...
</i18n>

View File

@ -28,8 +28,23 @@ const countriesOptions = ref([]);
const provincesOptions = ref([]); const provincesOptions = ref([]);
const townsLocationOptions = ref([]); const townsLocationOptions = ref([]);
const onDataSaved = (dataSaved) => { const onDataSaved = (formData) => {
emit('onDataSaved', dataSaved); const newPostcode = {
...formData
};
const townObject = townsLocationOptions.value.find(
({id}) => id === formData.townFk
);
newPostcode.town = townObject?.name;
const provinceObject = provincesOptions.value.find(
({id}) => id === formData.provinceFk
);
newPostcode.province = provinceObject?.name;
const countryObject = countriesOptions.value.find(
({id}) => id === formData.countryFk
);
newPostcode.country = countryObject?.country;
emit('onDataSaved', newPostcode);
}; };
const onCityCreated = async ({ name, provinceFk }, formData) => { const onCityCreated = async ({ name, provinceFk }, formData) => {
@ -73,7 +88,7 @@ const onProvinceCreated = async ({ name }, formData) => {
:title="t('New postcode')" :title="t('New postcode')"
:subtitle="t('Please, ensure you put the correct data!')" :subtitle="t('Please, ensure you put the correct data!')"
:form-initial-data="postcodeFormData" :form-initial-data="postcodeFormData"
@on-data-saved="onDataSaved($event)" @on-data-saved="onDataSaved"
> >
<template #form-inputs="{ data, validate }"> <template #form-inputs="{ data, validate }">
<VnRow class="row q-gutter-md q-mb-md"> <VnRow class="row q-gutter-md q-mb-md">

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { h, onMounted } from 'vue'; import { onMounted } from 'vue';
import axios from 'axios'; import axios from 'axios';
const $props = defineProps({ const $props = defineProps({
@ -60,3 +60,6 @@ async function fetch(fetchFilter = {}) {
} }
} }
</script> </script>
<template>
<template></template>
</template>

View File

@ -202,7 +202,6 @@ const selectItem = ({ id }) => {
<QTable <QTable
:columns="tableColumns" :columns="tableColumns"
:rows="tableRows" :rows="tableRows"
:pagination="{ rowsPerPage: 0 }"
:loading="loading" :loading="loading"
:hide-header="!tableRows || !tableRows.length > 0" :hide-header="!tableRows || !tableRows.length > 0"
:no-data-label="t('Enter a new search')" :no-data-label="t('Enter a new search')"

View File

@ -200,7 +200,6 @@ const selectTravel = ({ id }) => {
<QTable <QTable
:columns="tableColumns" :columns="tableColumns"
:rows="tableRows" :rows="tableRows"
:pagination="{ rowsPerPage: 0 }"
:loading="loading" :loading="loading"
:hide-header="!tableRows || !tableRows.length > 0" :hide-header="!tableRows || !tableRows.length > 0"
:no-data-label="t('Enter a new search')" :no-data-label="t('Enter a new search')"

View File

@ -78,10 +78,6 @@ const $props = defineProps({
const emit = defineEmits(['onFetch', 'onDataSaved']); const emit = defineEmits(['onFetch', 'onDataSaved']);
defineExpose({
save,
});
const componentIsRendered = ref(false); const componentIsRendered = ref(false);
onMounted(async () => { onMounted(async () => {
@ -105,16 +101,16 @@ onMounted(async () => {
}); });
onBeforeRouteLeave((to, from, next) => { onBeforeRouteLeave((to, from, next) => {
if (!hasChanges.value) next(); if (hasChanges.value)
quasar.dialog({
quasar.dialog({ component: VnConfirm,
component: VnConfirm, componentProps: {
componentProps: { title: t('Unsaved changes will be lost'),
title: t('Unsaved changes will be lost'), message: t('Are you sure exit without saving?'),
message: t('Are you sure exit without saving?'), promise: () => next(),
promise: () => next(), },
}, });
}); else next();
}); });
onUnmounted(() => { onUnmounted(() => {
@ -136,12 +132,12 @@ const formUrl = computed(() => $props.url);
const defaultButtons = computed(() => ({ const defaultButtons = computed(() => ({
save: { save: {
color: 'primary', color: 'primary',
icon: 'restart_alt', icon: 'save',
label: 'globals.save', label: 'globals.save',
}, },
reset: { reset: {
color: 'primary', color: 'primary',
icon: 'save', icon: 'restart_alt',
label: 'globals.reset', label: 'globals.reset',
}, },
...$props.defaultButtons, ...$props.defaultButtons,
@ -227,6 +223,12 @@ watch(formUrl, async () => {
reset(); reset();
fetch(); fetch();
}); });
defineExpose({
save,
isLoading,
hasChanges,
});
</script> </script>
<template> <template>
<div class="column items-center full-width"> <div class="column items-center full-width">
@ -283,6 +285,9 @@ watch(formUrl, async () => {
/> />
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.q-notifications {
color: black;
}
#formModel { #formModel {
max-width: 800px; max-width: 800px;
width: 100%; width: 100%;

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { ref } from 'vue'; import { ref, computed } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import FormModel from 'components/FormModel.vue'; import FormModel from 'components/FormModel.vue';
@ -39,21 +39,28 @@ const $props = defineProps({
const { t } = useI18n(); const { t } = useI18n();
const formModelRef = ref(null);
const closeButton = ref(null); const closeButton = ref(null);
const isLoading = ref(false);
const onDataSaved = (formData, requestResponse) => { const onDataSaved = (formData, requestResponse) => {
emit('onDataSaved', formData, requestResponse); emit('onDataSaved', formData, requestResponse);
closeForm(); closeForm();
}; };
const closeForm = () => { const isLoading = computed(() => formModelRef.value?.isLoading);
const closeForm = async () => {
if (closeButton.value) closeButton.value.click(); if (closeButton.value) closeButton.value.click();
}; };
defineExpose({
isLoading,
});
</script> </script>
<template> <template>
<FormModel <FormModel
ref="formModelRef"
:form-initial-data="formInitialData" :form-initial-data="formInitialData"
:observe-form-changes="false" :observe-form-changes="false"
:default-actions="false" :default-actions="false"
@ -71,6 +78,7 @@ const closeForm = () => {
<div class="q-mt-lg row justify-end"> <div class="q-mt-lg row justify-end">
<QBtn <QBtn
:label="t('globals.save')" :label="t('globals.save')"
:title="t('globals.save')"
type="submit" type="submit"
color="primary" color="primary"
:disabled="isLoading" :disabled="isLoading"
@ -78,6 +86,7 @@ const closeForm = () => {
/> />
<QBtn <QBtn
:label="t('globals.cancel')" :label="t('globals.cancel')"
:title="t('globals.cancel')"
type="reset" type="reset"
color="primary" color="primary"
flat flat

View File

@ -0,0 +1,96 @@
<script setup>
import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
const emit = defineEmits(['onSubmit']);
const $props = defineProps({
title: {
type: String,
default: '',
},
subtitle: {
type: String,
default: '',
},
defaultSubmitButton: {
type: Boolean,
default: true,
},
defaultCancelButton: {
type: Boolean,
default: true,
},
customSubmitButtonLabel: {
type: String,
default: '',
},
});
const { t } = useI18n();
const closeButton = ref(null);
const isLoading = ref(false);
const onSubmit = () => {
emit('onSubmit');
closeForm();
};
const closeForm = () => {
if (closeButton.value) closeButton.value.click();
};
</script>
<template>
<QForm
@submit="onSubmit($event)"
class="all-pointer-events full-width"
style="max-width: 800px"
>
<QCard class="q-pa-lg">
<span ref="closeButton" class="close-icon" v-close-popup>
<QIcon name="close" size="sm" />
</span>
<h1 class="title">{{ title }}</h1>
<p>{{ subtitle }}</p>
<slot name="form-inputs" />
<div class="q-mt-lg row justify-end">
<QBtn
v-if="defaultSubmitButton"
:label="customSubmitButtonLabel || t('globals.save')"
type="submit"
color="primary"
:disabled="isLoading"
:loading="isLoading"
/>
<QBtn
v-if="defaultCancelButton"
:label="t('globals.cancel')"
color="primary"
flat
class="q-ml-sm"
:disabled="isLoading"
:loading="isLoading"
v-close-popup
/>
<slot name="customButtons" />
</div>
</QCard>
</QForm>
</template>
<style lang="scss" scoped>
.title {
font-size: 17px;
font-weight: bold;
line-height: 20px;
}
.close-icon {
position: absolute;
top: 20px;
right: 20px;
cursor: pointer;
}
</style>

View File

@ -234,6 +234,6 @@ async function togglePinned(item, event) {
max-width: 256px; max-width: 256px;
} }
.header { .header {
color: #999999; color: var(--vn-label-color);
} }
</style> </style>

View File

@ -2,7 +2,7 @@
import { computed } from 'vue'; import { computed } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
const { t } = useI18n(); const { t, te } = useI18n();
const props = defineProps({ const props = defineProps({
item: { item: {
@ -11,19 +11,25 @@ const props = defineProps({
}, },
}); });
const item = computed(() => props.item); // eslint-disable-line vue/no-dupe-keys const itemComputed = computed(() => {
const item = JSON.parse(JSON.stringify(props.item));
const [, , section] = item.title.split('.');
if (!te(item.title)) item.title = t(`globals.pageTitles.${section}`);
return item;
});
</script> </script>
<template> <template>
<QItem active-class="text-primary" :to="{ name: item.name }" clickable v-ripple> <QItem active-class="bg-hover" :to="{ name: itemComputed.name }" clickable v-ripple>
<QItemSection avatar v-if="item.icon"> <QItemSection avatar v-if="itemComputed.icon">
<QIcon :name="item.icon" /> <QIcon :name="itemComputed.icon" />
</QItemSection> </QItemSection>
<QItemSection avatar v-if="!item.icon"> <QItemSection avatar v-if="!itemComputed.icon">
<QIcon name="disabled_by_default" /> <QIcon name="disabled_by_default" />
</QItemSection> </QItemSection>
<QItemSection>{{ t(item.title) }}</QItemSection> <QItemSection>{{ t(itemComputed.title) }}</QItemSection>
<QItemSection side> <QItemSection side>
<slot name="side" :item="item" /> <slot name="side" :item="itemComputed" />
</QItemSection> </QItemSection>
</QItem> </QItem>
</template> </template>

View File

@ -106,7 +106,7 @@ const pinnedModulesRef = ref();
width: max-content; width: max-content;
} }
.q-header { .q-header {
background-color: var(--vn-dark); background-color: var(--vn-section-color);
} }
</style> </style>
<i18n> <i18n>

View File

@ -0,0 +1,168 @@
<script setup>
import { ref, reactive } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import VnRow from 'components/ui/VnRow.vue';
import FetchData from 'components/FetchData.vue';
import VnSelectFilter from 'components/common/VnSelectFilter.vue';
import FormPopup from './FormPopup.vue';
import axios from 'axios';
import useNotify from 'src/composables/useNotify.js';
const $props = defineProps({
invoiceOutData: {
type: Object,
default: () => {},
},
});
const { t } = useI18n();
const router = useRouter();
const { notify } = useNotify();
const transferInvoiceParams = reactive({
id: $props.invoiceOutData?.id,
refFk: $props.invoiceOutData?.ref,
});
const closeButton = ref(null);
const clientsOptions = ref([]);
const rectificativeTypeOptions = ref([]);
const siiTypeInvoiceOutsOptions = ref([]);
const invoiceCorrectionTypesOptions = ref([]);
const closeForm = () => {
if (closeButton.value) closeButton.value.click();
};
const transferInvoice = async () => {
try {
const { data } = await axios.post(
'InvoiceOuts/transferInvoice',
transferInvoiceParams
);
notify(t('Transferred invoice'), 'positive');
closeForm();
router.push('InvoiceOutSummary', { id: data.id });
} catch (err) {
console.error('Error transfering invoice', err);
}
};
</script>
<template>
<FetchData
url="Clients"
@on-fetch="(data) => (clientsOptions = data)"
:filter="{ fields: ['id', 'name'], order: 'id', limit: 30 }"
auto-load
/>
<FetchData
url="CplusRectificationTypes"
:filter="{ order: 'description' }"
@on-fetch="(data) => (rectificativeTypeOptions = data)"
auto-load
/>
<FetchData
url="SiiTypeInvoiceOuts"
:filter="{ where: { code: { like: 'R%' } } }"
@on-fetch="(data) => (siiTypeInvoiceOutsOptions = data)"
auto-load
/>
<FetchData
url="InvoiceCorrectionTypes"
@on-fetch="(data) => (invoiceCorrectionTypesOptions = data)"
auto-load
/>
<FormPopup
@on-submit="transferInvoice()"
:title="t('Transfer invoice')"
:custom-submit-button-label="t('Transfer client')"
:default-cancel-button="false"
>
<template #form-inputs>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<VnSelectFilter
:label="t('Client')"
:options="clientsOptions"
hide-selected
option-label="name"
option-value="id"
v-model="transferInvoiceParams.newClientFk"
:required="true"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>
#{{ scope.opt?.id }} -
{{ scope.opt?.name }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelectFilter>
</div>
<div class="col">
<VnSelectFilter
:label="t('Rectificative type')"
:options="rectificativeTypeOptions"
hide-selected
option-label="description"
option-value="id"
v-model="transferInvoiceParams.cplusRectificationTypeFk"
:required="true"
/>
</div>
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<VnSelectFilter
:label="t('Class')"
:options="siiTypeInvoiceOutsOptions"
hide-selected
option-label="description"
option-value="id"
v-model="transferInvoiceParams.siiTypeInvoiceOutFk"
:required="true"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>
{{ scope.opt?.code }} -
{{ scope.opt?.description }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelectFilter>
</div>
<div class="col">
<VnSelectFilter
:label="t('Type')"
:options="invoiceCorrectionTypesOptions"
hide-selected
option-label="description"
option-value="id"
v-model="transferInvoiceParams.invoiceCorrectionTypeFk"
:required="true"
/>
</div>
</VnRow>
</template>
</FormPopup>
</template>
<i18n>
es:
Transfer invoice: Transferir factura
Transfer client: Transferir cliente
Client: Cliente
Rectificative type: Tipo rectificativa
Class: Clase
Type: Tipo
Transferred invoice: Factura transferida
</i18n>

View File

@ -7,12 +7,16 @@ import axios from 'axios';
import { useState } from 'src/composables/useState'; import { useState } from 'src/composables/useState';
import { useSession } from 'src/composables/useSession'; import { useSession } from 'src/composables/useSession';
import { localeEquivalence } from 'src/i18n/index'; import { localeEquivalence } from 'src/i18n/index';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
import VnRow from 'components/ui/VnRow.vue';
import FetchData from 'components/FetchData.vue';
const state = useState(); const state = useState();
const session = useSession(); const session = useSession();
const router = useRouter(); const router = useRouter();
const { t, locale } = useI18n(); const { t, locale } = useI18n();
import { useClipboard } from 'src/composables/useClipboard'; import { useClipboard } from 'src/composables/useClipboard';
import { ref } from 'vue';
const { copyText } = useClipboard(); const { copyText } = useClipboard();
const userLocale = computed({ const userLocale = computed({
get() { get() {
@ -45,6 +49,9 @@ const darkMode = computed({
const user = state.getUser(); const user = state.getUser();
const token = session.getTokenMultimedia(); const token = session.getTokenMultimedia();
const warehousesData = ref();
const companiesData = ref();
const accountBankData = ref();
onMounted(async () => { onMounted(async () => {
updatePreferences(); updatePreferences();
@ -87,10 +94,28 @@ function copyUserToken() {
</script> </script>
<template> <template>
<QMenu anchor="bottom left"> <FetchData
url="Warehouses"
order="name"
@on-fetch="(data) => (warehousesData = data)"
auto-load
/>
<FetchData
url="Companies"
order="name"
@on-fetch="(data) => (companiesData = data)"
auto-load
/>
<FetchData
url="Accountings"
order="name"
@on-fetch="(data) => (accountBankData = data)"
auto-load
/>
<QMenu anchor="bottom left" class="bg-vn-section-color">
<div class="row no-wrap q-pa-md"> <div class="row no-wrap q-pa-md">
<div class="column panel"> <div class="col column">
<div class="text-h6 q-mb-md"> <div class="text-h6 q-ma-sm q-mb-none">
{{ t('components.userPanel.settings') }} {{ t('components.userPanel.settings') }}
</div> </div>
<QToggle <QToggle
@ -114,7 +139,7 @@ function copyUserToken() {
<QSeparator vertical inset class="q-mx-lg" /> <QSeparator vertical inset class="q-mx-lg" />
<div class="column items-center panel"> <div class="col column items-center q-mb-sm">
<QAvatar size="80px"> <QAvatar size="80px">
<QImg <QImg
:src="`/api/Images/user/160x160/${user.id}/download?access_token=${token}`" :src="`/api/Images/user/160x160/${user.id}/download?access_token=${token}`"
@ -131,7 +156,6 @@ function copyUserToken() {
> >
@{{ user.name }} @{{ user.name }}
</div> </div>
<QBtn <QBtn
id="logout" id="logout"
color="orange" color="orange"
@ -141,17 +165,63 @@ function copyUserToken() {
icon="logout" icon="logout"
@click="logout()" @click="logout()"
v-close-popup v-close-popup
dense
/> />
</div> </div>
</div> </div>
<QSeparator inset class="q-mx-lg" />
<div class="col q-gutter-xs q-pa-md">
<VnRow>
<VnSelectFilter
:label="t('components.userPanel.localWarehouse')"
v-model="user.localWarehouseFk"
:options="warehousesData"
option-label="name"
option-value="id"
/>
<VnSelectFilter
:label="t('components.userPanel.localBank')"
hide-selected
v-model="user.localBankFk"
:options="accountBankData"
option-label="bank"
option-value="id"
></VnSelectFilter>
</VnRow>
<VnRow>
<VnSelectFilter
:label="t('components.userPanel.localCompany')"
hide-selected
v-model="user.companyFk"
:options="companiesData"
option-label="code"
option-value="id"
/>
<VnSelectFilter
:label="t('components.userPanel.userWarehouse')"
hide-selected
v-model="user.warehouseFk"
:options="warehousesData"
option-label="name"
option-value="id"
/>
</VnRow>
<VnRow>
<VnSelectFilter
:label="t('components.userPanel.userCompany')"
hide-selected
v-model="user.companyFk"
:options="companiesData"
option-label="code"
option-value="id"
style="flex: 0"
/>
</VnRow>
</div>
</QMenu> </QMenu>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.panel {
width: 150px;
}
.copyText { .copyText {
&:hover { &:hover {
cursor: alias; cursor: alias;

View File

@ -5,16 +5,16 @@ import { useQuasar } from 'quasar';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useCamelCase } from 'src/composables/useCamelCase'; import { useCamelCase } from 'src/composables/useCamelCase';
const router = useRouter(); const { currentRoute } = useRouter();
const quasar = useQuasar(); const { screen } = useQuasar();
const { t } = useI18n(); const { t, te } = useI18n();
let matched = ref([]); let matched = ref([]);
let breadcrumbs = ref([]); let breadcrumbs = ref([]);
let root = ref(null); let root = ref(null);
watchEffect(() => { watchEffect(() => {
matched.value = router.currentRoute.value.matched.filter( matched.value = currentRoute.value.matched.filter(
(matched) => Object.keys(matched.meta).length (matched) => Object.keys(matched.meta).length
); );
breadcrumbs.value.length = 0; breadcrumbs.value.length = 0;
@ -34,13 +34,17 @@ function getBreadcrumb(param) {
icon: param.meta.icon, icon: param.meta.icon,
path: param.path, path: param.path,
root: root.value, root: root.value,
locale: t(`globals.pageTitles.${param.meta.title}`),
}; };
if (quasar.screen.gt.sm) { if (screen.gt.sm) {
breadcrumb.name = param.name; breadcrumb.name = param.name;
breadcrumb.title = useCamelCase(param.meta.title); breadcrumb.title = useCamelCase(param.meta.title);
} }
const moduleLocale = `${breadcrumb.root}.pageTitles.${breadcrumb.title}`;
if (te(moduleLocale)) breadcrumb.locale = t(moduleLocale);
return breadcrumb; return breadcrumb;
} }
</script> </script>
@ -50,7 +54,7 @@ function getBreadcrumb(param) {
v-for="(breadcrumb, index) of breadcrumbs" v-for="(breadcrumb, index) of breadcrumbs"
:key="index" :key="index"
:icon="breadcrumb.icon" :icon="breadcrumb.icon"
:label="t(`${breadcrumb.root}.pageTitles.${breadcrumb.title}`)" :label="breadcrumb.locale"
:to="breadcrumb.path" :to="breadcrumb.path"
/> />
</QBreadcrumbs> </QBreadcrumbs>
@ -71,7 +75,7 @@ function getBreadcrumb(param) {
} }
&--last, &--last,
&__separator { &__separator {
color: var(--vn-label); color: var(--vn-label-color);
} }
} }
@media (max-width: $breakpoint-md) { @media (max-width: $breakpoint-md) {

View File

@ -5,7 +5,7 @@ import { useCapitalize } from 'src/composables/useCapitalize';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
const props = defineProps({ const props = defineProps({
modelValue: { type: String, default: '' }, modelValue: { type: [String, Number], default: '' },
}); });
const { t } = useI18n(); const { t } = useI18n();

View File

@ -198,9 +198,13 @@ function addDefaultData(data) {
en: en:
contentTypesInfo: Allowed file types {allowedContentTypes} contentTypesInfo: Allowed file types {allowedContentTypes}
EntryDmsDescription: Reference {reference} EntryDmsDescription: Reference {reference}
WorkersDescription: Working of employee id {reference}
SupplierDmsDescription: Reference {reference}
es: es:
Generate identifier for original file: Generar identificador para archivo original Generate identifier for original file: Generar identificador para archivo original
contentTypesInfo: Tipos de archivo permitidos {allowedContentTypes} contentTypesInfo: Tipos de archivo permitidos {allowedContentTypes}
EntryDmsDescription: Referencia {reference} EntryDmsDescription: Referencia {reference}
WorkersDescription: Laboral del empleado {reference}
SupplierDmsDescription: Referencia {reference}
</i18n> </i18n>

View File

@ -5,9 +5,11 @@ import { useRoute } from 'vue-router';
import { useQuasar, QCheckbox, QBtn, QInput } from 'quasar'; import { useQuasar, QCheckbox, QBtn, QInput } from 'quasar';
import axios from 'axios'; import axios from 'axios';
import FetchData from 'components/FetchData.vue'; import VnPaginate from 'components/ui/VnPaginate.vue';
import VnDms from 'src/components/common/VnDms.vue'; import VnDms from 'src/components/common/VnDms.vue';
import VnConfirm from 'components/ui/VnConfirm.vue'; import VnConfirm from 'components/ui/VnConfirm.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import VnUserLink from '../ui/VnUserLink.vue';
import { downloadFile } from 'src/composables/downloadFile'; import { downloadFile } from 'src/composables/downloadFile';
const route = useRoute(); const route = useRoute();
@ -26,6 +28,15 @@ const $props = defineProps({
type: String, type: String,
default: null, default: null,
}, },
deleteModel: {
type: String,
default: null,
},
downloadModel: {
type: String,
required: false,
default: null,
},
defaultDmsCode: { defaultDmsCode: {
type: String, type: String,
required: true, required: true,
@ -74,7 +85,7 @@ const dmsFilter = {
], ],
}, },
}, },
order: ['dmsFk DESC'], where: { [$props.filter]: route.params.id },
}; };
const columns = computed(() => [ const columns = computed(() => [
@ -94,12 +105,12 @@ const columns = computed(() => [
props: (prop) => ({ props: (prop) => ({
readonly: true, readonly: true,
borderless: true, borderless: true,
'model-value': prop.row.dmsType.name, 'model-value': prop.row.dmsType?.name,
}), }),
}, },
{ {
align: 'left', align: 'left',
field: 'order', field: 'hardCopyNumber',
label: t('globals.order'), label: t('globals.order'),
name: 'order', name: 'order',
component: 'span', component: 'span',
@ -117,6 +128,7 @@ const columns = computed(() => [
label: t('globals.description'), label: t('globals.description'),
name: 'description', name: 'description',
component: 'span', component: 'span',
props: (prop) => ({ value: prop.value?.toUpperCase() }),
}, },
{ {
align: 'left', align: 'left',
@ -136,21 +148,53 @@ const columns = computed(() => [
name: 'file', name: 'file',
component: 'span', component: 'span',
}, },
{
align: 'left',
field: 'worker',
label: t('globals.worker'),
name: 'worker',
component: VnUserLink,
props: (prop) => ({
name: prop.row.worker?.user?.name.toLowerCase(),
workerId: prop.row.worker?.id,
}),
},
{
align: 'left',
field: 'created',
label: t('globals.created'),
name: 'created',
component: VnInputDate,
props: (prop) => ({
disable: true,
'model-value': prop.row.created,
}),
},
{ {
field: 'options', field: 'options',
name: 'options', name: 'options',
components: [ components: [
{ {
component: QBtn, component: QBtn,
name: 'download',
isDocuware: true,
props: () => ({ props: () => ({
icon: 'cloud_download', icon: 'cloud_download',
flat: true, flat: true,
color: 'primary', color: 'primary',
}), }),
click: (prop) => downloadFile(prop.row.id), click: (prop) =>
downloadFile(
prop.row.id,
$props.downloadModel,
null,
prop.row.download
),
}, },
{ {
component: QBtn, component: QBtn,
name: 'edit',
external: false,
props: () => ({ props: () => ({
icon: 'edit', icon: 'edit',
flat: true, flat: true,
@ -160,6 +204,8 @@ const columns = computed(() => [
}, },
{ {
component: QBtn, component: QBtn,
name: 'delete',
external: false,
props: () => ({ props: () => ({
icon: 'delete', icon: 'delete',
flat: true, flat: true,
@ -167,12 +213,24 @@ const columns = computed(() => [
}), }),
click: (prop) => deleteDms(prop.row.id), click: (prop) => deleteDms(prop.row.id),
}, },
{
component: QBtn,
name: 'open',
external: true,
props: () => ({
icon: 'open_in_new',
flat: true,
color: 'primary',
}),
click: (prop) => open(prop.row.url),
},
], ],
}, },
]); ]);
function setData(data) { function setData(data) {
const newData = data.map((value) => value.dms); const newData = data.map((value) => value.dms || value);
newData.sort((a, b) => new Date(b.created) - new Date(a.created));
rows.value = newData; rows.value = newData;
} }
@ -186,7 +244,7 @@ function deleteDms(dmsFk) {
}, },
}) })
.onOk(async () => { .onOk(async () => {
await axios.post(`${$props.model}/${dmsFk}/removeFile`); await axios.post(`${$props.deleteModel ?? $props.model}/${dmsFk}/removeFile`);
const index = rows.value.findIndex((row) => row.id == dmsFk); const index = rows.value.findIndex((row) => row.id == dmsFk);
rows.value.splice(index, 1); rows.value.splice(index, 1);
}); });
@ -206,85 +264,106 @@ function parseDms(data) {
} }
return data; return data;
} }
async function open(url) {
window.open(url).focus();
}
function shouldRenderButton(button, isExternal = false) {
if (button.name == 'download') return true;
return button.external === isExternal;
}
</script> </script>
<template> <template>
<FetchData <VnPaginate
ref="dmsRef" ref="dmsRef"
:data-key="$props.model"
:url="$props.model" :url="$props.model"
:filter="dmsFilter" :filter="dmsFilter"
:where="{ [$props.filter]: route.params.id }" :order="['dmsFk DESC']"
:auto-load="true"
@on-fetch="setData" @on-fetch="setData"
auto-load
/>
<QTable
:columns="columns"
:pagination="{ rowsPerPage: 0 }"
:rows="rows"
class="full-width q-mt-md"
hide-bottom
row-key="clientFk"
:grid="$q.screen.lt.sm"
> >
<template #body-cell="props"> <template #body>
<QTd :props="props"> <QTable
<QTr :props="props"> :columns="columns"
<component :rows="rows"
v-if="props.col.component" class="full-width q-mt-md"
:is="props.col.component" hide-bottom
v-bind="props.col.props && props.col.props(props)" row-key="clientFk"
> :grid="$q.screen.lt.sm"
<span >
v-if="props.col.component == 'span'" <template #body-cell="props">
style="white-space: wrap" <QTd :props="props">
>{{ props.value }}</span <QTr :props="props">
> <component
</component> v-if="props.col.component"
</QTr> :is="props.col.component"
v-bind="props.col.props && props.col.props(props)"
<div class="flex justify-center" v-if="props.col.name == 'options'"> >
<div v-for="button of props.col.components" :key="button.id"> <span
<component v-if="props.col.component == 'span'"
:is="button.component" style="white-space: wrap"
v-bind="button.props(props)" >{{ props.value }}</span
@click="button.click(props)"
/>
</div>
</div>
</QTd>
</template>
<template #item="props">
<div class="q-pa-xs col-xs-12 col-sm-6 grid-style-transition">
<QCard
bordered
flat
@keyup.ctrl.enter.stop="claimDevelopmentForm?.saveChanges()"
>
<QSeparator />
<QList dense>
<QItem v-for="col in props.cols" :key="col.name">
<div v-if="col.name != 'options'" class="row">
<span class="labelColor">{{ col.label }}:</span>
<span>{{ col.value }}</span>
</div>
<div v-if="col.name == 'options'" class="row">
<div
v-for="button of col.components"
:key="button.id"
class="row"
> >
<component </component>
:is="button.component" </QTr>
v-bind="button.props(col)"
@click="button.click(col)" <div class="row no-wrap" v-if="props.col.name == 'options'">
/> <div v-for="button of props.col.components" :key="button.id">
</div> <component
v-if="
shouldRenderButton(button, props.row.isDocuware)
"
:is="button.component"
v-bind="button.props(props)"
@click="button.click(props)"
/>
</div> </div>
</QItem> </div>
</QList> </QTd>
</QCard> </template>
</div> <template #item="props">
<div class="q-pa-xs col-xs-12 col-sm-6 grid-style-transition">
<QCard
bordered
flat
@keyup.ctrl.enter.stop="claimDevelopmentForm?.saveChanges()"
>
<QSeparator />
<QList dense>
<QItem v-for="col in props.cols" :key="col.name">
<div v-if="col.name != 'options'" class="row">
<span class="labelColor">{{ col.label }}:</span>
<span>{{ col.value }}</span>
</div>
<div v-if="col.name == 'options'" class="row">
<div
v-for="button of col.components"
:key="button.id"
class="row"
>
<component
v-if="
shouldRenderButton(
button.name,
props.row.isDocuware
)
"
:is="button.component"
v-bind="button.props(col)"
@click="button.click(col)"
/>
</div>
</div>
</QItem>
</QList>
</QCard>
</div>
</template>
</QTable>
</template> </template>
</QTable> </VnPaginate>
<QDialog v-model="formDialog.show"> <QDialog v-model="formDialog.show">
<VnDms <VnDms
:model="updateModel ?? model" :model="updateModel ?? model"
@ -304,7 +383,7 @@ function parseDms(data) {
row-gap: 20px; row-gap: 20px;
} }
.labelColor { .labelColor {
color: var(--vn-label); color: var(--vn-label-color);
} }
</style> </style>
<i18n> <i18n>

View File

@ -88,6 +88,10 @@ function locationFilter(search = '') {
function handleFetch(data) { function handleFetch(data) {
postcodesOptions.value = data; postcodesOptions.value = data;
} }
function onDataSaved(newPostcode) {
postcodesOptions.value.push(newPostcode);
value.value = newPostcode.code;
}
</script> </script>
<template> <template>
<FetchData <FetchData
@ -111,11 +115,13 @@ function handleFetch(data) {
clearable clearable
> >
<template #form> <template #form>
<CreateNewPostcode @on-data-saved="locationFilter()" /> <CreateNewPostcode
@on-data-saved="onDataSaved"
/>
</template> </template>
<template #option="{ itemProps, opt }"> <template #option="{ itemProps, opt }">
<QItem v-bind="itemProps"> <QItem v-bind="itemProps">
<QItemSection v-if="opt"> <QItemSection v-if="opt.code">
<QItemLabel>{{ opt.code }}</QItemLabel> <QItemLabel>{{ opt.code }}</QItemLabel>
<QItemLabel caption>{{ showLabel(opt) }}</QItemLabel> <QItemLabel caption>{{ showLabel(opt) }}</QItemLabel>
</QItemSection> </QItemSection>

View File

@ -403,7 +403,7 @@ setLogTree();
auto-load auto-load
/> />
<div <div
class="column items-center logs origin-log" class="column items-center logs origin-log q-mt-md"
v-for="(originLog, originLogIndex) in logTree" v-for="(originLog, originLogIndex) in logTree"
:key="originLogIndex" :key="originLogIndex"
> >
@ -819,7 +819,7 @@ setLogTree();
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.q-card { .q-card {
background-color: var(--vn-gray); background-color: var(--vn-section-color);
} }
.q-item { .q-item {
min-height: 0px; min-height: 0px;
@ -836,7 +836,7 @@ setLogTree();
max-width: 400px; max-width: 400px;
& > .header { & > .header {
color: $dark; color: var(--vn-section-color);
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
@ -916,7 +916,7 @@ setLogTree();
font-style: italic; font-style: italic;
} }
.model-id { .model-id {
color: var(--vn-label); color: var(--vn-label-color);
font-size: 0.9rem; font-size: 0.9rem;
} }
.q-btn { .q-btn {
@ -942,7 +942,7 @@ setLogTree();
} }
.change-info { .change-info {
overflow: hidden; overflow: hidden;
background-color: var(--vn-dark); background-color: var(--vn-section-color);
& > .date { & > .date {
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
@ -981,7 +981,7 @@ setLogTree();
position: relative; position: relative;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
background-color: var(--vn-gray); background-color: var(--vn-section-color);
white-space: nowrap; white-space: nowrap;
box-sizing: border-box; box-sizing: border-box;
& > .q-icon { & > .q-icon {
@ -1030,7 +1030,7 @@ en:
ticketCreated: Created ticketCreated: Created
created: Created created: Created
isChargedToMana: Charged to mana isChargedToMana: Charged to mana
hasToPickUp: Has to pick Up pickup: Type of pickup
dmsFk: Document ID dmsFk: Document ID
text: Description text: Description
claimStateFk: Claim State claimStateFk: Claim State
@ -1069,7 +1069,7 @@ es:
ticketCreated: Creado ticketCreated: Creado
created: Creado created: Creado
isChargedToMana: Cargado a maná isChargedToMana: Cargado a maná
hasToPickUp: Se debe recoger pickup: Se debe recoger
dmsFk: ID documento dmsFk: ID documento
text: Descripción text: Descripción
claimStateFk: Estado de la reclamación claimStateFk: Estado de la reclamación

View File

@ -82,7 +82,7 @@ const toggleForm = () => {
border-radius: 50px; border-radius: 50px;
&.--add-icon { &.--add-icon {
color: var(--vn-text); color: var(--vn-text-color);
background-color: $primary; background-color: $primary;
} }
} }

View File

@ -51,8 +51,8 @@ const $props = defineProps({
default: null, default: null,
}, },
limit: { limit: {
type: Number, type: [Number, String],
default: 30, default: '30',
}, },
}); });
@ -151,7 +151,7 @@ watch(modelValue, (newValue) => {
@on-fetch="(data) => setOptions(data)" @on-fetch="(data) => setOptions(data)"
:where="where || { [optionValue]: value }" :where="where || { [optionValue]: value }"
:limit="limit" :limit="limit"
:order-by="orderBy" :sort-by="sortBy"
:fields="fields" :fields="fields"
/> />
<QSelect <QSelect

View File

@ -0,0 +1,25 @@
<script setup>
const $props = defineProps({
url: { type: String, default: null },
text: { type: String, default: null },
icon: { type: String, default: 'open_in_new' },
});
</script>
<template>
<div class="titleBox">
<div class="header-link">
<a :href="$props.url" :class="$props.url ? 'link' : 'color-vn-text'">
{{ $props.text }}
<QIcon v-if="url" :name="$props.icon" />
</a>
</div>
</div>
</template>
<style scoped lang="scss">
a {
font-size: large;
}
.titleBox {
padding-bottom: 2%;
}
</style>

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { onMounted, useSlots, watch, computed, ref } from 'vue'; import { onBeforeMount, useSlots, watch, computed, ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import SkeletonDescriptor from 'components/ui/SkeletonDescriptor.vue'; import SkeletonDescriptor from 'components/ui/SkeletonDescriptor.vue';
import { useArrayData } from 'composables/useArrayData'; import { useArrayData } from 'composables/useArrayData';
@ -41,29 +41,28 @@ const state = useState();
const slots = useSlots(); const slots = useSlots();
const { t } = useI18n(); const { t } = useI18n();
const { viewSummary } = useSummaryDialog(); const { viewSummary } = useSummaryDialog();
const entity = computed(() => useArrayData($props.dataKey).store.data); const arrayData = useArrayData($props.dataKey || $props.module, {
url: $props.url,
filter: $props.filter,
skip: 0,
});
const { store } = arrayData;
const entity = computed(() => store.data);
const isLoading = ref(false); const isLoading = ref(false);
defineExpose({ defineExpose({
getData, getData,
}); });
onMounted(async () => { onBeforeMount(async () => {
await getData(); await getData();
watch( watch(
() => $props.url, () => $props.url,
async (newUrl, lastUrl) => { async () => await getData()
if (newUrl == lastUrl) return;
await getData();
}
); );
}); });
async function getData() { async function getData() {
const arrayData = useArrayData($props.dataKey, { store.url = $props.url;
url: $props.url,
filter: $props.filter,
skip: 0,
});
isLoading.value = true; isLoading.value = true;
try { try {
const { data } = await arrayData.fetch({ append: false, updateRouter: false }); const { data } = await arrayData.fetch({ append: false, updateRouter: false });
@ -158,7 +157,7 @@ const emit = defineEmits(['onFetch']);
<div class="icons"> <div class="icons">
<slot name="icons" :entity="entity" /> <slot name="icons" :entity="entity" />
</div> </div>
<div class="actions"> <div class="actions justify-center">
<slot name="actions" :entity="entity" /> <slot name="actions" :entity="entity" />
</div> </div>
<slot name="after" /> <slot name="after" />
@ -175,33 +174,34 @@ const emit = defineEmits(['onFetch']);
<style lang="scss"> <style lang="scss">
.body { .body {
background-color: var(--vn-gray); background-color: var(--vn-section-color);
.text-h5 { .text-h5 {
font-size: 20px;
padding-top: 5px; padding-top: 5px;
padding-bottom: 5px; padding-bottom: 0px;
} }
.q-item { .q-item {
min-height: 20px; min-height: 20px;
.link { .link {
margin-left: 5px; margin-left: 10px;
} }
} }
.vn-label-value { .vn-label-value {
display: flex; display: flex;
padding: 2px 16px; padding: 0px 16px;
.label { .label {
color: var(--vn-label); color: var(--vn-label-color);
font-size: 12px; font-size: 14px;
&:not(:has(a))::after { &:not(:has(a))::after {
content: ':'; content: ':';
} }
} }
.value { .value {
color: var(--vn-text); color: var(--vn-text-color);
font-size: 14px; font-size: 14px;
margin-left: 12px; margin-left: 4px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
@ -219,18 +219,19 @@ const emit = defineEmits(['onFetch']);
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
span { span {
color: $primary; color: var(--vn-text-color);
font-weight: bold; font-weight: bold;
} }
} }
.subtitle { .subtitle {
color: var(--vn-text); color: var(--vn-text-color);
font-size: 16px; font-size: 16px;
margin-bottom: 15px; margin-bottom: 2px;
} }
.list-box { .list-box {
.q-item__label { .q-item__label {
color: var(--vn-label); color: var(--vn-label-color);
padding-bottom: 0%;
} }
} }
.descriptor { .descriptor {
@ -248,6 +249,7 @@ const emit = defineEmits(['onFetch']);
} }
.actions { .actions {
margin: 0 5px; margin: 0 5px;
justify-content: center !important;
} }
} }
</style> </style>

View File

@ -61,7 +61,7 @@ const toggleCardCheck = (item) => {
} }
.q-chip-color { .q-chip-color {
color: var(--vn-label); color: var(--vn-label-color) !important;
} }
.card-list-body { .card-list-body {
@ -75,7 +75,7 @@ const toggleCardCheck = (item) => {
width: 50%; width: 50%;
.label { .label {
width: 35%; width: 35%;
color: var(--vn-label); color: var(--vn-label-color);
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
@ -117,7 +117,7 @@ const toggleCardCheck = (item) => {
transition: background-color 0.2s; transition: background-color 0.2s;
} }
.card:hover { .card:hover {
background-color: var(--vn-gray); background-color: var(--vn-section-color);
} }
.list-items { .list-items {
width: 75%; width: 75%;

View File

@ -1,11 +1,10 @@
<script setup> <script setup>
import { onMounted, ref, watch } from 'vue'; import { ref, computed, watch, onBeforeMount } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import axios from 'axios';
import SkeletonSummary from 'components/ui/SkeletonSummary.vue'; import SkeletonSummary from 'components/ui/SkeletonSummary.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import { useArrayData } from 'src/composables/useArrayData';
const entity = ref();
const props = defineProps({ const props = defineProps({
url: { url: {
type: String, type: String,
@ -19,43 +18,48 @@ const props = defineProps({
type: Number, type: Number,
default: null, default: null,
}, },
dataKey: {
type: String,
default: '',
},
}); });
const emit = defineEmits(['onFetch']); const emit = defineEmits(['onFetch']);
const route = useRoute(); const route = useRoute();
const isSummary = ref(); const isSummary = ref();
const arrayData = useArrayData(props.dataKey || route.meta.moduleName, {
url: props.url,
filter: props.filter,
skip: 0,
});
const { store } = arrayData;
const entity = computed(() => store.data);
const isLoading = ref(false);
defineExpose({ defineExpose({
entity, entity,
fetch, fetch,
}); });
onMounted(() => { onBeforeMount(async () => {
isSummary.value = String(route.path).endsWith('/summary'); isSummary.value = String(route.path).endsWith('/summary');
fetch(); await fetch();
watch(props, async () => await fetch());
}); });
async function fetch() { async function fetch() {
const params = {}; store.url = props.url;
isLoading.value = true;
if (props.filter) params.filter = JSON.stringify(props.filter); const { data } = await arrayData.fetch({ append: false, updateRouter: false });
const { data } = await axios.get(props.url, { params });
entity.value = data;
emit('onFetch', data); emit('onFetch', data);
isLoading.value = false;
} }
watch(props, async () => {
entity.value = null;
fetch();
});
</script> </script>
<template> <template>
<div class="summary container"> <div class="summary container">
<QCard class="cardSummary"> <QCard class="cardSummary">
<SkeletonSummary v-if="!entity" /> <SkeletonSummary v-if="!entity || isLoading" />
<template v-if="entity"> <template v-if="entity && !isLoading">
<div class="summaryHeader bg-primary q-pa-sm text-weight-bolder"> <div class="summaryHeader bg-primary q-pa-sm text-weight-bolder">
<slot name="header-left"> <slot name="header-left">
<router-link <router-link
@ -70,7 +74,7 @@ watch(props, async () => {
</router-link> </router-link>
<span v-else></span> <span v-else></span>
</slot> </slot>
<slot name="header" :entity="entity"> <slot name="header" :entity="entity" dense>
<VnLv :label="`${entity.id} -`" :value="entity.name" /> <VnLv :label="`${entity.id} -`" :value="entity.name" />
</slot> </slot>
<slot name="header-right"> <slot name="header-right">
@ -93,7 +97,6 @@ watch(props, async () => {
.cardSummary { .cardSummary {
width: 100%; width: 100%;
.summaryHeader { .summaryHeader {
text-align: center; text-align: center;
font-size: 20px; font-size: 20px;
@ -107,7 +110,7 @@ watch(props, async () => {
justify-content: space-evenly; justify-content: space-evenly;
gap: 10px; gap: 10px;
padding: 10px; padding: 10px;
background-color: var(--vn-gray); background-color: var(--vn-section-color);
> .q-card.vn-one { > .q-card.vn-one {
flex: 1; flex: 1;
@ -124,17 +127,18 @@ watch(props, async () => {
> .q-card { > .q-card {
width: 100%; width: 100%;
background-color: var(--vn-gray); background-color: var(--vn-section-color);
padding: 7px; padding: 7px;
font-size: 16px; font-size: 16px;
min-width: 275px; min-width: 275px;
box-shadow: none;
.vn-label-value { .vn-label-value {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
margin-top: 2px; margin-top: 2px;
.label { .label {
color: var(--vn-label); color: var(--vn-label-color);
width: 8em; width: 8em;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
@ -144,7 +148,7 @@ watch(props, async () => {
flex-shrink: 0; flex-shrink: 0;
} }
.value { .value {
color: var(--vn-text); color: var(--vn-text-color);
overflow: hidden; overflow: hidden;
} }
} }
@ -163,12 +167,12 @@ watch(props, async () => {
margin-bottom: 9px; margin-bottom: 9px;
& .q-checkbox__label { & .q-checkbox__label {
margin-left: 31px; margin-left: 31px;
color: var(--vn-text); color: var(--vn-text-color);
} }
& .q-checkbox__inner { & .q-checkbox__inner {
position: absolute; position: absolute;
left: 0; left: 0;
color: var(--vn-label); color: var(--vn-label-color);
} }
} }
} }

View File

@ -164,7 +164,7 @@ function formatValue(value) {
</script> </script>
<template> <template>
<QForm @submit="search"> <QForm @submit="search" id="filterPanelForm">
<QList dense> <QList dense>
<QItem class="q-mt-xs"> <QItem class="q-mt-xs">
<QItemSection top> <QItemSection top>

View File

@ -15,7 +15,6 @@ const { t } = useI18n();
color="primary" color="primary"
padding="none" padding="none"
:href="`sip:${props.phoneNumber}`" :href="`sip:${props.phoneNumber}`"
:title="t('globals.microsip')"
@click.stop @click.stop
/> />
</template> </template>

View File

@ -61,7 +61,6 @@ const props = defineProps({
}); });
const emit = defineEmits(['onFetch', 'onPaginate']); const emit = defineEmits(['onFetch', 'onPaginate']);
defineExpose({ fetch });
const isLoading = ref(false); const isLoading = ref(false);
const pagination = ref({ const pagination = ref({
sortBy: props.order, sortBy: props.order,
@ -78,6 +77,7 @@ const arrayData = useArrayData(props.dataKey, {
userParams: props.userParams, userParams: props.userParams,
exprBuilder: props.exprBuilder, exprBuilder: props.exprBuilder,
}); });
const hasMoreData = ref();
const store = arrayData.store; const store = arrayData.store;
onMounted(() => { onMounted(() => {
@ -91,6 +91,10 @@ watch(
} }
); );
const addFilter = async (filter, params) => {
await arrayData.addFilter({ filter, params });
};
async function fetch() { async function fetch() {
await arrayData.fetch({ append: false }); await arrayData.fetch({ append: false });
if (!arrayData.hasMoreData.value) { if (!arrayData.hasMoreData.value) {
@ -106,11 +110,10 @@ async function paginate() {
isLoading.value = true; isLoading.value = true;
await arrayData.loadMore(); await arrayData.loadMore();
if (!arrayData.hasMoreData.value) { if (!arrayData.hasMoreData.value) {
if (store.userParamsChanged) arrayData.hasMoreData.value = true; if (store.userParamsChanged) arrayData.hasMoreData.value = true;
store.userParamsChanged = false; store.userParamsChanged = false;
isLoading.value = false; endPagination();
return; return;
} }
@ -120,12 +123,15 @@ async function paginate() {
pagination.value.sortBy = sortBy; pagination.value.sortBy = sortBy;
pagination.value.descending = descending; pagination.value.descending = descending;
isLoading.value = false; endPagination();
}
function endPagination() {
hasMoreData.value = arrayData.hasMoreData.value;
isLoading.value = false;
emit('onFetch', store.data); emit('onFetch', store.data);
emit('onPaginate'); emit('onPaginate');
} }
async function onLoad(index, done) { async function onLoad(index, done) {
if (!store.data) { if (!store.data) {
return done(); return done();
@ -140,6 +146,8 @@ async function onLoad(index, done) {
if (store.userParamsChanged) isDone = !arrayData.hasMoreData.value; if (store.userParamsChanged) isDone = !arrayData.hasMoreData.value;
done(isDone); done(isDone);
} }
defineExpose({ fetch, addFilter });
</script> </script>
<template> <template>
@ -188,6 +196,9 @@ async function onLoad(index, done) {
<QSpinner color="orange" size="md" /> <QSpinner color="orange" size="md" />
</div> </div>
</QInfiniteScroll> </QInfiniteScroll>
<div v-if="!isLoading && hasMoreData" class="w-full flex justify-center q-mt-md">
<QBtn color="primary" :label="t('Load more data')" @click="paginate()" />
</div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -204,4 +215,5 @@ async function onLoad(index, done) {
es: es:
No data to display: Sin datos que mostrar No data to display: Sin datos que mostrar
No results found: No se han encontrado resultados No results found: No se han encontrado resultados
Load more data: Cargar más resultados
</i18n> </i18n>

View File

@ -1,11 +1,9 @@
<script setup> <script setup>
import { onMounted, ref } from 'vue'; import { onMounted, ref } from 'vue';
import { useRouter, useRoute } from 'vue-router'; import { useRouter } from 'vue-router';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
import VnInput from 'src/components/common/VnInput.vue';
import { useArrayData } from 'composables/useArrayData'; import { useArrayData } from 'composables/useArrayData';
import VnInput from 'src/components/common/VnInput.vue';
const quasar = useQuasar(); const quasar = useQuasar();
@ -68,9 +66,8 @@ const props = defineProps({
}); });
const router = useRouter(); const router = useRouter();
const route = useRoute();
const arrayData = useArrayData(props.dataKey, { ...props }); const arrayData = useArrayData(props.dataKey, { ...props });
const store = arrayData.store; const { store } = arrayData;
const searchText = ref(''); const searchText = ref('');
onMounted(() => { onMounted(() => {
@ -92,23 +89,31 @@ async function search() {
}); });
if (!props.redirect) return; if (!props.redirect) return;
if (props.customRouteRedirectName) { if (props.customRouteRedirectName)
router.push({ return router.push({
name: props.customRouteRedirectName, name: props.customRouteRedirectName,
params: { id: searchText.value }, params: { id: searchText.value },
}); });
return;
}
const { matched: matches } = route; const { matched: matches } = router.currentRoute.value;
const { path } = matches[matches.length - 1]; const { path } = matches.at(-1);
const newRoute = path.replace(':id', searchText.value); const [, moduleName] = path.split('/');
await router.push(newRoute);
if (!store.data.length || store.data.length > 1)
return router.push({ path: `/${moduleName}/list` });
const targetId = store.data[0].id;
let targetUrl;
if (path.endsWith('/list')) targetUrl = path.replace('/list', `/${targetId}/summary`);
else if (path.includes(':id')) targetUrl = path.replace(':id', targetId);
await router.push({ path: targetUrl });
} }
</script> </script>
<template> <template>
<QForm @submit="search"> <QForm @submit="search" id="searchbarForm">
<VnInput <VnInput
id="searchbar" id="searchbar"
v-model="searchText" v-model="searchText"
@ -163,7 +168,12 @@ async function search() {
} }
#searchbar { #searchbar {
.q-field--standout.q-field--highlighted .q-field__control { .q-field--standout.q-field--highlighted .q-field__control {
background-color: var(--vn-text); background-color: white;
color: black;
.q-field__native,
.q-icon {
color: black !important;
}
} }
} }
</style> </style>

View File

@ -14,7 +14,7 @@ onUnmounted(() => {
</script> </script>
<template> <template>
<QToolbar class="bg-vn-dark justify-end sticky"> <QToolbar class="bg-vn-section-color justify-end sticky">
<slot name="st-data"> <slot name="st-data">
<div id="st-data"></div> <div id="st-data"></div>
</slot> </slot>
@ -24,6 +24,11 @@ onUnmounted(() => {
</slot> </slot>
</QToolbar> </QToolbar>
</template> </template>
<style lang="scss">
.q-toolbar {
background: var(--vn-section-color);
}
</style>
<style lang="scss" scoped> <style lang="scss" scoped>
.sticky { .sticky {
position: sticky; position: sticky;

View File

@ -76,7 +76,7 @@ const removeNode = (node) => {
notify(t('department.departmentRemoved'), 'positive'); notify(t('department.departmentRemoved'), 'positive');
await fetchNodeLeaves(parentFk); await fetchNodeLeaves(parentFk);
} catch (err) { } catch (err) {
console.log('Error removing department'); console.error('Error removing department');
} }
}); });
}; };

View File

@ -1,5 +1,6 @@
<script setup> <script setup>
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
const $props = defineProps({ const $props = defineProps({

View File

@ -1,11 +1,11 @@
import { useSession } from 'src/composables/useSession'; import { useSession } from 'src/composables/useSession';
import { getUrl } from './getUrl'; import { getUrl } from './getUrl';
const {getTokenMultimedia} = useSession(); const { getTokenMultimedia } = useSession();
const token = getTokenMultimedia(); const token = getTokenMultimedia();
export async function downloadFile(dmsId) { export async function downloadFile(id, model = 'dms', urlPath = '/downloadFile', url) {
let appUrl = await getUrl('', 'lilium'); let appUrl = await getUrl('', 'lilium');
appUrl = appUrl.replace('/#/', ''); appUrl = appUrl.replace('/#/', '');
window.open(`${appUrl}/api/dms/${dmsId}/downloadFile?access_token=${token}`); window.open(url ?? `${appUrl}/api/${model}/${id}${urlPath}?access_token=${token}`);
} }

View File

@ -1,5 +1,5 @@
import { onMounted, ref, computed } from 'vue'; import { onMounted, ref, computed } from 'vue';
import { useRouter, useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import axios from 'axios'; import axios from 'axios';
import { useArrayDataStore } from 'stores/useArrayDataStore'; import { useArrayDataStore } from 'stores/useArrayDataStore';
import { buildFilter } from 'filters/filterPanel'; import { buildFilter } from 'filters/filterPanel';
@ -15,7 +15,6 @@ export function useArrayData(key, userOptions) {
const store = arrayDataStore.get(key); const store = arrayDataStore.get(key);
const hasMoreData = ref(false); const hasMoreData = ref(false);
const router = useRouter();
const route = useRoute(); const route = useRoute();
let canceller = null; let canceller = null;
@ -98,14 +97,14 @@ export function useArrayData(key, userOptions) {
const { limit } = filter; const { limit } = filter;
hasMoreData.value = response.data.length === limit; hasMoreData.value = response.data.length >= limit;
if (append) { if (append) {
if (!store.data) store.data = []; if (!store.data) store.data = [];
for (const row of response.data) store.data.push(row); for (const row of response.data) store.data.push(row);
} else { } else {
store.data = response.data; store.data = response.data;
if (!document.querySelectorAll('[role="dialog"]')) if (!document.querySelectorAll('[role="dialog"]').length)
updateRouter && updateStateParams(); updateRouter && updateStateParams();
} }
@ -145,6 +144,8 @@ export function useArrayData(key, userOptions) {
store.userParams = userParams; store.userParams = userParams;
store.skip = 0; store.skip = 0;
store.filter.skip = 0; store.filter.skip = 0;
page.value = 1;
await fetch({ append: false }); await fetch({ append: false });
return { filter, params }; return { filter, params };
} }
@ -188,11 +189,15 @@ export function useArrayData(key, userOptions) {
if (store.userParams && Object.keys(store.userParams).length !== 0) if (store.userParams && Object.keys(store.userParams).length !== 0)
query.params = JSON.stringify(store.userParams); query.params = JSON.stringify(store.userParams);
if (router) const url = new URL(window.location.href);
router.replace({ const { hash: currentHash } = url;
path: route.path, const [currentRoute] = currentHash.split('?');
query: query,
}); const params = new URLSearchParams();
for (const param in query) params.append(param, query[param]);
url.hash = currentRoute + '?' + params.toString();
window.history.pushState({}, '', url.hash);
} }
const totalRows = computed(() => (store.data && store.data.length) || 0); const totalRows = computed(() => (store.data && store.data.length) || 0);

View File

@ -4,7 +4,7 @@ import { useQuasar } from 'quasar';
export function usePrintService() { export function usePrintService() {
const quasar = useQuasar(); const quasar = useQuasar();
const { getToken } = useSession(); const { getTokenMultimedia } = useSession();
function sendEmail(path, params) { function sendEmail(path, params) {
return axios.post(path, params).then(() => return axios.post(path, params).then(() =>
@ -19,7 +19,7 @@ export function usePrintService() {
function openReport(path, params) { function openReport(path, params) {
params = Object.assign( params = Object.assign(
{ {
access_token: getToken(), access_token: getTokenMultimedia(),
}, },
params params
); );

View File

@ -14,8 +14,8 @@ export function useSession() {
return localToken || sessionToken || ''; return localToken || sessionToken || '';
} }
function getTokenMultimedia() { function getTokenMultimedia() {
const localTokenMultimedia = localStorage.getItem('tokenMultimedia'); const localTokenMultimedia = localStorage.getItem('token'); // Temporal
const sessionTokenMultimedia = sessionStorage.getItem('tokenMultimedia'); const sessionTokenMultimedia = sessionStorage.getItem('token'); // Temporal
return localTokenMultimedia || sessionTokenMultimedia || ''; return localTokenMultimedia || sessionTokenMultimedia || '';
} }

View File

@ -0,0 +1,23 @@
import VnConfirm from 'components/ui/VnConfirm.vue';
import { useQuasar } from 'quasar';
export function useVnConfirm() {
const quasar = useQuasar();
const openConfirmationModal = (title, message, promise, successFn) => {
quasar
.dialog({
component: VnConfirm,
componentProps: {
title: title,
message: message,
promise: promise,
},
})
.onOk(async () => {
if (successFn) successFn();
});
};
return { openConfirmationModal };
}

View File

@ -2,29 +2,27 @@
@import './icons.scss'; @import './icons.scss';
body.body--light { body.body--light {
--fount-color: black; --font-color: black;
--vn-sectionColor: #ffffff; --vn-section-color: #e0e0e0;
--vn-pageColor: #e0e0e0; --vn-page-color: #ffffff;
background-color: var(--vn-pageColor); --vn-text-color: var(--font-color);
.q-header .q-toolbar { --vn-label-color: #5f5f5f;
color: var(--fount-color); --vn-accent-color: #e7e3e3;
}
--vn-text: var(--fount-color);
--vn-gray: var(--vn-sectionColor);
--vn-label: #5f5f5f;
--vn-dark: var(--vn-sectionColor);
--vn-light-gray: #e7e3e3;
}
background-color: var(--vn-page-color);
.q-header .q-toolbar {
color: var(--font-color);
}
}
body.body--dark { body.body--dark {
--vn-pageColor: #222; --vn-page-color: #222;
--vn-SectionColor: #3c3b3b; --vn-section-color: #3d3d3d;
background-color: var(--vn-pageColor); --vn-text-color: white;
--vn-text: white; --vn-label-color: #a8a8a8;
--vn-gray: var(--vn-SectionColor); --vn-accent-color: #424242;
--vn-label: #a8a8a8;
--vn-dark: var(--vn-SectionColor); background-color: var(--vn-page-color);
--vn-light-gray: #424242;
} }
a { a {
@ -39,6 +37,9 @@ a {
.tx-color-link { .tx-color-link {
color: $color-link !important; color: $color-link !important;
} }
.tx-color-font {
color: $color-link !important;
}
.header-link { .header-link {
color: $color-link !important; color: $color-link !important;
@ -59,28 +60,36 @@ a {
// Removes chrome autofill background // Removes chrome autofill background
input:-webkit-autofill, input:-webkit-autofill,
select:-webkit-autofill { select:-webkit-autofill {
color: var(--vn-text); color: var(--vn-text-color);
font-family: $typography-font-family; font-family: $typography-font-family;
-webkit-text-fill-color: var(--vn-text); -webkit-text-fill-color: var(--vn-text-color);
-webkit-background-clip: text !important; -webkit-background-clip: text !important;
background-clip: text !important; background-clip: text !important;
} }
.bg-vn-dark { .bg-vn-section-color {
background-color: var(--vn-dark); background-color: var(--vn-section-color);
}
.bg-hover {
background-color: #666666;
} }
.color-vn-text { .color-vn-text {
color: var(--vn-text); color: var(--vn-text-color);
} }
.color-vn-white { .color-vn-white {
color: $white; color: $white;
} }
.card-width {
max-width: 800px;
width: 100%;
}
.vn-card { .vn-card {
background-color: var(--vn-gray); background-color: var(--vn-section-color);
color: var(--vn-text); color: var(--vn-text-color);
border-radius: 8px; border-radius: 8px;
} }
@ -90,16 +99,20 @@ select:-webkit-autofill {
} }
.bg-vn-primary-row { .bg-vn-primary-row {
background-color: var(--vn-dark); background-color: var(--vn-section-color);
} }
.bg-vn-secondary-row { .bg-vn-secondary-row {
background-color: var(--vn-light-gray); background-color: var(--vn-accent-color);
}
.fill-icon {
font-variation-settings: 'FILL' 1;
} }
.vn-table-separation-row { .vn-table-separation-row {
height: 16px !important; height: 16px !important;
background-color: var(--vn-gray) !important; background-color: var(--vn-section-color) !important;
} }
/* Estilo para el asterisco en campos requeridos */ /* Estilo para el asterisco en campos requeridos */
@ -107,6 +120,37 @@ select:-webkit-autofill {
content: ' *'; content: ' *';
} }
.q-card,
.q-table,
.q-table__bottom,
.q-drawer {
background-color: var(--vn-section-color);
}
.q-chip,
.q-notification__message,
.q-notification__icon {
color: black;
}
.q-notification--standard.bg-negative {
background-color: #fa3939 !important;
}
.q-notification--standard.bg-positive {
background-color: #a3d131 !important;
}
.q-tooltip {
background-color: var(--vn-page-color);
color: var(--font-color);
font-size: medium;
}
.q-card__actions {
justify-content: center;
}
/* q-notification row items-stretch q-notification--standard bg-negative text-white */
input[type='number'] { input[type='number'] {
-moz-appearance: textfield; -moz-appearance: textfield;
} }
@ -115,4 +159,4 @@ input::-webkit-inner-spin-button {
appearance: none; appearance: none;
-webkit-appearance: none; -webkit-appearance: none;
-moz-appearance: none; -moz-appearance: none;
} }

View File

@ -14,15 +14,15 @@
// Tip: to add new colors https://quasar.dev/style/color-palette/#adding-your-own-colors // Tip: to add new colors https://quasar.dev/style/color-palette/#adding-your-own-colors
$primary: #ec8916; $primary: #ec8916;
$secondary: $primary; $secondary: $primary;
$positive: #21ba45; $positive: #c8e484;
$negative: #c10015; $negative: #fb5252;
$info: #31ccec; $info: #84d0e2;
$warning: #f2c037; $warning: #f4b974;
// Pendiente de cuadrar con la base de datos // Pendiente de cuadrar con la base de datos
$success: $positive; $success: $positive;
$alert: $negative; $alert: $negative;
$white: #fff; $white: #fff;
$dark: #3c3b3b; $dark: #3d3d3d;
// custom // custom
$color-link: #66bfff; $color-link: #66bfff;
$color-spacer-light: #a3a3a31f; $color-spacer-light: #a3a3a31f;

View File

@ -48,7 +48,6 @@ export default {
today: 'Today', today: 'Today',
yesterday: 'Yesterday', yesterday: 'Yesterday',
dateFormat: 'en-GB', dateFormat: 'en-GB',
microsip: 'Open in MicroSIP',
noSelectedRows: `You don't have any line selected`, noSelectedRows: `You don't have any line selected`,
downloadCSVSuccess: 'CSV downloaded successfully', downloadCSVSuccess: 'CSV downloaded successfully',
reference: 'Reference', reference: 'Reference',
@ -85,6 +84,15 @@ export default {
selectFile: 'Select a file', selectFile: 'Select a file',
copyClipboard: 'Copy on clipboard', copyClipboard: 'Copy on clipboard',
salesPerson: 'SalesPerson', salesPerson: 'SalesPerson',
code: 'Code',
pageTitles: {
summary: 'Summary',
basicData: 'Basic data',
log: 'Logs',
parkingList: 'Parkings list',
},
created: 'Created',
worker: 'Worker',
}, },
errors: { errors: {
statusUnauthorized: 'Access denied', statusUnauthorized: 'Access denied',
@ -492,6 +500,7 @@ export default {
request: 'Request', request: 'Request',
weight: 'Weight', weight: 'Weight',
goTo: 'Go to', goTo: 'Go to',
summaryAmount: 'Summary',
}, },
}, },
claim: { claim: {
@ -531,12 +540,14 @@ export default {
commercial: 'Commercial', commercial: 'Commercial',
province: 'Province', province: 'Province',
zone: 'Zone', zone: 'Zone',
customerId: 'client ID',
}, },
summary: { summary: {
customer: 'Customer', customer: 'Customer',
assignedTo: 'Assigned', assignedTo: 'Assigned',
attendedBy: 'Attended by', attendedBy: 'Attended by',
created: 'Created', created: 'Created',
pickup: 'Pickup',
state: 'State', state: 'State',
details: 'Details', details: 'Details',
item: 'Item', item: 'Item',
@ -558,13 +569,19 @@ export default {
responsible: 'Responsible', responsible: 'Responsible',
worker: 'Worker', worker: 'Worker',
redelivery: 'Redelivery', redelivery: 'Redelivery',
null: 'No',
agency: 'Agency',
delivery: 'Delivery',
}, },
basicData: { basicData: {
customer: 'Customer', customer: 'Customer',
assignedTo: 'Assigned', assignedTo: 'Assigned',
created: 'Created', created: 'Created',
state: 'State', state: 'State',
picked: 'Picked', pickup: 'Pickup',
null: 'No',
agency: 'Agency',
delivery: 'Delivery',
}, },
photo: { photo: {
fileDescription: 'Claim id {claimId} from client {clientName} id {clientId}', fileDescription: 'Claim id {claimId} from client {clientName} id {clientId}',
@ -592,6 +609,7 @@ export default {
company: 'Company', company: 'Company',
dued: 'Due date', dued: 'Due date',
shortDued: 'Due date', shortDued: 'Due date',
amount: 'Amount',
}, },
card: { card: {
issued: 'Issued', issued: 'Issued',
@ -625,7 +643,7 @@ export default {
fillDates: 'Invoice date and the max date should be filled', fillDates: 'Invoice date and the max date should be filled',
invoiceDateLessThanMaxDate: 'Invoice date can not be less than max date', invoiceDateLessThanMaxDate: 'Invoice date can not be less than max date',
invoiceWithFutureDate: 'Exists an invoice with a future date', invoiceWithFutureDate: 'Exists an invoice with a future date',
noTicketsToInvoice: 'There are not clients to invoice', noTicketsToInvoice: 'There are not tickets to invoice',
criticalInvoiceError: 'Critical invoicing error, process stopped', criticalInvoiceError: 'Critical invoicing error, process stopped',
}, },
table: { table: {
@ -685,6 +703,19 @@ export default {
recyclable: 'Recyclable', recyclable: 'Recyclable',
}, },
}, },
parking: {
pickingOrder: 'Picking order',
sector: 'Sector',
row: 'Row',
column: 'Column',
pageTitles: {
parking: 'Parking',
},
searchBar: {
info: 'You can search by parking code',
label: 'Search parking...',
},
},
invoiceIn: { invoiceIn: {
pageTitles: { pageTitles: {
invoiceIns: 'Invoices In', invoiceIns: 'Invoices In',
@ -830,12 +861,16 @@ export default {
pageTitles: { pageTitles: {
workers: 'Workers', workers: 'Workers',
list: 'List', list: 'List',
basicData: 'Basic data',
summary: 'Summary', summary: 'Summary',
notifications: 'Notifications',
workerCreate: 'New worker', workerCreate: 'New worker',
department: 'Department', department: 'Department',
basicData: 'Basic data',
notes: 'Notes',
pda: 'PDA', pda: 'PDA',
dms: 'My documentation',
notifications: 'Notifications',
pbx: 'Private Branch Exchange',
log: 'Log',
}, },
list: { list: {
name: 'Name', name: 'Name',
@ -954,7 +989,7 @@ export default {
roadmap: 'Roadmap', roadmap: 'Roadmap',
summary: 'Summary', summary: 'Summary',
basicData: 'Basic Data', basicData: 'Basic Data',
stops: 'Stops' stops: 'Stops',
}, },
}, },
roadmap: { roadmap: {
@ -962,7 +997,7 @@ export default {
roadmap: 'Roadmap', roadmap: 'Roadmap',
summary: 'Summary', summary: 'Summary',
basicData: 'Basic Data', basicData: 'Basic Data',
stops: 'Stops' stops: 'Stops',
}, },
}, },
route: { route: {
@ -1012,6 +1047,7 @@ export default {
addresses: 'Addresses', addresses: 'Addresses',
consumption: 'Consumption', consumption: 'Consumption',
agencyTerm: 'Agency agreement', agencyTerm: 'Agency agreement',
dms: 'File management',
}, },
list: { list: {
payMethod: 'Pay method', payMethod: 'Pay method',
@ -1183,6 +1219,7 @@ export default {
list: 'List', list: 'List',
diary: 'Diary', diary: 'Diary',
tags: 'Tags', tags: 'Tags',
create: 'Create',
}, },
descriptor: { descriptor: {
item: 'Item', item: 'Item',
@ -1195,6 +1232,24 @@ export default {
warehouseText: 'Calculated on the warehouse of { warehouseName }', warehouseText: 'Calculated on the warehouse of { warehouseName }',
itemDiary: 'Item diary', itemDiary: 'Item diary',
}, },
list: {
id: 'Identifier',
grouping: 'Grouping',
packing: 'Packing',
description: 'Description',
stems: 'Stems',
category: 'Category',
typeName: 'Type',
intrastat: 'Intrastat',
isActive: 'Active',
size: 'Size',
origin: 'Origin',
userName: 'Buyer',
weightByPiece: 'Weight/Piece',
stemMultiplier: 'Multiplier',
producer: 'Producer',
landed: 'Landed',
},
}, },
components: { components: {
topbar: {}, topbar: {},
@ -1202,6 +1257,11 @@ export default {
copyToken: 'Token copied to clipboard', copyToken: 'Token copied to clipboard',
settings: 'Settings', settings: 'Settings',
logOut: 'Log Out', logOut: 'Log Out',
localWarehouse: 'Local warehouse',
localBank: 'Local bank',
localCompany: 'Local company',
userWarehouse: 'User warehouse',
userCompany: 'User company',
}, },
smartCard: { smartCard: {
downloadFile: 'Download file', downloadFile: 'Download file',

View File

@ -49,7 +49,6 @@ export default {
yesterday: 'Ayer', yesterday: 'Ayer',
dateFormat: 'es-ES', dateFormat: 'es-ES',
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',
@ -85,6 +84,15 @@ export default {
selectFile: 'Seleccione un fichero', selectFile: 'Seleccione un fichero',
copyClipboard: 'Copiar en portapapeles', copyClipboard: 'Copiar en portapapeles',
salesPerson: 'Comercial', salesPerson: 'Comercial',
code: 'Código',
pageTitles: {
summary: 'Resumen',
basicData: 'Datos básicos',
log: 'Historial',
parkingList: 'Listado de parkings',
},
created: 'Fecha creación',
worker: 'Trabajador',
}, },
errors: { errors: {
statusUnauthorized: 'Acceso denegado', statusUnauthorized: 'Acceso denegado',
@ -491,6 +499,7 @@ export default {
request: 'Petición de compra', request: 'Petición de compra',
weight: 'Peso', weight: 'Peso',
goTo: 'Ir a', goTo: 'Ir a',
summaryAmount: 'Resumen',
}, },
}, },
claim: { claim: {
@ -530,12 +539,14 @@ export default {
commercial: 'Comercial', commercial: 'Comercial',
province: 'Provincia', province: 'Provincia',
zone: 'Zona', zone: 'Zona',
customerId: 'ID del cliente',
}, },
summary: { summary: {
customer: 'Cliente', customer: 'Cliente',
assignedTo: 'Asignada a', assignedTo: 'Asignada a',
attendedBy: 'Atendida por', attendedBy: 'Atendida por',
created: 'Creada', created: 'Creada',
pickup: 'Recogida',
state: 'Estado', state: 'Estado',
details: 'Detalles', details: 'Detalles',
item: 'Artículo', item: 'Artículo',
@ -557,13 +568,19 @@ export default {
responsible: 'Responsable', responsible: 'Responsable',
worker: 'Trabajador', worker: 'Trabajador',
redelivery: 'Devolución', redelivery: 'Devolución',
null: 'No',
agency: 'Agencia',
delivery: 'Reparto',
}, },
basicData: { basicData: {
customer: 'Cliente', customer: 'Cliente',
assignedTo: 'Asignada a', assignedTo: 'Asignada a',
created: 'Creada', created: 'Creada',
state: 'Estado', state: 'Estado',
picked: 'Recogida', pickup: 'Recogida',
null: 'No',
agency: 'Agencia',
delivery: 'Reparto',
}, },
photo: { photo: {
fileDescription: fileDescription:
@ -592,6 +609,7 @@ export default {
company: 'Empresa', company: 'Empresa',
dued: 'Fecha vencimineto', dued: 'Fecha vencimineto',
shortDued: 'F. vencimiento', shortDued: 'F. vencimiento',
amount: 'Importe',
}, },
card: { card: {
issued: 'Fecha emisión', issued: 'Fecha emisión',
@ -627,7 +645,7 @@ export default {
invoiceDateLessThanMaxDate: invoiceDateLessThanMaxDate:
'La fecha de la factura no puede ser menor que la fecha máxima', 'La fecha de la factura no puede ser menor que la fecha máxima',
invoiceWithFutureDate: 'Existe una factura con una fecha futura', invoiceWithFutureDate: 'Existe una factura con una fecha futura',
noTicketsToInvoice: 'No hay clientes para facturar', noTicketsToInvoice: 'No existen tickets para facturar',
criticalInvoiceError: 'Error crítico en la facturación, proceso detenido', criticalInvoiceError: 'Error crítico en la facturación, proceso detenido',
}, },
table: { table: {
@ -743,6 +761,18 @@ export default {
recyclable: 'Reciclable', recyclable: 'Reciclable',
}, },
}, },
parking: {
pickingOrder: 'Orden de recogida',
row: 'Fila',
column: 'Columna',
pageTitles: {
parking: 'Parking',
},
searchBar: {
info: 'Puedes buscar por código de parking',
label: 'Buscar parking...',
},
},
invoiceIn: { invoiceIn: {
pageTitles: { pageTitles: {
invoiceIns: 'Fact. recibidas', invoiceIns: 'Fact. recibidas',
@ -830,12 +860,16 @@ export default {
pageTitles: { pageTitles: {
workers: 'Trabajadores', workers: 'Trabajadores',
list: 'Listado', list: 'Listado',
basicData: 'Datos básicos',
summary: 'Resumen', summary: 'Resumen',
notifications: 'Notificaciones',
workerCreate: 'Nuevo trabajador', workerCreate: 'Nuevo trabajador',
department: 'Departamentos', department: 'Departamentos',
basicData: 'Datos básicos',
notes: 'Notas',
pda: 'PDA', pda: 'PDA',
dms: 'Mi documentación',
notifications: 'Notificaciones',
pbx: 'Centralita',
log: 'Historial',
}, },
list: { list: {
name: 'Nombre', name: 'Nombre',
@ -954,7 +988,7 @@ export default {
roadmap: 'Troncales', roadmap: 'Troncales',
summary: 'Resumen', summary: 'Resumen',
basicData: 'Datos básicos', basicData: 'Datos básicos',
stops: 'Paradas' stops: 'Paradas',
}, },
}, },
roadmap: { roadmap: {
@ -962,7 +996,7 @@ export default {
roadmap: 'Troncales', roadmap: 'Troncales',
summary: 'Resumen', summary: 'Resumen',
basicData: 'Datos básicos', basicData: 'Datos básicos',
stops: 'Paradas' stops: 'Paradas',
}, },
}, },
route: { route: {
@ -1012,6 +1046,7 @@ export default {
addresses: 'Direcciones', addresses: 'Direcciones',
consumption: 'Consumo', consumption: 'Consumo',
agencyTerm: 'Acuerdo agencia', agencyTerm: 'Acuerdo agencia',
dms: 'Gestión documental',
}, },
list: { list: {
payMethod: 'Método de pago', payMethod: 'Método de pago',
@ -1183,6 +1218,7 @@ export default {
list: 'Listado', list: 'Listado',
diary: 'Histórico', diary: 'Histórico',
tags: 'Etiquetas', tags: 'Etiquetas',
create: 'Crear',
}, },
descriptor: { descriptor: {
item: 'Artículo', item: 'Artículo',
@ -1195,6 +1231,24 @@ export default {
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',
}, },
list: {
id: 'Identificador',
grouping: 'Grouping',
packing: 'Packing',
description: 'Descripción',
stems: 'Tallos',
category: 'Reino',
typeName: 'Tipo',
intrastat: 'Intrastat',
isActive: 'Activo',
size: 'Medida',
origin: 'Origen',
weightByPiece: 'Peso (gramos)/tallo',
userName: 'Comprador',
stemMultiplier: 'Multiplicador',
producer: 'Productor',
landed: 'F. entrega',
},
}, },
components: { components: {
topbar: {}, topbar: {},
@ -1202,6 +1256,11 @@ export default {
copyToken: 'Token copiado al portapapeles', copyToken: 'Token copiado al portapapeles',
settings: 'Configuración', settings: 'Configuración',
logOut: 'Cerrar sesión', logOut: 'Cerrar sesión',
localWarehouse: 'Almacén local',
localBank: 'Banco local',
localCompany: 'Empresa local',
userWarehouse: 'Almacén del usuario',
userCompany: 'Empresa del usuario',
}, },
smartCard: { smartCard: {
downloadFile: 'Descargar archivo', downloadFile: 'Descargar archivo',

View File

@ -11,5 +11,3 @@ const quasar = useQuasar();
<QFooter v-if="quasar.platform.is.mobile"></QFooter> <QFooter v-if="quasar.platform.is.mobile"></QFooter>
</QLayout> </QLayout>
</template> </template>
<style lang="scss" scoped></style>

View File

@ -40,7 +40,7 @@ const langs = ['en', 'es'];
<template> <template>
<QLayout view="hHh LpR fFf"> <QLayout view="hHh LpR fFf">
<QHeader reveal class="bg-vn-dark"> <QHeader reveal class="bg-vn-section-color">
<QToolbar class="justify-end"> <QToolbar class="justify-end">
<QBtn <QBtn
id="switchLanguage" id="switchLanguage"

View File

@ -291,8 +291,6 @@ async function importToNewRefundTicket() {
selection="multiple" selection="multiple"
v-model:selected="selectedRows" v-model:selected="selectedRows"
:grid="$q.screen.lt.md" :grid="$q.screen.lt.md"
:pagination="{ rowsPerPage: 0 }"
:hide-bottom="true"
> >
<template #body-cell-ticket="{ value }"> <template #body-cell-ticket="{ value }">
<QTd align="center"> <QTd align="center">

View File

@ -9,6 +9,7 @@ import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
import VnInputDate from 'components/common/VnInputDate.vue'; import VnInputDate from 'components/common/VnInputDate.vue';
import axios from 'axios';
import { useSession } from 'src/composables/useSession'; import { useSession } from 'src/composables/useSession';
const route = useRoute(); const route = useRoute();
@ -24,7 +25,7 @@ const claimFilter = {
'workerFk', 'workerFk',
'claimStateFk', 'claimStateFk',
'packages', 'packages',
'hasToPickUp', 'pickup',
], ],
include: [ include: [
{ {
@ -50,6 +51,20 @@ function setClaimStates(data) {
claimStates.value = data; claimStates.value = data;
claimStatesCopy.value = data; claimStatesCopy.value = data;
} }
let optionsList;
async function getEnumValues() {
optionsList = [{ id: null, description: t('claim.basicData.null') }];
const { data } = await axios.get(`Applications/get-enum-values`, {
params: {
schema: 'vn',
table: 'claim',
column: 'pickup',
},
});
for (let value of data)
optionsList.push({ id: value, description: t(`claim.basicData.${value}`) });
}
getEnumValues();
const workerFilter = { const workerFilter = {
options: workers, options: workers,
@ -168,13 +183,19 @@ const statesFilter = {
type="number" type="number"
/> />
</div> </div>
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col"> <div class="col">
<QCheckbox <QSelect
v-model="data.hasToPickUp" v-model="data.pickup"
:label="t('claim.basicData.picked')" :options="optionsList"
/> option-value="id"
option-label="description"
emit-value
:label="t('claim.basicData.pickup')"
map-options
use-input
:input-debounce="0"
>
</QSelect>
</div> </div>
</VnRow> </VnRow>
</template> </template>

View File

@ -107,7 +107,11 @@ onMounted(async () => {
<template #body="{ entity }"> <template #body="{ entity }">
<VnLv v-if="entity.claimState" :label="t('claim.card.state')"> <VnLv v-if="entity.claimState" :label="t('claim.card.state')">
<template #value> <template #value>
<QBadge :color="stateColor(entity.claimState.code)" dense> <QBadge
:color="stateColor(entity.claimState.code)"
text-color="black"
dense
>
{{ entity.claimState.description }} {{ entity.claimState.description }}
</QBadge> </QBadge>
</template> </template>

View File

@ -150,10 +150,8 @@ const columns = computed(() => [
<QTable <QTable
:columns="columns" :columns="columns"
:rows="rows" :rows="rows"
:pagination="{ rowsPerPage: 0 }"
row-key="$index" row-key="$index"
selection="multiple" selection="multiple"
hide-pagination
v-model:selected="selected" v-model:selected="selected"
:grid="$q.screen.lt.md" :grid="$q.screen.lt.md"
table-header-class="text-left" table-header-class="text-left"

View File

@ -161,7 +161,7 @@ function showImportDialog() {
<div class="row q-gutter-md"> <div class="row q-gutter-md">
<div> <div>
{{ t('Amount') }} {{ t('Amount') }}
<QChip :dense="$q.screen.lt.sm"> <QChip :dense="$q.screen.lt.sm" text-color="white">
{{ toCurrency(amount) }} {{ toCurrency(amount) }}
</QChip> </QChip>
</div> </div>
@ -201,11 +201,9 @@ function showImportDialog() {
:columns="columns" :columns="columns"
:rows="rows" :rows="rows"
:dense="$q.screen.lt.md" :dense="$q.screen.lt.md"
:pagination="{ rowsPerPage: 0 }"
row-key="id" row-key="id"
selection="multiple" selection="multiple"
v-model:selected="selected" v-model:selected="selected"
hide-pagination
:grid="$q.screen.lt.md" :grid="$q.screen.lt.md"
> >
<template #body-cell-claimed="{ row, value }"> <template #body-cell-claimed="{ row, value }">

View File

@ -121,7 +121,6 @@ function cancel() {
class="my-sticky-header-table" class="my-sticky-header-table"
:columns="columns" :columns="columns"
:rows="claimableSales" :rows="claimableSales"
:pagination="{ rowsPerPage: 10 }"
row-key="saleFk" row-key="saleFk"
selection="multiple" selection="multiple"
v-model:selected="selected" v-model:selected="selected"

View File

@ -11,6 +11,8 @@ import VnLv from 'src/components/ui/VnLv.vue';
import ClaimNotes from 'src/pages/Claim/Card/ClaimNotes.vue'; import ClaimNotes from 'src/pages/Claim/Card/ClaimNotes.vue';
import VnUserLink from 'src/components/ui/VnUserLink.vue'; import VnUserLink from 'src/components/ui/VnUserLink.vue';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue'; import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import VnTitle from 'src/components/common/VnTitle.vue';
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
@ -176,14 +178,14 @@ function openDialog(dmsId) {
@on-fetch="getClaimDms" @on-fetch="getClaimDms"
> >
<template #header="{ entity: { claim } }"> <template #header="{ entity: { claim } }">
{{ claim.id }} - {{ claim.client.name }} {{ claim.id }} - {{ claim.client.name }} ({{ claim.client.id }})
</template> </template>
<template #body="{ entity: { claim, salesClaimed, developments } }"> <template #body="{ entity: { claim, salesClaimed, developments } }">
<QCard class="vn-one"> <QCard class="vn-one">
<a class="header header-link" :href="`#/claim/${entityId}/basic-data`"> <VnTitle
{{ t('claim.pageTitles.basicData') }} :url="`#/claim/${entityId}/basic-data`"
<QIcon name="open_in_new" /> :text="t('claim.pageTitles.basicData')"
</a> />
<VnLv <VnLv
:label="t('claim.summary.created')" :label="t('claim.summary.created')"
:value="toDate(claim.created)" :value="toDate(claim.created)"
@ -213,23 +215,22 @@ function openDialog(dmsId) {
</VnLv> </VnLv>
<VnLv :label="t('claim.summary.customer')"> <VnLv :label="t('claim.summary.customer')">
<template #value> <template #value>
<VnUserLink <span class="link cursor-pointer">
:name="claim.client?.name" {{ claim.client?.name }}
:worker-id="claim.client?.id" <CustomerDescriptorProxy :id="claim.clientFk" />
/> </span>
</template> </template>
</VnLv> </VnLv>
<QCheckbox <VnLv
:label="t('claim.basicData.picked')" :label="t('claim.summary.pickup')"
v-model="claim.hasToPickUp" :value="t(`claim.summary.${claim.pickup}`)"
:disable="true"
/> />
</QCard> </QCard>
<QCard class="vn-three"> <QCard class="vn-three">
<a class="header header-link" :href="`#/claim/${entityId}/notes`"> <VnTitle
{{ t('claim.summary.notes') }} :url="`#/claim/${entityId}/notes`"
<QIcon name="open_in_new" /> :text="t('claim.summary.notes')"
</a> />
<ClaimNotes <ClaimNotes
:id="entityId" :id="entityId"
:add-note="false" :add-note="false"
@ -238,10 +239,10 @@ function openDialog(dmsId) {
/> />
</QCard> </QCard>
<QCard class="vn-two" v-if="salesClaimed.length > 0"> <QCard class="vn-two" v-if="salesClaimed.length > 0">
<a class="header header-link" :href="`#/claim/${entityId}/lines`"> <VnTitle
{{ t('claim.summary.details') }} :url="`#/claim/${entityId}/lines`"
<QIcon name="open_in_new" /> :text="t('claim.summary.details')"
</a> />
<QTable <QTable
:columns="detailsColumns" :columns="detailsColumns"
:rows="salesClaimed" :rows="salesClaimed"
@ -280,11 +281,10 @@ function openDialog(dmsId) {
</QTable> </QTable>
</QCard> </QCard>
<QCard class="vn-two" v-if="developments.length > 0"> <QCard class="vn-two" v-if="developments.length > 0">
<a class="header header-link" :href="claimUrl + 'development'"> <VnTitle
{{ t('claim.summary.development') }} :url="claimUrl + 'development'"
<QIcon name="open_in_new" /> :text="t('claim.summary.development')"
</a> />
<QTable <QTable
:columns="developmentColumns" :columns="developmentColumns"
:rows="developments" :rows="developments"
@ -303,10 +303,10 @@ function openDialog(dmsId) {
</QTable> </QTable>
</QCard> </QCard>
<QCard class="vn-max" v-if="claimDms.length > 0"> <QCard class="vn-max" v-if="claimDms.length > 0">
<a class="header header-link" :href="`#/claim/${entityId}/photos`"> <VnTitle
{{ t('claim.summary.photos') }} :url="`#/claim/${entityId}/photos`"
<QIcon name="open_in_new" /> :text="t('claim.summary.photos')"
</a> />
<div class="container"> <div class="container">
<div <div
class="multimedia-container" class="multimedia-container"
@ -346,10 +346,7 @@ function openDialog(dmsId) {
</QCard> </QCard>
<QCard class="vn-max"> <QCard class="vn-max">
<a class="header header-link" :href="claimUrl + 'action'"> <VnTitle :url="claimUrl + 'action'" :text="t('claim.summary.actions')" />
{{ t('claim.summary.actions') }}
<QIcon name="open_in_new" class="link" />
</a>
<div id="slider-container" class="q-px-xl q-py-md"> <div id="slider-container" class="q-px-xl q-py-md">
<QSlider <QSlider
v-model="claim.responsibility" v-model="claim.responsibility"

View File

@ -108,7 +108,11 @@ function navigate(event, id) {
/> />
<VnLv :label="t('claim.list.state')"> <VnLv :label="t('claim.list.state')">
<template #value> <template #value>
<QBadge :color="stateColor(row.stateCode)" dense> <QBadge
text-color="black"
:color="stateColor(row.stateCode)"
dense
>
{{ row.stateDescription }} {{ row.stateDescription }}
</QBadge> </QBadge>
</template> </template>
@ -118,7 +122,6 @@ function navigate(event, id) {
<QBtn <QBtn
:label="t('globals.description')" :label="t('globals.description')"
@click.stop @click.stop
class="bg-vn-dark"
outline outline
style="margin-top: 15px" style="margin-top: 15px"
> >

View File

@ -198,7 +198,6 @@ const updateCompanyId = (id) => {
<QTable <QTable
:columns="columns" :columns="columns"
:pagination="{ rowsPerPage: 12 }"
:rows="rows" :rows="rows"
class="full-width q-mt-md" class="full-width q-mt-md"
row-key="id" row-key="id"

View File

@ -150,14 +150,14 @@ const toCustomerConsigneeEdit = (consigneeId) => {
<style lang="scss" scoped> <style lang="scss" scoped>
.consignees-card { .consignees-card {
border: 2px solid var(--vn-light-gray); border: 2px solid var(--vn-accent-color);
border-radius: 10px; border-radius: 10px;
padding: 10px; padding: 10px;
display: flex; display: flex;
cursor: pointer; cursor: pointer;
&:hover { &:hover {
background-color: var(--vn-light-gray); background-color: var(--vn-accent-color);
} }
} }
</style> </style>

View File

@ -97,13 +97,7 @@ const toCustomerCreditCreate = () => {
<template> <template>
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<QTable <QTable :columns="columns" :rows="rows" class="full-width q-mt-md" row-key="id">
:columns="columns"
:pagination="{ rowsPerPage: 12 }"
:rows="rows"
class="full-width q-mt-md"
row-key="id"
>
<template #body-cell="props"> <template #body-cell="props">
<QTd :props="props"> <QTd :props="props">
<QTr :props="props" class="cursor-pointer"> <QTr :props="props" class="cursor-pointer">

View File

@ -140,7 +140,6 @@ const toCustomerGreugeCreate = () => {
<QTable <QTable
:columns="columns" :columns="columns"
:pagination="{ rowsPerPage: 12 }"
:rows="rows" :rows="rows"
class="full-width q-mt-md" class="full-width q-mt-md"
row-key="id" row-key="id"
@ -180,13 +179,13 @@ const toCustomerGreugeCreate = () => {
<style lang="scss"> <style lang="scss">
.consignees-card { .consignees-card {
border: 2px solid var(--vn-light-gray); border: 2px solid var(--vn-accent-color);
border-radius: 10px; border-radius: 10px;
padding: 10px; padding: 10px;
} }
.label-color { .label-color {
color: var(--vn-label); color: var(--vn-label-color);
} }
</style> </style>

View File

@ -85,12 +85,12 @@ const toCustomerNoteCreate = () => {
<style lang="scss"> <style lang="scss">
.custom-border { .custom-border {
border: 2px solid var(--vn-light-gray); border: 2px solid var(--vn-accent-color);
border-radius: 10px; border-radius: 10px;
padding: 10px; padding: 10px;
} }
.label-color { .label-color {
color: var(--vn-label); color: var(--vn-label-color);
} }
</style> </style>

View File

@ -97,7 +97,6 @@ const toCustomerRecoverieCreate = () => {
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<QTable <QTable
:columns="columns" :columns="columns"
:pagination="{ rowsPerPage: 12 }"
:rows="rows" :rows="rows"
class="full-width q-mt-md" class="full-width q-mt-md"
row-key="id" row-key="id"
@ -137,13 +136,13 @@ const toCustomerRecoverieCreate = () => {
<style lang="scss"> <style lang="scss">
.consignees-card { .consignees-card {
border: 2px solid var(--vn-light-gray); border: 2px solid var(--vn-accent-color);
border-radius: 10px; border-radius: 10px;
padding: 10px; padding: 10px;
} }
.label-color { .label-color {
color: var(--vn-label); color: var(--vn-label-color);
} }
</style> </style>

View File

@ -7,6 +7,7 @@ import CardSummary from 'components/ui/CardSummary.vue';
import { getUrl } from 'src/composables/getUrl'; import { getUrl } from 'src/composables/getUrl';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue'; import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
import VnTitle from 'src/components/common/VnTitle.vue';
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
@ -62,10 +63,10 @@ const creditWarning = computed(() => {
<CardSummary ref="summary" :url="`Clients/${entityId}/summary`"> <CardSummary ref="summary" :url="`Clients/${entityId}/summary`">
<template #body="{ entity }"> <template #body="{ entity }">
<QCard class="vn-one"> <QCard class="vn-one">
<a class="header header-link" :href="`#/customer/${entityId}/basic-data`"> <VnTitle
{{ t('customer.summary.basicData') }} :url="`#/customer/${entityId}/basic-data`"
<QIcon name="open_in_new" /> :text="t('customer.summary.basicData')"
</a> />
<VnLv :label="t('customer.summary.customerId')" :value="entity.id" /> <VnLv :label="t('customer.summary.customerId')" :value="entity.id" />
<VnLv :label="t('customer.summary.name')" :value="entity.name" /> <VnLv :label="t('customer.summary.name')" :value="entity.name" />
<VnLv :label="t('customer.summary.contact')" :value="entity.contact" /> <VnLv :label="t('customer.summary.contact')" :value="entity.contact" />
@ -96,13 +97,10 @@ const creditWarning = computed(() => {
/> />
</QCard> </QCard>
<QCard class="vn-one"> <QCard class="vn-one">
<a <VnTitle
class="header header-link" :url="`#/customer/${entityId}/fiscal-data`"
:href="`#/customer/${entityId}/fiscal-data`" :text="t('customer.summary.fiscalAddress')"
> />
{{ t('customer.summary.fiscalAddress') }}
<QIcon name="open_in_new" />
</a>
<VnLv <VnLv
:label="t('customer.summary.socialName')" :label="t('customer.summary.socialName')"
:value="entity.socialName" :value="entity.socialName"
@ -124,14 +122,10 @@ const creditWarning = computed(() => {
<VnLv :label="t('customer.summary.street')" :value="entity.street" /> <VnLv :label="t('customer.summary.street')" :value="entity.street" />
</QCard> </QCard>
<QCard class="vn-one"> <QCard class="vn-one">
<a <VnTitle
class="header header-link" :url="`#/customer/${entityId}/fiscal-data`"
:href="`#/customer/${entityId}/fiscal-data`" :text="t('customer.summary.fiscalData')"
link />
>
{{ t('customer.summary.fiscalData') }}
<QIcon name="open_in_new" />
</a>
<QCheckbox <QCheckbox
:label="t('customer.summary.isEqualizated')" :label="t('customer.summary.isEqualizated')"
v-model="entity.isEqualizated" v-model="entity.isEqualizated"
@ -169,14 +163,10 @@ const creditWarning = computed(() => {
/> />
</QCard> </QCard>
<QCard class="vn-one"> <QCard class="vn-one">
<a <VnTitle
class="header header-link" :url="`#/customer/${entityId}/billing-data`"
:href="`#/customer/${entityId}/billing-data`" :text="t('customer.summary.billingData')"
link />
>
{{ t('customer.summary.billingData') }}
<QIcon name="open_in_new" />
</a>
<VnLv <VnLv
:label="t('customer.summary.payMethod')" :label="t('customer.summary.payMethod')"
:value="entity.payMethod.name" :value="entity.payMethod.name"
@ -202,14 +192,10 @@ const creditWarning = computed(() => {
/> />
</QCard> </QCard>
<QCard class="vn-one" v-if="entity.defaultAddress"> <QCard class="vn-one" v-if="entity.defaultAddress">
<a <VnTitle
class="header header-link" :url="`#/customer/${entityId}/consignees`"
:href="`#/customer/${entityId}/consignees`" :text="t('customer.summary.consignee')"
link />
>
{{ t('customer.summary.consignee') }}
<QIcon name="open_in_new" />
</a>
<VnLv <VnLv
:label="t('customer.summary.addressName')" :label="t('customer.summary.addressName')"
:value="entity.defaultAddress.nickname" :value="entity.defaultAddress.nickname"
@ -224,10 +210,10 @@ const creditWarning = computed(() => {
/> />
</QCard> </QCard>
<QCard class="vn-one" v-if="entity.account"> <QCard class="vn-one" v-if="entity.account">
<a class="header header-link" :href="`#/customer/${entityId}/web-access`"> <VnTitle
{{ t('customer.summary.webAccess') }} :url="`#/customer/${entityId}/web-access`"
<QIcon name="open_in_new" /> :text="t('customer.summary.webAccess')"
</a> />
<VnLv <VnLv
:label="t('customer.summary.username')" :label="t('customer.summary.username')"
:value="entity.account.name" :value="entity.account.name"
@ -239,9 +225,7 @@ const creditWarning = computed(() => {
/> />
</QCard> </QCard>
<QCard class="vn-one" v-if="entity.account"> <QCard class="vn-one" v-if="entity.account">
<div class="header header-link"> <VnTitle :text="t('customer.summary.businessData')" />
{{ t('customer.summary.businessData') }}
</div>
<VnLv <VnLv
:label="t('customer.summary.totalGreuge')" :label="t('customer.summary.totalGreuge')"
:value="toCurrency(entity.totalGreuge)" :value="toCurrency(entity.totalGreuge)"
@ -266,14 +250,11 @@ const creditWarning = computed(() => {
/> />
</QCard> </QCard>
<QCard class="vn-one" v-if="entity.account"> <QCard class="vn-one" v-if="entity.account">
<a <VnTitle
class="header header-link" :url="`https://grafana.verdnatura.es/d/40buzE4Vk/comportamiento-pagos-clientes?orgId=1&var-clientFk=${entityId}`"
:href="`https://grafana.verdnatura.es/d/40buzE4Vk/comportamiento-pagos-clientes?orgId=1&var-clientFk=${entityId}`" :text="t('customer.summary.financialData')"
link icon="vn:grafana"
> />
{{ t('customer.summary.financialData') }}
<QIcon name="vn:grafana" />
</a>
<VnLv <VnLv
:label="t('customer.summary.risk')" :label="t('customer.summary.risk')"
:value="toCurrency(entity?.debt?.debt)" :value="toCurrency(entity?.debt?.debt)"

View File

@ -84,7 +84,6 @@ const redirectToCreateView = () => {
<QBtn <QBtn
:label="t('components.smartCard.openCard')" :label="t('components.smartCard.openCard')"
@click.stop="navigate(row.id)" @click.stop="navigate(row.id)"
class="bg-vn-dark"
outline outline
/> />
<QBtn <QBtn

View File

@ -30,16 +30,16 @@ const { t } = useI18n();
border: 1px solid black; border: 1px solid black;
} }
.title_balance { .title_balance {
color: var(--vn-text); color: var(--vn-text-color);
margin-top: 0; margin-top: 0;
margin-bottom: 0; margin-bottom: 0;
} }
.key_balance { .key_balance {
color: var(--vn-label); color: var(--vn-label-color);
margin-bottom: 0; margin-bottom: 0;
} }
.value_balance { .value_balance {
color: var(--vn-text); color: var(--vn-text-color);
margin-bottom: 0; margin-bottom: 0;
} }
</style> </style>

View File

@ -207,7 +207,7 @@ const refreshData = () => {
</QScrollArea> </QScrollArea>
</QDrawer> </QDrawer>
<VnSubToolbar class="bg-vn-dark"> <VnSubToolbar>
<template #st-data> <template #st-data>
<CustomerBalanceDueTotal :amount="balanceDueTotal" /> <CustomerBalanceDueTotal :amount="balanceDueTotal" />
<div class="flex items-center q-ml-lg"> <div class="flex items-center q-ml-lg">
@ -224,10 +224,8 @@ const refreshData = () => {
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<QTable <QTable
:columns="columns" :columns="columns"
:pagination="{ rowsPerPage: 0 }"
:rows="rows" :rows="rows"
class="full-width q-mt-md" class="full-width q-mt-md"
hide-bottom
row-key="clientFk" row-key="clientFk"
selection="multiple" selection="multiple"
v-model:selected="selected" v-model:selected="selected"

View File

@ -510,7 +510,6 @@ const selectSalesPersonId = (id) => (selectedSalesPersonId.value = id);
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<QTable <QTable
:columns="columns" :columns="columns"
:pagination="{ rowsPerPage: 12 }"
:rows="rows" :rows="rows"
class="full-width q-mt-md" class="full-width q-mt-md"
row-key="id" row-key="id"

View File

@ -108,10 +108,8 @@ const selectCustomerId = (id) => {
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<QTable <QTable
:columns="columns" :columns="columns"
:pagination="{ rowsPerPage: 0 }"
:rows="rows" :rows="rows"
class="full-width q-mt-md" class="full-width q-mt-md"
hide-bottom
row-key="id" row-key="id"
selection="multiple" selection="multiple"
v-model:selected="selected" v-model:selected="selected"

View File

@ -151,10 +151,8 @@ function stateColor(row) {
:columns="columns" :columns="columns"
:rows="rows" :rows="rows"
row-key="id" row-key="id"
:pagination="{ rowsPerPage: 0 }"
:grid="grid || $q.screen.lt.sm" :grid="grid || $q.screen.lt.sm"
class="q-mt-xs custom-table" class="q-mt-xs custom-table"
hide-pagination
> >
<template #body-cell-actions="{ row }"> <template #body-cell-actions="{ row }">
<QTd auto-width class="text-center"> <QTd auto-width class="text-center">
@ -196,7 +194,7 @@ function stateColor(row) {
</template> </template>
<template #body-cell-state="{ row }"> <template #body-cell-state="{ row }">
<QTd auto-width class="text-center"> <QTd auto-width class="text-center">
<QBadge :color="stateColor(row)"> <QBadge text-color="black" :color="stateColor(row)">
{{ {{
row.isConfirmed row.isConfirmed
? t('Confirmed') ? t('Confirmed')
@ -227,6 +225,7 @@ function stateColor(row) {
v-if="col.name == 'state'" v-if="col.name == 'state'"
> >
<QBadge <QBadge
text-color="black"
:color=" :color="
stateColor(row) stateColor(row)
" "

View File

@ -21,7 +21,7 @@ const pinnedModules = computed(() => navigation.getPinnedModules());
:width="256" :width="256"
:breakpoint="1000" :breakpoint="1000"
> >
<QScrollArea class="fit text-grey-8"> <QScrollArea class="fit">
<LeftMenu /> <LeftMenu />
</QScrollArea> </QScrollArea>
</QDrawer> </QDrawer>
@ -67,6 +67,10 @@ const pinnedModules = computed(() => navigation.getPinnedModules());
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.left-menu {
color: var(--vn-font-color);
}
.flex-container { .flex-container {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;

View File

@ -63,7 +63,7 @@ const removeDepartment = () => {
router.push({ name: 'WorkerDepartment' }); router.push({ name: 'WorkerDepartment' });
notify('department.departmentRemoved', 'positive'); notify('department.departmentRemoved', 'positive');
} catch (err) { } catch (err) {
console.log('Error removing department'); console.error('Error removing department');
} }
}); });
}; };

View File

@ -5,6 +5,7 @@ import { useI18n } from 'vue-i18n';
import CardSummary from 'components/ui/CardSummary.vue'; import CardSummary from 'components/ui/CardSummary.vue';
import { getUrl } from 'src/composables/getUrl'; import { getUrl } from 'src/composables/getUrl';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import VnTitle from 'src/components/common/VnTitle.vue';
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
@ -36,13 +37,10 @@ onMounted(async () => {
</template> </template>
<template #body="{ entity: department }"> <template #body="{ entity: department }">
<QCard class="column"> <QCard class="column">
<a <VnTitle
class="header header-link" :url="`#/department/department/${entityId}/basic-data`"
:href="`#/department/department/${entityId}/basic-data`" :text="t('Basic data')"
> />
{{ t('Basic data') }}
<QIcon name="open_in_new" />
</a>
<div class="full-width row wrap justify-between content-between"> <div class="full-width row wrap justify-between content-between">
<div class="column" style="min-width: 50%"> <div class="column" style="min-width: 50%">
<VnLv <VnLv

View File

@ -471,6 +471,9 @@ const lockIconType = (groupingMode, mode) => {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.separation-row {
background-color: var(--vn-section-color) !important;
}
.grid-style-transition { .grid-style-transition {
transition: transform 0.28s, background-color 0.28s; transition: transform 0.28s, background-color 0.28s;
} }

View File

@ -238,12 +238,7 @@ const redirectToBuysView = () => {
</div> </div>
</VnRow> </VnRow>
<VnRow> <VnRow>
<QTable <QTable :columns="columns" :rows="importData.buys">
:columns="columns"
:rows="importData.buys"
:pagination="{ rowsPerPage: 0 }"
hide-pagination
>
<template #body-cell-item="{ row, col }"> <template #body-cell-item="{ row, col }">
<QTd auto-width> <QTd auto-width>
<VnSelectDialog <VnSelectDialog

View File

@ -5,9 +5,8 @@ import { useI18n } from 'vue-i18n';
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 VnRow from 'components/ui/VnRow.vue';
import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.vue'; import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.vue';
import FetchedTags from 'components/ui/FetchedTags.vue'; import VnTitle from 'src/components/common/VnTitle.vue';
import { toDate, toCurrency } from 'src/filters'; import { toDate, toCurrency } from 'src/filters';
import { getUrl } from 'src/composables/getUrl'; import { getUrl } from 'src/composables/getUrl';
@ -354,6 +353,12 @@ const fetchEntryBuys = async () => {
</CardSummary> </CardSummary>
</template> </template>
<style lang="scss" scoped>
.separation-row {
background-color: var(--vn-section-color) !important;
}
</style>
<i18n> <i18n>
es: es:
Travel data: Datos envío Travel data: Datos envío

View File

@ -636,7 +636,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
auto-load auto-load
@on-fetch="(data) => (intrastatOptions = data)" @on-fetch="(data) => (intrastatOptions = data)"
/> />
<QToolbar class="bg-vn-dark justify-end"> <QToolbar class="justify-end">
<div id="st-data"> <div id="st-data">
<TableVisibleColumns <TableVisibleColumns
:all-columns="allColumnNames" :all-columns="allColumnNames"
@ -659,7 +659,6 @@ onUnmounted(() => (stateStore.rightDrawer = false));
:columns="columns" :columns="columns"
selection="multiple" selection="multiple"
row-key="id" row-key="id"
:pagination="{ rowsPerPage: 0 }"
class="full-width q-mt-md" class="full-width q-mt-md"
:visible-columns="visibleColumns" :visible-columns="visibleColumns"
v-model:selected="rowsSelected" v-model:selected="rowsSelected"

View File

@ -412,7 +412,7 @@ const removeTag = (index, params, search) => {
width: 60px; width: 60px;
height: 60px; height: 60px;
font-size: 1.4rem; font-size: 1.4rem;
background-color: var(--vn-light-gray); background-color: var(--vn-accent-color);
&.active { &.active {
background-color: $primary; background-color: $primary;

View File

@ -111,7 +111,6 @@ const onSave = (data) => data.deletes && router.push(`/invoice-in/${invoiceId}/s
:rows="rows" :rows="rows"
row-key="$index" row-key="$index"
selection="single" selection="single"
hide-pagination
:grid="$q.screen.lt.sm" :grid="$q.screen.lt.sm"
:pagination="{ rowsPerPage: 0 }" :pagination="{ rowsPerPage: 0 }"
> >

View File

@ -99,7 +99,6 @@ async function insert() {
:columns="columns" :columns="columns"
:rows="rows" :rows="rows"
row-key="$index" row-key="$index"
hide-pagination
:grid="$q.screen.lt.sm" :grid="$q.screen.lt.sm"
> >
<template #body-cell-duedate="{ row }"> <template #body-cell-duedate="{ row }">

View File

@ -134,7 +134,6 @@ function getTotal(type) {
:columns="columns" :columns="columns"
:rows="rows" :rows="rows"
row-key="$index" row-key="$index"
hide-pagination
:grid="$q.screen.lt.sm" :grid="$q.screen.lt.sm"
> >
<template #body-cell="{ row, col }"> <template #body-cell="{ row, col }">

View File

@ -6,6 +6,7 @@ import { toCurrency, toDate } from 'src/filters';
import { getUrl } from 'src/composables/getUrl'; import { getUrl } from 'src/composables/getUrl';
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 VnTitle from 'src/components/common/VnTitle.vue';
onMounted(async () => { onMounted(async () => {
salixUrl.value = await getUrl(''); salixUrl.value = await getUrl('');
@ -198,7 +199,7 @@ function getLink(param) {
<template> <template>
<CardSummary <CardSummary
ref="summary" data-key="InvoiceInSummary"
:url="`InvoiceIns/${entityId}/summary`" :url="`InvoiceIns/${entityId}/summary`"
@on-fetch="(data) => setData(data)" @on-fetch="(data) => setData(data)"
> >
@ -209,10 +210,10 @@ function getLink(param) {
<!--Basic Data--> <!--Basic Data-->
<QCard class="vn-one"> <QCard class="vn-one">
<QCardSection class="q-pa-none"> <QCardSection class="q-pa-none">
<a class="header header-link" :href="getLink('basic-data')"> <VnTitle
{{ t('invoiceIn.pageTitles.basicData') }} :url="getLink('basic-data')"
<QIcon name="open_in_new" /> :text="t('invoiceIn.pageTitles.basicData')"
</a> />
</QCardSection> </QCardSection>
<VnLv <VnLv
:label="t('invoiceIn.summary.supplier')" :label="t('invoiceIn.summary.supplier')"
@ -233,10 +234,10 @@ function getLink(param) {
</QCard> </QCard>
<QCard class="vn-one"> <QCard class="vn-one">
<QCardSection class="q-pa-none"> <QCardSection class="q-pa-none">
<a class="header header-link" :href="getLink('basic-data')"> <VnTitle
{{ t('invoiceIn.pageTitles.basicData') }} :url="getLink('basic-data')"
<QIcon name="open_in_new" /> :text="t('invoiceIn.pageTitles.basicData')"
</a> />
</QCardSection> </QCardSection>
<VnLv <VnLv
:ellipsis-value="false" :ellipsis-value="false"
@ -258,10 +259,10 @@ function getLink(param) {
</QCard> </QCard>
<QCard class="vn-one"> <QCard class="vn-one">
<QCardSection class="q-pa-none"> <QCardSection class="q-pa-none">
<a class="header header-link" :href="getLink('basic-data')"> <VnTitle
{{ t('invoiceIn.pageTitles.basicData') }} :url="getLink('basic-data')"
<QIcon name="open_in_new" /> :text="t('invoiceIn.pageTitles.basicData')"
</a> />
</QCardSection> </QCardSection>
<VnLv <VnLv
:label="t('invoiceIn.summary.sage')" :label="t('invoiceIn.summary.sage')"
@ -283,10 +284,10 @@ function getLink(param) {
</QCard> </QCard>
<QCard class="vn-one"> <QCard class="vn-one">
<QCardSection class="q-pa-none"> <QCardSection class="q-pa-none">
<a class="header header-link" :href="getLink('basic-data')"> <VnTitle
{{ t('invoiceIn.pageTitles.basicData') }} :url="getLink('basic-data')"
<QIcon name="open_in_new" /> :text="t('invoiceIn.pageTitles.basicData')"
</a> />
</QCardSection> </QCardSection>
<QCardSection class="q-pa-none"> <QCardSection class="q-pa-none">
<div class="bordered q-px-sm q-mx-auto"> <div class="bordered q-px-sm q-mx-auto">
@ -319,10 +320,7 @@ function getLink(param) {
</QCard> </QCard>
<!--Vat--> <!--Vat-->
<QCard v-if="invoiceIn.invoiceInTax.length"> <QCard v-if="invoiceIn.invoiceInTax.length">
<a class="header header-link" :href="getLink('vat')"> <VnTitle :url="getLink('vat')" :text="t('invoiceIn.card.vat')" />
{{ t('invoiceIn.card.vat') }}
<QIcon name="open_in_new" />
</a>
<QTable <QTable
:columns="vatColumns" :columns="vatColumns"
:rows="invoiceIn.invoiceInTax" :rows="invoiceIn.invoiceInTax"
@ -352,16 +350,12 @@ function getLink(param) {
</QCard> </QCard>
<!--Due Day--> <!--Due Day-->
<QCard v-if="invoiceIn.invoiceInDueDay.length"> <QCard v-if="invoiceIn.invoiceInDueDay.length">
<a class="header header-link" :href="getLink('due-day')"> <VnTitle :url="getLink('due-day')" :text="t('invoiceIn.card.dueDay')" />
{{ t('invoiceIn.card.dueDay') }}
<QIcon name="open_in_new" />
</a>
<QTable <QTable
class="full-width" class="full-width"
:columns="dueDayColumns" :columns="dueDayColumns"
:rows="invoiceIn.invoiceInDueDay" :rows="invoiceIn.invoiceInDueDay"
flat flat
hide-pagination
> >
<template #header="props"> <template #header="props">
<QTr :props="props" class="bg"> <QTr :props="props" class="bg">
@ -382,15 +376,14 @@ function getLink(param) {
</QCard> </QCard>
<!--Intrastat--> <!--Intrastat-->
<QCard v-if="invoiceIn.invoiceInIntrastat.length"> <QCard v-if="invoiceIn.invoiceInIntrastat.length">
<a class="header header-link" :href="getLink('intrastat')"> <VnTitle
{{ t('invoiceIn.card.intrastat') }} :url="getLink('intrastat')"
<QIcon name="open_in_new" /> :text="t('invoiceIn.card.intrastat')"
</a> />
<QTable <QTable
:columns="intrastatColumns" :columns="intrastatColumns"
:rows="invoiceIn.invoiceInIntrastat" :rows="invoiceIn.invoiceInIntrastat"
flat flat
hide-pagination
> >
<template #header="props"> <template #header="props">
<QTr :props="props" class="bg"> <QTr :props="props" class="bg">
@ -415,10 +408,10 @@ function getLink(param) {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.bg { .bg {
background-color: var(--vn-light-gray); background-color: var(--vn-accent-color);
} }
.bordered { .bordered {
border: 1px solid var(--vn-text); border: 1px solid var(--vn-text-color);
max-width: 18em; max-width: 18em;
} }
</style> </style>

View File

@ -32,6 +32,13 @@ const invoiceInFormRef = ref();
const expensesRef = ref(); const expensesRef = ref();
const newExpenseRef = ref(); const newExpenseRef = ref();
defineProps({
actionIcon: {
type: String,
default: 'add',
},
});
const columns = computed(() => [ const columns = computed(() => [
{ {
name: 'expense', name: 'expense',
@ -184,10 +191,8 @@ async function addExpense() {
selection="multiple" selection="multiple"
:columns="columns" :columns="columns"
:rows="rows" :rows="rows"
row-key="$index" row-key="$index"
hide-pagination
:grid="$q.screen.lt.sm" :grid="$q.screen.lt.sm"
:pagination="{ rowsPerPage: 0 }"
> >
<template #body-cell-expense="{ row, col }"> <template #body-cell-expense="{ row, col }">
<QTd auto-width> <QTd auto-width>
@ -209,17 +214,16 @@ async function addExpense() {
@click.stop="value = null" @click.stop="value = null"
class="cursor-pointer" class="cursor-pointer"
/> />
<QBtn <QIcon
padding="xs" @click.stop.prevent="newExpenseRef.show()"
round :name="actionIcon"
flat size="xs"
icon="add_circle" class="default-icon"
@click.stop="newExpenseRef.show()"
> >
<QTooltip> <QTooltip>
{{ t('Create expense') }} {{ t('Create expense') }}
</QTooltip> </QTooltip>
</QBtn> </QIcon>
</template> </template>
</VnSelectFilter> </VnSelectFilter>
</QTd> </QTd>
@ -472,6 +476,11 @@ async function addExpense() {
.q-item { .q-item {
min-height: 0; min-height: 0;
} }
.default-icon {
cursor: pointer;
border-radius: 50px;
background-color: $primary;
}
</style> </style>
<i18n> <i18n>
es: es:

View File

@ -29,6 +29,7 @@ const suppliersRef = ref();
order="nickname" order="nickname"
limit="30" limit="30"
@on-fetch="(data) => (suppliers = data)" @on-fetch="(data) => (suppliers = 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 }">
@ -38,46 +39,6 @@ const suppliersRef = ref();
</div> </div>
</template> </template>
<template #body="{ params, searchFn }"> <template #body="{ params, searchFn }">
<QItem>
<QItemSection>
<VnInput
:label="t('Id or Supplier')"
v-model="params.search"
is-outlined
>
<template #prepend>
<QIcon name="badge" size="sm"></QIcon>
</template>
</VnInput>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
:label="useCapitalize(t('params.correctedFk'))"
v-model="params.correctedFk"
is-outlined
>
<template #prepend>
<QIcon name="attachment" size="sm" />
</template>
</VnInput>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
:label="t('params.supplierRef')"
v-model="params.supplierRef"
is-outlined
lazy-rules
>
<template #prepend>
<QIcon name="vn:client" size="sm"></QIcon>
</template>
</VnInput>
</QItemSection>
</QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnSelectFilter <VnSelectFilter
@ -97,31 +58,31 @@ const suppliersRef = ref();
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInput <VnInput
:label="t('params.fi')" :label="t('params.supplierRef')"
v-model="params.fi" v-model="params.supplierRef"
is-outlined is-outlined
lazy-rules lazy-rules
> >
<template #prepend> <template #prepend>
<QIcon name="badge" size="sm"></QIcon> <QIcon name="vn:client" size="sm"></QIcon>
</template> </template>
</VnInput> </VnInput>
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInput <VnInputDate
:label="t('params.serialNumber')" :label="t('From')"
v-model="params.serialNumber" v-model="params.from"
is-outlined is-outlined
lazy-rules />
> </QItemSection>
<template #prepend> </QItem>
<QIcon name="badge" size="sm"></QIcon> <QItem>
</template> <QItemSection>
</VnInput> <VnInputDate :label="t('To')" v-model="params.to" is-outlined />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInput <VnInput
@ -152,6 +113,34 @@ const suppliersRef = ref();
</QItemSection> </QItemSection>
</QItem> </QItem>
<QExpansionItem :label="t('More options')" expand-separator> <QExpansionItem :label="t('More options')" expand-separator>
<QItem>
<QItemSection>
<VnInput
:label="t('params.fi')"
v-model="params.fi"
is-outlined
lazy-rules
>
<template #prepend>
<QIcon name="badge" size="sm"></QIcon>
</template>
</VnInput>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
:label="t('params.serialNumber')"
v-model="params.serialNumber"
is-outlined
lazy-rules
>
<template #prepend>
<QIcon name="badge" size="sm"></QIcon>
</template>
</VnInput>
</QItemSection>
</QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInput <VnInput
@ -180,20 +169,6 @@ const suppliersRef = ref();
</VnInput> </VnInput>
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem>
<QItemSection>
<VnInputDate
:label="t('From')"
v-model="params.from"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate :label="t('To')" v-model="params.to" is-outlined />
</QItemSection>
</QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInputDate <VnInputDate

View File

@ -112,7 +112,6 @@ function navigate(id) {
<QBtn <QBtn
:label="t('components.smartCard.openCard')" :label="t('components.smartCard.openCard')"
@click.stop="navigate(row.id)" @click.stop="navigate(row.id)"
class="bg-vn-dark"
outline outline
type="reset" type="reset"
/> />

View File

@ -2,13 +2,15 @@
import { ref, computed } from 'vue'; import { 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 { toCurrency, toDate } from 'src/filters';
import CardDescriptor from 'components/ui/CardDescriptor.vue'; import CardDescriptor from 'components/ui/CardDescriptor.vue';
import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue'; import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import useCardDescription from 'src/composables/useCardDescription';
import InvoiceOutDescriptorMenu from './InvoiceOutDescriptorMenu.vue'; import InvoiceOutDescriptorMenu from './InvoiceOutDescriptorMenu.vue';
import useCardDescription from 'src/composables/useCardDescription';
import { toCurrency, toDate } from 'src/filters';
const $props = defineProps({ const $props = defineProps({
id: { id: {
type: Number, type: Number,
@ -23,7 +25,6 @@ const { t } = useI18n();
const entityId = computed(() => { const entityId = computed(() => {
return $props.id || route.params.id; return $props.id || route.params.id;
}); });
const descriptor = ref();
const filter = { const filter = {
include: [ include: [
@ -42,6 +43,8 @@ const filter = {
], ],
}; };
const descriptor = ref();
function ticketFilter(invoice) { function ticketFilter(invoice) {
return JSON.stringify({ refFk: invoice.ref }); return JSON.stringify({ refFk: invoice.ref });
} }
@ -61,7 +64,7 @@ const setData = (entity) => (data.value = useCardDescription(entity.ref, entity.
data-key="invoiceOutData" data-key="invoiceOutData"
> >
<template #menu="{ entity }"> <template #menu="{ entity }">
<InvoiceOutDescriptorMenu :invoice-out="entity" /> <InvoiceOutDescriptorMenu :invoice-out-data="entity" />
</template> </template>
<template #body="{ entity }"> <template #body="{ entity }">
<VnLv :label="t('invoiceOut.card.issued')" :value="toDate(entity.issued)" /> <VnLv :label="t('invoiceOut.card.issued')" :value="toDate(entity.issued)" />

View File

@ -1,40 +1,260 @@
<script setup> <script setup>
import { ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import { useQuasar } from 'quasar';
import TransferInvoiceForm from 'src/components/TransferInvoiceForm.vue';
import SendEmailDialog from 'components/common/SendEmailDialog.vue';
import useNotify from 'src/composables/useNotify';
import { useSession } from 'src/composables/useSession';
import { usePrintService } from 'composables/usePrintService';
import { useVnConfirm } from 'composables/useVnConfirm';
import axios from 'axios';
const $props = defineProps({
invoiceOutData: {
type: Object,
default: () => {},
},
});
const { notify } = useNotify();
const router = useRouter();
const session = useSession();
const token = session.getToken();
const { t } = useI18n(); const { t } = useI18n();
const { openReport, sendEmail } = usePrintService();
const { openConfirmationModal } = useVnConfirm();
const quasar = useQuasar();
const transferInvoiceDialogRef = ref();
const invoiceFormType = ref('pdf');
const defaultEmailAddress = ref($props.invoiceOutData.client?.email);
const showInvoicePdf = () => {
const url = `api/InvoiceOuts/${$props.invoiceOutData.id}/download?access_token=${token}`;
window.open(url, '_blank');
};
const showInvoiceCsv = () => {
openReport(`InvoiceOuts/${$props.invoiceOutData.ref}/invoice-csv`, {
recipientId: $props.invoiceOutData.client.id,
});
};
const showSendInvoiceDialog = (type) => {
invoiceFormType.value = type;
quasar.dialog({
component: SendEmailDialog,
componentProps: {
data: {
address: defaultEmailAddress.value,
},
promise: sendEmailInvoice,
},
});
};
const sendEmailInvoice = async ({ address }) => {
try {
if (!address) notify(`The email can't be empty`, 'negative');
if (invoiceFormType.value === 'pdf') {
return sendEmail(`InvoiceOuts/${$props.invoiceOutData.ref}/invoice-email`, {
recipientId: $props.invoiceOutData.client.id,
recipient: address,
});
} else {
return sendEmail(
`InvoiceOuts/${$props.invoiceOutData.ref}/invoice-csv-email`,
{
recipientId: $props.invoiceOutData.client.id,
recipient: address,
}
);
}
} catch (err) {
console.error('Error sending email', err);
}
};
const redirectToInvoiceOutList = () => {
router.push({ name: 'InvoiceOutList' });
};
const deleteInvoice = async () => {
try {
await axios.post(`InvoiceOuts/${$props.invoiceOutData.id}/delete`);
notify(t('InvoiceOut deleted'), 'positive');
} catch (err) {
console.error('Error deleting invoice out', err);
}
};
const bookInvoice = async () => {
try {
await axios.post(`InvoiceOuts/${$props.invoiceOutData.ref}/book`);
notify(t('InvoiceOut booked'), 'positive');
} catch (err) {
console.error('Error booking invoice out', err);
}
};
const generateInvoicePdf = async () => {
try {
await axios.post(`InvoiceOuts/${$props.invoiceOutData.id}/createPdf`);
notify(t('The invoice PDF document has been regenerated'), 'positive');
} catch (err) {
console.error('Error generating invoice out pdf', err);
}
};
const refundInvoice = async (withWarehouse) => {
try {
const params = { ref: $props.invoiceOutData.ref, withWarehouse: withWarehouse };
const { data } = await axios.post('InvoiceOuts/refund', params);
notify(
t('refundInvoiceSuccessMessage', {
refundTicket: data[0].id,
}),
'positive'
);
} catch (err) {
console.error('Error generating invoice out pdf', err);
}
};
</script> </script>
<template> <template>
<QItem v-ripple clickable> <QItem v-ripple clickable @click="transferInvoiceDialogRef.show()">
<QItemSection>{{ t('Transfer invoice to') }}</QItemSection> <QItemSection>{{ t('Transfer invoice to...') }}</QItemSection>
</QItem> </QItem>
<QItem v-ripple clickable> <QItem v-ripple clickable>
<QItemSection>{{ t('See invoice') }}</QItemSection> <QItemSection>{{ t('Show invoice...') }}</QItemSection>
<QItemSection side>
<QIcon name="keyboard_arrow_right" />
</QItemSection>
<QMenu anchor="top end" self="top start">
<QList>
<QItem v-ripple clickable @click="showInvoicePdf()">
<QItemSection>{{ t('As PDF') }}</QItemSection>
</QItem>
<QItem v-ripple clickable @click="showInvoiceCsv()">
<QItemSection>{{ t('As CSV') }}</QItemSection>
</QItem>
</QList>
</QMenu>
</QItem> </QItem>
<QItem v-ripple clickable> <QItem v-ripple clickable>
<QItemSection>{{ t('Send invoice') }}</QItemSection> <QItemSection>{{ t('Send invoice...') }}</QItemSection>
<QItemSection side>
<QIcon name="keyboard_arrow_right" />
</QItemSection>
<QMenu anchor="top end" self="top start">
<QList>
<QItem v-ripple clickable @click="showSendInvoiceDialog('pdf')">
<QItemSection>{{ t('Send PDF') }}</QItemSection>
</QItem>
<QItem v-ripple clickable @click="showSendInvoiceDialog('csv')">
<QItemSection>{{ t('Send CSV') }}</QItemSection>
</QItem>
</QList>
</QMenu>
</QItem> </QItem>
<QItem v-ripple clickable> <QItem
v-ripple
clickable
@click="
openConfirmationModal(
t('Confirm deletion'),
t('Are you sure you want to delete this invoice?'),
deleteInvoice,
redirectToInvoiceOutList
)
"
>
<QItemSection>{{ t('Delete invoice') }}</QItemSection> <QItemSection>{{ t('Delete invoice') }}</QItemSection>
</QItem> </QItem>
<QItem v-ripple clickable> <QItem
<QItemSection>{{ t('Post invoice') }}</QItemSection> v-ripple
clickable
@click="
openConfirmationModal(
'',
t('Are you sure you want to book this invoice?'),
bookInvoice
)
"
>
<QItemSection>{{ t('Book invoice') }}</QItemSection>
</QItem>
<QItem
v-ripple
clickable
@click="
openConfirmationModal(
t('Generate PDF invoice document'),
t('Are you sure you want to generate/regenerate the PDF invoice?'),
generateInvoicePdf
)
"
>
<QItemSection>{{ t('Generate PDF invoice') }}</QItemSection>
</QItem> </QItem>
<QItem v-ripple clickable> <QItem v-ripple clickable>
<QItemSection>{{ t('Regenerate invoice PDF') }}</QItemSection> <QItemSection>{{ t('Refund...') }}</QItemSection>
</QItem> <QItemSection side>
<QItem v-ripple clickable> <QIcon name="keyboard_arrow_right" />
<QItemSection>{{ t('Pass') }}</QItemSection> </QItemSection>
<QMenu anchor="top end" self="top start">
<QList>
<QItem v-ripple clickable @click="refundInvoice(true)">
<QItemSection>{{ t('With warehouse') }}</QItemSection>
</QItem>
<QItem v-ripple clickable @click="refundInvoice(false)">
<QItemSection>{{ t('Without warehouse') }}</QItemSection>
</QItem>
</QList>
</QMenu>
<QTooltip>
{{ t('Create a single ticket with all the content of the current invoice') }}
</QTooltip>
</QItem> </QItem>
<QDialog ref="transferInvoiceDialogRef">
<TransferInvoiceForm :invoice-out-data="invoiceOutData" />
</QDialog>
</template> </template>
<i18n> <i18n>
es: es:
Transfer invoice to: Transferir factura a Transfer invoice to...: Transferir factura a...
See invoice: Ver factura Show invoice...: Ver factura...
Send invoice: Enviar factura Send invoice...: Enviar factura...
Delete invoice: Eliminar factura Delete invoice: Eliminar factura
Post invoice: Asentar factura Book invoice: Asentar factura
Regenerate invoice PDF: Regenerar PDF factura Generate PDF invoice: Generar PDF factura
Pass: Abono Refund...: Abono
As PDF: como PDF
As CSV: como CSV
Send PDF: Enviar PDF
Send CSV: Enviar CSV
With warehouse: Con almacén
Without warehouse: Sin almacén
InvoiceOut deleted: Factura eliminada
Confirm deletion: Confirmar eliminación
Are you sure you want to delete this invoice?: Estas seguro de eliminar esta factura?
Are you sure you want to book this invoice?: Estas seguro de querer asentar esta factura?
InvoiceOut booked: Factura asentada
Generate PDF invoice document: Generar PDF de la factura
Are you sure you want to generate/regenerate the PDF invoice?: ¿Seguro que quieres generar/regenerar el PDF de la factura?
The invoice PDF document has been regenerated: El documento PDF de la factura ha sido regenerado
Create a single ticket with all the content of the current invoice: Crear un ticket único con todo el contenido de la factura actual
refundInvoiceSuccessMessage: Se ha creado el siguiente ticket de abono {refundTicket}
The email can't be empty: El email no puede estar vacío
en:
refundInvoiceSuccessMessage: The following refund ticket have been created {refundTicket}
</i18n> </i18n>

View File

@ -7,6 +7,9 @@ import { toCurrency, toDate } from 'src/filters';
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 { getUrl } from 'src/composables/getUrl'; import { getUrl } from 'src/composables/getUrl';
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
import VnTitle from 'src/components/common/VnTitle.vue';
onMounted(async () => { onMounted(async () => {
fetch(); fetch();
@ -67,29 +70,33 @@ const taxColumns = ref([
const ticketsColumns = ref([ const ticketsColumns = ref([
{ {
name: 'item', name: 'item',
label: 'invoiceOut.summary.ticketId', label: t('invoiceOut.summary.ticketId'),
field: (row) => row.id, field: (row) => row.id,
sortable: true, sortable: true,
align: 'left',
}, },
{ {
name: 'quantity', name: 'quantity',
label: 'invoiceOut.summary.nickname', label: t('invoiceOut.summary.nickname'),
field: (row) => row.nickname, field: (row) => row.nickname,
sortable: true, sortable: true,
align: 'left',
}, },
{ {
name: 'landed', name: 'landed',
label: 'invoiceOut.summary.shipped', label: t('invoiceOut.summary.shipped'),
field: (row) => row.shipped, field: (row) => row.shipped,
format: (value) => toDate(value), format: (value) => toDate(value),
sortable: true, sortable: true,
align: 'left',
}, },
{ {
name: 'landed', name: 'landed',
label: 'invoiceOut.summary.totalWithVat', label: t('invoiceOut.summary.totalWithVat'),
field: (row) => row.totalWithVat, field: (row) => row.totalWithVat,
format: (value) => toCurrency(value), format: (value) => toCurrency(value),
sortable: true, sortable: true,
align: 'left',
}, },
]); ]);
</script> </script>
@ -105,10 +112,7 @@ const ticketsColumns = ref([
</template> </template>
<template #body="{ entity: { invoiceOut } }"> <template #body="{ entity: { invoiceOut } }">
<QCard class="vn-one"> <QCard class="vn-one">
<a class="header header-link"> <VnTitle :text="t('invoiceOut.pageTitles.basicData')" />
{{ t('invoiceOut.pageTitles.basicData') }}
<QIcon name="open_in_new" />
</a>
<VnLv <VnLv
:label="t('invoiceOut.summary.issued')" :label="t('invoiceOut.summary.issued')"
:value="toDate(invoiceOut.issued)" :value="toDate(invoiceOut.issued)"
@ -131,10 +135,7 @@ const ticketsColumns = ref([
/> />
</QCard> </QCard>
<QCard class="vn-three"> <QCard class="vn-three">
<a class="header header-link"> <VnTitle :text="t('invoiceOut.summary.taxBreakdown')" />
{{ t('invoiceOut.summary.taxBreakdown') }}
<QIcon name="open_in_new" />
</a>
<QTable :columns="taxColumns" :rows="invoiceOut.taxesBreakdown" flat> <QTable :columns="taxColumns" :rows="invoiceOut.taxesBreakdown" flat>
<template #header="props"> <template #header="props">
<QTr :props="props"> <QTr :props="props">
@ -146,17 +147,23 @@ const ticketsColumns = ref([
</QTable> </QTable>
</QCard> </QCard>
<QCard class="vn-three"> <QCard class="vn-three">
<a class="header header-link"> <VnTitle :text="t('invoiceOut.summary.tickets')" />
{{ t('invoiceOut.summary.tickets') }}
<QIcon name="open_in_new" />
</a>
<QTable v-if="tickets" :columns="ticketsColumns" :rows="tickets" flat> <QTable v-if="tickets" :columns="ticketsColumns" :rows="tickets" flat>
<template #header="props"> <template #body-cell-item="{ value }">
<QTr :props="props"> <QTd>
<QTh v-for="col in props.cols" :key="col.name" :props="props"> <QBtn flat color="primary">
{{ t(col.label) }} {{ value }}
</QTh> <TicketDescriptorProxy :id="value" />
</QTr> </QBtn>
</QTd>
</template>
<template #body-cell-quantity="{ value, row }">
<QTd>
<QBtn flat color="primary" dense>
{{ value }}
<CustomerDescriptorProxy :id="row.id" />
</QBtn>
</QTd>
</template> </template>
</QTable> </QTable>
</QCard> </QCard>

View File

@ -21,6 +21,7 @@ const {
nPdfs, nPdfs,
totalPdfs, totalPdfs,
errors, errors,
addresses,
} = storeToRefs(invoiceOutGlobalStore); } = storeToRefs(invoiceOutGlobalStore);
const selectedCustomerId = ref(null); const selectedCustomerId = ref(null);
@ -86,6 +87,14 @@ const selectCustomerId = (id) => {
selectedCustomerId.value = id; selectedCustomerId.value = id;
}; };
const statusText = computed(() => {
return status.value === 'invoicing'
? `${t(`status.${status.value}`)} ${
addresses.value[getAddressNumber.value]?.clientId
}`
: t(`status.${status.value}`);
});
onMounted(() => (stateStore.rightDrawer = true)); onMounted(() => (stateStore.rightDrawer = true));
onUnmounted(() => { onUnmounted(() => {
stateStore.rightDrawer = false; stateStore.rightDrawer = false;
@ -103,7 +112,7 @@ onUnmounted(() => {
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<QCard v-if="status" class="card"> <QCard v-if="status" class="card">
<QCardSection class="card-section"> <QCardSection class="card-section">
<span class="text">{{ t(`status.${status}`) }}</span> <span class="text">{{ statusText }}</span>
<span class="text">{{ <span class="text">{{
t('invoiceOut.globalInvoices.statusCard.percentageText', { t('invoiceOut.globalInvoices.statusCard.percentageText', {
getPercentage: getPercentage, getPercentage: getPercentage,
@ -124,9 +133,7 @@ onUnmounted(() => {
v-if="rows.length > 0" v-if="rows.length > 0"
:rows="rows" :rows="rows"
:columns="columns" :columns="columns"
hide-bottom
row-key="id" row-key="id"
:pagination="{ rowsPerPage: 0 }"
class="full-width q-mt-md" class="full-width q-mt-md"
> >
<template #body-cell="props"> <template #body-cell="props">
@ -156,7 +163,7 @@ onUnmounted(() => {
display: flex; display: flex;
justify-content: center; justify-content: center;
width: 100%; width: 100%;
background-color: var(--vn-dark); background-color: var(--vn-section-color);
padding: 16px; padding: 16px;
.card-section { .card-section {
@ -167,7 +174,7 @@ onUnmounted(() => {
.text { .text {
font-size: 14px; font-size: 14px;
color: var(--vn-text); color: var(--vn-text-color);
} }
} }

View File

@ -13,13 +13,8 @@ const { t } = useI18n();
const invoiceOutGlobalStore = useInvoiceOutGlobalStore(); const invoiceOutGlobalStore = useInvoiceOutGlobalStore();
// invoiceOutGlobalStore state and getters // invoiceOutGlobalStore state and getters
const { const { initialDataLoading, formInitialData, invoicing, status } =
initialDataLoading, storeToRefs(invoiceOutGlobalStore);
formInitialData,
invoicing,
status,
} = storeToRefs(invoiceOutGlobalStore);
// invoiceOutGlobalStore actions // invoiceOutGlobalStore actions
const { makeInvoice, setStatusValue } = invoiceOutGlobalStore; const { makeInvoice, setStatusValue } = invoiceOutGlobalStore;
@ -32,13 +27,7 @@ const printersOptions = ref([]);
const clientsOptions = ref([]); const clientsOptions = ref([]);
const formData = ref({ const formData = ref({});
companyFk: null,
invoiceDate: null,
maxShipped: null,
clientId: null,
printer: null,
});
const optionsInitialData = computed(() => { const optionsInitialData = computed(() => {
return ( return (

View File

@ -2,25 +2,32 @@
import { onMounted, onUnmounted, ref } from 'vue'; import { onMounted, onUnmounted, ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { exportFile, useQuasar } from 'quasar';
import { useStateStore } from 'stores/useStateStore';
import VnPaginate from 'src/components/ui/VnPaginate.vue'; import VnPaginate from 'src/components/ui/VnPaginate.vue';
import InvoiceOutSummary from './Card/InvoiceOutSummary.vue'; import InvoiceOutSummary from './Card/InvoiceOutSummary.vue';
import { toDate, toCurrency } from 'src/filters/index';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import InvoiceOutFilter from './InvoiceOutFilter.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import CardList from 'src/components/ui/CardList.vue'; import CardList from 'src/components/ui/CardList.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
import CreateManualInvoiceForm from 'src/components/CreateManualInvoiceForm.vue';
import InvoiceOutFilter from './InvoiceOutFilter.vue';
import { toDate, toCurrency } from 'src/filters/index';
import { useStateStore } from 'stores/useStateStore';
import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import { useSession } from 'src/composables/useSession';
const { t } = useI18n(); const { t } = useI18n();
const selectedCards = ref(new Map());
const quasar = useQuasar();
const router = useRouter(); const router = useRouter();
const stateStore = useStateStore(); const stateStore = useStateStore();
const session = useSession();
const tokenMultimedia = session.getTokenMultimedia();
const { viewSummary } = useSummaryDialog(); const { viewSummary } = useSummaryDialog();
const manualInvoiceDialogRef = ref(null);
const selectedCards = ref(new Map());
onMounted(() => (stateStore.rightDrawer = true)); onMounted(() => (stateStore.rightDrawer = true));
onUnmounted(() => (stateStore.rightDrawer = false)); onUnmounted(() => (stateStore.rightDrawer = false));
@ -52,37 +59,37 @@ const toggleAllCards = (cardsData) => {
} }
}; };
const downloadCsv = () => { const openPdf = () => {
if (selectedCards.value.size === 0) return; try {
const selectedCardsArray = Array.from(selectedCards.value.values()); if (selectedCards.value.size === 0) return;
let file; const selectedCardsArray = Array.from(selectedCards.value.values());
for (var i = 0; i < selectedCardsArray.length; i++) {
if (i == 0) file += Object.keys(selectedCardsArray[i]).join(';') + '\n'; if (selectedCards.value.size === 1) {
file += const [invoiceOut] = selectedCardsArray;
Object.keys(selectedCardsArray[i]) const url = `api/InvoiceOuts/${invoiceOut.id}/download?access_token=${tokenMultimedia}`;
.map(function (key) { window.open(url, '_blank');
return selectedCardsArray[i][key]; } else {
}) const invoiceOutIdsArray = selectedCardsArray.map(
.join(';') + '\n'; (invoiceOut) => invoiceOut.id
} );
const status = exportFile('file.csv', file, { const invoiceOutIds = invoiceOutIdsArray.join(',');
encoding: 'windows-1252',
mimeType: 'text/csv;charset=windows-1252;', const params = new URLSearchParams({
}); access_token: tokenMultimedia,
if (status === true) { ids: invoiceOutIds,
quasar.notify({ });
message: t('fileAllowed'),
color: 'positive', const url = `api/InvoiceOuts/downloadZip?${params}`;
icon: 'check', window.open(url, '_blank');
}); }
} else { } catch (err) {
quasar.notify({ console.error('Error opening PDF');
message: t('fileDenied'),
color: 'negative',
icon: 'warning',
});
} }
}; };
const openCreateInvoiceModal = () => {
manualInvoiceDialogRef.value.show();
};
</script> </script>
<template> <template>
@ -119,52 +126,21 @@ const downloadCsv = () => {
<VnPaginate <VnPaginate
auto-load auto-load
data-key="InvoiceOutList" data-key="InvoiceOutList"
order="issued DESC, id DESC" :order="['issued DESC', 'id DESC']"
url="InvoiceOuts/filter" url="InvoiceOuts/filter"
> >
<template #body="{ rows }"> <template #body="{ rows }">
<VnSubToolbar class="bg-vn-dark justify-end"> <VnSubToolbar class="justify-end">
<template #st-actions> <template #st-actions>
<QBtn <QBtn
@click="downloadCsv()" @click="openPdf()"
class="q-mr-xl" class="q-mr-md"
color="primary" color="primary"
icon="cloud_download"
:disable="selectedCards.size === 0" :disable="selectedCards.size === 0"
:label="t('globals.download')"
/>
<!-- <QBtnDropdown
class="q-mr-xl"
color="primary"
:disable="!manageCheckboxes && arrayElements.length < 1"
:label="t('globals.download')"
v-else
> >
<QList> <QTooltip>{{ t('downloadPdf') }}</QTooltip>
<QItem clickable v-close-popup @click="downloadCsv(rows)"> </QBtn>
<QItemSection>
<QItemLabel>
{{
t('globals.allRows', {
numberRows: rows.length,
})
}}
</QItemLabel>
</QItemSection>
</QItem>
<QItem clickable v-close-popup @click="downloadCsv(rows)">
<QItemSection>
<QItemLabel>
{{
t('globals.selectRows', {
numberRows: rows.length,
})
}}
</QItemLabel>
</QItemSection>
</QItem>
</QList>
</QBtnDropdown> -->
<QCheckbox <QCheckbox
left-label left-label
:label="t('globals.markAll')" :label="t('globals.markAll')"
@ -189,18 +165,23 @@ const downloadCsv = () => {
> >
<template #list-items> <template #list-items>
<VnLv <VnLv
:label="t('invoiceOut.list.shortIssued')" :label="t('invoiceOut.list.issued')"
:title-label="t('invoiceOut.list.issued')"
:value="toDate(row.issued)" :value="toDate(row.issued)"
/> />
<VnLv <VnLv
:label="t('invoiceOut.list.amount')" :label="t('invoiceOut.list.amount')"
:value="toCurrency(row.amount)" :value="toCurrency(row.amount)"
/> />
<VnLv <VnLv :label="t('invoiceOut.list.client')">
:label="t('invoiceOut.list.client')" <template #value>
:value="row.clientSocialName" <span class="link" @click.stop>
/> {{ row?.clientSocialName }}
<CustomerDescriptorProxy
:id="row?.clientFk"
/>
</span>
</template>
</VnLv>
<VnLv <VnLv
:label="t('invoiceOut.list.shortCreated')" :label="t('invoiceOut.list.shortCreated')"
:title-label="t('invoiceOut.list.created')" :title-label="t('invoiceOut.list.created')"
@ -217,13 +198,6 @@ const downloadCsv = () => {
/> />
</template> </template>
<template #actions> <template #actions>
<QBtn
:label="t('components.smartCard.openCard')"
@click.stop="navigate(row.id)"
class="bg-vn-dark"
outline
type="reset"
/>
<QBtn <QBtn
:label="t('components.smartCard.openSummary')" :label="t('components.smartCard.openSummary')"
@click.stop="viewSummary(row.id, InvoiceOutSummary)" @click.stop="viewSummary(row.id, InvoiceOutSummary)"
@ -237,6 +211,20 @@ const downloadCsv = () => {
</div> </div>
</template> </template>
</VnPaginate> </VnPaginate>
<QPageSticky :offset="[20, 20]">
<QBtn fab icon="add" color="primary" @click="openCreateInvoiceModal()" />
<QTooltip>
{{ t('createInvoice') }}
</QTooltip>
</QPageSticky>
<QDialog
ref="manualInvoiceDialogRef"
transition-show="scale"
transition-hide="scale"
>
<CreateManualInvoiceForm />
</QDialog>
</QPage> </QPage>
</template> </template>
@ -246,9 +234,13 @@ en:
fileDenied: Browser denied file download... fileDenied: Browser denied file download...
fileAllowed: Successful download of CSV file fileAllowed: Successful download of CSV file
youCanSearchByInvoiceReference: You can search by invoice reference youCanSearchByInvoiceReference: You can search by invoice reference
downloadPdf: Download PDF
createInvoice: Make invoice
es: es:
searchInvoice: Buscar factura emitida searchInvoice: Buscar factura emitida
fileDenied: El navegador denegó la descarga de archivos... fileDenied: El navegador denegó la descarga de archivos...
fileAllowed: Descarga exitosa de archivo CSV fileAllowed: Descarga exitosa de archivo CSV
youCanSearchByInvoiceReference: Puedes buscar por referencia de la factura youCanSearchByInvoiceReference: Puedes buscar por referencia de la factura
downloadPdf: Descargar PDF
createInvoice: Crear factura
</i18n> </i18n>

View File

@ -1,17 +1,17 @@
<script setup> <script setup>
import { ref, computed, onBeforeMount } from 'vue'; import { ref, computed, onBeforeMount, onMounted, nextTick } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { QCheckbox, QBtn } from 'quasar';
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue'; import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
import InvoiceOutNegativeFilter from './InvoiceOutNegativeBasesFilter.vue'; import InvoiceOutNegativeFilter from './InvoiceOutNegativeBasesFilter.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
import { toCurrency } from 'src/filters'; import { toCurrency } from 'src/filters';
import { useInvoiceOutGlobalStore } from 'src/stores/invoiceOutGlobal.js'; import { useInvoiceOutGlobalStore } from 'src/stores/invoiceOutGlobal.js';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import { useArrayData } from 'composables/useArrayData'; import { useArrayData } from 'composables/useArrayData';
import VnUserLink from 'src/components/ui/VnUserLink.vue';
const invoiceOutGlobalStore = useInvoiceOutGlobalStore(); const invoiceOutGlobalStore = useInvoiceOutGlobalStore();
const stateStore = useStateStore(); const stateStore = useStateStore();
@ -45,78 +45,16 @@ onBeforeMount(async () => {
stateStore.rightDrawer = true; stateStore.rightDrawer = true;
}); });
const componentIsRendered = ref(false);
onMounted(() =>
nextTick(() => {
componentIsRendered.value = true;
})
);
const rows = computed(() => arrayData.value.store.data); const rows = computed(() => arrayData.value.store.data);
const selectedCustomerId = ref(0);
const selectedWorkerId = ref(0);
const tableColumnComponents = {
company: {
component: 'span',
props: () => {},
event: () => {},
},
country: {
component: 'span',
props: () => {},
event: () => {},
},
clientId: {
component: QBtn,
props: () => ({ flat: true, color: 'blue' }),
event: (prop) => selectCustomerId(prop.value),
},
client: {
component: 'span',
props: () => {},
event: () => {},
},
amount: {
component: 'span',
props: () => {},
event: () => {},
},
base: {
component: 'span',
props: () => {},
event: () => {},
},
ticketId: {
component: 'span',
props: () => {},
event: () => {},
},
active: {
component: QCheckbox,
props: (prop) => ({
disable: true,
'model-value': Boolean(prop.value),
}),
event: () => {},
},
hasToInvoice: {
component: QCheckbox,
props: (prop) => ({
disable: true,
'model-value': Boolean(prop.value),
}),
event: () => {},
},
verifiedData: {
component: QCheckbox,
props: (prop) => ({
disable: true,
'model-value': Boolean(prop.value),
}),
event: () => {},
},
comercial: {
component: QBtn,
props: () => ({ flat: true, color: 'blue' }),
event: (prop) => selectWorkerId(prop.row.comercialId),
},
};
const columns = computed(() => [ const columns = computed(() => [
{ {
label: t('invoiceOut.negativeBases.company'), label: t('invoiceOut.negativeBases.company'),
@ -205,20 +143,17 @@ const downloadCSV = async () => {
params params
); );
}; };
const selectCustomerId = (id) => {
selectedCustomerId.value = id;
};
const selectWorkerId = (id) => {
selectedWorkerId.value = id;
};
</script> </script>
<template> <template>
<template v-if="stateStore.isHeaderMounted()"> <template v-if="stateStore.isHeaderMounted()">
<Teleport to="#st-actions" v-if="stateStore?.isSubToolbarShown()"> <Teleport
<QBtn color="primary" icon-right="archive" no-caps @click="downloadCSV()" /> to="#st-actions"
v-if="stateStore?.isSubToolbarShown() && componentIsRendered"
>
<QBtn color="primary" icon-right="download" no-caps @click="downloadCSV()">
<QTooltip>{{ t('Download as CSV') }}</QTooltip>
</QBtn>
</Teleport> </Teleport>
</template> </template>
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above> <QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
@ -231,36 +166,40 @@ const selectWorkerId = (id) => {
<QTable <QTable
:columns="columns" :columns="columns"
:rows="rows" :rows="rows"
hide-bottom
row-key="clientId" row-key="clientId"
:pagination="{ rowsPerPage: 0 }"
class="full-width q-mt-md" class="full-width q-mt-md"
> >
<template #body-cell="props"> <template #body-cell-clientId="{ row }">
<QTd :props="props"> <QTd>
<component <QBtn flat dense color="blue"> {{ row.clientId }}</QBtn>
:is="tableColumnComponents[props.col.name].component" <CustomerDescriptorProxy :id="row.clientId" />
class="col-content" </QTd>
v-bind="tableColumnComponents[props.col.name].props(props)" </template>
@click="tableColumnComponents[props.col.name].event(props)" <template #body-cell-ticketId="{ row }">
> <QTd>
<template <QBtn flat dense color="blue"> {{ row.ticketFk }}</QBtn>
v-if=" <TicketDescriptorProxy :id="row.ticketFk" />
props.col.name !== 'active' && </QTd>
props.col.name !== 'hasToInvoice' && </template>
props.col.name !== 'verifiedData' <template #body-cell-comercial="{ row }">
" <QTd>
>{{ props.value }} <QBtn flat dense color="blue">{{ row.comercialName }}</QBtn>
</template> <WorkerDescriptorProxy :id="row.comercialId" />
<CustomerDescriptorProxy </QTd>
v-if="props.col.name === 'clientId'" </template>
:id="selectedCustomerId" <template #body-cell-active="{ row }">
/> <QTd>
<VnUserLink <QCheckbox :model-value="!!row.isActive" disable />
v-if="props.col.name === 'comercial'" </QTd>
:worker-id="selectedWorkerId" </template>
/> <template #body-cell-hasToInvoice="{ row }">
</component> <QTd>
<QCheckbox :model-value="!!row.hasToInvoice" disable />
</QTd>
</template>
<template #body-cell-verifiedData="{ row }">
<QTd>
<QCheckbox :model-value="!!row.isTaxDataChecked" disable />
</QTd> </QTd>
</template> </template>
</QTable> </QTable>
@ -274,4 +213,7 @@ const selectWorkerId = (id) => {
} }
</style> </style>
<i18n></i18n> <i18n>
es:
Download as CSV: Descargar como CSV
</i18n>

View File

@ -0,0 +1 @@
<template>Item create view</template>

View File

@ -1 +1,577 @@
<template>Item list</template> <script setup>
import { onMounted, ref, computed, reactive, onUnmounted } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import FetchData from 'components/FetchData.vue';
import FetchedTags from 'components/ui/FetchedTags.vue';
import TableVisibleColumns from 'src/components/common/TableVisibleColumns.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
import ItemDescriptorProxy from '../Item/Card/ItemDescriptorProxy.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import ItemSummary from '../Item/Card/ItemSummary.vue';
import VnPaginate from 'components/ui/VnPaginate.vue';
import { useStateStore } from 'stores/useStateStore';
import { toDateFormat } from 'src/filters/date.js';
import { useSession } from 'composables/useSession';
import { dashIfEmpty } from 'src/filters';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import { useVnConfirm } from 'composables/useVnConfirm';
import axios from 'axios';
const router = useRouter();
const { getTokenMultimedia } = useSession();
const token = getTokenMultimedia();
const stateStore = useStateStore();
const { t } = useI18n();
const { viewSummary } = useSummaryDialog();
const { openConfirmationModal } = useVnConfirm();
const paginateRef = ref(null);
const itemTypesOptions = ref([]);
const originsOptions = ref([]);
const buyersOptions = ref([]);
const intrastatOptions = ref([]);
const itemCategoriesOptions = ref([]);
const visibleColumns = ref([]);
const allColumnNames = ref([]);
const exprBuilder = (param, value) => {
switch (param) {
case 'category':
return { 'ic.name': value };
case 'buyerFk':
return { 'it.workerFk': value };
case 'grouping':
return { 'b.grouping': value };
case 'packing':
return { 'b.packing': value };
case 'origin':
return { 'ori.code': value };
case 'typeFk':
return { 'i.typeFk': value };
case 'intrastat':
return { 'intr.description': value };
case 'name':
return { 'i.name': { like: `%${value}%` } };
case 'producer':
return { 'pr.name': { like: `%${value}%` } };
case 'id':
case 'size':
case 'subname':
case 'isActive':
case 'weightByPiece':
case 'stemMultiplier':
case 'stems':
return { [`i.${param}`]: value };
}
};
const params = reactive({});
const applyColumnFilter = async (col) => {
try {
const paramKey = col.columnFilter?.filterParamKey || col.field;
params[paramKey] = col.columnFilter.filterValue;
await paginateRef.value.addFilter(null, params);
} catch (err) {
console.error('Error applying column filter', err);
}
};
const getInputEvents = (col) => {
return col.columnFilter.type === 'select'
? { 'update:modelValue': () => applyColumnFilter(col) }
: {
'keyup.enter': () => applyColumnFilter(col),
};
};
const columns = computed(() => [
{
label: '',
name: 'picture',
align: 'left',
columnFilter: null,
},
{
label: t('item.list.id'),
name: 'id',
field: 'id',
align: 'left',
sortable: true,
columnFilter: {
component: VnInput,
type: 'text',
filterValue: null,
event: getInputEvents,
attrs: {
dense: true,
},
},
},
{
label: t('item.list.grouping'),
field: 'grouping',
name: 'grouping',
align: 'left',
sortable: true,
columnFilter: {
component: VnInput,
type: 'text',
filterValue: null,
event: getInputEvents,
attrs: {
dense: true,
},
},
format: (val) => dashIfEmpty(val),
},
{
label: t('item.list.packing'),
field: 'packing',
name: 'packing',
align: 'left',
sortable: true,
columnFilter: {
component: VnInput,
type: 'text',
filterValue: null,
event: getInputEvents,
attrs: {
dense: true,
},
},
format: (val) => dashIfEmpty(val),
},
{
label: t('globals.description'),
field: 'name',
name: 'description',
align: 'left',
sortable: true,
columnFilter: {
component: VnInput,
type: 'text',
filterValue: null,
event: getInputEvents,
attrs: {
dense: true,
},
},
},
{
label: t('item.list.stems'),
field: 'stems',
name: 'stems',
align: 'left',
sortable: true,
columnFilter: {
component: VnInput,
type: 'text',
filterValue: null,
event: getInputEvents,
attrs: {
dense: true,
},
},
},
{
label: t('item.list.size'),
field: 'size',
name: 'size',
align: 'left',
sortable: true,
columnFilter: {
component: VnInput,
type: 'text',
filterValue: null,
event: getInputEvents,
attrs: {
dense: true,
},
},
},
{
label: t('item.list.typeName'),
field: 'typeName',
name: 'typeName',
align: 'left',
sortable: true,
columnFilter: {
component: VnSelectFilter,
filterParamKey: 'typeFk',
type: 'select',
filterValue: null,
event: getInputEvents,
attrs: {
options: itemTypesOptions.value,
'option-value': 'id',
'option-label': 'name',
dense: true,
},
},
},
{
label: t('item.list.category'),
field: 'category',
name: 'category',
align: 'left',
sortable: true,
columnFilter: {
component: VnSelectFilter,
type: 'select',
filterValue: null,
event: getInputEvents,
attrs: {
options: itemCategoriesOptions.value,
'option-value': 'name',
'option-label': 'name',
dense: true,
},
},
},
{
label: t('item.list.intrastat'),
field: 'intrastat',
name: 'intrastat',
align: 'left',
sortable: true,
columnFilter: {
component: VnSelectFilter,
type: 'select',
filterValue: null,
event: getInputEvents,
attrs: {
options: intrastatOptions.value,
'option-value': 'description',
'option-label': 'description',
dense: true,
},
},
},
{
label: t('item.list.origin'),
field: 'origin',
name: 'origin',
align: 'left',
sortable: true,
columnFilter: {
component: VnSelectFilter,
type: 'select',
filterValue: null,
event: getInputEvents,
attrs: {
options: originsOptions.value,
'option-value': 'code',
'option-label': 'code',
dense: true,
},
},
},
{
label: t('item.list.userName'),
field: 'userName',
name: 'userName',
align: 'left',
sortable: true,
columnFilter: {
component: VnSelectFilter,
filterParamKey: 'buyerFk',
type: 'select',
filterValue: null,
event: getInputEvents,
attrs: {
options: buyersOptions.value,
'option-value': 'id',
'option-label': 'nickname',
dense: true,
},
},
},
{
label: t('item.list.weightByPiece'),
field: 'weightByPiece',
name: 'weightByPiece',
align: 'left',
sortable: true,
columnFilter: {
component: VnInput,
type: 'text',
filterValue: null,
event: getInputEvents,
attrs: {
dense: true,
},
},
format: (val) => dashIfEmpty(val),
},
{
label: t('item.list.stemMultiplier'),
field: 'stemMultiplier',
name: 'stemMultiplier',
align: 'left',
sortable: true,
columnFilter: {
component: VnInput,
type: 'text',
filterValue: null,
event: getInputEvents,
attrs: {
dense: true,
},
},
format: (val) => dashIfEmpty(val),
},
{
label: t('item.list.isActive'),
field: 'isActive',
name: 'isActive',
align: 'left',
sortable: true,
columnFilter: null,
},
{
label: t('item.list.producer'),
field: 'producer',
name: 'producer',
align: 'left',
sortable: true,
columnFilter: {
component: VnInput,
type: 'text',
filterValue: null,
event: getInputEvents,
attrs: {
dense: true,
},
},
format: (val) => dashIfEmpty(val),
},
{
label: t('item.list.landed'),
field: 'landed',
name: 'landed',
align: 'left',
sortable: true,
format: (val) => dashIfEmpty(toDateFormat(val)),
columnFilter: null,
},
{
label: '',
name: 'actions',
align: 'left',
columnFilter: null,
},
]);
const redirectToItemCreate = () => {
router.push({ name: 'ItemCreate' });
};
const redirectToItemSummary = (id) => {
router.push({ name: 'ItemSummary', params: { id } });
};
const cloneItem = async (itemFk) => {
try {
const { data } = await axios.post(`Items/${itemFk}/clone`);
if (!data) return;
router.push({ name: 'ItemTags', params: { id: data.id } });
} catch (err) {
console.error('Error cloning item', err);
}
};
onMounted(async () => {
stateStore.rightDrawer = true;
const filteredColumns = columns.value.filter(
(col) => col.name !== 'picture' && col.name !== 'actions'
);
allColumnNames.value = filteredColumns.map((col) => col.name);
});
onUnmounted(() => (stateStore.rightDrawer = false));
</script>
<template>
<FetchData
url="ItemTypes"
:filter="{ fields: ['id', 'name'], order: 'name ASC' }"
auto-load
@on-fetch="(data) => (itemTypesOptions = data)"
/>
<FetchData
url="ItemCategories"
:filter="{ fields: ['name'], order: 'name ASC' }"
auto-load
@on-fetch="(data) => (itemCategoriesOptions = data)"
/>
<FetchData
url="Intrastats"
:filter="{ fields: ['description'], order: 'description ASC' }"
auto-load
@on-fetch="(data) => (intrastatOptions = data)"
/>
<FetchData
url="Origins"
:filter="{ fields: ['code'], order: 'code ASC' }"
auto-load
@on-fetch="(data) => (originsOptions = data)"
/>
<FetchData
url="TicketRequests/getItemTypeWorker"
:filter="{ fields: ['id', 'nickname'], order: 'nickname ASC' }"
auto-load
@on-fetch="(data) => (buyersOptions = data)"
/>
<QToolbar class="bg-vn-dark justify-end">
<div id="st-data">
<TableVisibleColumns
:all-columns="allColumnNames"
table-code="itemsIndex"
labels-traductions-path="item.list"
@on-config-saved="visibleColumns = ['picture', ...$event, 'actions']"
/>
</div>
<QSpace />
<div id="st-actions"></div>
</QToolbar>
<QPage class="column items-center q-pa-md">
<VnPaginate
ref="paginateRef"
data-key="ItemList"
url="Items/filter"
:order="['isActive DESC', 'name', 'id']"
:limit="12"
:expr-builder="exprBuilder"
:user-params="params"
:offset="50"
auto-load
>
<template #body="{ rows }">
<QTable
:rows="rows"
:columns="columns"
row-key="id"
:pagination="{ rowsPerPage: 0 }"
class="full-width q-mt-md"
:visible-columns="visibleColumns"
:no-data-label="t('globals.noResults')"
@row-click="(_, row) => redirectToItemSummary(row.id)"
>
<template #top-row="{ cols }">
<QTr>
<QTd
v-for="(col, index) in cols"
:key="index"
style="max-width: 100px"
>
<component
:is="col.columnFilter.component"
v-if="col.columnFilter"
v-model="col.columnFilter.filterValue"
v-bind="col.columnFilter.attrs"
v-on="col.columnFilter.event(col)"
dense
/>
</QTd>
</QTr>
</template>
<template #body-cell-picture="{ row }">
<QTd>
<QImg
:src="`/api/Images/catalog/50x50/${row.id}/download?access_token=${token}`"
spinner-color="primary"
:ratio="1"
height="50px"
width="50px"
class="image"
/>
</QTd>
</template>
<template #body-cell-id="{ row }">
<QTd @click.stop>
<QBtn flat color="primary">
{{ row.id }}
</QBtn>
<ItemDescriptorProxy :id="row.id" />
</QTd>
</template>
<template #body-cell-userName="{ row }">
<QTd @click.stop>
<QBtn flat color="primary" dense>
{{ row.userName }}
</QBtn>
<WorkerDescriptorProxy :id="row.buyerFk" />
</QTd>
</template>
<template #body-cell-description="{ row }">
<QTd class="col">
<span>{{ row.name }} {{ row.subName }}</span>
<fetched-tags :item="row" :max-length="6" />
</QTd>
</template>
<template #body-cell-isActive="{ row }">
<QTd>
<QCheckbox :model-value="!!row.isActive" disable />
</QTd>
</template>
<template #body-cell-actions="{ row }">
<QTd>
<QIcon
@click.stop="
openConfirmationModal(
t(`All it's properties will be copied`),
t('Do you want to clone this item?'),
() => cloneItem(row.id)
)
"
class="q-ml-sm"
color="primary"
name="vn:clone"
size="sm"
>
<QTooltip>
{{ t('Clone') }}
</QTooltip>
</QIcon>
<QIcon
@click.stop="viewSummary(row.id, ItemSummary)"
class="q-ml-md"
color="primary"
name="preview"
size="sm"
>
<QTooltip class="text-no-wrap">
{{ t('Preview') }}
</QTooltip>
</QIcon>
</QTd>
</template>
</QTable>
</template>
</VnPaginate>
<QPageSticky :offset="[20, 20]">
<QBtn @click="redirectToItemCreate()" color="primary" fab icon="add" />
<QTooltip class="text-no-wrap">
{{ t('New item') }}
</QTooltip>
</QPageSticky>
</QPage>
</template>
<i18n>
es:
New item: Nuevo artículo
All it's properties will be copied: Todas sus propiedades serán copiadas
Do you want to clone this item?: ¿Desea clonar este artículo?
Clone: Clonar
Preview: Vista previa
</i18n>

View File

@ -55,7 +55,7 @@ async function onSubmit() {
if (res.response?.data?.error?.code === 'REQUIRES_2FA') { if (res.response?.data?.error?.code === 'REQUIRES_2FA') {
Notify.create({ Notify.create({
message: t('login.twoFactorRequired'), message: t('login.twoFactorRequired'),
icon: 'phonelink_lock', icon: 'phoneLink_lock',
type: 'warning', type: 'warning',
}); });
params.keepLogin = keepLogin.value; params.keepLogin = keepLogin.value;

View File

@ -57,10 +57,13 @@ onMounted(async () => {
:href="button.url" :href="button.url"
> >
<div class="row items-center no-wrap q-gutter-md"> <div class="row items-center no-wrap q-gutter-md">
<div class="circle q-pa-sm" style="background-color: var(--vn-gray)"> <div
class="circle q-pa-sm"
style="background-color: var(--vn-section-color)"
>
<QImg :src="button.icon" class="q-pa-md" /> <QImg :src="button.icon" class="q-pa-md" />
</div> </div>
<div class="text-h5" style="color: var(--vn-gray)"> <div class="text-h5" style="color: var(--vn-section-color)">
{{ t(button.text) }} {{ t(button.text) }}
</div> </div>
</div> </div>

Some files were not shown because too many files have changed in this diff Show More