Merge pull request 'supplier Migration' (!456) from 6898-supplierMigration into dev
gitea/salix-front/pipeline/head This commit looks good Details

Reviewed-on: #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 payDay: Pay day
account: Account account: Account
newSupplier: New supplier newSupplier: New supplier
tableVisibleColumns:
id: Id
name: Name
nif: NIF/CIF
nickname: Alias
account: Account
payMethod: Pay Method
payDay: Pay Day
summary: summary:
responsible: Responsible responsible: Responsible
notes: Notes notes: Notes

View File

@ -1045,6 +1045,14 @@ supplier:
payDay: Día de pago payDay: Día de pago
account: Cuenta account: Cuenta
newSupplier: Nuevo proveedor 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: summary:
responsible: Responsable responsible: Responsable
notes: Notas notes: Notas

View File

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

View File

@ -1,26 +1,81 @@
<script setup> <script setup>
import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router'; import VnTable from 'components/VnTable/VnTable.vue';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; import VnSearchbar from 'components/ui/VnSearchbar.vue';
import VnPaginate from 'src/components/ui/VnPaginate.vue'; import RightMenu from 'components/common/RightMenu.vue';
import CardList from 'src/components/ui/CardList.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import SupplierSummary from './Card/SupplierSummary.vue';
import SupplierListFilter from './SupplierListFilter.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 { t } = useI18n();
const { viewSummary } = useSummaryDialog(); const tableRef = ref();
function navigate(id) { const columns = computed(() => [
router.push({ path: `/supplier/${id}` }); {
} align: 'left',
label: t('supplier.list.tableVisibleColumns.id'),
const redirectToCreateView = () => { name: 'id',
router.push({ name: 'SupplierCreate' }); 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> </script>
<template> <template>
@ -30,56 +85,25 @@ const redirectToCreateView = () => {
<SupplierListFilter data-key="SuppliersList" /> <SupplierListFilter data-key="SuppliersList" />
</template> </template>
</RightMenu> </RightMenu>
<QPage class="column items-center q-pa-md"> <VnTable
<div class="vn-card-list"> ref="tableRef"
<VnPaginate data-key="SuppliersList" url="Suppliers/filter"> data-key="SuppliersList"
<template #body="{ rows }"> :url="`Suppliers`"
<CardList save-url="Suppliers/crud"
v-for="row of rows" redirect="supplier"
:key="row.id" :create="{
:title="row.socialName" urlCreate: 'Suppliers/newSupplier',
:id="row.id" title: t('Create Supplier'),
@click="navigate(row.id)" onDataSaved: ({ id }) => tableRef.redirect(id),
> formInitialData: {},
<template #list-items> }"
<VnLv label="NIF/CIF" :value="row.nif" /> order="id ASC"
<VnLv label="Alias" :value="row.alias" /> :columns="columns"
<VnLv default-mode="table"
:label="t('supplier.list.payMethod')" auto-load
:value="row.payMethod" :right-search="false"
/> :use-model="true"
<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>
</template> </template>
<i18n> <i18n>