forked from verdnatura/salix-front
Merge branch 'test' into hotfix_ItemDiary
This commit is contained in:
commit
bdf4c793dc
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "salix-front",
|
"name": "salix-front",
|
||||||
"version": "24.30.2",
|
"version": "24.32.0",
|
||||||
"description": "Salix frontend",
|
"description": "Salix frontend",
|
||||||
"productName": "Salix",
|
"productName": "Salix",
|
||||||
"author": "Verdnatura",
|
"author": "Verdnatura",
|
||||||
|
|
|
@ -52,7 +52,7 @@ onMounted(async () => {
|
||||||
@on-data-saved="onDataSaved"
|
@on-data-saved="onDataSaved"
|
||||||
>
|
>
|
||||||
<template #form-inputs="{ data, validate }">
|
<template #form-inputs="{ data, validate }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('name')"
|
:label="t('name')"
|
||||||
v-model="data.name"
|
v-model="data.name"
|
||||||
|
@ -67,7 +67,7 @@ onMounted(async () => {
|
||||||
:rules="validate('bankEntity.bic')"
|
:rules="validate('bankEntity.bic')"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('country')"
|
:label="t('country')"
|
||||||
|
|
|
@ -59,7 +59,7 @@ const onDataSaved = async (formData, requestResponse) => {
|
||||||
<QIcon name="warning" class="fill-icon q-mr-sm" size="md" />
|
<QIcon name="warning" class="fill-icon q-mr-sm" size="md" />
|
||||||
{{ t('Invoicing in progress...') }}
|
{{ t('Invoicing in progress...') }}
|
||||||
</span>
|
</span>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Ticket')"
|
:label="t('Ticket')"
|
||||||
:options="ticketsOptions"
|
:options="ticketsOptions"
|
||||||
|
@ -99,7 +99,7 @@ const onDataSaved = async (formData, requestResponse) => {
|
||||||
/>
|
/>
|
||||||
<VnInputDate :label="t('Max date')" v-model="data.maxShipped" />
|
<VnInputDate :label="t('Max date')" v-model="data.maxShipped" />
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Serial')"
|
:label="t('Serial')"
|
||||||
:options="invoiceOutSerialsOptions"
|
:options="invoiceOutSerialsOptions"
|
||||||
|
@ -117,7 +117,7 @@ const onDataSaved = async (formData, requestResponse) => {
|
||||||
v-model="data.taxArea"
|
v-model="data.taxArea"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('Reference')"
|
:label="t('Reference')"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
|
|
|
@ -39,7 +39,7 @@ const onDataSaved = (...args) => {
|
||||||
@on-data-saved="onDataSaved"
|
@on-data-saved="onDataSaved"
|
||||||
>
|
>
|
||||||
<template #form-inputs="{ data, validate }">
|
<template #form-inputs="{ data, validate }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('Name')"
|
:label="t('Name')"
|
||||||
v-model="data.name"
|
v-model="data.name"
|
||||||
|
|
|
@ -42,7 +42,7 @@ const onDataSaved = (dataSaved, requestResponse) => {
|
||||||
@on-data-saved="onDataSaved"
|
@on-data-saved="onDataSaved"
|
||||||
>
|
>
|
||||||
<template #form-inputs="{ data, validate }">
|
<template #form-inputs="{ data, validate }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('Name')"
|
:label="t('Name')"
|
||||||
v-model="data.name"
|
v-model="data.name"
|
||||||
|
|
|
@ -53,7 +53,7 @@ const onDataSaved = (dataSaved) => {
|
||||||
@on-data-saved="onDataSaved($event)"
|
@on-data-saved="onDataSaved($event)"
|
||||||
>
|
>
|
||||||
<template #form-inputs="{ data, validate }">
|
<template #form-inputs="{ data, validate }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('Identifier')"
|
:label="t('Identifier')"
|
||||||
v-model="data.thermographId"
|
v-model="data.thermographId"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { computed, ref, watch } from 'vue';
|
import { computed, ref, watch } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter, onBeforeRouteLeave } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import { useValidator } from 'src/composables/useValidator';
|
import { useValidator } from 'src/composables/useValidator';
|
||||||
|
@ -97,6 +97,19 @@ defineExpose({
|
||||||
vnPaginateRef,
|
vnPaginateRef,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onBeforeRouteLeave((to, from, next) => {
|
||||||
|
if (hasChanges.value)
|
||||||
|
quasar.dialog({
|
||||||
|
component: VnConfirm,
|
||||||
|
componentProps: {
|
||||||
|
title: t('globals.unsavedPopup.title'),
|
||||||
|
message: t('globals.unsavedPopup.subtitle'),
|
||||||
|
promise: () => next(),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
else next();
|
||||||
|
});
|
||||||
|
|
||||||
async function fetch(data) {
|
async function fetch(data) {
|
||||||
resetData(data);
|
resetData(data);
|
||||||
emit('onFetch', data);
|
emit('onFetch', data);
|
||||||
|
|
|
@ -245,14 +245,14 @@ const makeRequest = async () => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<QOptionGroup
|
<QOptionGroup
|
||||||
:options="uploadMethodsOptions"
|
:options="uploadMethodsOptions"
|
||||||
type="radio"
|
type="radio"
|
||||||
v-model="uploadMethodSelected"
|
v-model="uploadMethodSelected"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<QFile
|
<QFile
|
||||||
v-if="uploadMethodSelected === 'computer'"
|
v-if="uploadMethodSelected === 'computer'"
|
||||||
ref="inputFileRef"
|
ref="inputFileRef"
|
||||||
|
@ -287,7 +287,7 @@ const makeRequest = async () => {
|
||||||
placeholder="https://"
|
placeholder="https://"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Orientation')"
|
:label="t('Orientation')"
|
||||||
:options="viewportTypes"
|
:options="viewportTypes"
|
||||||
|
|
|
@ -82,7 +82,7 @@ const closeForm = () => {
|
||||||
<span class="title">{{ t('Edit') }}</span>
|
<span class="title">{{ t('Edit') }}</span>
|
||||||
<span class="countLines">{{ ` ${rows.length} ` }}</span>
|
<span class="countLines">{{ ` ${rows.length} ` }}</span>
|
||||||
<span class="title">{{ t('buy(s)') }}</span>
|
<span class="title">{{ t('buy(s)') }}</span>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Field to edit')"
|
:label="t('Field to edit')"
|
||||||
:options="fieldsOptions"
|
:options="fieldsOptions"
|
||||||
|
|
|
@ -151,7 +151,7 @@ const selectItem = ({ id }) => {
|
||||||
<QIcon name="close" size="sm" />
|
<QIcon name="close" size="sm" />
|
||||||
</span>
|
</span>
|
||||||
<h1 class="title">{{ t('Filter item') }}</h1>
|
<h1 class="title">{{ t('Filter item') }}</h1>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput :label="t('entry.buys.name')" v-model="itemFilterParams.name" />
|
<VnInput :label="t('entry.buys.name')" v-model="itemFilterParams.name" />
|
||||||
<VnInput :label="t('entry.buys.size')" v-model="itemFilterParams.size" />
|
<VnInput :label="t('entry.buys.size')" v-model="itemFilterParams.size" />
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
|
|
@ -144,7 +144,7 @@ const selectTravel = ({ id }) => {
|
||||||
<QIcon name="close" size="sm" />
|
<QIcon name="close" size="sm" />
|
||||||
</span>
|
</span>
|
||||||
<h1 class="title">{{ t('Filter travels') }}</h1>
|
<h1 class="title">{{ t('Filter travels') }}</h1>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('entry.basicData.agency')"
|
:label="t('entry.basicData.agency')"
|
||||||
:options="agenciesOptions"
|
:options="agenciesOptions"
|
||||||
|
|
|
@ -159,8 +159,8 @@ onBeforeRouteLeave((to, from, next) => {
|
||||||
quasar.dialog({
|
quasar.dialog({
|
||||||
component: VnConfirm,
|
component: VnConfirm,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
title: t('Unsaved changes will be lost'),
|
title: t('globals.unsavedPopup.title'),
|
||||||
message: t('Are you sure exit without saving?'),
|
message: t('globals.unsavedPopup.subtitle'),
|
||||||
promise: () => next(),
|
promise: () => next(),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -356,8 +356,3 @@ defineExpose({
|
||||||
padding: 32px;
|
padding: 32px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<i18n>
|
|
||||||
es:
|
|
||||||
Unsaved changes will be lost: Los cambios que no haya guardado se perderán
|
|
||||||
Are you sure exit without saving?: ¿Seguro que quiere salir sin guardar?
|
|
||||||
</i18n>
|
|
||||||
|
|
|
@ -112,6 +112,7 @@ const getCategoryClass = (category, params) => {
|
||||||
|
|
||||||
const getSelectedTagValues = async (tag) => {
|
const getSelectedTagValues = async (tag) => {
|
||||||
try {
|
try {
|
||||||
|
if (!tag?.selectedTag?.id) return;
|
||||||
tag.value = null;
|
tag.value = null;
|
||||||
const filter = {
|
const filter = {
|
||||||
fields: ['value'],
|
fields: ['value'],
|
||||||
|
|
|
@ -49,7 +49,7 @@ const onDataSaved = (data) => {
|
||||||
@on-data-saved="onDataSaved($event)"
|
@on-data-saved="onDataSaved($event)"
|
||||||
>
|
>
|
||||||
<template #form-inputs="{ data }">
|
<template #form-inputs="{ data }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<QInput
|
<QInput
|
||||||
:label="t('Type the visible quantity')"
|
:label="t('Type the visible quantity')"
|
||||||
v-model.number="data.quantity"
|
v-model.number="data.quantity"
|
||||||
|
@ -57,7 +57,7 @@ const onDataSaved = (data) => {
|
||||||
autofocus
|
autofocus
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Warehouse')"
|
:label="t('Warehouse')"
|
||||||
|
|
|
@ -124,7 +124,7 @@ const makeInvoice = async () => {
|
||||||
:default-cancel-button="false"
|
:default-cancel-button="false"
|
||||||
>
|
>
|
||||||
<template #form-inputs>
|
<template #form-inputs>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Client')"
|
:label="t('Client')"
|
||||||
:options="clientsOptions"
|
:options="clientsOptions"
|
||||||
|
@ -160,7 +160,7 @@ const makeInvoice = async () => {
|
||||||
:required="true"
|
:required="true"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Class')"
|
:label="t('Class')"
|
||||||
:options="siiTypeInvoiceOutsOptions"
|
:options="siiTypeInvoiceOutsOptions"
|
||||||
|
@ -191,9 +191,12 @@ const makeInvoice = async () => {
|
||||||
:required="true"
|
:required="true"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div>
|
<div>
|
||||||
<QCheckbox :label="t('Bill destination client')" v-model="checked" />
|
<QCheckbox
|
||||||
|
:label="t('Bill destination client')"
|
||||||
|
v-model="checked"
|
||||||
|
/>
|
||||||
<QIcon name="info" class="cursor-info q-ml-sm" size="sm">
|
<QIcon name="info" class="cursor-info q-ml-sm" size="sm">
|
||||||
<QTooltip>{{ t('transferInvoiceInfo') }}</QTooltip>
|
<QTooltip>{{ t('transferInvoiceInfo') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
|
|
|
@ -35,7 +35,9 @@ function stopEventPropagation(event) {
|
||||||
dense
|
dense
|
||||||
square
|
square
|
||||||
>
|
>
|
||||||
<span v-if="!col.chip.icon">{{ row[col.name] }}</span>
|
<span v-if="!col.chip.icon">
|
||||||
|
{{ col.format ? col.format(row) : row[col.name] }}
|
||||||
|
</span>
|
||||||
<QIcon v-else :name="col.chip.icon" color="primary-light" />
|
<QIcon v-else :name="col.chip.icon" color="primary-light" />
|
||||||
</QChip>
|
</QChip>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -147,7 +147,7 @@ const col = computed(() => {
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
(newColumn.name.startsWith('is') || newColumn.name.startsWith('has')) &&
|
(newColumn.name.startsWith('is') || newColumn.name.startsWith('has')) &&
|
||||||
!newColumn.component
|
newColumn.component == null
|
||||||
)
|
)
|
||||||
newColumn.component = 'checkbox';
|
newColumn.component = 'checkbox';
|
||||||
if ($props.default && !newColumn.component) newColumn.component = $props.default;
|
if ($props.default && !newColumn.component) newColumn.component = $props.default;
|
||||||
|
|
|
@ -75,6 +75,7 @@ const components = {
|
||||||
attrs: {
|
attrs: {
|
||||||
...defaultAttrs,
|
...defaultAttrs,
|
||||||
clearable: true,
|
clearable: true,
|
||||||
|
type: 'number',
|
||||||
},
|
},
|
||||||
forceAttrs,
|
forceAttrs,
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
const model = defineModel({ type: Object, required: true });
|
const model = defineModel({ type: Object });
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
name: {
|
name: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -56,7 +56,7 @@ defineExpose({ orderBy });
|
||||||
<span :title="label">{{ label }}</span>
|
<span :title="label">{{ label }}</span>
|
||||||
<QChip
|
<QChip
|
||||||
v-if="name"
|
v-if="name"
|
||||||
:label="!vertical && model?.index"
|
:label="!vertical ? model?.index : ''"
|
||||||
:icon="
|
:icon="
|
||||||
(model?.index || hover) && !vertical
|
(model?.index || hover) && !vertical
|
||||||
? model?.direction == 'DESC'
|
? model?.direction == 'DESC'
|
||||||
|
|
|
@ -96,9 +96,9 @@ const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
|
|
||||||
const DEFAULT_MODE = 'card';
|
const CARD_MODE = 'card';
|
||||||
const TABLE_MODE = 'table';
|
const TABLE_MODE = 'table';
|
||||||
const mode = ref(DEFAULT_MODE);
|
const mode = ref(CARD_MODE);
|
||||||
const selected = ref([]);
|
const selected = ref([]);
|
||||||
const hasParams = ref(false);
|
const hasParams = ref(false);
|
||||||
const routeQuery = JSON.parse(route?.query[$props.searchUrl] ?? '{}');
|
const routeQuery = JSON.parse(route?.query[$props.searchUrl] ?? '{}');
|
||||||
|
@ -118,7 +118,7 @@ const tableModes = [
|
||||||
{
|
{
|
||||||
icon: 'grid_view',
|
icon: 'grid_view',
|
||||||
title: t('grid view'),
|
title: t('grid view'),
|
||||||
value: DEFAULT_MODE,
|
value: CARD_MODE,
|
||||||
disable: $props.disableOption?.card,
|
disable: $props.disableOption?.card,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -128,7 +128,10 @@ onBeforeMount(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
mode.value = quasar.platform.is.mobile ? DEFAULT_MODE : $props.defaultMode;
|
mode.value =
|
||||||
|
quasar.platform.is.mobile && !$props.disableOption?.card
|
||||||
|
? CARD_MODE
|
||||||
|
: $props.defaultMode;
|
||||||
stateStore.rightDrawer = true;
|
stateStore.rightDrawer = true;
|
||||||
columnsVisibilitySkiped.value = [
|
columnsVisibilitySkiped.value = [
|
||||||
...splittedColumns.value.columns
|
...splittedColumns.value.columns
|
||||||
|
@ -230,6 +233,7 @@ function stopEventPropagation(event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function reload(params) {
|
function reload(params) {
|
||||||
|
selected.value = [];
|
||||||
CrudModelRef.value.reload(params);
|
CrudModelRef.value.reload(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -281,7 +285,9 @@ defineExpose({
|
||||||
<template #body>
|
<template #body>
|
||||||
<div
|
<div
|
||||||
class="row no-wrap flex-center"
|
class="row no-wrap flex-center"
|
||||||
v-for="col of splittedColumns.columns"
|
v-for="col of splittedColumns.columns.filter(
|
||||||
|
(c) => c.columnFilter ?? true
|
||||||
|
)"
|
||||||
:key="col.id"
|
:key="col.id"
|
||||||
>
|
>
|
||||||
<VnTableFilter
|
<VnTableFilter
|
||||||
|
@ -378,7 +384,7 @@ defineExpose({
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #header-cell="{ col }">
|
<template #header-cell="{ col }">
|
||||||
<QTh v-if="col.visible ?? true" auto-width>
|
<QTh v-if="col.visible ?? true">
|
||||||
<div
|
<div
|
||||||
class="column self-start q-ml-xs ellipsis"
|
class="column self-start q-ml-xs ellipsis"
|
||||||
:class="`text-${col?.align ?? 'left'}`"
|
:class="`text-${col?.align ?? 'left'}`"
|
||||||
|
@ -403,6 +409,7 @@ defineExpose({
|
||||||
:data-key="$attrs['data-key']"
|
:data-key="$attrs['data-key']"
|
||||||
v-model="params[columnName(col)]"
|
v-model="params[columnName(col)]"
|
||||||
:search-url="searchUrl"
|
:search-url="searchUrl"
|
||||||
|
class="full-width"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</QTh>
|
</QTh>
|
||||||
|
@ -427,7 +434,7 @@ defineExpose({
|
||||||
<QTd
|
<QTd
|
||||||
auto-width
|
auto-width
|
||||||
class="no-margin q-px-xs"
|
class="no-margin q-px-xs"
|
||||||
:class="[getColAlign(col), col.class, col.columnField?.class]"
|
:class="[getColAlign(col), col.columnClass]"
|
||||||
v-if="col.visible ?? true"
|
v-if="col.visible ?? true"
|
||||||
@click.ctrl="
|
@click.ctrl="
|
||||||
($event) =>
|
($event) =>
|
||||||
|
@ -455,6 +462,7 @@ defineExpose({
|
||||||
>
|
>
|
||||||
<QBtn
|
<QBtn
|
||||||
v-for="(btn, index) of col.actions"
|
v-for="(btn, index) of col.actions"
|
||||||
|
v-show="btn.show ? btn.show(row) : true"
|
||||||
:key="index"
|
:key="index"
|
||||||
:title="btn.title"
|
:title="btn.title"
|
||||||
:icon="btn.icon"
|
:icon="btn.icon"
|
||||||
|
|
|
@ -17,15 +17,17 @@ const $props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let mixed;
|
||||||
const componentArray = computed(() => {
|
const componentArray = computed(() => {
|
||||||
if (typeof $props.prop === 'object') return [$props.prop];
|
if (typeof $props.prop === 'object') return [$props.prop];
|
||||||
return $props.prop;
|
return $props.prop;
|
||||||
});
|
});
|
||||||
|
|
||||||
function mix(toComponent) {
|
function mix(toComponent) {
|
||||||
|
if (mixed) return mixed;
|
||||||
const { component, attrs, event } = toComponent;
|
const { component, attrs, event } = toComponent;
|
||||||
const customComponent = $props.components[component];
|
const customComponent = $props.components[component];
|
||||||
return {
|
mixed = {
|
||||||
component: customComponent?.component ?? component,
|
component: customComponent?.component ?? component,
|
||||||
attrs: {
|
attrs: {
|
||||||
...toValueAttrs(attrs),
|
...toValueAttrs(attrs),
|
||||||
|
@ -35,6 +37,7 @@ function mix(toComponent) {
|
||||||
},
|
},
|
||||||
event: event ?? customComponent?.event,
|
event: event ?? customComponent?.event,
|
||||||
};
|
};
|
||||||
|
return mixed;
|
||||||
}
|
}
|
||||||
|
|
||||||
function toValueAttrs(attrs) {
|
function toValueAttrs(attrs) {
|
||||||
|
|
|
@ -50,7 +50,7 @@ const formattedTime = computed({
|
||||||
}
|
}
|
||||||
if (!props.timeOnly) {
|
if (!props.timeOnly) {
|
||||||
const [hh, mm] = time.split(':');
|
const [hh, mm] = time.split(':');
|
||||||
const date = new Date(model.value ? model.value : null);
|
const date = model.value ?? Date.vnNew();
|
||||||
date.setHours(hh, mm, 0);
|
date.setHours(hh, mm, 0);
|
||||||
time = date?.toISOString();
|
time = date?.toISOString();
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ const formattedTime = computed({
|
||||||
function dateToTime(newDate) {
|
function dateToTime(newDate) {
|
||||||
return date.formatDate(new Date(newDate), dateFormat);
|
return date.formatDate(new Date(newDate), dateFormat);
|
||||||
}
|
}
|
||||||
|
const timeField = ref();
|
||||||
watch(
|
watch(
|
||||||
() => model.value,
|
() => model.value,
|
||||||
(val) => (formattedTime.value = val),
|
(val) => (formattedTime.value = val),
|
||||||
|
|
|
@ -1,8 +1,16 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import LeftMenu from 'components/LeftMenu.vue';
|
import LeftMenu from 'components/LeftMenu.vue';
|
||||||
|
import { onMounted } from 'vue';
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
|
const $props = defineProps({
|
||||||
|
leftDrawer: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
onMounted(() => (stateStore.leftDrawer = $props.leftDrawer));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
|
@ -31,7 +31,7 @@ const $props = defineProps({
|
||||||
},
|
},
|
||||||
url: {
|
url: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: null,
|
||||||
},
|
},
|
||||||
filterOptions: {
|
filterOptions: {
|
||||||
type: [Array],
|
type: [Array],
|
||||||
|
@ -119,7 +119,7 @@ function setOptions(data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function filter(val, options) {
|
function filter(val, options) {
|
||||||
const search = val.toString().toLowerCase();
|
const search = val?.toString()?.toLowerCase();
|
||||||
|
|
||||||
if (!search) return options;
|
if (!search) return options;
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ const $props = defineProps({
|
||||||
find: {
|
find: {
|
||||||
type: [String, Object],
|
type: [String, Object],
|
||||||
default: null,
|
default: null,
|
||||||
|
description: 'search in row to add default options',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const options = ref([]);
|
const options = ref([]);
|
||||||
|
|
|
@ -7,7 +7,7 @@ defineProps({
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div :class="$q.screen.gt.md ? 'q-pb-lg' : 'q-pb-md'">
|
<div :class="$q.screen.gt.md ? 'q-pb-lg' : 'q-pb-md'">
|
||||||
<div class="header-link">
|
<div class="header-link" :style="{ cursor: url ? 'pointer' : 'default' }">
|
||||||
<a :href="url" :class="url ? 'link' : 'color-vn-text'">
|
<a :href="url" :class="url ? 'link' : 'color-vn-text'">
|
||||||
{{ text }}
|
{{ text }}
|
||||||
<QIcon v-if="url" :name="icon" />
|
<QIcon v-if="url" :name="icon" />
|
||||||
|
|
|
@ -120,7 +120,7 @@ const toModule = computed(() =>
|
||||||
:icon="iconModule"
|
:icon="iconModule"
|
||||||
color="white"
|
color="white"
|
||||||
class="link"
|
class="link"
|
||||||
:to="toModule"
|
:to="$attrs['to-module'] ?? toModule"
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('globals.goToModuleIndex') }}
|
{{ t('globals.goToModuleIndex') }}
|
||||||
|
|
|
@ -52,8 +52,8 @@ const containerClasses = computed(() => {
|
||||||
--calendar-border-current: #84d0e2 2px solid;
|
--calendar-border-current: #84d0e2 2px solid;
|
||||||
--calendar-current-color-dark: #84d0e2;
|
--calendar-current-color-dark: #84d0e2;
|
||||||
// Colores de fondo del calendario en dark mode
|
// Colores de fondo del calendario en dark mode
|
||||||
--calendar-outside-background-dark: #222;
|
--calendar-outside-background-dark: var(--vn-section-color);
|
||||||
--calendar-background-dark: #222;
|
--calendar-background-dark: var(--vn-section-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clases para modificar el color de fecha seleccionada en componente QCalendarMonth
|
// Clases para modificar el color de fecha seleccionada en componente QCalendarMonth
|
||||||
|
@ -70,8 +70,27 @@ const containerClasses = computed(() => {
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.q-calendar-month__head--workweek,
|
||||||
|
.q-calendar-month__head--weekday,
|
||||||
|
// .q-calendar-month__workweek.q-past-day,
|
||||||
|
.q-calendar-month__week :nth-child(6),
|
||||||
|
:nth-child(7) {
|
||||||
|
color: var(--vn-label-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.q-calendar-month__head--weekdays > div[aria-label='miércoles'] > span {
|
||||||
|
/* color: transparent; */
|
||||||
|
visibility: hidden;
|
||||||
|
// position: absolute;
|
||||||
|
}
|
||||||
|
.q-calendar-month__head--weekdays > div[aria-label='miércoles'] > span:after {
|
||||||
|
content: 'X';
|
||||||
|
visibility: visible;
|
||||||
|
left: 33%;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
.transparent-background {
|
.transparent-background {
|
||||||
--calendar-background-dark: transparent;
|
// --calendar-background-dark: transparent;
|
||||||
--calendar-background: transparent;
|
--calendar-background: transparent;
|
||||||
--calendar-outside-background-dark: transparent;
|
--calendar-outside-background-dark: transparent;
|
||||||
}
|
}
|
||||||
|
@ -110,11 +129,6 @@ const containerClasses = computed(() => {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.q-calendar-month__week--days > div:nth-child(6),
|
|
||||||
.q-calendar-month__week--days > div:nth-child(7) {
|
|
||||||
// Cambia el color de los días sábado y domingo
|
|
||||||
color: #777777;
|
|
||||||
}
|
|
||||||
|
|
||||||
.q-calendar-month__week--wrapper {
|
.q-calendar-month__week--wrapper {
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
|
@ -124,6 +138,7 @@ const containerClasses = computed(() => {
|
||||||
height: 32px;
|
height: 32px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
color: var(--vn-label-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.q-calendar__button--bordered {
|
.q-calendar__button--bordered {
|
||||||
|
@ -147,7 +162,7 @@ const containerClasses = computed(() => {
|
||||||
.q-calendar-month__head--workweek,
|
.q-calendar-month__head--workweek,
|
||||||
.q-calendar-month__head--weekday.q-calendar__center.q-calendar__ellipsis {
|
.q-calendar-month__head--weekday.q-calendar__center.q-calendar__ellipsis {
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
color: $color-font-secondary;
|
color: var(--vn-label-color);
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
|
@ -110,9 +110,11 @@ async function search(evt) {
|
||||||
|
|
||||||
store.filter.where = {};
|
store.filter.where = {};
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
const filter = { ...userParams.value };
|
const filter = { ...userParams.value, ...$props.modelValue };
|
||||||
store.userParamsChanged = true;
|
store.userParamsChanged = true;
|
||||||
const { params: newParams } = await arrayData.addFilter({ params: userParams.value });
|
const { params: newParams } = await arrayData.addFilter({
|
||||||
|
params: filter,
|
||||||
|
});
|
||||||
userParams.value = newParams;
|
userParams.value = newParams;
|
||||||
|
|
||||||
if (!$props.showAll && !Object.values(filter).length) store.data = [];
|
if (!$props.showAll && !Object.values(filter).length) store.data = [];
|
||||||
|
|
|
@ -1,13 +1,18 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import VnAvatar from 'src/components/ui/VnAvatar.vue';
|
|
||||||
import { toDateHourMin } from 'src/filters';
|
|
||||||
import { ref } from 'vue';
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { onBeforeRouteLeave } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import VnPaginate from './VnPaginate.vue';
|
import { useQuasar } from 'quasar';
|
||||||
import VnUserLink from '../ui/VnUserLink.vue';
|
|
||||||
|
import { toDateHourMin } from 'src/filters';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
|
|
||||||
|
import VnPaginate from 'components/ui/VnPaginate.vue';
|
||||||
|
import VnUserLink from 'components/ui/VnUserLink.vue';
|
||||||
|
import VnConfirm from 'components/ui/VnConfirm.vue';
|
||||||
|
import VnAvatar from 'components/ui/VnAvatar.vue';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
url: { type: String, default: null },
|
url: { type: String, default: null },
|
||||||
filter: { type: Object, default: () => {} },
|
filter: { type: Object, default: () => {} },
|
||||||
|
@ -17,6 +22,7 @@ const $props = defineProps({
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const state = useState();
|
const state = useState();
|
||||||
|
const quasar = useQuasar();
|
||||||
const currentUser = ref(state.getUser());
|
const currentUser = ref(state.getUser());
|
||||||
const newNote = ref('');
|
const newNote = ref('');
|
||||||
const vnPaginateRef = ref();
|
const vnPaginateRef = ref();
|
||||||
|
@ -33,6 +39,19 @@ async function insert() {
|
||||||
await vnPaginateRef.value.fetch();
|
await vnPaginateRef.value.fetch();
|
||||||
newNote.value = '';
|
newNote.value = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onBeforeRouteLeave((to, from, next) => {
|
||||||
|
if (newNote.value)
|
||||||
|
quasar.dialog({
|
||||||
|
component: VnConfirm,
|
||||||
|
componentProps: {
|
||||||
|
title: t('globals.unsavedPopup.title'),
|
||||||
|
message: t('globals.unsavedPopup.subtitle'),
|
||||||
|
promise: () => next(),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
else next();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<QCard class="q-pa-xs q-mb-xl full-width" v-if="$props.addNote">
|
<QCard class="q-pa-xs q-mb-xl full-width" v-if="$props.addNote">
|
||||||
|
|
|
@ -115,8 +115,8 @@ watch(
|
||||||
);
|
);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.url,
|
() => [props.url, props.filter],
|
||||||
(url) => fetch({ url })
|
([url, filter]) => fetch({ url, filter })
|
||||||
);
|
);
|
||||||
|
|
||||||
const addFilter = async (filter, params) => {
|
const addFilter = async (filter, params) => {
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
|
<script setup>
|
||||||
|
defineProps({ wrap: { type: Boolean, default: false } });
|
||||||
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="vn-row q-gutter-md q-mb-md">
|
<div class="vn-row q-gutter-md q-mb-md" :class="{ wrap }">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -153,6 +153,12 @@ select:-webkit-autofill {
|
||||||
background-color: var(--vn-section-color);
|
background-color: var(--vn-section-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.q-table td[shrink] {
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
max-width: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
.tr-header {
|
.tr-header {
|
||||||
color: var(--vn-label-color);
|
color: var(--vn-label-color);
|
||||||
}
|
}
|
||||||
|
@ -188,13 +194,6 @@ select:-webkit-autofill {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.q-card,
|
|
||||||
.q-table,
|
|
||||||
.q-table__bottom,
|
|
||||||
.q-drawer {
|
|
||||||
background-color: var(--vn-section-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type='number'] {
|
input[type='number'] {
|
||||||
-moz-appearance: textfield;
|
-moz-appearance: textfield;
|
||||||
}
|
}
|
||||||
|
@ -235,13 +234,7 @@ input::-webkit-inner-spin-button {
|
||||||
}
|
}
|
||||||
|
|
||||||
.q-table {
|
.q-table {
|
||||||
thead,
|
th,
|
||||||
tbody {
|
|
||||||
th {
|
|
||||||
.q-select {
|
|
||||||
max-width: 120px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
td {
|
td {
|
||||||
padding: 1px 10px 1px 10px;
|
padding: 1px 10px 1px 10px;
|
||||||
max-width: 100px;
|
max-width: 100px;
|
||||||
|
@ -254,8 +247,20 @@ input::-webkit-inner-spin-button {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
tr {
|
||||||
|
th {
|
||||||
|
font-size: 11pt;
|
||||||
|
}
|
||||||
|
td {
|
||||||
|
font-size: 11pt;
|
||||||
|
border-top: 1px solid var(--vn-page-color);
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.shrink {
|
||||||
|
max-width: 75px;
|
||||||
|
}
|
||||||
.expand {
|
.expand {
|
||||||
max-width: 400px;
|
max-width: 400px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -254,6 +254,9 @@ globals:
|
||||||
comment: Comment
|
comment: Comment
|
||||||
observations: Observations
|
observations: Observations
|
||||||
goToModuleIndex: Go to module index
|
goToModuleIndex: Go to module index
|
||||||
|
unsavedPopup:
|
||||||
|
title: Unsaved changes will be lost
|
||||||
|
subtitle: Are you sure exit without saving?
|
||||||
errors:
|
errors:
|
||||||
statusUnauthorized: Access denied
|
statusUnauthorized: Access denied
|
||||||
statusInternalServerError: An internal server error has ocurred
|
statusInternalServerError: An internal server error has ocurred
|
||||||
|
@ -386,8 +389,8 @@ customer:
|
||||||
extendedList:
|
extendedList:
|
||||||
tableVisibleColumns:
|
tableVisibleColumns:
|
||||||
id: Identifier
|
id: Identifier
|
||||||
name: Comercial name
|
name: Name
|
||||||
socialName: Business name
|
socialName: Social name
|
||||||
fi: Tax number
|
fi: Tax number
|
||||||
salesPersonFk: Salesperson
|
salesPersonFk: Salesperson
|
||||||
credit: Credit
|
credit: Credit
|
||||||
|
@ -997,18 +1000,6 @@ route:
|
||||||
shipped: Preparation date
|
shipped: Preparation date
|
||||||
viewCmr: View CMR
|
viewCmr: View CMR
|
||||||
downloadCmrs: Download CMRs
|
downloadCmrs: Download CMRs
|
||||||
columnLabels:
|
|
||||||
Id: Id
|
|
||||||
vehicle: Vehicle
|
|
||||||
description: Description
|
|
||||||
isServed: Served
|
|
||||||
worker: Worker
|
|
||||||
date: Date
|
|
||||||
started: Started
|
|
||||||
actions: Actions
|
|
||||||
agency: Agency
|
|
||||||
volume: Volume
|
|
||||||
finished: Finished
|
|
||||||
supplier:
|
supplier:
|
||||||
list:
|
list:
|
||||||
payMethod: Pay method
|
payMethod: Pay method
|
||||||
|
|
|
@ -256,6 +256,9 @@ globals:
|
||||||
comment: Comentario
|
comment: Comentario
|
||||||
observations: Observaciones
|
observations: Observaciones
|
||||||
goToModuleIndex: Ir al índice del módulo
|
goToModuleIndex: Ir al índice del módulo
|
||||||
|
unsavedPopup:
|
||||||
|
title: Los cambios que no haya guardado se perderán
|
||||||
|
subtitle: ¿Seguro que quiere salir sin guardar?
|
||||||
errors:
|
errors:
|
||||||
statusUnauthorized: Acceso denegado
|
statusUnauthorized: Acceso denegado
|
||||||
statusInternalServerError: Ha ocurrido un error interno del servidor
|
statusInternalServerError: Ha ocurrido un error interno del servidor
|
||||||
|
@ -385,7 +388,7 @@ customer:
|
||||||
extendedList:
|
extendedList:
|
||||||
tableVisibleColumns:
|
tableVisibleColumns:
|
||||||
id: Identificador
|
id: Identificador
|
||||||
name: Nombre Comercial
|
name: Nombre
|
||||||
socialName: Razón social
|
socialName: Razón social
|
||||||
fi: NIF / CIF
|
fi: NIF / CIF
|
||||||
salesPersonFk: Comercial
|
salesPersonFk: Comercial
|
||||||
|
@ -978,18 +981,6 @@ route:
|
||||||
shipped: Fecha preparación
|
shipped: Fecha preparación
|
||||||
viewCmr: Ver CMR
|
viewCmr: Ver CMR
|
||||||
downloadCmrs: Descargar CMRs
|
downloadCmrs: Descargar CMRs
|
||||||
columnLabels:
|
|
||||||
Id: Id
|
|
||||||
vehicle: Vehículo
|
|
||||||
description: Descripción
|
|
||||||
isServed: Servida
|
|
||||||
worker: Trabajador
|
|
||||||
date: Fecha
|
|
||||||
started: Iniciada
|
|
||||||
actions: Acciones
|
|
||||||
agency: Agencia
|
|
||||||
volume: Volumen
|
|
||||||
finished: Finalizada
|
|
||||||
supplier:
|
supplier:
|
||||||
list:
|
list:
|
||||||
payMethod: Método de pago
|
payMethod: Método de pago
|
||||||
|
|
|
@ -34,12 +34,12 @@ const onDataSaved = ({ id }) => {
|
||||||
@on-data-saved="onDataSaved"
|
@on-data-saved="onDataSaved"
|
||||||
>
|
>
|
||||||
<template #form-inputs="{ data }">
|
<template #form-inputs="{ data }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnInput v-model="data.alias" :label="t('mailAlias.name')" />
|
<VnInput v-model="data.alias" :label="t('mailAlias.name')" />
|
||||||
</div>
|
</div>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="data.description"
|
v-model="data.description"
|
||||||
|
|
|
@ -33,7 +33,7 @@ const aliasOptions = ref([]);
|
||||||
@on-submit="emit('onSubmitCreateAlias', aliasFormData)"
|
@on-submit="emit('onSubmitCreateAlias', aliasFormData)"
|
||||||
>
|
>
|
||||||
<template #form-inputs>
|
<template #form-inputs>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('account.card.alias')"
|
:label="t('account.card.alias')"
|
||||||
|
|
|
@ -10,12 +10,12 @@ const { t } = useI18n();
|
||||||
<template>
|
<template>
|
||||||
<FormModel :url="`VnRoles/${route.params.id}`" model="VnRole" auto-load>
|
<FormModel :url="`VnRoles/${route.params.id}`" model="VnRole" auto-load>
|
||||||
<template #form="{ data }">
|
<template #form="{ data }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnInput v-model="data.name" :label="t('role.card.name')" />
|
<VnInput v-model="data.name" :label="t('role.card.name')" />
|
||||||
</div>
|
</div>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="data.description"
|
v-model="data.description"
|
||||||
|
@ -23,7 +23,7 @@ const { t } = useI18n();
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<QCheckbox :label="t('mailAlias.isPublic')" v-model="data.isPublic" />
|
<QCheckbox :label="t('mailAlias.isPublic')" v-model="data.isPublic" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -21,12 +21,12 @@ const { t } = useI18n();
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<template #form-inputs="{ data }">
|
<template #form-inputs="{ data }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnInput v-model="data.name" :label="t('role.card.name')" />
|
<VnInput v-model="data.name" :label="t('role.card.name')" />
|
||||||
</div>
|
</div>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="data.description"
|
v-model="data.description"
|
||||||
|
|
|
@ -33,7 +33,7 @@ const rolesOptions = ref([]);
|
||||||
@on-submit="emit('onSubmitCreateSubrole', subRoleFormData)"
|
@on-submit="emit('onSubmitCreateSubrole', subRoleFormData)"
|
||||||
>
|
>
|
||||||
<template #form-inputs>
|
<template #form-inputs>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('account.card.role')"
|
:label="t('account.card.role')"
|
||||||
|
|
|
@ -31,7 +31,7 @@ const destinationTypes = ref([]);
|
||||||
const totalClaimed = ref(null);
|
const totalClaimed = ref(null);
|
||||||
const DEFAULT_MAX_RESPONSABILITY = 5;
|
const DEFAULT_MAX_RESPONSABILITY = 5;
|
||||||
const DEFAULT_MIN_RESPONSABILITY = 1;
|
const DEFAULT_MIN_RESPONSABILITY = 1;
|
||||||
const arrayData = useArrayData('claimData');
|
const arrayData = useArrayData('Claim');
|
||||||
const marker_labels = [
|
const marker_labels = [
|
||||||
{ value: DEFAULT_MIN_RESPONSABILITY, label: t('claim.company') },
|
{ value: DEFAULT_MIN_RESPONSABILITY, label: t('claim.company') },
|
||||||
{ value: DEFAULT_MAX_RESPONSABILITY, label: t('claim.person') },
|
{ value: DEFAULT_MAX_RESPONSABILITY, label: t('claim.person') },
|
||||||
|
|
|
@ -74,7 +74,7 @@ const statesFilter = {
|
||||||
:reload="true"
|
:reload="true"
|
||||||
>
|
>
|
||||||
<template #form="{ data, validate, filter }">
|
<template #form="{ data, validate, filter }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="data.client.name"
|
v-model="data.client.name"
|
||||||
:label="t('claim.customer')"
|
:label="t('claim.customer')"
|
||||||
|
@ -82,7 +82,7 @@ const statesFilter = {
|
||||||
/>
|
/>
|
||||||
<VnInputDate v-model="data.created" :label="t('claim.created')" />
|
<VnInputDate v-model="data.created" :label="t('claim.created')" />
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('claim.assignedTo')"
|
:label="t('claim.assignedTo')"
|
||||||
v-model="data.workerFk"
|
v-model="data.workerFk"
|
||||||
|
@ -120,7 +120,7 @@ const statesFilter = {
|
||||||
>
|
>
|
||||||
</QSelect>
|
</QSelect>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<QInput
|
<QInput
|
||||||
v-model.number="data.packages"
|
v-model.number="data.packages"
|
||||||
:label="t('globals.packages')"
|
:label="t('globals.packages')"
|
||||||
|
|
|
@ -14,7 +14,8 @@ const $props = defineProps({
|
||||||
});
|
});
|
||||||
const claimId = computed(() => $props.id || route.params.id);
|
const claimId = computed(() => $props.id || route.params.id);
|
||||||
|
|
||||||
const claimFilter = {
|
const claimFilter = computed(() => {
|
||||||
|
return {
|
||||||
where: { claimFk: claimId.value },
|
where: { claimFk: claimId.value },
|
||||||
fields: ['id', 'created', 'workerFk', 'text'],
|
fields: ['id', 'created', 'workerFk', 'text'],
|
||||||
include: {
|
include: {
|
||||||
|
@ -30,6 +31,7 @@ const claimFilter = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
});
|
||||||
|
|
||||||
const body = {
|
const body = {
|
||||||
claimFk: claimId.value,
|
claimFk: claimId.value,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed, watch } from 'vue';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
@ -22,10 +22,8 @@ const claimDms = ref([
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const client = ref({});
|
const client = ref({});
|
||||||
|
|
||||||
const inputFile = ref();
|
const inputFile = ref();
|
||||||
const files = ref({});
|
const files = ref({});
|
||||||
|
|
||||||
const spinnerRef = ref();
|
const spinnerRef = ref();
|
||||||
const claimDmsRef = ref();
|
const claimDmsRef = ref();
|
||||||
const dmsType = ref({});
|
const dmsType = ref({});
|
||||||
|
@ -58,6 +56,14 @@ const claimDmsFilter = ref({
|
||||||
const multimediaDialog = ref();
|
const multimediaDialog = ref();
|
||||||
const multimediaSlide = ref();
|
const multimediaSlide = ref();
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => router.currentRoute.value.params.id,
|
||||||
|
() => {
|
||||||
|
claimDmsFilter.value.where.id = router.currentRoute.value.params.id;
|
||||||
|
claimDmsRef.value.fetch();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
function openDialog(dmsId) {
|
function openDialog(dmsId) {
|
||||||
multimediaSlide.value = dmsId;
|
multimediaSlide.value = dmsId;
|
||||||
multimediaDialog.value = true;
|
multimediaDialog.value = true;
|
||||||
|
|
|
@ -279,7 +279,7 @@ async function changeState(value) {
|
||||||
<ClaimNotes
|
<ClaimNotes
|
||||||
:id="entityId"
|
:id="entityId"
|
||||||
:add-note="false"
|
:add-note="false"
|
||||||
class="max-container-height"
|
style="max-height: 300px"
|
||||||
order="created ASC"
|
order="created ASC"
|
||||||
/>
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
|
@ -330,7 +330,7 @@ async function changeState(value) {
|
||||||
<QTable
|
<QTable
|
||||||
:columns="detailsColumns"
|
:columns="detailsColumns"
|
||||||
:rows="salesClaimed"
|
:rows="salesClaimed"
|
||||||
flat
|
separator="horizontal"
|
||||||
dense
|
dense
|
||||||
:rows-per-page-options="[0]"
|
:rows-per-page-options="[0]"
|
||||||
hide-bottom
|
hide-bottom
|
||||||
|
@ -344,7 +344,7 @@ async function changeState(value) {
|
||||||
</template>
|
</template>
|
||||||
<template #body="props">
|
<template #body="props">
|
||||||
<QTr :props="props">
|
<QTr :props="props">
|
||||||
<QTh v-for="col in props.cols" :key="col.name" :props="props">
|
<QTd v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
<span v-if="col.name != 'description'">{{
|
<span v-if="col.name != 'description'">{{
|
||||||
t(col.value)
|
t(col.value)
|
||||||
}}</span>
|
}}</span>
|
||||||
|
@ -359,7 +359,7 @@ async function changeState(value) {
|
||||||
:id="props.row.sale.itemFk"
|
:id="props.row.sale.itemFk"
|
||||||
:sale-fk="props.row.saleFk"
|
:sale-fk="props.row.saleFk"
|
||||||
></ItemDescriptorProxy>
|
></ItemDescriptorProxy>
|
||||||
</QTh>
|
</QTd>
|
||||||
</QTr>
|
</QTr>
|
||||||
</template>
|
</template>
|
||||||
</QTable>
|
</QTable>
|
||||||
|
@ -384,7 +384,7 @@ async function changeState(value) {
|
||||||
<template #body-cell-worker="props">
|
<template #body-cell-worker="props">
|
||||||
<QTd :props="props" class="link">
|
<QTd :props="props" class="link">
|
||||||
{{ props.value }}
|
{{ props.value }}
|
||||||
<WorkerDescriptorProxy :id="props.row.worker.id" />
|
<WorkerDescriptorProxy :id="props.row.worker?.id" />
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
</QTable>
|
</QTable>
|
||||||
|
|
|
@ -100,6 +100,7 @@ defineExpose({ states });
|
||||||
url="Items/withName"
|
url="Items/withName"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
|
:use-like="false"
|
||||||
sort-by="id DESC"
|
sort-by="id DESC"
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
|
|
@ -44,7 +44,7 @@ const columns = computed(() => [
|
||||||
fields: ['id', 'name'],
|
fields: ['id', 'name'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
class: 'expand',
|
columnClass: 'expand',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -125,7 +125,7 @@ const STATE_COLOR = {
|
||||||
<VnTable
|
<VnTable
|
||||||
data-key="ClaimList"
|
data-key="ClaimList"
|
||||||
url="Claims/filter"
|
url="Claims/filter"
|
||||||
:order="['priority ASC', 'created DESC']"
|
:order="['priority ASC', 'created ASC']"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
redirect="claim"
|
redirect="claim"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
<script setup>
|
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
|
||||||
import LeftMenu from 'components/LeftMenu.vue';
|
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<QDrawer v-model="stateStore.leftDrawer" show-if-above :width="256">
|
|
||||||
<QScrollArea class="fit text-grey-8">
|
|
||||||
<LeftMenu />
|
|
||||||
</QScrollArea>
|
|
||||||
</QDrawer>
|
|
||||||
<QPageContainer>
|
|
||||||
<RouterView></RouterView>
|
|
||||||
</QPageContainer>
|
|
||||||
</template>
|
|
|
@ -67,7 +67,7 @@ const filterOptions = {
|
||||||
|
|
||||||
<FormModel :url="`Clients/${route.params.id}`" auto-load model="customer">
|
<FormModel :url="`Clients/${route.params.id}`" auto-load model="customer">
|
||||||
<template #form="{ data, validate, filter }">
|
<template #form="{ data, validate, filter }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('globals.name')"
|
:label="t('globals.name')"
|
||||||
:rules="validate('client.socialName')"
|
:rules="validate('client.socialName')"
|
||||||
|
@ -88,7 +88,7 @@ const filterOptions = {
|
||||||
v-model="data.businessTypeFk"
|
v-model="data.businessTypeFk"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('customer.basicData.contact')"
|
:label="t('customer.basicData.contact')"
|
||||||
:rules="validate('client.contact')"
|
:rules="validate('client.contact')"
|
||||||
|
@ -111,7 +111,7 @@ const filterOptions = {
|
||||||
</template>
|
</template>
|
||||||
</VnInput>
|
</VnInput>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('customer.basicData.phone')"
|
:label="t('customer.basicData.phone')"
|
||||||
:rules="validate('client.phone')"
|
:rules="validate('client.phone')"
|
||||||
|
@ -125,7 +125,7 @@ const filterOptions = {
|
||||||
v-model="data.mobile"
|
v-model="data.mobile"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<QSelect
|
<QSelect
|
||||||
:input-debounce="0"
|
:input-debounce="0"
|
||||||
:label="t('customer.basicData.salesPerson')"
|
:label="t('customer.basicData.salesPerson')"
|
||||||
|
@ -162,7 +162,7 @@ const filterOptions = {
|
||||||
:input-debounce="0"
|
:input-debounce="0"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<QSelect
|
<QSelect
|
||||||
:input-debounce="0"
|
:input-debounce="0"
|
||||||
:label="t('customer.basicData.previousClient')"
|
:label="t('customer.basicData.previousClient')"
|
||||||
|
|
|
@ -47,7 +47,7 @@ const getBankEntities = (data, formData) => {
|
||||||
model="customer"
|
model="customer"
|
||||||
>
|
>
|
||||||
<template #form="{ data, validate }">
|
<template #form="{ data, validate }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Billing data')"
|
:label="t('Billing data')"
|
||||||
:options="payMethods"
|
:options="payMethods"
|
||||||
|
@ -59,7 +59,7 @@ const getBankEntities = (data, formData) => {
|
||||||
<VnInput :label="t('Due day')" clearable v-model="data.dueDay" />
|
<VnInput :label="t('Due day')" clearable v-model="data.dueDay" />
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput :label="t('IBAN')" clearable v-model="data.iban">
|
<VnInput :label="t('IBAN')" clearable v-model="data.iban">
|
||||||
<template #append>
|
<template #append>
|
||||||
<QIcon name="info" class="cursor-info">
|
<QIcon name="info" class="cursor-info">
|
||||||
|
@ -94,7 +94,7 @@ const getBankEntities = (data, formData) => {
|
||||||
</VnSelectDialog>
|
</VnSelectDialog>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<QCheckbox :label="t('Received LCR')" v-model="data.hasLcr" />
|
<QCheckbox :label="t('Received LCR')" v-model="data.hasLcr" />
|
||||||
<QCheckbox :label="t('VNL core received')" v-model="data.hasCoreVnl" />
|
<QCheckbox :label="t('VNL core received')" v-model="data.hasCoreVnl" />
|
||||||
<QCheckbox :label="t('VNL B2B received')" v-model="data.hasSepaVnl" />
|
<QCheckbox :label="t('VNL B2B received')" v-model="data.hasSepaVnl" />
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import CustomerConsumptionFilter from './CustomerConsumptionFilter.vue';
|
||||||
|
import { useStateStore } from 'src/stores/useStateStore';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<h5 class="flex justify-center color-vn-label">
|
<Teleport to="#right-panel" v-if="useStateStore().isHeaderMounted()">
|
||||||
{{ t('Enter a new search') }}
|
<CustomerConsumptionFilter data-key="CustomerConsumption" />
|
||||||
</h5>
|
</Teleport>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
|
|
|
@ -0,0 +1,91 @@
|
||||||
|
<script setup>
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
import { QItem } from 'quasar';
|
||||||
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import { QItemSection } from 'quasar';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
defineProps({ dataKey: { type: String, required: true } });
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<VnFilterPanel :data-key="dataKey" :search-button="true">
|
||||||
|
<template #tags="{ tag, formatFn }">
|
||||||
|
<div class="q-gutter-x-xs">
|
||||||
|
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
||||||
|
<span>{{ formatFn(tag.value) }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #body="{ params }">
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnInput
|
||||||
|
:label="t('params.item')"
|
||||||
|
v-model="params.itemId"
|
||||||
|
is-outlined
|
||||||
|
lazy-rules
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelect
|
||||||
|
v-model="params.buyerId"
|
||||||
|
url="TicketRequests/getItemTypeWorker"
|
||||||
|
:label="t('params.buyer')"
|
||||||
|
option-value="id"
|
||||||
|
option-label="nickname"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<!--It's required to include the relation category !! There's 413 records in production-->
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelect
|
||||||
|
v-model="params.typeId"
|
||||||
|
url="ItemTypes"
|
||||||
|
:label="t('params.type')"
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
>
|
||||||
|
</VnSelect>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelect
|
||||||
|
url="ItemCategories"
|
||||||
|
:label="t('params.category')"
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
v-model="params.categoryId"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnFilterPanel>
|
||||||
|
</template>
|
||||||
|
<i18n>
|
||||||
|
en:
|
||||||
|
params:
|
||||||
|
item: Item id
|
||||||
|
buyer: Buyer
|
||||||
|
type: Type
|
||||||
|
category: Category
|
||||||
|
es:
|
||||||
|
params:
|
||||||
|
item: Id artículo
|
||||||
|
buyer: Comprador
|
||||||
|
type: Tipo
|
||||||
|
category: Categoría
|
||||||
|
</i18n>
|
|
@ -88,7 +88,7 @@ watch(
|
||||||
:url-create="`Clients/${route.params.id}/setRating`"
|
:url-create="`Clients/${route.params.id}/setRating`"
|
||||||
>
|
>
|
||||||
<template #form="{ data }">
|
<template #form="{ data }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('Rating')"
|
:label="t('Rating')"
|
||||||
|
|
|
@ -1,20 +1,14 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
import { QBtn } from 'quasar';
|
import { QBtn } from 'quasar';
|
||||||
|
|
||||||
import { toCurrency, toDateHourMin } from 'src/filters';
|
import { toCurrency, toDateHourMin } from 'src/filters';
|
||||||
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import FetchData from 'components/FetchData.vue';
|
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
||||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
const rows = ref([]);
|
|
||||||
|
|
||||||
const filter = {
|
const filter = {
|
||||||
include: [
|
include: [
|
||||||
|
@ -26,113 +20,63 @@ const filter = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
where: { clientFk: route.params.id },
|
where: { clientFk: +route.params.id },
|
||||||
order: ['created DESC'],
|
order: ['created DESC'],
|
||||||
limit: 20,
|
limit: 20,
|
||||||
};
|
};
|
||||||
|
|
||||||
const tableColumnComponents = {
|
|
||||||
created: {
|
|
||||||
component: 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
employee: {
|
|
||||||
component: QBtn,
|
|
||||||
props: () => ({ flat: true, color: 'blue', noCaps: true }),
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
amount: {
|
|
||||||
component: 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: 'created',
|
|
||||||
label: t('Since'),
|
|
||||||
name: 'created',
|
name: 'created',
|
||||||
format: (value) => toDateHourMin(value),
|
label: t('Since'),
|
||||||
|
format: ({ created }) => toDateHourMin(created),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: (value) => value.worker.user.name,
|
|
||||||
label: t('Employee'),
|
label: t('Employee'),
|
||||||
name: 'employee',
|
name: 'employee',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: 'amount',
|
|
||||||
label: t('Credit'),
|
label: t('Credit'),
|
||||||
name: 'amount',
|
name: 'amount',
|
||||||
format: (value) => toCurrency(value),
|
format: ({ amount }) => toCurrency(amount),
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const toCustomerCreditCreate = () => {
|
|
||||||
router.push({ name: 'CustomerCreditCreate' });
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<!-- Column titles are missing -->
|
||||||
:filter="filter"
|
<VnTable
|
||||||
@on-fetch="(data) => (rows = data)"
|
ref="tableRef"
|
||||||
auto-load
|
data-key="ClientCredit"
|
||||||
url="ClientCredits"
|
url="ClientCredits"
|
||||||
/>
|
:filter="filter"
|
||||||
|
|
||||||
<div class="full-width flex justify-center">
|
|
||||||
<QCard class="card-width q-pa-lg">
|
|
||||||
<QTable
|
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:pagination="{ rowsPerPage: 12 }"
|
default-mode="table"
|
||||||
:rows="rows"
|
auto-load
|
||||||
class="full-width q-mt-md"
|
:right-search="false"
|
||||||
row-key="id"
|
:is-editable="false"
|
||||||
v-if="rows?.length"
|
:use-model="true"
|
||||||
|
:column-search="false"
|
||||||
|
:disable-option="{ card: true }"
|
||||||
>
|
>
|
||||||
<template #body-cell="props">
|
<template #column-employee="{ row }">
|
||||||
<QTd :props="props">
|
<VnUserLink :name="row?.worker?.user?.name" :worker-id="row.worker?.id" />
|
||||||
<QTr :props="props" class="cursor-pointer">
|
|
||||||
<component
|
|
||||||
:is="tableColumnComponents[props.col.name].component"
|
|
||||||
@click="
|
|
||||||
tableColumnComponents[props.col.name].event(props)
|
|
||||||
"
|
|
||||||
class="rounded-borders q-pa-sm"
|
|
||||||
v-bind="
|
|
||||||
tableColumnComponents[props.col.name].props(props)
|
|
||||||
"
|
|
||||||
>
|
|
||||||
{{ props.value }}
|
|
||||||
<WorkerDescriptorProxy
|
|
||||||
:id="props.row.workerFk"
|
|
||||||
v-if="props.col.name === 'employee'"
|
|
||||||
/>
|
|
||||||
</component>
|
|
||||||
</QTr>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
</QTable>
|
</VnTable>
|
||||||
|
|
||||||
<h5 class="flex justify-center color-vn-label" v-else>
|
|
||||||
{{ t('globals.noResults') }}
|
|
||||||
</h5>
|
|
||||||
</QCard>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<QPageSticky :offset="[18, 18]">
|
<QPageSticky :offset="[18, 18]">
|
||||||
<QBtn @click.stop="toCustomerCreditCreate()" color="primary" fab icon="add" />
|
<QBtn
|
||||||
|
@click.stop="$router.push({ name: 'CustomerCreditCreate' })"
|
||||||
|
color="primary"
|
||||||
|
fab
|
||||||
|
icon="add"
|
||||||
|
/>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('New credit') }}
|
{{ t('New credit') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QPageSticky>
|
</QPageSticky>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
Since: Desde
|
Since: Desde
|
||||||
|
|
|
@ -39,7 +39,7 @@ function handleLocation(data, location) {
|
||||||
model="customer"
|
model="customer"
|
||||||
>
|
>
|
||||||
<template #form="{ data, validate }">
|
<template #form="{ data, validate }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('Social name')"
|
:label="t('Social name')"
|
||||||
:required="true"
|
:required="true"
|
||||||
|
@ -56,11 +56,11 @@ function handleLocation(data, location) {
|
||||||
<VnInput :label="t('Tax number')" clearable v-model="data.fi" />
|
<VnInput :label="t('Tax number')" clearable v-model="data.fi" />
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput :label="t('Street')" clearable v-model="data.street" />
|
<VnInput :label="t('Street')" clearable v-model="data.street" />
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Sage tax type')"
|
:label="t('Sage tax type')"
|
||||||
:options="typesTaxes"
|
:options="typesTaxes"
|
||||||
|
@ -90,7 +90,7 @@ function handleLocation(data, location) {
|
||||||
</VnSelect>
|
</VnSelect>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnLocation
|
<VnLocation
|
||||||
:rules="validate('Worker.postcode')"
|
:rules="validate('Worker.postcode')"
|
||||||
:roles-allowed-to-create="['deliveryAssistant']"
|
:roles-allowed-to-create="['deliveryAssistant']"
|
||||||
|
|
|
@ -9,7 +9,7 @@ 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 CustomerSummaryTable from 'src/pages/Customer/components/CustomerSummaryTable.vue';
|
import CustomerSummaryTable from 'src/pages/Customer/components/CustomerSummaryTable.vue';
|
||||||
import VnTitle from 'src/components/common/VnTitle.vue';
|
import VnTitle from 'src/components/common/VnTitle.vue';
|
||||||
|
import VnRow from 'src/components/ui/VnRow.vue';
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
@ -131,41 +131,33 @@ const creditWarning = computed(() => {
|
||||||
:url="`#/customer/${entityId}/fiscal-data`"
|
:url="`#/customer/${entityId}/fiscal-data`"
|
||||||
:text="t('customer.summary.fiscalData')"
|
:text="t('customer.summary.fiscalData')"
|
||||||
/>
|
/>
|
||||||
<QCheckbox
|
<VnRow>
|
||||||
|
<VnLv
|
||||||
:label="t('customer.summary.isEqualizated')"
|
:label="t('customer.summary.isEqualizated')"
|
||||||
v-model="entity.isEqualizated"
|
:value="entity.isEqualizated"
|
||||||
:disable="true"
|
|
||||||
/>
|
/>
|
||||||
<QCheckbox
|
<VnLv
|
||||||
:label="t('customer.summary.isActive')"
|
:label="t('customer.summary.isActive')"
|
||||||
v-model="entity.isActive"
|
:value="entity.isActive"
|
||||||
:disable="true"
|
|
||||||
/>
|
/>
|
||||||
<QCheckbox
|
</VnRow>
|
||||||
:label="t('customer.summary.invoiceByAddress')"
|
<VnRow>
|
||||||
v-model="entity.hasToInvoiceByAddress"
|
<VnLv
|
||||||
:disable="true"
|
|
||||||
/>
|
|
||||||
<QCheckbox
|
|
||||||
:label="t('customer.summary.verifiedData')"
|
:label="t('customer.summary.verifiedData')"
|
||||||
v-model="entity.isTaxDataChecked"
|
:value="entity.isTaxDataChecked"
|
||||||
:disable="true"
|
|
||||||
/>
|
/>
|
||||||
<QCheckbox
|
<VnLv
|
||||||
:label="t('customer.summary.hasToInvoice')"
|
:label="t('customer.summary.hasToInvoice')"
|
||||||
v-model="entity.hasToInvoice"
|
:value="entity.hasToInvoice"
|
||||||
:disable="true"
|
|
||||||
/>
|
/>
|
||||||
<QCheckbox
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnLv
|
||||||
:label="t('customer.summary.notifyByEmail')"
|
:label="t('customer.summary.notifyByEmail')"
|
||||||
v-model="entity.isToBeMailed"
|
:value="entity.isToBeMailed"
|
||||||
:disable="true"
|
|
||||||
/>
|
|
||||||
<QCheckbox
|
|
||||||
:label="t('customer.summary.vies')"
|
|
||||||
v-model="entity.isVies"
|
|
||||||
:disable="true"
|
|
||||||
/>
|
/>
|
||||||
|
<VnLv :label="t('customer.summary.vies')" :value="entity.isVies" />
|
||||||
|
</VnRow>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<VnTitle
|
<VnTitle
|
||||||
|
@ -178,23 +170,18 @@ const creditWarning = computed(() => {
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('customer.summary.bankAccount')" :value="entity.iban" />
|
<VnLv :label="t('customer.summary.bankAccount')" :value="entity.iban" />
|
||||||
<VnLv :label="t('customer.summary.dueDay')" :value="entity.dueDay" />
|
<VnLv :label="t('customer.summary.dueDay')" :value="entity.dueDay" />
|
||||||
<QCheckbox
|
<VnRow class="q-mt-sm" wrap>
|
||||||
style="padding: 0"
|
<VnLv :label="t('customer.summary.hasLcr')" :value="entity.hasLcr" />
|
||||||
:label="t('customer.summary.hasLcr')"
|
<VnLv
|
||||||
v-model="entity.hasLcr"
|
|
||||||
:disable="true"
|
|
||||||
/>
|
|
||||||
<QCheckbox
|
|
||||||
:label="t('customer.summary.hasCoreVnl')"
|
:label="t('customer.summary.hasCoreVnl')"
|
||||||
v-model="entity.hasCoreVnl"
|
:value="entity.hasCoreVnl"
|
||||||
:disable="true"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<QCheckbox
|
<VnLv
|
||||||
:label="t('customer.summary.hasB2BVnl')"
|
:label="t('customer.summary.hasB2BVnl')"
|
||||||
v-model="entity.hasSepaVnl"
|
:value="entity.hasSepaVnl"
|
||||||
:disable="true"
|
|
||||||
/>
|
/>
|
||||||
|
</VnRow>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one" v-if="entity.defaultAddress">
|
<QCard class="vn-one" v-if="entity.defaultAddress">
|
||||||
<VnTitle
|
<VnTitle
|
||||||
|
|
|
@ -134,7 +134,7 @@ watch(
|
||||||
<div class="full-width flex justify-center">
|
<div class="full-width flex justify-center">
|
||||||
<QCard class="card-width q-pa-lg">
|
<QCard class="card-width q-pa-lg">
|
||||||
<QForm>
|
<QForm>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<QCheckbox :label="t('Unpaid client')" v-model="unpaidClient" />
|
<QCheckbox :label="t('Unpaid client')" v-model="unpaidClient" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -47,7 +47,7 @@ function handleLocation(data, location) {
|
||||||
url-create="Clients/createWithUser"
|
url-create="Clients/createWithUser"
|
||||||
>
|
>
|
||||||
<template #form="{ data, validate }">
|
<template #form="{ data, validate }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<QInput :label="t('Comercial name')" v-model="data.name" />
|
<QInput :label="t('Comercial name')" v-model="data.name" />
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Salesperson')"
|
:label="t('Salesperson')"
|
||||||
|
@ -58,7 +58,7 @@ function handleLocation(data, location) {
|
||||||
v-model="data.salesPersonFk"
|
v-model="data.salesPersonFk"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Business type')"
|
:label="t('Business type')"
|
||||||
:options="businessTypesOptions"
|
:options="businessTypesOptions"
|
||||||
|
@ -69,21 +69,21 @@ function handleLocation(data, location) {
|
||||||
/>
|
/>
|
||||||
<QInput v-model="data.fi" :label="t('Tax number')" />
|
<QInput v-model="data.fi" :label="t('Tax number')" />
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<QInput
|
<QInput
|
||||||
:label="t('Business name')"
|
:label="t('Business name')"
|
||||||
:rules="validate('client.socialName')"
|
:rules="validate('client.socialName')"
|
||||||
v-model="data.socialName"
|
v-model="data.socialName"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<QInput
|
<QInput
|
||||||
:label="t('Street')"
|
:label="t('Street')"
|
||||||
:rules="validate('client.street')"
|
:rules="validate('client.street')"
|
||||||
v-model="data.street"
|
v-model="data.street"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnLocation
|
<VnLocation
|
||||||
:rules="validate('Worker.postcode')"
|
:rules="validate('Worker.postcode')"
|
||||||
:roles-allowed-to-create="['deliveryAssistant']"
|
:roles-allowed-to-create="['deliveryAssistant']"
|
||||||
|
@ -93,7 +93,7 @@ function handleLocation(data, location) {
|
||||||
</VnLocation>
|
</VnLocation>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<QInput v-model="data.userName" :label="t('Web user')" />
|
<QInput v-model="data.userName" :label="t('Web user')" />
|
||||||
<QInput
|
<QInput
|
||||||
:label="t('Email')"
|
:label="t('Email')"
|
||||||
|
|
|
@ -41,9 +41,7 @@ const columns = computed(() => [
|
||||||
name: 'name',
|
name: 'name',
|
||||||
isTitle: true,
|
isTitle: true,
|
||||||
create: true,
|
create: true,
|
||||||
columnField: {
|
columnClass: 'expand',
|
||||||
class: 'expand',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -51,9 +49,7 @@ const columns = computed(() => [
|
||||||
label: t('customer.extendedList.tableVisibleColumns.socialName'),
|
label: t('customer.extendedList.tableVisibleColumns.socialName'),
|
||||||
isTitle: true,
|
isTitle: true,
|
||||||
create: true,
|
create: true,
|
||||||
columnField: {
|
columnClass: 'expand',
|
||||||
class: 'expand',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -135,9 +131,7 @@ const columns = computed(() => [
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
inWhere: true,
|
inWhere: true,
|
||||||
},
|
},
|
||||||
columnField: {
|
columnClass: 'expand',
|
||||||
class: 'expand',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
<script setup>
|
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
|
||||||
import LeftMenu from 'components/LeftMenu.vue';
|
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<QDrawer v-model="stateStore.leftDrawer" show-if-above :width="256">
|
|
||||||
<QScrollArea class="fit text-grey-8">
|
|
||||||
<LeftMenu />
|
|
||||||
</QScrollArea>
|
|
||||||
</QDrawer>
|
|
||||||
<QPageContainer>
|
|
||||||
<RouterView></RouterView>
|
|
||||||
</QPageContainer>
|
|
||||||
</template>
|
|
|
@ -1,9 +1,8 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { QBtn, QCheckbox, useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import { toCurrency, toDate, dateRange } from 'filters/index';
|
import { toCurrency, toDate, dateRange } from 'filters/index';
|
||||||
import VnPaginate from 'src/components/ui/VnPaginate.vue';
|
|
||||||
import CustomerNotificationsFilter from './CustomerDefaulterFilter.vue';
|
import CustomerNotificationsFilter from './CustomerDefaulterFilter.vue';
|
||||||
import CustomerBalanceDueTotal from './CustomerBalanceDueTotal.vue';
|
import CustomerBalanceDueTotal from './CustomerBalanceDueTotal.vue';
|
||||||
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
||||||
|
@ -11,8 +10,9 @@ import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.v
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import CustomerDefaulterAddObservation from './CustomerDefaulterAddObservation.vue';
|
import CustomerDefaulterAddObservation from './CustomerDefaulterAddObservation.vue';
|
||||||
import axios from 'axios';
|
import DepartmentDescriptorProxy from 'src/pages/Department/Card/DepartmentDescriptorProxy.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
|
@ -21,175 +21,139 @@ const dataRef = ref(null);
|
||||||
const balanceDueTotal = ref(0);
|
const balanceDueTotal = ref(0);
|
||||||
const selected = ref([]);
|
const selected = ref([]);
|
||||||
|
|
||||||
const tableColumnComponents = {
|
|
||||||
clientFk: {
|
|
||||||
component: QBtn,
|
|
||||||
props: () => ({ flat: true, class: 'link', noCaps: true }),
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
isWorker: {
|
|
||||||
component: QCheckbox,
|
|
||||||
props: (prop) => ({
|
|
||||||
disable: true,
|
|
||||||
'model-value': Boolean(prop.value),
|
|
||||||
}),
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
salesPerson: {
|
|
||||||
component: QBtn,
|
|
||||||
props: () => ({ flat: true, class: 'link', noCaps: true }),
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
departmentName: {
|
|
||||||
component: 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
country: {
|
|
||||||
component: 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
payMethod: {
|
|
||||||
component: 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
balance: {
|
|
||||||
component: 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
author: {
|
|
||||||
component: QBtn,
|
|
||||||
props: () => ({ flat: true, class: 'link', noCaps: true }),
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
lastObservation: {
|
|
||||||
component: 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
date: {
|
|
||||||
component: 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
credit: {
|
|
||||||
component: 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
from: {
|
|
||||||
component: 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
finished: {
|
|
||||||
component: QCheckbox,
|
|
||||||
|
|
||||||
props: (prop) => ({
|
|
||||||
disable: true,
|
|
||||||
'model-value': prop.value,
|
|
||||||
}),
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: 'clientName',
|
|
||||||
label: t('Client'),
|
|
||||||
name: 'clientFk',
|
name: 'clientFk',
|
||||||
sortable: true,
|
label: t('Client'),
|
||||||
|
columnFilter: {
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'Clients',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: ({ isWorker }) => Boolean(isWorker),
|
|
||||||
label: t('Is worker'),
|
|
||||||
name: 'isWorker',
|
name: 'isWorker',
|
||||||
|
label: t('Is worker'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: 'salesPersonName',
|
name: 'salesPersonFk',
|
||||||
label: t('Salesperson'),
|
label: t('Salesperson'),
|
||||||
name: 'salesPerson',
|
columnFilter: {
|
||||||
sortable: true,
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'Workers/activeWithInheritedRole',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
where: { role: 'salesPerson' },
|
||||||
|
useLike: false,
|
||||||
|
optionValue: 'id',
|
||||||
|
optionLabel: 'name',
|
||||||
|
optionFilter: 'firstName',
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: 'departmentName',
|
name: 'departmentFk',
|
||||||
label: t('Department'),
|
label: t('Department'),
|
||||||
name: 'departmentName',
|
columnFilter: {
|
||||||
sortable: true,
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'Departments',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: 'country',
|
name: 'countryFk',
|
||||||
label: t('Country'),
|
label: t('Country'),
|
||||||
name: 'country',
|
format: ({ country }) => country,
|
||||||
sortable: true,
|
columnFilter: {
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'Countries',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: 'payMethod',
|
|
||||||
label: t('P. Method'),
|
|
||||||
name: 'payMethod',
|
name: 'payMethod',
|
||||||
sortable: true,
|
label: t('P. Method'),
|
||||||
tooltip: t('Pay method'),
|
columnFilter: {
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'Paymethods',
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: ({ amount }) => toCurrency(amount),
|
name: 'amount',
|
||||||
label: t('Balance D.'),
|
label: t('Balance D.'),
|
||||||
name: 'balance',
|
format: ({ amount }) => toCurrency(amount),
|
||||||
sortable: true,
|
|
||||||
tooltip: t('Balance due'),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: 'workerName',
|
name: 'workerFk',
|
||||||
label: t('Author'),
|
label: t('Author'),
|
||||||
name: 'author',
|
|
||||||
sortable: true,
|
|
||||||
tooltip: t('Worker who made the last observation'),
|
tooltip: t('Worker who made the last observation'),
|
||||||
|
columnFilter: {
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'Workers/activeWithInheritedRole',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
useLike: false,
|
||||||
|
optionValue: 'id',
|
||||||
|
optionLabel: 'name',
|
||||||
|
optionFilter: 'firstName',
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: 'observation',
|
name: 'observation',
|
||||||
label: t('Last observation'),
|
label: t('Last observation'),
|
||||||
name: 'lastObservation',
|
columnClass: 'expand',
|
||||||
sortable: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: ({ created }) => toDate(created),
|
name: 'created',
|
||||||
label: t('L. O. Date'),
|
label: t('L. O. Date'),
|
||||||
name: 'date',
|
format: ({ created }) => toDate(created),
|
||||||
sortable: true,
|
|
||||||
tooltip: t('Last observation date'),
|
tooltip: t('Last observation date'),
|
||||||
|
columnFilter: {
|
||||||
|
component: 'date',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: ({ creditInsurance }) => toCurrency(creditInsurance),
|
name: 'creditInsurance',
|
||||||
|
format: ({ creditInsurance }) => toCurrency(creditInsurance),
|
||||||
label: t('Credit I.'),
|
label: t('Credit I.'),
|
||||||
name: 'credit',
|
|
||||||
sortable: true,
|
|
||||||
tooltip: t('Credit insurance'),
|
tooltip: t('Credit insurance'),
|
||||||
|
columnFilter: {
|
||||||
|
component: 'number',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: ({ defaulterSinced }) => toDate(defaulterSinced),
|
name: 'defaulterSinced',
|
||||||
|
format: ({ defaulterSinced }) => toDate(defaulterSinced),
|
||||||
label: t('From'),
|
label: t('From'),
|
||||||
name: 'from',
|
columnFilter: {
|
||||||
sortable: true,
|
component: 'date',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: 'finished',
|
label: t('Has recovery'),
|
||||||
label: t('Has recover'),
|
name: 'hasRecovery',
|
||||||
name: 'finished',
|
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -198,22 +162,12 @@ const viewAddObservation = (rowsSelected) => {
|
||||||
component: CustomerDefaulterAddObservation,
|
component: CustomerDefaulterAddObservation,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
clients: rowsSelected,
|
clients: rowsSelected,
|
||||||
promise: async () => await dataRef.value.fetch(),
|
promise: async () => await dataRef.value.reload(),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const onFetch = async (data) => {
|
const onFetch = async (data) => {
|
||||||
const recoveryData = await axios.get('Recoveries');
|
|
||||||
const recoveries = recoveryData.data.map(({ clientFk, finished }) => ({
|
|
||||||
clientFk,
|
|
||||||
finished,
|
|
||||||
}));
|
|
||||||
|
|
||||||
data.forEach((item) => {
|
|
||||||
const recovery = recoveries.find(({ clientFk }) => clientFk === item.clientFk);
|
|
||||||
item.finished = recovery?.finished === null;
|
|
||||||
});
|
|
||||||
balanceDueTotal.value = data.reduce((acc, { amount = 0 }) => acc + amount, 0);
|
balanceDueTotal.value = data.reduce((acc, { amount = 0 }) => acc + amount, 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -229,7 +183,7 @@ function exprBuilder(param, value) {
|
||||||
case 'payMethod':
|
case 'payMethod':
|
||||||
case 'salesPersonFk':
|
case 'salesPersonFk':
|
||||||
return { [`d.${param}`]: value };
|
return { [`d.${param}`]: value };
|
||||||
case 'date':
|
case 'created':
|
||||||
return { 'd.created': { between: dateRange(value) } };
|
return { 'd.created': { between: dateRange(value) } };
|
||||||
case 'defaulterSinced':
|
case 'defaulterSinced':
|
||||||
return { 'd.defaulterSinced': { between: dateRange(value) } };
|
return { 'd.defaulterSinced': { between: dateRange(value) } };
|
||||||
|
@ -246,7 +200,8 @@ function exprBuilder(param, value) {
|
||||||
<VnSubToolbar>
|
<VnSubToolbar>
|
||||||
<template #st-data>
|
<template #st-data>
|
||||||
<CustomerBalanceDueTotal :amount="balanceDueTotal" />
|
<CustomerBalanceDueTotal :amount="balanceDueTotal" />
|
||||||
<div class="flex items-center q-ml-lg">
|
</template>
|
||||||
|
<template #st-actions>
|
||||||
<QBtn
|
<QBtn
|
||||||
color="primary"
|
color="primary"
|
||||||
icon="vn:notes"
|
icon="vn:notes"
|
||||||
|
@ -255,114 +210,54 @@ function exprBuilder(param, value) {
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('Add observation') }}</QTooltip>
|
<QTooltip>{{ t('Add observation') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
</VnSubToolbar>
|
</VnSubToolbar>
|
||||||
<QPage class="column items-center q-pa-md">
|
<VnTable
|
||||||
<VnPaginate
|
|
||||||
ref="dataRef"
|
ref="dataRef"
|
||||||
@on-fetch="onFetch"
|
|
||||||
data-key="CustomerDefaulter"
|
data-key="CustomerDefaulter"
|
||||||
:filter="filter"
|
|
||||||
:expr-builder="exprBuilder"
|
|
||||||
auto-load
|
|
||||||
url="Defaulters/filter"
|
url="Defaulters/filter"
|
||||||
>
|
:expr-builder="exprBuilder"
|
||||||
<template #body="{ rows }">
|
|
||||||
<div class="q-pa-md">
|
|
||||||
<QTable
|
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="rows"
|
@on-fetch="onFetch"
|
||||||
class="full-width"
|
:use-model="true"
|
||||||
row-key="clientFk"
|
:table="{
|
||||||
selection="multiple"
|
'row-key': 'clientFk',
|
||||||
|
selection: 'multiple',
|
||||||
|
}"
|
||||||
v-model:selected="selected"
|
v-model:selected="selected"
|
||||||
|
:disable-option="{ card: true }"
|
||||||
|
auto-load
|
||||||
|
:order="['amount DESC']"
|
||||||
>
|
>
|
||||||
<template #header="props">
|
<template #column-clientFk="{ row }">
|
||||||
<QTr :props="props" class="bg" style="min-height: 200px">
|
<span class="link" @click.stop>
|
||||||
<QTh>
|
{{ row.clientName }}
|
||||||
<QCheckbox v-model="props.selected" />
|
<CustomerDescriptorProxy :id="row.clientFk" />
|
||||||
</QTh>
|
</span>
|
||||||
<QTh
|
|
||||||
v-for="col in props.cols"
|
|
||||||
:key="col.name"
|
|
||||||
:props="props"
|
|
||||||
>
|
|
||||||
{{ t(col.label) }}
|
|
||||||
<QTooltip v-if="col.tooltip">{{
|
|
||||||
col.tooltip
|
|
||||||
}}</QTooltip>
|
|
||||||
</QTh>
|
|
||||||
</QTr>
|
|
||||||
</template>
|
</template>
|
||||||
|
<template #column-observation="{ row }">
|
||||||
<template #body-cell="props">
|
<VnInput type="textarea" v-model="row.observation" readonly dense rows="2" />
|
||||||
<QTd :props="props">
|
|
||||||
<QTr :props="props" class="cursor-pointer">
|
|
||||||
<component
|
|
||||||
:is="
|
|
||||||
tableColumnComponents[props.col.name]
|
|
||||||
.component
|
|
||||||
"
|
|
||||||
class="col-content"
|
|
||||||
v-bind="
|
|
||||||
tableColumnComponents[props.col.name].props(
|
|
||||||
props
|
|
||||||
)
|
|
||||||
"
|
|
||||||
@click="
|
|
||||||
tableColumnComponents[props.col.name].event(
|
|
||||||
props
|
|
||||||
)
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<template v-if="typeof props.value !== 'boolean'">
|
|
||||||
<div
|
|
||||||
v-if="
|
|
||||||
props.col.name === 'lastObservation'
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<VnInput
|
|
||||||
type="textarea"
|
|
||||||
v-model="props.value"
|
|
||||||
readonly
|
|
||||||
dense
|
|
||||||
rows="2"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div v-else>{{ props.value }}</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
<template #column-salesPersonFk="{ row }">
|
||||||
<WorkerDescriptorProxy
|
<span class="link" @click.stop>
|
||||||
:id="props.row.salesPersonFk"
|
{{ row.salesPersonName }}
|
||||||
v-if="props.col.name === 'salesPerson'"
|
<WorkerDescriptorProxy :id="row.salesPersonFk" />
|
||||||
/>
|
</span>
|
||||||
<WorkerDescriptorProxy
|
|
||||||
:id="props.row.workerFk"
|
|
||||||
v-if="props.col.name === 'author'"
|
|
||||||
/>
|
|
||||||
<CustomerDescriptorProxy
|
|
||||||
:id="props.row.clientFk"
|
|
||||||
v-if="props.col.name === 'client'"
|
|
||||||
/>
|
|
||||||
</component>
|
|
||||||
</QTr>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
</QTable>
|
<template #column-departmentFk="{ row }">
|
||||||
</div>
|
<span class="link" @click.stop>
|
||||||
|
{{ row.departmentName }}
|
||||||
|
<DepartmentDescriptorProxy :id="row.departmentFk" />
|
||||||
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</VnPaginate>
|
<template #column-workerFk="{ row }">
|
||||||
</QPage>
|
<span class="link" @click.stop>
|
||||||
|
{{ row.workerName }}
|
||||||
|
<WorkerDescriptorProxy :id="row.workerFk" />
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.col-content {
|
|
||||||
border-radius: 4px;
|
|
||||||
padding: 6px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
Add observation: Añadir observación
|
Add observation: Añadir observación
|
||||||
|
@ -383,4 +278,5 @@ es:
|
||||||
Credit I.: Crédito A.
|
Credit I.: Crédito A.
|
||||||
Credit insurance: Crédito asegurado
|
Credit insurance: Crédito asegurado
|
||||||
From: Desde
|
From: Desde
|
||||||
|
Has recovery: Tiene recobro
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -60,7 +60,7 @@ const onSubmit = async () => {
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<QInput
|
<QInput
|
||||||
:label="t('Message')"
|
:label="t('Message')"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
|
|
|
@ -1,92 +1,92 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { QBtn } from 'quasar';
|
|
||||||
import CustomerNotificationsFilter from './CustomerNotificationsFilter.vue';
|
|
||||||
import CustomerDescriptorProxy from '../Card/CustomerDescriptorProxy.vue';
|
import CustomerDescriptorProxy from '../Card/CustomerDescriptorProxy.vue';
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
import VnPaginate from 'src/components/ui/VnPaginate.vue';
|
|
||||||
import CustomerNotificationsCampaignConsumption from './CustomerNotificationsCampaignConsumption.vue';
|
import CustomerNotificationsCampaignConsumption from './CustomerNotificationsCampaignConsumption.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const dataKey = 'CustomerNotifications';
|
||||||
const selected = ref([]);
|
const selected = ref([]);
|
||||||
const selectedCustomerId = ref(0);
|
|
||||||
|
|
||||||
const tableColumnComponents = {
|
|
||||||
id: {
|
|
||||||
component: QBtn,
|
|
||||||
props: () => ({ flat: true, color: 'blue' }),
|
|
||||||
event: (prop) => selectCustomerId(prop.row.id),
|
|
||||||
},
|
|
||||||
socialName: {
|
|
||||||
component: 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
city: {
|
|
||||||
component: 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
phone: {
|
|
||||||
component: 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
email: {
|
|
||||||
component: 'span',
|
|
||||||
props: () => {},
|
|
||||||
event: () => {},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: 'id',
|
|
||||||
label: t('Identifier'),
|
label: t('Identifier'),
|
||||||
name: 'id',
|
name: 'id',
|
||||||
|
columnClass: 'shrink',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: 'socialName',
|
|
||||||
label: t('Social name'),
|
label: t('Social name'),
|
||||||
name: 'socialName',
|
name: 'socialName',
|
||||||
|
columnFilter: {
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'Clients',
|
||||||
|
fields: ['id', 'socialName'],
|
||||||
|
optionLabel: 'socialName',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
columnClass: 'expand',
|
||||||
|
isTitle: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: 'city',
|
|
||||||
label: t('City'),
|
label: t('City'),
|
||||||
name: 'city',
|
name: 'city',
|
||||||
|
columnFilter: {
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'Towns',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: 'phone',
|
|
||||||
label: t('Phone'),
|
label: t('Phone'),
|
||||||
name: 'phone',
|
name: 'phone',
|
||||||
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: 'email',
|
|
||||||
label: t('Email'),
|
label: t('Email'),
|
||||||
name: 'email',
|
name: 'email',
|
||||||
|
cardVisible: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'fi',
|
||||||
|
label: t('Fi'),
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'postcode',
|
||||||
|
label: t('Postcode'),
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('customer.extendedList.tableVisibleColumns.salesPersonFk'),
|
||||||
|
name: 'salesPersonFk',
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'Workers/activeWithInheritedRole',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
where: { role: 'salesPerson' },
|
||||||
|
optionFilter: 'firstName',
|
||||||
|
useLike: false,
|
||||||
|
},
|
||||||
|
visible: false,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const selectCustomerId = (id) => {
|
|
||||||
selectedCustomerId.value = id;
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<RightMenu>
|
|
||||||
<template #right-panel>
|
|
||||||
<CustomerNotificationsFilter data-key="CustomerNotifications" />
|
|
||||||
</template>
|
|
||||||
</RightMenu>
|
|
||||||
<VnSubToolbar class="justify-end">
|
<VnSubToolbar class="justify-end">
|
||||||
<template #st-data>
|
<template #st-actions>
|
||||||
<CustomerNotificationsCampaignConsumption
|
<CustomerNotificationsCampaignConsumption
|
||||||
:selected-rows="selected.length > 0"
|
:selected-rows="selected.length > 0"
|
||||||
:clients="selected"
|
:clients="selected"
|
||||||
|
@ -94,51 +94,26 @@ const selectCustomerId = (id) => {
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnSubToolbar>
|
</VnSubToolbar>
|
||||||
<QPage class="column items-center q-pa-md">
|
<VnTable
|
||||||
<VnPaginate data-key="CustomerNotifications" url="Clients" auto-load>
|
:data-key="dataKey"
|
||||||
<template #body="{ rows }">
|
url="Clients"
|
||||||
<div class="q-pa-md">
|
:table="{
|
||||||
<QTable
|
'row-key': 'id',
|
||||||
:columns="columns"
|
selection: 'multiple',
|
||||||
:rows="rows"
|
}"
|
||||||
class="full-width q-mt-md"
|
|
||||||
row-key="id"
|
|
||||||
selection="multiple"
|
|
||||||
v-model:selected="selected"
|
v-model:selected="selected"
|
||||||
|
:right-search="true"
|
||||||
|
:columns="columns"
|
||||||
|
:use-model="true"
|
||||||
|
auto-load
|
||||||
>
|
>
|
||||||
<template #body-cell="props">
|
<template #column-id="{ row }">
|
||||||
<QTd :props="props">
|
<span class="link">
|
||||||
<QTr :props="props" class="cursor-pointer">
|
{{ row.id }}
|
||||||
<component
|
<CustomerDescriptorProxy :id="row.id" />
|
||||||
:is="
|
</span>
|
||||||
tableColumnComponents[props.col.name]
|
|
||||||
.component
|
|
||||||
"
|
|
||||||
class="col-content"
|
|
||||||
v-bind="
|
|
||||||
tableColumnComponents[props.col.name].props(
|
|
||||||
props
|
|
||||||
)
|
|
||||||
"
|
|
||||||
@click="
|
|
||||||
tableColumnComponents[props.col.name].event(
|
|
||||||
props
|
|
||||||
)
|
|
||||||
"
|
|
||||||
>
|
|
||||||
{{ props.value }}
|
|
||||||
<CustomerDescriptorProxy
|
|
||||||
:id="selectedCustomerId"
|
|
||||||
/>
|
|
||||||
</component>
|
|
||||||
</QTr>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
</QTable>
|
</VnTable>
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</VnPaginate>
|
|
||||||
</QPage>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
@ -99,7 +99,7 @@ onMounted(async () => {
|
||||||
<QPopupProxy ref="popupProxyRef">
|
<QPopupProxy ref="popupProxyRef">
|
||||||
<QCard class="column q-pa-md">
|
<QCard class="column q-pa-md">
|
||||||
<span class="text-body1 q-mb-sm">{{ t('Campaign consumption') }}</span>
|
<span class="text-body1 q-mb-sm">{{ t('Campaign consumption') }}</span>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:options="moreFields"
|
:options="moreFields"
|
||||||
option-value="code"
|
option-value="code"
|
||||||
|
@ -109,7 +109,7 @@ onMounted(async () => {
|
||||||
@update:model-value="campaignChange"
|
@update:model-value="campaignChange"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInputDate v-model="campaignParams.from" :label="t('From')" />
|
<VnInputDate v-model="campaignParams.from" :label="t('From')" />
|
||||||
<VnInputDate v-model="campaignParams.to" :label="t('To')" />
|
<VnInputDate v-model="campaignParams.to" :label="t('To')" />
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
|
@ -1,145 +0,0 @@
|
||||||
<script setup>
|
|
||||||
import { ref } from 'vue';
|
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
|
||||||
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
|
||||||
import VnSelect from 'components/common/VnSelect.vue';
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
|
||||||
const props = defineProps({
|
|
||||||
dataKey: {
|
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const cities = ref();
|
|
||||||
const clients = ref();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<FetchData
|
|
||||||
:filter="{ where: { role: 'socialName' } }"
|
|
||||||
@on-fetch="(data) => (clients = data)"
|
|
||||||
auto-load
|
|
||||||
url="Clients"
|
|
||||||
/>
|
|
||||||
<FetchData @on-fetch="(data) => (cities = data)" auto-load url="Towns" />
|
|
||||||
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
|
||||||
<template #tags="{ tag, formatFn }">
|
|
||||||
<div class="q-gutter-x-xs">
|
|
||||||
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
|
||||||
<span>{{ formatFn(tag.value) }}</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template #body="{ params, searchFn }">
|
|
||||||
<QItem class="q-mb-sm q-mt-sm">
|
|
||||||
<QItemSection>
|
|
||||||
<VnInput
|
|
||||||
:label="t('Identifier')"
|
|
||||||
clearable
|
|
||||||
is-outlined
|
|
||||||
v-model="params.identifier"
|
|
||||||
/>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
|
|
||||||
<QItem class="q-mb-sm">
|
|
||||||
<QItemSection v-if="!clients">
|
|
||||||
<QSkeleton type="QInput" class="full-width" />
|
|
||||||
</QItemSection>
|
|
||||||
<QItemSection v-if="clients">
|
|
||||||
<VnSelect
|
|
||||||
:input-debounce="0"
|
|
||||||
:label="t('Social name')"
|
|
||||||
:options="clients"
|
|
||||||
@update:model-value="searchFn()"
|
|
||||||
dense
|
|
||||||
emit-value
|
|
||||||
hide-selected
|
|
||||||
map-options
|
|
||||||
option-label="socialName"
|
|
||||||
option-value="socialName"
|
|
||||||
outlined
|
|
||||||
rounded
|
|
||||||
use-input
|
|
||||||
v-model="params.socialName"
|
|
||||||
/>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
|
|
||||||
<QItem class="q-mb-sm">
|
|
||||||
<QItemSection v-if="!cities">
|
|
||||||
<QSkeleton type="QInput" class="full-width" />
|
|
||||||
</QItemSection>
|
|
||||||
<QItemSection v-if="cities">
|
|
||||||
<VnSelect
|
|
||||||
:input-debounce="0"
|
|
||||||
:label="t('City')"
|
|
||||||
:options="cities"
|
|
||||||
@update:model-value="searchFn()"
|
|
||||||
dense
|
|
||||||
emit-value
|
|
||||||
hide-selected
|
|
||||||
map-options
|
|
||||||
option-label="name"
|
|
||||||
option-value="name"
|
|
||||||
outlined
|
|
||||||
rounded
|
|
||||||
use-input
|
|
||||||
v-model="params.city"
|
|
||||||
/>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
|
|
||||||
<QItem class="q-mb-sm">
|
|
||||||
<QItemSection>
|
|
||||||
<VnInput
|
|
||||||
:label="t('Phone')"
|
|
||||||
clearable
|
|
||||||
is-outlined
|
|
||||||
v-model="params.phone"
|
|
||||||
/>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
|
|
||||||
<QItem class="q-mb-sm">
|
|
||||||
<QItemSection>
|
|
||||||
<VnInput
|
|
||||||
:label="t('Email')"
|
|
||||||
clearable
|
|
||||||
is-outlined
|
|
||||||
type="email"
|
|
||||||
v-model="params.email"
|
|
||||||
/>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QSeparator />
|
|
||||||
</template>
|
|
||||||
</VnFilterPanel>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<i18n>
|
|
||||||
en:
|
|
||||||
params:
|
|
||||||
identifier: Identifier
|
|
||||||
socialName: Social name
|
|
||||||
city: City
|
|
||||||
phone: Phone
|
|
||||||
email: Email
|
|
||||||
es:
|
|
||||||
params:
|
|
||||||
identifier: Identificador
|
|
||||||
socialName: Razón social
|
|
||||||
city: Población
|
|
||||||
phone: Teléfono
|
|
||||||
email: Email
|
|
||||||
Identifier: Identificador
|
|
||||||
Social name: Razón social
|
|
||||||
City: Población
|
|
||||||
Phone: Teléfono
|
|
||||||
Email: Email
|
|
||||||
</i18n>
|
|
|
@ -1,19 +1,18 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { ref, computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { toDate, toCurrency } from 'filters/index';
|
||||||
import VnPaginate from 'components/ui/VnPaginate.vue';
|
|
||||||
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
import VnConfirm from 'components/ui/VnConfirm.vue';
|
import VnConfirm from 'components/ui/VnConfirm.vue';
|
||||||
import CustomerDescriptorProxy from '../Card/CustomerDescriptorProxy.vue';
|
import CustomerDescriptorProxy from '../Card/CustomerDescriptorProxy.vue';
|
||||||
import { toDate, toCurrency } from 'filters/index';
|
|
||||||
import CustomerPaymentsFilter from './CustomerPaymentsFilter.vue';
|
import CustomerPaymentsFilter from './CustomerPaymentsFilter.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
|
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const arrayData = useArrayData('CustomerTransactions');
|
|
||||||
|
|
||||||
async function confirm(transaction) {
|
async function confirm(transaction) {
|
||||||
quasar
|
quasar
|
||||||
|
@ -36,59 +35,73 @@ async function confirmTransaction({ id }) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const grid = ref(false);
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
name: 'id',
|
name: 'id',
|
||||||
label: t('Transaction ID'),
|
label: t('Transaction ID'),
|
||||||
field: (row) => row.id,
|
isTitle: true,
|
||||||
sortable: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'customerId',
|
|
||||||
label: t('Customer ID'),
|
|
||||||
field: (row) => row.clientFk,
|
|
||||||
align: 'right',
|
|
||||||
sortable: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'customer',
|
|
||||||
label: t('Customer Name'),
|
|
||||||
field: (row) => row.customerName,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'state',
|
|
||||||
label: t('State'),
|
|
||||||
field: (row) => row.isConfirmed,
|
|
||||||
format: (value) => (value ? t('Confirmed') : t('Unconfirmed')),
|
|
||||||
align: 'left',
|
align: 'left',
|
||||||
sortable: true,
|
columnFilter: {
|
||||||
|
inWhere: true,
|
||||||
|
alias: 't',
|
||||||
|
},
|
||||||
|
columnClass: 'shrink',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'dated',
|
align: 'left',
|
||||||
|
name: 'clientFk',
|
||||||
|
label: t('Customer'),
|
||||||
|
columnFilter: {
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'Clients',
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
columnClass: 'expand',
|
||||||
|
cardVisible: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'isConfirmed',
|
||||||
|
label: t('State'),
|
||||||
|
align: 'left',
|
||||||
|
format: ({ isConfirmed }) => (isConfirmed ? t('Confirmed') : t('Unconfirmed')),
|
||||||
|
chip: {
|
||||||
|
condition: () => true,
|
||||||
|
color: ({ isConfirmed }) => (isConfirmed ? 'bg-positive' : 'bg-primary'),
|
||||||
|
},
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'created',
|
||||||
label: t('Dated'),
|
label: t('Dated'),
|
||||||
field: (row) => toDate(row.created),
|
format: ({ created }) => toDate(created),
|
||||||
sortable: true,
|
columnFilter: false,
|
||||||
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'amount',
|
name: 'amount',
|
||||||
label: t('Amount'),
|
label: t('Amount'),
|
||||||
field: (row) => row.amount,
|
format: ({ amount }) => toCurrency(amount),
|
||||||
format: (value) => toCurrency(value),
|
columnFilter: {
|
||||||
sortable: true,
|
component: 'number',
|
||||||
|
},
|
||||||
|
cardVisible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'actions',
|
align: 'right',
|
||||||
label: t('Actions'),
|
name: 'tableActions',
|
||||||
grid: false,
|
actions: [
|
||||||
|
{
|
||||||
|
title: t('Confirm transaction'),
|
||||||
|
icon: 'check',
|
||||||
|
action: (row) => confirm(row),
|
||||||
|
show: ({ isConfirmed }) => !isConfirmed,
|
||||||
|
isPrimary: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const isLoading = computed(() => arrayData.isLoading.value);
|
|
||||||
|
|
||||||
function stateColor(row) {
|
|
||||||
if (row.isConfirmed) return 'positive';
|
|
||||||
return 'primary';
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -97,158 +110,22 @@ function stateColor(row) {
|
||||||
<CustomerPaymentsFilter data-key="CustomerTransactions" />
|
<CustomerPaymentsFilter data-key="CustomerTransactions" />
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
</RightMenu>
|
||||||
<QPage class="column items-center q-pa-md customer-payments">
|
<VnTable
|
||||||
<div class="vn-card-list">
|
|
||||||
<QToolbar class="q-pa-none justify-end">
|
|
||||||
<QBtn
|
|
||||||
@click="arrayData.refresh()"
|
|
||||||
:loading="isLoading"
|
|
||||||
icon="refresh"
|
|
||||||
color="primary"
|
|
||||||
class="q-mr-sm"
|
|
||||||
round
|
|
||||||
dense
|
|
||||||
/>
|
|
||||||
<QBtn @click="grid = !grid" icon="list" color="primary" round dense>
|
|
||||||
<QTooltip>{{ t('Change view') }}</QTooltip>
|
|
||||||
</QBtn>
|
|
||||||
</QToolbar>
|
|
||||||
<VnPaginate
|
|
||||||
data-key="CustomerTransactions"
|
data-key="CustomerTransactions"
|
||||||
url="Clients/transactions"
|
url="Clients/transactions"
|
||||||
order="created DESC"
|
order="created DESC"
|
||||||
:limit="20"
|
|
||||||
:offset="50"
|
|
||||||
:auto-load="!!$route?.query.params"
|
|
||||||
>
|
|
||||||
<template #body="{ rows }">
|
|
||||||
<QTable
|
|
||||||
:dense="$q.screen.lt.md"
|
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="rows"
|
:right-search="false"
|
||||||
row-key="id"
|
auto-load
|
||||||
:grid="grid || $q.screen.lt.sm"
|
|
||||||
class="q-mt-xs custom-table"
|
|
||||||
>
|
>
|
||||||
<template #body-cell-actions="{ row }">
|
<template #column-clientFk="{ row }">
|
||||||
<QTd auto-width class="text-center">
|
|
||||||
<QBtn
|
|
||||||
v-if="!row.isConfirmed"
|
|
||||||
icon="check"
|
|
||||||
@click="confirm(row)"
|
|
||||||
color="primary"
|
|
||||||
size="md"
|
|
||||||
round
|
|
||||||
flat
|
|
||||||
dense
|
|
||||||
>
|
|
||||||
<QTooltip>{{ t('Confirm transaction') }}</QTooltip>
|
|
||||||
</QBtn>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
|
||||||
<template #body-cell-id="{ row }">
|
|
||||||
<QTd auto-width align="right">
|
|
||||||
<span>
|
|
||||||
{{ row.id }}
|
|
||||||
</span>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
|
||||||
<template #body-cell-customerId="{ row }">
|
|
||||||
<QTd align="right">
|
|
||||||
<span class="link">
|
<span class="link">
|
||||||
{{ row.clientFk }}
|
{{ row.clientFk }} -
|
||||||
|
{{ row.customerName }}
|
||||||
<CustomerDescriptorProxy :id="row.clientFk" />
|
<CustomerDescriptorProxy :id="row.clientFk" />
|
||||||
</span>
|
</span>
|
||||||
</QTd>
|
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-customer="{ row }">
|
</VnTable>
|
||||||
<QTd auto-width align="left" :title="row.customerName">
|
|
||||||
<span>
|
|
||||||
{{ row.customerName }}
|
|
||||||
</span>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
|
||||||
<template #body-cell-state="{ row }">
|
|
||||||
<QTd auto-width class="text-center">
|
|
||||||
<QBadge text-color="black" :color="stateColor(row)">
|
|
||||||
{{
|
|
||||||
row.isConfirmed
|
|
||||||
? t('Confirmed')
|
|
||||||
: t('Unconfirmed')
|
|
||||||
}}
|
|
||||||
</QBadge>
|
|
||||||
</QTd>
|
|
||||||
</template>
|
|
||||||
<template #item="{ cols, row }">
|
|
||||||
<div class="q-mb-md col-12">
|
|
||||||
<QCard class="q-pa-none">
|
|
||||||
<QItem class="q-pa-none items-start">
|
|
||||||
<QItemSection class="q-pa-none">
|
|
||||||
<QList>
|
|
||||||
<template
|
|
||||||
v-for="col of cols"
|
|
||||||
:key="col.name"
|
|
||||||
>
|
|
||||||
<QItem
|
|
||||||
v-if="col.grid !== false"
|
|
||||||
class="q-pa-none"
|
|
||||||
>
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel caption>
|
|
||||||
{{ col.label }}
|
|
||||||
</QItemLabel>
|
|
||||||
<QItemLabel
|
|
||||||
v-if="col.name == 'state'"
|
|
||||||
>
|
|
||||||
<QBadge
|
|
||||||
text-color="black"
|
|
||||||
:color="
|
|
||||||
stateColor(row)
|
|
||||||
"
|
|
||||||
>
|
|
||||||
{{ col.value }}
|
|
||||||
</QBadge>
|
|
||||||
</QItemLabel>
|
|
||||||
<QItemLabel
|
|
||||||
v-if="col.name != 'state'"
|
|
||||||
>
|
|
||||||
{{ col.value }}
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</QList>
|
|
||||||
</QItemSection>
|
|
||||||
<template v-if="!row.isConfirmed">
|
|
||||||
<QSeparator vertical />
|
|
||||||
<QCardActions
|
|
||||||
vertical
|
|
||||||
class="justify-between"
|
|
||||||
>
|
|
||||||
<QBtn
|
|
||||||
icon="check"
|
|
||||||
@click="confirm(row)"
|
|
||||||
color="primary"
|
|
||||||
size="md"
|
|
||||||
round
|
|
||||||
flat
|
|
||||||
dense
|
|
||||||
>
|
|
||||||
<QTooltip>
|
|
||||||
{{ t('Confirm transaction') }}
|
|
||||||
</QTooltip>
|
|
||||||
</QBtn>
|
|
||||||
</QCardActions>
|
|
||||||
</template>
|
|
||||||
</QItem>
|
|
||||||
</QCard>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</QTable>
|
|
||||||
</template>
|
|
||||||
</VnPaginate>
|
|
||||||
</div>
|
|
||||||
</QPage>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
@ -269,14 +146,11 @@ es:
|
||||||
Web Payments: Pagos Web
|
Web Payments: Pagos Web
|
||||||
Confirm transaction: Confirmar transacción
|
Confirm transaction: Confirmar transacción
|
||||||
Transaction ID: ID transacción
|
Transaction ID: ID transacción
|
||||||
Customer ID: ID cliente
|
Customer: cliente
|
||||||
Customer Name: Nombre cliente
|
|
||||||
State: Estado
|
State: Estado
|
||||||
Dated: Fecha
|
Dated: Fecha
|
||||||
Amount: Importe
|
Amount: Importe
|
||||||
Actions: Acciones
|
|
||||||
Confirmed: Confirmada
|
Confirmed: Confirmada
|
||||||
Unconfirmed: Sin confirmar
|
Unconfirmed: Sin confirmar
|
||||||
Change view: Cambiar vista
|
|
||||||
Payment confirmed: Pago confirmado
|
Payment confirmed: Pago confirmado
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -84,7 +84,7 @@ function handleLocation(data, location) {
|
||||||
<template #form="{ data, validate }">
|
<template #form="{ data, validate }">
|
||||||
<QCheckbox :label="t('Default')" v-model="data.isDefaultAddress" />
|
<QCheckbox :label="t('Default')" v-model="data.isDefaultAddress" />
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput :label="t('Consignee')" clearable v-model="data.nickname" />
|
<VnInput :label="t('Consignee')" clearable v-model="data.nickname" />
|
||||||
|
|
||||||
<VnInput :label="t('Street address')" clearable v-model="data.street" />
|
<VnInput :label="t('Street address')" clearable v-model="data.street" />
|
||||||
|
@ -117,7 +117,7 @@ function handleLocation(data, location) {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Incoterms')"
|
:label="t('Incoterms')"
|
||||||
:options="incoterms"
|
:options="incoterms"
|
||||||
|
|
|
@ -145,7 +145,7 @@ function handleLocation(data, location) {
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #form="{ data, validate }">
|
<template #form="{ data, validate }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<QCheckbox :label="t('Enabled')" v-model="data.isActive" />
|
<QCheckbox :label="t('Enabled')" v-model="data.isActive" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -163,7 +163,7 @@ function handleLocation(data, location) {
|
||||||
</div>
|
</div>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnInput :label="t('Consignee')" clearable v-model="data.nickname" />
|
<VnInput :label="t('Consignee')" clearable v-model="data.nickname" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -172,7 +172,7 @@ function handleLocation(data, location) {
|
||||||
</div>
|
</div>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnLocation
|
<VnLocation
|
||||||
:rules="validate('Worker.postcode')"
|
:rules="validate('Worker.postcode')"
|
||||||
|
@ -183,7 +183,7 @@ function handleLocation(data, location) {
|
||||||
</div>
|
</div>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Agency')"
|
:label="t('Agency')"
|
||||||
|
@ -202,7 +202,7 @@ function handleLocation(data, location) {
|
||||||
<VnInput :label="t('Mobile')" clearable v-model="data.mobile" />
|
<VnInput :label="t('Mobile')" clearable v-model="data.mobile" />
|
||||||
</div>
|
</div>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Incoterms')"
|
:label="t('Incoterms')"
|
||||||
|
|
|
@ -39,7 +39,7 @@ const toCustomerCreditContracts = () => {
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #form="{ data }">
|
<template #form="{ data }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('Credit')"
|
:label="t('Credit')"
|
||||||
|
|
|
@ -143,7 +143,7 @@ const toCustomerFileManagement = () => {
|
||||||
<QCard class="q-pa-lg">
|
<QCard class="q-pa-lg">
|
||||||
<QCardSection>
|
<QCardSection>
|
||||||
<QForm>
|
<QForm>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('Reference')"
|
:label="t('Reference')"
|
||||||
|
@ -163,7 +163,7 @@ const toCustomerFileManagement = () => {
|
||||||
</div>
|
</div>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Warehouse')"
|
:label="t('Warehouse')"
|
||||||
|
@ -184,7 +184,7 @@ const toCustomerFileManagement = () => {
|
||||||
</div>
|
</div>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('Description')"
|
:label="t('Description')"
|
||||||
|
@ -196,7 +196,7 @@ const toCustomerFileManagement = () => {
|
||||||
</div>
|
</div>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<QFile
|
<QFile
|
||||||
ref="inputFileRef"
|
ref="inputFileRef"
|
||||||
|
|
|
@ -119,7 +119,7 @@ const toCustomerFileManagement = () => {
|
||||||
<QCard class="q-pa-lg">
|
<QCard class="q-pa-lg">
|
||||||
<QCardSection>
|
<QCardSection>
|
||||||
<QForm>
|
<QForm>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('Reference')"
|
:label="t('Reference')"
|
||||||
|
@ -139,7 +139,7 @@ const toCustomerFileManagement = () => {
|
||||||
</div>
|
</div>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Warehouse')"
|
:label="t('Warehouse')"
|
||||||
|
@ -160,7 +160,7 @@ const toCustomerFileManagement = () => {
|
||||||
</div>
|
</div>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('Description')"
|
:label="t('Description')"
|
||||||
|
@ -172,7 +172,7 @@ const toCustomerFileManagement = () => {
|
||||||
</div>
|
</div>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<QFile
|
<QFile
|
||||||
ref="inputFileRef"
|
ref="inputFileRef"
|
||||||
|
|
|
@ -55,7 +55,7 @@ const toCustomerGreuges = () => {
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #form="{ data }">
|
<template #form="{ data }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('Amount')"
|
:label="t('Amount')"
|
||||||
clearable
|
clearable
|
||||||
|
@ -65,7 +65,7 @@ const toCustomerGreuges = () => {
|
||||||
<VnInputDate :label="t('Date')" v-model="data.shipped" />
|
<VnInputDate :label="t('Date')" v-model="data.shipped" />
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput :label="t('Comment')" clearable v-model="data.description" />
|
<VnInput :label="t('Comment')" clearable v-model="data.description" />
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Type')"
|
:label="t('Type')"
|
||||||
|
|
|
@ -22,7 +22,7 @@ const onDataSaved = (dataSaved) => {
|
||||||
url-create="CustomsAgents"
|
url-create="CustomsAgents"
|
||||||
>
|
>
|
||||||
<template #form-inputs="{ data }">
|
<template #form-inputs="{ data }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('NIF')"
|
:label="t('NIF')"
|
||||||
:required="true"
|
:required="true"
|
||||||
|
@ -36,7 +36,7 @@ const onDataSaved = (dataSaved) => {
|
||||||
v-model="data.fiscalName"
|
v-model="data.fiscalName"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput :label="t('Street')" clearable v-model="data.street" />
|
<VnInput :label="t('Street')" clearable v-model="data.street" />
|
||||||
<VnInput :label="t('Phone')" clearable v-model="data.phone" />
|
<VnInput :label="t('Phone')" clearable v-model="data.phone" />
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
|
@ -11,10 +11,12 @@ import VnRow from 'components/ui/VnRow.vue';
|
||||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
import { useState } from 'src/composables/useState';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { dialogRef } = useDialogPluginComponent();
|
const { dialogRef } = useDialogPluginComponent();
|
||||||
|
const state = useState();
|
||||||
|
const user = state.getUser();
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
companyId: {
|
companyId: {
|
||||||
|
@ -55,12 +57,12 @@ const filterClientFindOne = {
|
||||||
id: route.params.id,
|
id: route.params.id,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const initialData = reactive({
|
const initialData = reactive({
|
||||||
amountPaid: $props.totalCredit,
|
amountPaid: $props.totalCredit,
|
||||||
clientFk: route.params.id,
|
clientFk: route.params.id,
|
||||||
companyFk: $props.companyId,
|
companyFk: $props.companyId,
|
||||||
email: clientFindOne.value.email,
|
email: clientFindOne.value.email,
|
||||||
|
bankFk: user.value.localBankFk,
|
||||||
});
|
});
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
|
@ -134,7 +136,7 @@ const onDataSaved = async () => {
|
||||||
|
|
||||||
<h5 class="q-mt-none">{{ t('New payment') }}</h5>
|
<h5 class="q-mt-none">{{ t('New payment') }}</h5>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInputDate
|
<VnInputDate
|
||||||
:label="t('Date')"
|
:label="t('Date')"
|
||||||
:required="true"
|
:required="true"
|
||||||
|
@ -152,7 +154,7 @@ const onDataSaved = async () => {
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Bank')"
|
:label="t('Bank')"
|
||||||
:options="bankOptions"
|
:options="bankOptions"
|
||||||
|
@ -187,7 +189,7 @@ const onDataSaved = async () => {
|
||||||
{{ t('Compensation') }}
|
{{ t('Compensation') }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col" v-if="data.bankFk === 3 || data.bankFk === 3117">
|
<div class="col" v-if="data.bankFk === 3 || data.bankFk === 3117">
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('Compensation account')"
|
:label="t('Compensation account')"
|
||||||
|
@ -206,7 +208,7 @@ const onDataSaved = async () => {
|
||||||
<div class="q-mt-lg" v-if="data.bankFk === 2">
|
<div class="q-mt-lg" v-if="data.bankFk === 2">
|
||||||
<div class="text-h6">{{ t('Cash') }}</div>
|
<div class="text-h6">{{ t('Cash') }}</div>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('Delivered amount')"
|
:label="t('Delivered amount')"
|
||||||
@update:model-value="calculateFromDeliveredAmount($event)"
|
@update:model-value="calculateFromDeliveredAmount($event)"
|
||||||
|
@ -223,7 +225,7 @@ const onDataSaved = async () => {
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<QCheckbox v-model="viewRecipt" />
|
<QCheckbox v-model="viewRecipt" />
|
||||||
<QCheckbox v-model="sendEmail" />
|
<QCheckbox v-model="sendEmail" />
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
|
@ -44,7 +44,7 @@ const toCustomerNotes = () => {
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #form="{ data }">
|
<template #form="{ data }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<QInput :label="t('Note')" type="textarea" v-model="data.text" />
|
<QInput :label="t('Note')" type="textarea" v-model="data.text" />
|
||||||
</VnRow>
|
</VnRow>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -49,12 +49,12 @@ const toCustomerRecoveries = () => {
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #form="{ data }">
|
<template #form="{ data }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInputDate :label="t('Since')" v-model="data.started" />
|
<VnInputDate :label="t('Since')" v-model="data.started" />
|
||||||
<VnInputDate :label="t('To')" v-model="data.finished" />
|
<VnInputDate :label="t('To')" v-model="data.finished" />
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('Amount')"
|
:label="t('Amount')"
|
||||||
clearable
|
clearable
|
||||||
|
|
|
@ -264,7 +264,7 @@ const toCustomerSamples = () => {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('Recipient')"
|
:label="t('Recipient')"
|
||||||
|
|
|
@ -29,7 +29,7 @@ const clientsOptions = ref([]);
|
||||||
class="full-width"
|
class="full-width"
|
||||||
>
|
>
|
||||||
<template #form="{ data, validate }">
|
<template #form="{ data, validate }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('department.name')"
|
:label="t('department.name')"
|
||||||
v-model="data.name"
|
v-model="data.name"
|
||||||
|
@ -44,7 +44,7 @@ const clientsOptions = ref([]);
|
||||||
clearable
|
clearable
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('department.chat')"
|
:label="t('department.chat')"
|
||||||
v-model="data.chatName"
|
v-model="data.chatName"
|
||||||
|
@ -58,7 +58,7 @@ const clientsOptions = ref([]);
|
||||||
clearable
|
clearable
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('department.bossDepartment')"
|
:label="t('department.bossDepartment')"
|
||||||
v-model="data.workerFk"
|
v-model="data.workerFk"
|
||||||
|
@ -80,7 +80,7 @@ const clientsOptions = ref([]);
|
||||||
:rules="validate('department.clientFk')"
|
:rules="validate('department.clientFk')"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:label="t('department.telework')"
|
:label="t('department.telework')"
|
||||||
v-model="data.isTeleworking"
|
v-model="data.isTeleworking"
|
||||||
|
@ -92,7 +92,7 @@ const clientsOptions = ref([]);
|
||||||
:true-value="1"
|
:true-value="1"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:label="t('department.worksInProduction')"
|
:label="t('department.worksInProduction')"
|
||||||
v-model="data.isProduction"
|
v-model="data.isProduction"
|
||||||
|
@ -102,7 +102,7 @@ const clientsOptions = ref([]);
|
||||||
v-model="data.hasToRefill"
|
v-model="data.hasToRefill"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:label="t('department.hasToSendMail')"
|
:label="t('department.hasToSendMail')"
|
||||||
v-model="data.hasToSendMail"
|
v-model="data.hasToSendMail"
|
||||||
|
|
|
@ -24,7 +24,7 @@ const $props = defineProps({
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const DepartmentDescriptorRef = ref();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
|
|
||||||
|
@ -55,18 +55,20 @@ const { openConfirmationModal } = useVnConfirm();
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
|
ref="DepartmentDescriptorRef"
|
||||||
module="Department"
|
module="Department"
|
||||||
data-key="departmentData"
|
|
||||||
:url="`Departments/${entityId}`"
|
:url="`Departments/${entityId}`"
|
||||||
:title="data.title"
|
:title="data.title"
|
||||||
:subtitle="data.subtitle"
|
:subtitle="data.subtitle"
|
||||||
:summary="$props.summary"
|
:summary="$props.summary"
|
||||||
|
:to-module="{ name: 'WorkerDepartment' }"
|
||||||
@on-fetch="
|
@on-fetch="
|
||||||
(data) => {
|
(data) => {
|
||||||
department = data;
|
department = data;
|
||||||
setData(data);
|
setData(data);
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
|
data-key="department"
|
||||||
>
|
>
|
||||||
<template #menu="{}">
|
<template #menu="{}">
|
||||||
<QItem
|
<QItem
|
||||||
|
|
|
@ -67,7 +67,7 @@ const onFilterTravelSelected = (formData, id) => {
|
||||||
:clear-store-on-unmount="false"
|
:clear-store-on-unmount="false"
|
||||||
>
|
>
|
||||||
<template #form="{ data }">
|
<template #form="{ data }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('entry.basicData.supplier')"
|
:label="t('entry.basicData.supplier')"
|
||||||
v-model="data.supplierFk"
|
v-model="data.supplierFk"
|
||||||
|
@ -121,13 +121,13 @@ const onFilterTravelSelected = (formData, id) => {
|
||||||
</template>
|
</template>
|
||||||
</VnSelectDialog>
|
</VnSelectDialog>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="data.reference"
|
v-model="data.reference"
|
||||||
:label="t('entry.basicData.reference')"
|
:label="t('entry.basicData.reference')"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="data.invoiceNumber"
|
v-model="data.invoiceNumber"
|
||||||
:label="t('entry.basicData.invoiceNumber')"
|
:label="t('entry.basicData.invoiceNumber')"
|
||||||
|
@ -143,7 +143,7 @@ const onFilterTravelSelected = (formData, id) => {
|
||||||
:required="true"
|
:required="true"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('entry.basicData.currency')"
|
:label="t('entry.basicData.currency')"
|
||||||
v-model="data.currencyFk"
|
v-model="data.currencyFk"
|
||||||
|
@ -159,7 +159,7 @@ const onFilterTravelSelected = (formData, id) => {
|
||||||
min="0"
|
min="0"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<QInput
|
<QInput
|
||||||
:label="t('entry.basicData.observation')"
|
:label="t('entry.basicData.observation')"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
|
@ -169,7 +169,7 @@ const onFilterTravelSelected = (formData, id) => {
|
||||||
fill-input
|
fill-input
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
v-model="data.isOrdered"
|
v-model="data.isOrdered"
|
||||||
:label="t('entry.basicData.ordered')"
|
:label="t('entry.basicData.ordered')"
|
||||||
|
|
|
@ -197,7 +197,7 @@ const redirectToBuysView = () => {
|
||||||
</div>
|
</div>
|
||||||
</Teleport>
|
</Teleport>
|
||||||
<QCard class="q-pa-lg">
|
<QCard class="q-pa-lg">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<QFile
|
<QFile
|
||||||
ref="inputFileRef"
|
ref="inputFileRef"
|
||||||
:label="t('entry.buys.file')"
|
:label="t('entry.buys.file')"
|
||||||
|
@ -219,13 +219,13 @@ const redirectToBuysView = () => {
|
||||||
</QFile>
|
</QFile>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<div v-if="importData.file">
|
<div v-if="importData.file">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('entry.buys.reference')"
|
:label="t('entry.buys.reference')"
|
||||||
v-model="importData.ref"
|
v-model="importData.ref"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('entry.buys.observations')"
|
:label="t('entry.buys.observations')"
|
||||||
v-model="importData.observation"
|
v-model="importData.observation"
|
||||||
|
|
|
@ -115,7 +115,6 @@ watch;
|
||||||
:subtitle="data.subtitle"
|
:subtitle="data.subtitle"
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
data-key="entry"
|
data-key="entry"
|
||||||
:summary="$attrs"
|
|
||||||
>
|
>
|
||||||
<template #menu="{ entity }">
|
<template #menu="{ entity }">
|
||||||
<QItem v-ripple clickable @click="showEntryReport(entity)">
|
<QItem v-ripple clickable @click="showEntryReport(entity)">
|
||||||
|
|
|
@ -78,7 +78,7 @@ const redirectToEntryBasicData = (_, { id }) => {
|
||||||
@on-data-saved="redirectToEntryBasicData"
|
@on-data-saved="redirectToEntryBasicData"
|
||||||
>
|
>
|
||||||
<template #form="{ data, validate }">
|
<template #form="{ data, validate }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Supplier')"
|
:label="t('Supplier')"
|
||||||
class="full-width"
|
class="full-width"
|
||||||
|
@ -102,7 +102,7 @@ const redirectToEntryBasicData = (_, { id }) => {
|
||||||
</template>
|
</template>
|
||||||
</VnSelect>
|
</VnSelect>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Travel')"
|
:label="t('Travel')"
|
||||||
class="full-width"
|
class="full-width"
|
||||||
|
@ -131,7 +131,7 @@ const redirectToEntryBasicData = (_, { id }) => {
|
||||||
</template>
|
</template>
|
||||||
</VnSelect>
|
</VnSelect>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Company')"
|
:label="t('Company')"
|
||||||
class="full-width"
|
class="full-width"
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
<script setup>
|
|
||||||
import LeftMenu from 'src/components/LeftMenu.vue';
|
|
||||||
|
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<QDrawer v-model="stateStore.leftDrawer" show-if-above :width="256">
|
|
||||||
<QScrollArea class="fit text-grey-8">
|
|
||||||
<LeftMenu />
|
|
||||||
</QScrollArea>
|
|
||||||
</QDrawer>
|
|
||||||
<QPageContainer>
|
|
||||||
<RouterView></RouterView>
|
|
||||||
</QPageContainer>
|
|
||||||
</template>
|
|
|
@ -2,6 +2,7 @@
|
||||||
import VnCard from 'components/common/VnCard.vue';
|
import VnCard from 'components/common/VnCard.vue';
|
||||||
import InvoiceInDescriptor from './InvoiceInDescriptor.vue';
|
import InvoiceInDescriptor from './InvoiceInDescriptor.vue';
|
||||||
import InvoiceInFilter from '../InvoiceInFilter.vue';
|
import InvoiceInFilter from '../InvoiceInFilter.vue';
|
||||||
|
import InvoiceInSearchbar from '../InvoiceInSearchbar.vue';
|
||||||
|
|
||||||
const filter = {
|
const filter = {
|
||||||
include: [
|
include: [
|
||||||
|
@ -28,8 +29,9 @@ const filter = {
|
||||||
:descriptor="InvoiceInDescriptor"
|
:descriptor="InvoiceInDescriptor"
|
||||||
:filter-panel="InvoiceInFilter"
|
:filter-panel="InvoiceInFilter"
|
||||||
search-data-key="InvoiceInList"
|
search-data-key="InvoiceInList"
|
||||||
search-url="InvoiceIns/filter"
|
>
|
||||||
searchbar-label="Search invoice"
|
<template #searchbar>
|
||||||
searchbar-info="You can search by invoice reference"
|
<InvoiceInSearchbar />
|
||||||
/>
|
</template>
|
||||||
|
</VnCard>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, computed, onBeforeMount } from 'vue';
|
import { ref, reactive, computed, onBeforeMount } from 'vue';
|
||||||
import { useRouter, onBeforeRouteLeave } from 'vue-router';
|
import { useRouter, onBeforeRouteUpdate } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
@ -129,33 +129,23 @@ onBeforeMount(async () => {
|
||||||
totalAmount.value = data.totalDueDay;
|
totalAmount.value = data.totalDueDay;
|
||||||
});
|
});
|
||||||
|
|
||||||
onBeforeRouteLeave(async (to, from) => {
|
onBeforeRouteUpdate(async (to, from) => {
|
||||||
invoiceInCorrection.correcting.length = 0;
|
invoiceInCorrection.correcting.length = 0;
|
||||||
invoiceInCorrection.corrected = null;
|
invoiceInCorrection.corrected = null;
|
||||||
if (to.params.id !== from.params.id) await setInvoiceCorrection(entityId.value);
|
if (to.params.id !== from.params.id) {
|
||||||
|
await setInvoiceCorrection(to.params.id);
|
||||||
|
const { data } = await axios.get(`InvoiceIns/${to.params.id}/getTotals`);
|
||||||
|
totalAmount.value = data.totalDueDay;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
async function setInvoiceCorrection(id) {
|
async function setInvoiceCorrection(id) {
|
||||||
const [{ data: correctingData }, { data: correctedData }] = await Promise.all([
|
const { data: correctingData } = await axios.get('InvoiceInCorrections', {
|
||||||
axios.get('InvoiceInCorrections', {
|
params: { filter: { where: { correctingFk: id } } },
|
||||||
params: {
|
});
|
||||||
filter: {
|
const { data: correctedData } = await axios.get('InvoiceInCorrections', {
|
||||||
where: {
|
params: { filter: { where: { correctedFk: id } } },
|
||||||
correctingFk: id,
|
});
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
axios.get('InvoiceInCorrections', {
|
|
||||||
params: {
|
|
||||||
filter: {
|
|
||||||
where: {
|
|
||||||
correctedFk: id,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
|
|
||||||
if (correctingData[0]) invoiceInCorrection.corrected = correctingData[0].correctedFk;
|
if (correctingData[0]) invoiceInCorrection.corrected = correctingData[0].correctedFk;
|
||||||
|
|
||||||
|
@ -380,7 +370,7 @@ const createInvoiceInCorrection = async () => {
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
</template>
|
</template>
|
||||||
<template #action="{ entity }">
|
<template #actions="{ entity }">
|
||||||
<QCardActions>
|
<QCardActions>
|
||||||
<QBtn
|
<QBtn
|
||||||
size="md"
|
size="md"
|
||||||
|
@ -448,7 +438,7 @@ const createInvoiceInCorrection = async () => {
|
||||||
readonly
|
readonly
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="`${useCapitalize(t('globals.class'))}*`"
|
:label="`${useCapitalize(t('globals.class'))}`"
|
||||||
v-model="correctionFormData.invoiceClass"
|
v-model="correctionFormData.invoiceClass"
|
||||||
:options="siiTypeInvoiceOuts"
|
:options="siiTypeInvoiceOuts"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
|
@ -458,7 +448,7 @@ const createInvoiceInCorrection = async () => {
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="`${useCapitalize(t('globals.type'))}*`"
|
:label="`${useCapitalize(t('globals.type'))}`"
|
||||||
v-model="correctionFormData.invoiceType"
|
v-model="correctionFormData.invoiceType"
|
||||||
:options="cplusRectificationTypes"
|
:options="cplusRectificationTypes"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
|
@ -466,7 +456,7 @@ const createInvoiceInCorrection = async () => {
|
||||||
:required="true"
|
:required="true"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="`${useCapitalize(t('globals.reason'))}*`"
|
:label="`${useCapitalize(t('globals.reason'))}`"
|
||||||
v-model="correctionFormData.invoiceReason"
|
v-model="correctionFormData.invoiceReason"
|
||||||
:options="invoiceCorrectionTypes"
|
:options="invoiceCorrectionTypes"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
|
@ -494,6 +484,9 @@ const createInvoiceInCorrection = async () => {
|
||||||
.q-card {
|
.q-card {
|
||||||
max-width: 45em;
|
max-width: 45em;
|
||||||
}
|
}
|
||||||
|
.q-field:nth-child(1) {
|
||||||
|
padding-bottom: 20px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: $breakpoint-xs) {
|
@media (max-width: $breakpoint-xs) {
|
||||||
|
|
|
@ -72,7 +72,13 @@ const columns = computed(() => [
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const getTotal = (data, key) =>
|
const getTotal = (data, key) =>
|
||||||
data.reduce((acc, cur) => acc + +String(cur[key]).replace(',', '.'), 0);
|
data.reduce((acc, cur) => acc + +String(cur[key] || 0).replace(',', '.'), 0);
|
||||||
|
|
||||||
|
const formatOpt = (row, { model, options }, prop) => {
|
||||||
|
const obj = row[model];
|
||||||
|
const option = options.find(({ id }) => id == obj);
|
||||||
|
return option ? `${obj}:${option[prop]}` : '';
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
@ -92,7 +98,7 @@ const getTotal = (data, key) =>
|
||||||
ref="invoiceInFormRef"
|
ref="invoiceInFormRef"
|
||||||
data-key="InvoiceInIntrastats"
|
data-key="InvoiceInIntrastats"
|
||||||
url="InvoiceInIntrastats"
|
url="InvoiceInIntrastats"
|
||||||
:auto-load="!currency"
|
auto-load
|
||||||
:data-required="{ invoiceInFk: invoiceInId }"
|
:data-required="{ invoiceInFk: invoiceInId }"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
v-model:selected="rowsSelected"
|
v-model:selected="rowsSelected"
|
||||||
|
@ -124,6 +130,9 @@ const getTotal = (data, key) =>
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="description"
|
option-label="description"
|
||||||
:filter-options="['id', 'description']"
|
:filter-options="['id', 'description']"
|
||||||
|
:hide-selected="false"
|
||||||
|
:fill-input="false"
|
||||||
|
:display-value="formatOpt(row, col, 'description')"
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
<QItem v-bind="scope.itemProps">
|
<QItem v-bind="scope.itemProps">
|
||||||
|
@ -247,7 +256,11 @@ const getTotal = (data, key) =>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped>
|
||||||
|
:deep(.q-table tr .q-td:nth-child(2) input) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<i18n>
|
<i18n>
|
||||||
en:
|
en:
|
||||||
amount: Amount
|
amount: Amount
|
||||||
|
|
|
@ -66,7 +66,7 @@ const vatColumns = ref([
|
||||||
field: (row) => taxRate(row.taxableBase, row.taxTypeSage?.rate),
|
field: (row) => taxRate(row.taxableBase, row.taxTypeSage?.rate),
|
||||||
format: (value) => toCurrency(value, currency.value),
|
format: (value) => toCurrency(value, currency.value),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
align: 'center',
|
align: 'left',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'currency',
|
name: 'currency',
|
||||||
|
@ -339,6 +339,16 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
||||||
</QTh>
|
</QTh>
|
||||||
</QTr>
|
</QTr>
|
||||||
</template>
|
</template>
|
||||||
|
<template #body-cell-vat="{ value: vatCell }">
|
||||||
|
<QTd :title="vatCell" shrink>
|
||||||
|
{{ vatCell }}
|
||||||
|
</QTd>
|
||||||
|
</template>
|
||||||
|
<template #body-cell-transaction="{ value: transactionCell }">
|
||||||
|
<QTd :title="transactionCell" shrink>
|
||||||
|
{{ transactionCell }}
|
||||||
|
</QTd>
|
||||||
|
</template>
|
||||||
<template #bottom-row>
|
<template #bottom-row>
|
||||||
<QTr class="bg">
|
<QTr class="bg">
|
||||||
<QTd></QTd>
|
<QTd></QTd>
|
||||||
|
@ -347,7 +357,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
||||||
}}</QTd>
|
}}</QTd>
|
||||||
<QTd></QTd>
|
<QTd></QTd>
|
||||||
<QTd></QTd>
|
<QTd></QTd>
|
||||||
<QTd class="text-center">{{
|
<QTd>{{
|
||||||
toCurrency(getTotalTax(entity.invoiceInTax, currency))
|
toCurrency(getTotalTax(entity.invoiceInTax, currency))
|
||||||
}}</QTd>
|
}}</QTd>
|
||||||
<QTd></QTd>
|
<QTd></QTd>
|
||||||
|
@ -423,6 +433,10 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
||||||
.bg {
|
.bg {
|
||||||
background-color: var(--vn-accent-color);
|
background-color: var(--vn-accent-color);
|
||||||
}
|
}
|
||||||
|
.q-chip {
|
||||||
|
color: var(--vn-text-color);
|
||||||
|
}
|
||||||
|
|
||||||
@media (min-width: $breakpoint-md) {
|
@media (min-width: $breakpoint-md) {
|
||||||
.summaryBody {
|
.summaryBody {
|
||||||
.vat {
|
.vat {
|
||||||
|
|
|
@ -162,8 +162,14 @@ async function addExpense() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const getTotalTaxableBase = (rows) =>
|
const getTotalTaxableBase = (rows) =>
|
||||||
rows.reduce((acc, { taxableBase }) => acc + +taxableBase, 0);
|
rows.reduce((acc, { taxableBase }) => acc + +(taxableBase || 0), 0);
|
||||||
const getTotalRate = (rows) => rows.reduce((acc, cur) => acc + +taxRate(cur), 0);
|
const getTotalRate = (rows) => rows.reduce((acc, cur) => acc + +taxRate(cur), 0);
|
||||||
|
|
||||||
|
const formatOpt = (row, { model, options }, prop) => {
|
||||||
|
const obj = row[model];
|
||||||
|
const option = options.find(({ id }) => id == obj);
|
||||||
|
return option ? `${obj}:${option[prop]}` : '';
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
@ -254,8 +260,9 @@ const getTotalRate = (rows) => rows.reduce((acc, cur) => acc + +taxRate(cur), 0)
|
||||||
:option-value="col.optionValue"
|
:option-value="col.optionValue"
|
||||||
:option-label="col.optionLabel"
|
:option-label="col.optionLabel"
|
||||||
:filter-options="['id', 'vat']"
|
:filter-options="['id', 'vat']"
|
||||||
:autofocus="col.tabIndex == 1"
|
:hide-selected="false"
|
||||||
input-debounce="0"
|
:fill-input="false"
|
||||||
|
:display-value="formatOpt(row, col, 'vat')"
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
<QItem v-bind="scope.itemProps">
|
<QItem v-bind="scope.itemProps">
|
||||||
|
@ -280,6 +287,9 @@ const getTotalRate = (rows) => rows.reduce((acc, cur) => acc + +taxRate(cur), 0)
|
||||||
:filter-options="['id', 'transaction']"
|
:filter-options="['id', 'transaction']"
|
||||||
:autofocus="col.tabIndex == 1"
|
:autofocus="col.tabIndex == 1"
|
||||||
input-debounce="0"
|
input-debounce="0"
|
||||||
|
:hide-selected="false"
|
||||||
|
:fill-input="false"
|
||||||
|
:display-value="formatOpt(row, col, 'transaction')"
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<template #option="scope">
|
||||||
<QItem v-bind="scope.itemProps">
|
<QItem v-bind="scope.itemProps">
|
||||||
|
@ -474,11 +484,16 @@ const getTotalRate = (rows) => rows.reduce((acc, cur) => acc + +taxRate(cur), 0)
|
||||||
/>
|
/>
|
||||||
</QPageSticky>
|
</QPageSticky>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.bg {
|
.bg {
|
||||||
background-color: var(--vn-light-gray);
|
background-color: var(--vn-light-gray);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:deep(.q-table tr td:nth-child(n + 4):nth-child(-n + 5) input) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: $breakpoint-xs) {
|
@media (max-width: $breakpoint-xs) {
|
||||||
.q-dialog {
|
.q-dialog {
|
||||||
.q-card {
|
.q-card {
|
||||||
|
|
|
@ -7,13 +7,19 @@ import VnFilterPanel from 'src/components/ui/VnFilterPanel.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 VnCurrency from 'src/components/common/VnCurrency.vue';
|
import VnCurrency from 'src/components/common/VnCurrency.vue';
|
||||||
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
defineProps({ dataKey: { type: String, required: true } });
|
defineProps({ dataKey: { type: String, required: true } });
|
||||||
const suppliers = ref([]);
|
const activities = ref([]);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<FetchData
|
||||||
|
url="SupplierActivities"
|
||||||
|
auto-load
|
||||||
|
@on-fetch="(data) => (activities = data)"
|
||||||
|
/>
|
||||||
<VnFilterPanel :data-key="dataKey" :search-button="true">
|
<VnFilterPanel :data-key="dataKey" :search-button="true">
|
||||||
<template #tags="{ tag, formatFn }">
|
<template #tags="{ tag, formatFn }">
|
||||||
<div class="q-gutter-x-xs">
|
<div class="q-gutter-x-xs">
|
||||||
|
@ -29,11 +35,7 @@ const suppliers = ref([]);
|
||||||
v-model="params.supplierRef"
|
v-model="params.supplierRef"
|
||||||
is-outlined
|
is-outlined
|
||||||
lazy-rules
|
lazy-rules
|
||||||
>
|
/>
|
||||||
<template #prepend>
|
|
||||||
<QIcon name="vn:client" size="sm"></QIcon>
|
|
||||||
</template>
|
|
||||||
</VnInput>
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
|
@ -43,11 +45,7 @@ const suppliers = ref([]);
|
||||||
v-model="params.fi"
|
v-model="params.fi"
|
||||||
is-outlined
|
is-outlined
|
||||||
lazy-rules
|
lazy-rules
|
||||||
>
|
/>
|
||||||
<template #prepend>
|
|
||||||
<QIcon name="badge" size="sm"></QIcon>
|
|
||||||
</template>
|
|
||||||
</VnInput>
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
|
@ -59,12 +57,11 @@ const suppliers = ref([]);
|
||||||
:label="t('params.supplierFk')"
|
:label="t('params.supplierFk')"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="nickname"
|
option-label="nickname"
|
||||||
:options="suppliers"
|
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
>
|
:filter-options="['id', 'name']"
|
||||||
</VnSelect>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
|
@ -74,11 +71,7 @@ const suppliers = ref([]);
|
||||||
v-model="params.account"
|
v-model="params.account"
|
||||||
is-outlined
|
is-outlined
|
||||||
lazy-rules
|
lazy-rules
|
||||||
>
|
/>
|
||||||
<template #prepend>
|
|
||||||
<QIcon name="person" size="sm" />
|
|
||||||
</template>
|
|
||||||
</VnInput>
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
|
@ -105,7 +98,21 @@ const suppliers = ref([]);
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem class="q-mb-md">
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelect
|
||||||
|
:label="t('params.supplierActivityFk')"
|
||||||
|
v-model="params.supplierActivityFk"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
option-value="code"
|
||||||
|
option-label="name"
|
||||||
|
:options="activities"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:label="t('params.isBooked')"
|
:label="t('params.isBooked')"
|
||||||
|
@ -114,6 +121,14 @@ const suppliers = ref([]);
|
||||||
toggle-indeterminate
|
toggle-indeterminate
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
<QItemSection>
|
||||||
|
<QCheckbox
|
||||||
|
:label="t('params.correctingFk')"
|
||||||
|
v-model="params.correctingFk"
|
||||||
|
@update:model-value="searchFn()"
|
||||||
|
toggle-indeterminate
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QExpansionItem :label="t('More options')" expand-separator>
|
<QExpansionItem :label="t('More options')" expand-separator>
|
||||||
<QItem>
|
<QItem>
|
||||||
|
@ -123,11 +138,7 @@ const suppliers = ref([]);
|
||||||
v-model="params.serialNumber"
|
v-model="params.serialNumber"
|
||||||
is-outlined
|
is-outlined
|
||||||
lazy-rules
|
lazy-rules
|
||||||
>
|
/>
|
||||||
<template #prepend>
|
|
||||||
<QIcon name="badge" size="sm"></QIcon>
|
|
||||||
</template>
|
|
||||||
</VnInput>
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
|
@ -137,11 +148,7 @@ const suppliers = ref([]);
|
||||||
v-model="params.serial"
|
v-model="params.serial"
|
||||||
is-outlined
|
is-outlined
|
||||||
lazy-rules
|
lazy-rules
|
||||||
>
|
/>
|
||||||
<template #prepend>
|
|
||||||
<QIcon name="badge" size="sm"></QIcon>
|
|
||||||
</template>
|
|
||||||
</VnInput>
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
|
@ -151,11 +158,7 @@ const suppliers = ref([]);
|
||||||
v-model="params.awbCode"
|
v-model="params.awbCode"
|
||||||
is-outlined
|
is-outlined
|
||||||
lazy-rules
|
lazy-rules
|
||||||
>
|
/>
|
||||||
<template #prepend>
|
|
||||||
<QIcon name="badge" size="sm"></QIcon>
|
|
||||||
</template>
|
|
||||||
</VnInput>
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
</QExpansionItem>
|
</QExpansionItem>
|
||||||
|
@ -166,7 +169,7 @@ const suppliers = ref([]);
|
||||||
<i18n>
|
<i18n>
|
||||||
en:
|
en:
|
||||||
params:
|
params:
|
||||||
search: ID
|
search: Id or supplier name
|
||||||
supplierRef: Supplier ref.
|
supplierRef: Supplier ref.
|
||||||
supplierFk: Supplier
|
supplierFk: Supplier
|
||||||
fi: Supplier fiscal id
|
fi: Supplier fiscal id
|
||||||
|
@ -177,12 +180,17 @@ en:
|
||||||
dued: Dued
|
dued: Dued
|
||||||
serialNumber: Serial Number
|
serialNumber: Serial Number
|
||||||
serial: Serial
|
serial: Serial
|
||||||
account: Account
|
account: Ledger account
|
||||||
isBooked: is booked
|
isBooked: is booked
|
||||||
correctedFk: Rectificatives
|
correctedFk: Rectified
|
||||||
|
issued: Issued
|
||||||
|
to: To
|
||||||
|
awbCode: AWB
|
||||||
|
correctingFk: Rectificative
|
||||||
|
supplierActivityFk: Supplier activity
|
||||||
es:
|
es:
|
||||||
params:
|
params:
|
||||||
search: Contiene
|
search: Id o nombre proveedor
|
||||||
supplierRef: Ref. proveedor
|
supplierRef: Ref. proveedor
|
||||||
supplierFk: Proveedor
|
supplierFk: Proveedor
|
||||||
clientFk: Cliente
|
clientFk: Cliente
|
||||||
|
@ -193,10 +201,12 @@ es:
|
||||||
amount: Importe
|
amount: Importe
|
||||||
issued: Emitida
|
issued: Emitida
|
||||||
isBooked: Conciliada
|
isBooked: Conciliada
|
||||||
account: Cuenta
|
account: Cuenta contable
|
||||||
created: Creada
|
created: Creada
|
||||||
dued: Vencida
|
dued: Vencida
|
||||||
correctedFk: Rectificativas
|
correctedFk: Rectificada
|
||||||
|
correctingFk: Rectificativa
|
||||||
|
supplierActivityFk: Actividad proveedor
|
||||||
From: Desde
|
From: Desde
|
||||||
To: Hasta
|
To: Hasta
|
||||||
Amount: Importe
|
Amount: Importe
|
||||||
|
|
|
@ -1,44 +1,29 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, onUnmounted } from 'vue';
|
import { onMounted, onUnmounted } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRouter } from 'vue-router';
|
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { downloadFile } from 'src/composables/downloadFile';
|
import { downloadFile } from 'src/composables/downloadFile';
|
||||||
import { toDate, toCurrency } from 'src/filters/index';
|
import { toDate, toCurrency } from 'src/filters/index';
|
||||||
import VnPaginate from 'src/components/ui/VnPaginate.vue';
|
import VnPaginate from 'src/components/ui/VnPaginate.vue';
|
||||||
import VnSearchbar from 'src/components/ui/VnSearchbar.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 InvoiceInFilter from './InvoiceInFilter.vue';
|
import InvoiceInFilter from './InvoiceInFilter.vue';
|
||||||
import { getUrl } from 'src/composables/getUrl';
|
|
||||||
import InvoiceInSummary from './Card/InvoiceInSummary.vue';
|
import InvoiceInSummary from './Card/InvoiceInSummary.vue';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
|
import InvoiceInSearchbar from 'src/pages/InvoiceIn/InvoiceInSearchbar.vue';
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const router = useRouter();
|
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
let url = ref();
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => (stateStore.rightDrawer = true));
|
||||||
stateStore.rightDrawer = true;
|
|
||||||
url.value = await getUrl('');
|
|
||||||
});
|
|
||||||
onUnmounted(() => (stateStore.rightDrawer = false));
|
onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
|
|
||||||
function navigate(id) {
|
|
||||||
router.push({ path: `/invoice-in/${id}` });
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnSearchbar
|
<InvoiceInSearchbar />
|
||||||
data-key="InvoiceInList"
|
|
||||||
:label="t('Search invoice')"
|
|
||||||
:info="t('You can search by invoice reference')"
|
|
||||||
/>
|
|
||||||
<RightMenu>
|
<RightMenu>
|
||||||
<template #right-panel>
|
<template #right-panel>
|
||||||
<InvoiceInFilter data-key="InvoiceInList" />
|
<InvoiceInFilter data-key="InvoiceInList" />
|
||||||
|
@ -54,10 +39,10 @@ function navigate(id) {
|
||||||
>
|
>
|
||||||
<template #body="{ rows }">
|
<template #body="{ rows }">
|
||||||
<CardList
|
<CardList
|
||||||
v-for="row of rows"
|
v-for="(row, index) of rows"
|
||||||
:key="row.id"
|
:key="index"
|
||||||
:title="row.supplierRef"
|
:title="row.supplierRef"
|
||||||
@click="navigate(row.id)"
|
@click="$router.push({ path: `/invoice-in/${row.id}` })"
|
||||||
:id="row.id"
|
:id="row.id"
|
||||||
>
|
>
|
||||||
<template #list-items>
|
<template #list-items>
|
||||||
|
@ -102,7 +87,9 @@ function navigate(id) {
|
||||||
<template #actions>
|
<template #actions>
|
||||||
<QBtn
|
<QBtn
|
||||||
:label="t('components.smartCard.openCard')"
|
:label="t('components.smartCard.openCard')"
|
||||||
@click.stop="navigate(row.id)"
|
@click.stop="
|
||||||
|
$router.push({ path: `/invoice-in/${row.id}` })
|
||||||
|
"
|
||||||
outline
|
outline
|
||||||
type="reset"
|
type="reset"
|
||||||
/>
|
/>
|
||||||
|
@ -115,7 +102,7 @@ function navigate(id) {
|
||||||
class="q-mt-sm"
|
class="q-mt-sm"
|
||||||
/>
|
/>
|
||||||
<QBtn
|
<QBtn
|
||||||
:label="t('Download')"
|
:label="t('globals.download')"
|
||||||
class="q-mt-sm"
|
class="q-mt-sm"
|
||||||
@click.stop="downloadFile(row.dmsFk)"
|
@click.stop="downloadFile(row.dmsFk)"
|
||||||
type="submit"
|
type="submit"
|
||||||
|
@ -131,10 +118,3 @@ function navigate(id) {
|
||||||
<QBtn color="primary" icon="add" size="lg" round :href="`/#/invoice-in/create`" />
|
<QBtn color="primary" icon="add" size="lg" round :href="`/#/invoice-in/create`" />
|
||||||
</QPageSticky>
|
</QPageSticky>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
|
||||||
es:
|
|
||||||
Search invoice: Buscar factura recibida
|
|
||||||
You can search by invoice reference: Puedes buscar por referencia de la factura
|
|
||||||
Download: Descargar
|
|
||||||
</i18n>
|
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
<script setup>
|
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
|
||||||
import LeftMenu from 'src/components/LeftMenu.vue';
|
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<QDrawer v-model="stateStore.leftDrawer" show-if-above :width="256">
|
|
||||||
<QScrollArea class="fit text-grey-8">
|
|
||||||
<LeftMenu />
|
|
||||||
</QScrollArea>
|
|
||||||
</QDrawer>
|
|
||||||
<QPageContainer>
|
|
||||||
<RouterView></RouterView>
|
|
||||||
</QPageContainer>
|
|
||||||
</template>
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
<script setup>
|
||||||
|
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
const { t } = useI18n();
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<VnSearchbar
|
||||||
|
data-key="InvoiceInList"
|
||||||
|
:label="t('Search invoice')"
|
||||||
|
:info="t('Search invoices in by id or supplier fiscal name')"
|
||||||
|
url="InvoiceIns/filter"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<i18n>
|
||||||
|
es:
|
||||||
|
Search invoice: Buscar factura recibida
|
||||||
|
Search invoices in by id or supplier fiscal name: Buscar facturas recibidas por id o por nombre fiscal del proveedor
|
||||||
|
</i18n>
|
|
@ -1,2 +0,0 @@
|
||||||
Search invoice: Buscar factura recibida
|
|
||||||
You can search by invoice reference: Puedes buscar por referencia de la factura
|
|
|
@ -84,7 +84,7 @@ const setData = (entity) => (data.value = useCardDescription(entity.ref, entity.
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #actions="{ entity }">
|
<template #actions="{ entity }">
|
||||||
<QCardActions>
|
<QCardActions class="flex justify-center">
|
||||||
<QBtn
|
<QBtn
|
||||||
v-if="entity.client"
|
v-if="entity.client"
|
||||||
size="md"
|
size="md"
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
<script setup>
|
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
|
||||||
import LeftMenu from 'src/components/LeftMenu.vue';
|
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<QDrawer v-model="stateStore.leftDrawer" show-if-above :width="256">
|
|
||||||
<QScrollArea class="fit text-grey-8">
|
|
||||||
<LeftMenu />
|
|
||||||
</QScrollArea>
|
|
||||||
</QDrawer>
|
|
||||||
<QPageContainer>
|
|
||||||
<RouterView></RouterView>
|
|
||||||
</QPageContainer>
|
|
||||||
</template>
|
|
|
@ -31,7 +31,7 @@ onMounted(async () => {
|
||||||
@on-data-saved="onDataSaved"
|
@on-data-saved="onDataSaved"
|
||||||
>
|
>
|
||||||
<template #form-inputs="{ data }">
|
<template #form-inputs="{ data }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
ref="genusInputRef"
|
ref="genusInputRef"
|
||||||
:label="t('Latin genus name')"
|
:label="t('Latin genus name')"
|
||||||
|
|
|
@ -33,7 +33,7 @@ onMounted(async () => {
|
||||||
@on-data-saved="onDataSaved"
|
@on-data-saved="onDataSaved"
|
||||||
>
|
>
|
||||||
<template #form-inputs="{ data }">
|
<template #form-inputs="{ data }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
ref="identifierInputRef"
|
ref="identifierInputRef"
|
||||||
:label="t('createIntrastatForm.identifier')"
|
:label="t('createIntrastatForm.identifier')"
|
||||||
|
|
|
@ -31,7 +31,7 @@ onMounted(async () => {
|
||||||
@on-data-saved="onDataSaved"
|
@on-data-saved="onDataSaved"
|
||||||
>
|
>
|
||||||
<template #form-inputs="{ data }">
|
<template #form-inputs="{ data }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
ref="specieInputRef"
|
ref="specieInputRef"
|
||||||
:label="t('Latin species name')"
|
:label="t('Latin species name')"
|
||||||
|
|
|
@ -71,7 +71,7 @@ const onIntrastatCreated = (response, formData) => {
|
||||||
:clear-store-on-unmount="false"
|
:clear-store-on-unmount="false"
|
||||||
>
|
>
|
||||||
<template #form="{ data }">
|
<template #form="{ data }">
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('basicData.type')"
|
:label="t('basicData.type')"
|
||||||
v-model="data.typeFk"
|
v-model="data.typeFk"
|
||||||
|
@ -95,7 +95,7 @@ const onIntrastatCreated = (response, formData) => {
|
||||||
<VnInput :label="t('basicData.reference')" v-model="data.comment" />
|
<VnInput :label="t('basicData.reference')" v-model="data.comment" />
|
||||||
<VnInput :label="t('basicData.relevancy')" v-model="data.relevancy" />
|
<VnInput :label="t('basicData.relevancy')" v-model="data.relevancy" />
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput :label="t('basicData.stems')" v-model="data.stems" />
|
<VnInput :label="t('basicData.stems')" v-model="data.stems" />
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('basicData.multiplier')"
|
:label="t('basicData.multiplier')"
|
||||||
|
@ -127,7 +127,7 @@ const onIntrastatCreated = (response, formData) => {
|
||||||
</template>
|
</template>
|
||||||
</VnSelectDialog>
|
</VnSelectDialog>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnSelectDialog
|
<VnSelectDialog
|
||||||
:label="t('basicData.intrastat')"
|
:label="t('basicData.intrastat')"
|
||||||
v-model="data.intrastatFk"
|
v-model="data.intrastatFk"
|
||||||
|
@ -166,7 +166,7 @@ const onIntrastatCreated = (response, formData) => {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('basicData.weightByPiece')"
|
:label="t('basicData.weightByPiece')"
|
||||||
v-model.number="data.weightByPiece"
|
v-model.number="data.weightByPiece"
|
||||||
|
@ -192,7 +192,7 @@ const onIntrastatCreated = (response, formData) => {
|
||||||
type="number"
|
type="number"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow class="row q-gutter-md q-mb-md">
|
<VnRow>
|
||||||
<QCheckbox v-model="data.isActive" :label="t('basicData.isActive')" />
|
<QCheckbox v-model="data.isActive" :label="t('basicData.isActive')" />
|
||||||
<QCheckbox v-model="data.hasKgPrice" :label="t('basicData.hasKgPrice')" />
|
<QCheckbox v-model="data.hasKgPrice" :label="t('basicData.hasKgPrice')" />
|
||||||
<div>
|
<div>
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue