8627-devToTest #1421

Merged
alexm merged 768 commits from 8627-devToTest into test 2025-02-18 12:37:37 +00:00
10 changed files with 287 additions and 377 deletions
Showing only changes of commit be894f52c1 - Show all commits

View File

@ -27,7 +27,7 @@ function columnName(col) {
</script> </script>
<template> <template>
<VnFilterPanel v-bind="$attrs" :search-button="true" :disable-submit-event="true"> <VnFilterPanel v-bind="$attrs" :search-button="true" :disable-submit-event="true">
<template #body="{ params, orders }"> <template #body="{ params, orders, searchFn }">
<div <div
class="row no-wrap flex-center" class="row no-wrap flex-center"
v-for="col of columns.filter((c) => c.columnFilter ?? true)" v-for="col of columns.filter((c) => c.columnFilter ?? true)"
@ -52,6 +52,7 @@ function columnName(col) {
<slot <slot
name="moreFilterPanel" name="moreFilterPanel"
:params="params" :params="params"
:search-fn="searchFn"
:orders="orders" :orders="orders"
:columns="columns" :columns="columns"
/> />

View File

@ -106,7 +106,14 @@ function checkIsMain() {
:data-key="dataKey" :data-key="dataKey"
:array-data="arrayData" :array-data="arrayData"
:columns="columns" :columns="columns"
/> >
<template #moreFilterPanel="{ params, orders, searchFn }">
<slot
name="moreFilterPanel"
v-bind="{ params, orders, searchFn }"
/>
</template>
</VnTableFilter>
</slot> </slot>
</template> </template>
</RightAdvancedMenu> </RightAdvancedMenu>

View File

@ -635,6 +635,8 @@ wagon:
name: Name name: Name
supplier: supplier:
search: Search supplier
searchInfo: Search supplier by id or name
list: list:
payMethod: Pay method payMethod: Pay method
account: Account account: Account

View File

@ -644,6 +644,8 @@ wagon:
volume: Volumen volume: Volumen
name: Nombre name: Nombre
supplier: supplier:
search: Buscar proveedor
searchInfo: Buscar proveedor por id o nombre
list: list:
payMethod: Método de pago payMethod: Método de pago
account: Cuenta account: Cuenta
@ -651,6 +653,7 @@ supplier:
tableVisibleColumns: tableVisibleColumns:
nif: NIF/CIF nif: NIF/CIF
account: Cuenta account: Cuenta
summary: summary:
responsible: Responsable responsible: Responsable
verified: Verificado verified: Verificado

View File

@ -119,7 +119,7 @@ const openSendEmailDialog = async () => {
openConfirmationModal( openConfirmationModal(
t('The consumption report will be sent'), t('The consumption report will be sent'),
t('Please, confirm'), t('Please, confirm'),
() => sendCampaignMetricsEmail({ address: arrayData.store.data.email }) () => sendCampaignMetricsEmail({ address: arrayData.store.data.email }),
); );
}; };
const sendCampaignMetricsEmail = ({ address }) => { const sendCampaignMetricsEmail = ({ address }) => {

View File

@ -1,19 +1,13 @@
<script setup> <script setup>
import VnCard from 'components/common/VnCard.vue';
import SupplierDescriptor from './SupplierDescriptor.vue'; import SupplierDescriptor from './SupplierDescriptor.vue';
import VnCardBeta from 'src/components/common/VnCardBeta.vue';
import filter from './SupplierFilter.js'; import filter from './SupplierFilter.js';
</script> </script>
<template> <template>
<VnCard <VnCardBeta
data-key="Supplier" data-key="Supplier"
url="Suppliers" url="Suppliers"
:filter="filter"
:descriptor="SupplierDescriptor" :descriptor="SupplierDescriptor"
search-data-key="SupplierList" :filter="filter"
:searchbar-props="{
url: 'Suppliers/filter',
searchUrl: 'table',
label: 'Search suppliers',
}"
/> />
</template> </template>

View File

@ -16,6 +16,7 @@ import axios from 'axios';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import { useState } from 'src/composables/useState'; import { useState } from 'src/composables/useState';
import { useArrayData } from 'composables/useArrayData'; import { useArrayData } from 'composables/useArrayData';
import RightMenu from 'src/components/common/RightMenu.vue';
const state = useState(); const state = useState();
const stateStore = useStateStore(); const stateStore = useStateStore();
@ -173,59 +174,59 @@ onMounted(async () => {
</div> </div>
</div> </div>
</Teleport> </Teleport>
<QPage class="column items-center q-pa-md"> <RightMenu>
<Teleport to="#right-panel" v-if="stateStore.isHeaderMounted()"> <template #right-panel>
<SupplierConsumptionFilter data-key="SupplierConsumption" /> <SupplierConsumptionFilter data-key="SupplierConsumption" />
</Teleport> </template>
<QTable </RightMenu>
:rows="rows" <QTable
row-key="id" :rows="rows"
hide-header row-key="id"
class="full-width q-mt-md" hide-header
:no-data-label="t('No results')" class="full-width q-mt-md"
> :no-data-label="t('No results')"
<template #body="{ row }"> >
<QTr> <template #body="{ row }">
<QTd no-hover> <QTr>
<span class="label">{{ t('supplier.consumption.entry') }}: </span> <QTd no-hover>
<span>{{ row.id }}</span> <span class="label">{{ t('supplier.consumption.entry') }}: </span>
</QTd> <span>{{ row.id }}</span>
<QTd no-hover> </QTd>
<span class="label">{{ t('globals.date') }}: </span> <QTd no-hover>
<span>{{ toDate(row.shipped) }}</span></QTd <span class="label">{{ t('globals.date') }}: </span>
> <span>{{ toDate(row.shipped) }}</span></QTd
<QTd colspan="6" no-hover> >
<span class="label">{{ t('globals.reference') }}: </span> <QTd colspan="6" no-hover>
<span>{{ row.invoiceNumber }}</span> <span class="label">{{ t('globals.reference') }}: </span>
</QTd> <span>{{ row.invoiceNumber }}</span>
</QTr> </QTd>
<QTr v-for="(buy, index) in row.buys" :key="index"> </QTr>
<QTd no-hover> <QTr v-for="(buy, index) in row.buys" :key="index">
<QBtn flat color="blue" dense no-caps>{{ buy.itemName }}</QBtn> <QTd no-hover>
<ItemDescriptorProxy :id="buy.itemFk" /> <QBtn flat color="blue" dense no-caps>{{ buy.itemName }}</QBtn>
</QTd> <ItemDescriptorProxy :id="buy.itemFk" />
</QTd>
<QTd no-hover> <QTd no-hover>
<span>{{ buy.subName }}</span> <span>{{ buy.subName }}</span>
<FetchedTags :item="buy" /> <FetchedTags :item="buy" />
</QTd> </QTd>
<QTd no-hover> {{ dashIfEmpty(buy.quantity) }}</QTd> <QTd no-hover> {{ dashIfEmpty(buy.quantity) }}</QTd>
<QTd no-hover> {{ dashIfEmpty(buy.price) }}</QTd> <QTd no-hover> {{ dashIfEmpty(buy.price) }}</QTd>
<QTd colspan="2" no-hover> {{ dashIfEmpty(buy.total) }}</QTd> <QTd colspan="2" no-hover> {{ dashIfEmpty(buy.total) }}</QTd>
</QTr> </QTr>
<QTr> <QTr>
<QTd colspan="5" no-hover> <QTd colspan="5" no-hover>
<span class="label">{{ t('Total entry') }}: </span> <span class="label">{{ t('Total entry') }}: </span>
<span>{{ row.total }} </span> <span>{{ row.total }} </span>
</QTd> </QTd>
<QTd no-hover> <QTd no-hover>
<span class="label">{{ t('Total stems') }}: </span> <span class="label">{{ t('Total stems') }}: </span>
<span>{{ row.quantity }}</span> <span>{{ row.quantity }}</span>
</QTd> </QTd>
</QTr> </QTr>
</template> </template>
</QTable> </QTable>
</QPage>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@ -2,14 +2,15 @@
import { computed, ref } from 'vue'; import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import VnTable from 'components/VnTable/VnTable.vue'; import VnTable from 'components/VnTable/VnTable.vue';
import VnSearchbar from 'components/ui/VnSearchbar.vue'; import VnSection from 'src/components/common/VnSection.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
import SupplierListFilter from './SupplierListFilter.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import FetchData from 'src/components/FetchData.vue';
const { t } = useI18n(); const { t } = useI18n();
const tableRef = ref(); const tableRef = ref();
const dataKey = 'SupplierList';
const provincesOptions = ref([]);
const columns = computed(() => [ const columns = computed(() => [
{ {
align: 'left', align: 'left',
@ -104,38 +105,62 @@ const columns = computed(() => [
}, },
]); ]);
</script> </script>
<template> <template>
<VnSearchbar data-key="SuppliersList" :limit="20" :label="t('Search suppliers')" /> <FetchData
<RightMenu> url="Provinces"
<template #right-panel> :filter="{ fields: ['id', 'name'], order: 'name ASC' }"
<SupplierListFilter data-key="SuppliersList" /> @on-fetch="(data) => (provincesOptions = data)"
</template> auto-load
</RightMenu> />
<VnTable <VnSection
ref="tableRef" :data-key="dataKey"
data-key="SuppliersList"
url="Suppliers/filter"
redirect="supplier"
:create="{
urlCreate: 'Suppliers/newSupplier',
title: t('Create Supplier'),
onDataSaved: ({ id }) => tableRef.redirect(id),
formInitialData: {},
mapper: (data) => {
data.name = data.socialName;
return data;
},
}"
:right-search="false"
order="id ASC"
:columns="columns" :columns="columns"
prefix="supplier"
:array-data-props="{
url: 'Suppliers/filter',
order: 'id ASC',
}"
> >
<template #more-create-dialog="{ data }"> <template #body>
<VnInput :label="t('globals.name')" v-model="data.socialName" :uppercase="true" /> <VnTable
</template> ref="tableRef"
</VnTable> :data-key="dataKey"
:create="{
urlCreate: 'Suppliers/newSupplier',
title: t('Create Supplier'),
onDataSaved: ({ id }) => tableRef.redirect(id),
formInitialData: {},
mapper: (data) => {
data.name = data.socialName;
delete data.socialName;
return data;
},
}"
:columns="columns"
redirect="supplier"
:right-search="false"
>
<template #more-create-dialog="{ data }">
<VnInput
:label="t('globals.name')"
v-model="data.socialName"
:uppercase="true"
/>
</template>
</VnTable>
</template>
<template #moreFilterPanel="{ params, searchFn }">
<VnSelect
:label="t('globals.params.provinceFk')"
v-model="params.provinceFk"
@update:model-value="searchFn()"
:options="provincesOptions"
filled
dense
class="q-px-sm q-pr-lg"
/>
</template>
</VnSection>
</template> </template>
<i18n> <i18n>

View File

@ -1,122 +0,0 @@
<script setup>
import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnInput from 'src/components/common/VnInput.vue';
import FetchData from 'components/FetchData.vue';
const props = defineProps({
dataKey: {
type: String,
required: true,
},
});
const { t } = useI18n();
const provincesOptions = ref([]);
const countriesOptions = ref([]);
</script>
<template>
<FetchData
url="Provinces"
:filter="{ fields: ['id', 'name'], order: 'name ASC'}"
@on-fetch="(data) => (provincesOptions = data)"
auto-load
/>
<FetchData
url="countries"
:filter="{ fields: ['id', 'name'], order: 'name ASC'}"
@on-fetch="(data) => (countriesOptions = data)"
auto-load
/>
<VnFilterPanel
:data-key="props.dataKey"
:search-button="true"
:unremovable-params="['supplierFk']"
>
<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>
<QItemSection>
<VnInput
v-model="params.search"
:label="t('params.search')"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
v-model="params.nickname"
:label="t('params.nickname')"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput v-model="params.nif" :label="t('params.nif')" is-outlined />
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
:label="t('params.provinceFk')"
v-model="params.provinceFk"
@update:model-value="searchFn()"
:options="provincesOptions"
option-value="id"
option-label="name"
hide-selected
dense
outlined
rounded
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
:label="t('params.countryFk')"
v-model="params.countryFk"
@update:model-value="searchFn()"
:options="countriesOptions"
option-value="id"
option-label="name"
hide-selected
dense
outlined
rounded
/>
</QItemSection>
</QItem>
</template>
</VnFilterPanel>
</template>
<i18n>
en:
params:
search: General search
nickname: Alias
nif: Tax number
provinceFk: Province
countryFk: Country
es:
params:
search: Búsqueda general
nickname: Alias
nif: NIF/CIF
provinceFk: Provincia
countryFk: País
</i18n>

View File

@ -1,19 +1,12 @@
import { RouterView } from 'vue-router'; import { RouterView } from 'vue-router';
export default { const supplierCard = {
path: '/supplier', name: 'SupplierCard',
name: 'Supplier', path: ':id',
component: () => import('src/pages/Supplier/Card/SupplierCard.vue'),
redirect: { name: 'SupplierSummary' },
meta: { meta: {
title: 'suppliers', menu: [
icon: 'vn:supplier',
moduleName: 'Supplier',
keyBinding: 'p',
},
component: RouterView,
redirect: { name: 'SupplierMain' },
menus: {
main: ['SupplierList'],
card: [
'SupplierBasicData', 'SupplierBasicData',
'SupplierFiscalData', 'SupplierFiscalData',
'SupplierBillingData', 'SupplierBillingData',
@ -27,21 +20,165 @@ export default {
'SupplierDms', 'SupplierDms',
], ],
}, },
children: [
{
name: 'SupplierSummary',
path: 'summary',
meta: {
title: 'summary',
icon: 'launch',
},
component: () => import('src/pages/Supplier/Card/SupplierSummary.vue'),
},
{
path: 'basic-data',
name: 'SupplierBasicData',
meta: {
title: 'basicData',
icon: 'vn:settings',
},
component: () => import('src/pages/Supplier/Card/SupplierBasicData.vue'),
},
{
path: 'fiscal-data',
name: 'SupplierFiscalData',
meta: {
title: 'fiscalData',
icon: 'vn:dfiscales',
},
component: () => import('src/pages/Supplier/Card/SupplierFiscalData.vue'),
},
{
path: 'billing-data',
name: 'SupplierBillingData',
meta: {
title: 'billingData',
icon: 'vn:payment',
},
component: () => import('src/pages/Supplier/Card/SupplierBillingData.vue'),
},
{
path: 'log',
name: 'SupplierLog',
meta: {
title: 'log',
icon: 'vn:History',
},
component: () => import('src/pages/Supplier/Card/SupplierLog.vue'),
},
{
path: 'account',
name: 'SupplierAccounts',
meta: {
title: 'accounts',
icon: 'vn:credit',
},
component: () => import('src/pages/Supplier/Card/SupplierAccounts.vue'),
},
{
path: 'contact',
name: 'SupplierContacts',
meta: {
title: 'contacts',
icon: 'contact_phone',
},
component: () => import('src/pages/Supplier/Card/SupplierContacts.vue'),
},
{
path: 'address',
name: 'SupplierAddresses',
meta: {
title: 'addresses',
icon: 'vn:delivery',
},
component: () => import('src/pages/Supplier/Card/SupplierAddresses.vue'),
},
{
path: 'address/create',
name: 'SupplierAddressesCreate',
component: () =>
import('src/pages/Supplier/Card/SupplierAddressesCreate.vue'),
},
{
path: 'balance',
name: 'SupplierBalance',
meta: {
title: 'balance',
icon: 'balance',
},
component: () => import('src/pages/Supplier/Card/SupplierBalance.vue'),
},
{
path: 'consumption',
name: 'SupplierConsumption',
meta: {
title: 'consumption',
icon: 'show_chart',
},
component: () => import('src/pages/Supplier/Card/SupplierConsumption.vue'),
},
{
path: 'agency-term',
name: 'SupplierAgencyTerm',
meta: {
title: 'agencyTerm',
icon: 'vn:agency-term',
},
component: () => import('src/pages/Supplier/Card/SupplierAgencyTerm.vue'),
},
{
path: 'dms',
name: 'SupplierDms',
meta: {
title: 'dms',
icon: 'smb_share',
},
component: () => import('src/pages/Supplier/Card/SupplierDms.vue'),
},
{
path: 'agency-term/create',
name: 'SupplierAgencyTermCreate',
component: () =>
import('src/pages/Supplier/Card/SupplierAgencyTermCreate.vue'),
},
],
};
export default {
name: 'Supplier',
path: '/supplier',
meta: {
title: 'suppliers',
icon: 'vn:supplier',
moduleName: 'Supplier',
keyBinding: 'p',
menu: ['SupplierList'],
},
component: RouterView,
redirect: { name: 'SupplierMain' },
children: [ children: [
{ {
path: '', path: '',
name: 'SupplierMain', name: 'SupplierMain',
component: () => import('src/components/common/VnModule.vue'), component: () => import('src/components/common/VnModule.vue'),
redirect: { name: 'SupplierList' }, redirect: { name: 'SupplierIndexMain' },
children: [ children: [
{ {
path: 'list', path: '',
name: 'SupplierList', name: 'SupplierIndexMain',
meta: { redirect: { name: 'SupplierList' },
title: 'list',
icon: 'view_list',
},
component: () => import('src/pages/Supplier/SupplierList.vue'), component: () => import('src/pages/Supplier/SupplierList.vue'),
children: [
{
path: 'list',
name: 'SupplierList',
meta: {
title: 'list',
icon: 'view_list',
},
},
supplierCard,
],
}, },
{ {
path: 'create', path: 'create',
@ -54,143 +191,5 @@ export default {
}, },
], ],
}, },
{
name: 'SupplierCard',
path: ':id',
component: () => import('src/pages/Supplier/Card/SupplierCard.vue'),
redirect: { name: 'SupplierSummary' },
children: [
{
name: 'SupplierSummary',
path: 'summary',
meta: {
title: 'summary',
icon: 'launch',
},
component: () =>
import('src/pages/Supplier/Card/SupplierSummary.vue'),
},
{
path: 'basic-data',
name: 'SupplierBasicData',
meta: {
title: 'basicData',
icon: 'vn:settings',
},
component: () =>
import('src/pages/Supplier/Card/SupplierBasicData.vue'),
},
{
path: 'fiscal-data',
name: 'SupplierFiscalData',
meta: {
title: 'fiscalData',
icon: 'vn:dfiscales',
},
component: () =>
import('src/pages/Supplier/Card/SupplierFiscalData.vue'),
},
{
path: 'billing-data',
name: 'SupplierBillingData',
meta: {
title: 'billingData',
icon: 'vn:payment',
},
component: () =>
import('src/pages/Supplier/Card/SupplierBillingData.vue'),
},
{
path: 'log',
name: 'SupplierLog',
meta: {
title: 'log',
icon: 'vn:History',
},
component: () => import('src/pages/Supplier/Card/SupplierLog.vue'),
},
{
path: 'account',
name: 'SupplierAccounts',
meta: {
title: 'accounts',
icon: 'vn:credit',
},
component: () =>
import('src/pages/Supplier/Card/SupplierAccounts.vue'),
},
{
path: 'contact',
name: 'SupplierContacts',
meta: {
title: 'contacts',
icon: 'contact_phone',
},
component: () =>
import('src/pages/Supplier/Card/SupplierContacts.vue'),
},
{
path: 'address',
name: 'SupplierAddresses',
meta: {
title: 'addresses',
icon: 'vn:delivery',
},
component: () =>
import('src/pages/Supplier/Card/SupplierAddresses.vue'),
},
{
path: 'address/create',
name: 'SupplierAddressesCreate',
component: () =>
import('src/pages/Supplier/Card/SupplierAddressesCreate.vue'),
},
{
path: 'balance',
name: 'SupplierBalance',
meta: {
title: 'balance',
icon: 'balance',
},
component: () =>
import('src/pages/Supplier/Card/SupplierBalance.vue'),
},
{
path: 'consumption',
name: 'SupplierConsumption',
meta: {
title: 'consumption',
icon: 'show_chart',
},
component: () =>
import('src/pages/Supplier/Card/SupplierConsumption.vue'),
},
{
path: 'agency-term',
name: 'SupplierAgencyTerm',
meta: {
title: 'agencyTerm',
icon: 'vn:agency-term',
},
component: () =>
import('src/pages/Supplier/Card/SupplierAgencyTerm.vue'),
},
{
path: 'dms',
name: 'SupplierDms',
meta: {
title: 'dms',
icon: 'smb_share',
},
component: () => import('src/pages/Supplier/Card/SupplierDms.vue'),
},
{
path: 'agency-term/create',
name: 'SupplierAgencyTermCreate',
component: () =>
import('src/pages/Supplier/Card/SupplierAgencyTermCreate.vue'),
},
],
},
], ],
}; };