0
0
Fork 0

Merge pull request 'supplier Migration' (!456) from 6898-supplierMigration into dev

Reviewed-on: verdnatura/salix-front#456
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
Carlos Satorres 2024-07-03 10:51:22 +00:00
commit 2162315905
4 changed files with 107 additions and 69 deletions

View File

@ -1072,6 +1072,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

@ -1045,6 +1045,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

@ -9,8 +9,6 @@ import { dashIfEmpty } from 'src/filters';
import VnUserLink from 'src/components/ui/VnUserLink.vue';
import VnTitle from 'src/components/common/VnTitle.vue';
onUpdated(() => summaryRef.value.fetch());
const route = useRoute();
const roleState = useRole();
const { t } = useI18n();

View File

@ -1,26 +1,81 @@
<script setup>
import { computed, ref } 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 VnSearchbar from 'components/ui/VnSearchbar.vue';
import RightMenu from 'components/common/RightMenu.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();
const tableRef = ref();
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',
columnField: {
component: null,
},
},
{
align: 'left',
label: t('supplier.list.tableVisibleColumns.nif'),
name: 'nif',
component: 'input',
columnField: {
component: null,
},
},
{
align: 'left',
label: t('supplier.list.tableVisibleColumns.nickname'),
name: 'nickname',
component: 'input',
columnField: {
component: null,
},
},
{
align: 'left',
label: t('supplier.list.tableVisibleColumns.account'),
name: 'account',
component: 'input',
columnField: {
component: null,
},
},
{
align: 'left',
label: t('supplier.list.tableVisibleColumns.payMethod'),
name: 'payMethodFk',
component: 'select',
attrs: {
url: 'payMethods',
fields: ['id', 'name'],
},
columnField: {
component: null,
},
},
{
align: 'left',
label: t('supplier.list.tableVisibleColumns.payDay'),
name: 'payDat',
component: 'input',
columnField: {
component: null,
},
},
]);
</script>
<template>
@ -30,56 +85,25 @@ const redirectToCreateView = () => {
<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="tableRef"
data-key="SuppliersList"
:url="`Suppliers`"
save-url="Suppliers/crud"
redirect="supplier"
:create="{
urlCreate: 'Suppliers/newSupplier',
title: t('Create Supplier'),
onDataSaved: ({ id }) => tableRef.redirect(id),
formInitialData: {},
}"
order="id ASC"
:columns="columns"
default-mode="table"
auto-load
:right-search="false"
:use-model="true"
/>
</template>
<i18n>