7729-devToTest_2430 #554

Merged
alexm merged 401 commits from 7729-devToTest_2430 into test 2024-07-16 07:17:04 +00:00
3 changed files with 90 additions and 67 deletions
Showing only changes of commit 789dffe2e2 - Show all commits

View File

@ -1015,6 +1015,14 @@ supplier:
payDay: Pay day
account: Account
newSupplier: New supplier
tableVisibleColumns:
id: Id
name: Name
nif: NIF/CIF
nickname: Alias
account: Account
payMethod: Pay Method
payDay: Pay Day
summary:
responsible: Responsible
notes: Notes

View File

@ -1000,6 +1000,14 @@ supplier:
payDay: Día de pago
account: Cuenta
newSupplier: Nuevo proveedor
tableVisibleColumns:
id: Id
name: Nombre
nif: NIF/CIF
nickname: Alias
account: Cuenta
payMethod: Método de pago
payDay: Dia de pago
summary:
responsible: Responsable
notes: Notas

View File

@ -1,85 +1,92 @@
<script setup>
import { computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import VnPaginate from 'src/components/ui/VnPaginate.vue';
import CardList from 'src/components/ui/CardList.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import SupplierSummary from './Card/SupplierSummary.vue';
import VnTable from 'components/VnTable/VnTable.vue';
import SupplierListFilter from './SupplierListFilter.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import RightMenu from 'src/components/common/RightMenu.vue';
const router = useRouter();
const { t } = useI18n();
const { viewSummary } = useSummaryDialog();
function navigate(id) {
router.push({ path: `/supplier/${id}` });
}
const redirectToCreateView = () => {
router.push({ name: 'SupplierCreate' });
};
const columns = computed(() => [
{
align: 'left',
label: t('supplier.list.tableVisibleColumns.id'),
name: 'id',
isTitle: true,
},
{
align: 'left',
label: t('supplier.list.tableVisibleColumns.name'),
name: 'name',
create: true,
component: 'input',
},
{
align: 'left',
label: t('supplier.list.tableVisibleColumns.nif'),
name: 'nif',
create: true,
component: 'input',
},
{
align: 'left',
label: t('supplier.list.tableVisibleColumns.nickname'),
name: 'nickname',
create: true,
component: 'input',
},
{
align: 'left',
label: t('supplier.list.tableVisibleColumns.account'),
name: 'account',
create: true,
component: 'input',
},
{
align: 'left',
label: t('supplier.list.tableVisibleColumns.payMethod'),
name: 'payMethodFk',
create: true,
component: 'select',
attrs: {
url: 'payMethods',
fields: ['id', 'name'],
},
},
{
align: 'left',
label: t('supplier.list.tableVisibleColumns.payDay'),
name: 'payDat',
create: true,
component: 'input',
},
]);
</script>
<template>
<VnSearchbar data-key="SuppliersList" :limit="20" :label="t('Search suppliers')" />
<RightMenu>
<template #right-panel>
<SupplierListFilter data-key="SuppliersList" />
</template>
</RightMenu>
<QPage class="column items-center q-pa-md">
<div class="vn-card-list">
<VnPaginate data-key="SuppliersList" url="Suppliers/filter">
<template #body="{ rows }">
<CardList
v-for="row of rows"
:key="row.id"
:title="row.socialName"
:id="row.id"
@click="navigate(row.id)"
>
<template #list-items>
<VnLv label="NIF/CIF" :value="row.nif" />
<VnLv label="Alias" :value="row.alias" />
<VnLv
:label="t('supplier.list.payMethod')"
:value="row.payMethod"
/>
<VnLv
:label="t('supplier.list.payDeadline')"
:title-label="t('invoiceOut.list.created')"
:value="row.payDem"
/>
<VnLv
:label="t('supplier.list.payDay')"
:value="row.payDay"
/>
<VnLv
:label="t('supplier.list.account')"
:value="row.account"
/>
</template>
<template #actions>
<QBtn
:label="t('components.smartCard.openSummary')"
@click.stop="viewSummary(row.id, SupplierSummary)"
color="primary"
/>
</template>
</CardList>
</template>
</VnPaginate>
</div>
<QPageSticky :offset="[20, 20]">
<QBtn fab icon="add" color="primary" @click="redirectToCreateView()" />
<QTooltip>
{{ t('supplier.list.newSupplier') }}
</QTooltip>
</QPageSticky>
</QPage>
<VnTable
ref="SuppliersRef"
data-key="SuppliersList"
:url="`Suppliers`"
save-url="Suppliers/crud"
:create="{
urlCreate: 'suppliers',
title: t('Create Supplier'),
onDataSaved: () => tableRef.reload(),
}"
order="id ASC"
:columns="columns"
default-mode="table"
auto-load
:right-search="false"
:is-editable="true"
:use-model="true"
/>
</template>
<i18n>