0
0
Fork 0

refs #6898 fix create

This commit is contained in:
Carlos Satorres 2024-06-19 13:01:31 +02:00
parent 789dffe2e2
commit a803250cb9
1 changed files with 10 additions and 13 deletions

View File

@ -1,11 +1,12 @@
<script setup>
import { computed } from 'vue';
import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import VnTable from 'components/VnTable/VnTable.vue';
import SupplierListFilter from './SupplierListFilter.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
import SupplierListFilter from './SupplierListFilter.vue';
const { t } = useI18n();
const tableRef = ref();
const columns = computed(() => [
{
@ -25,28 +26,24 @@ const columns = computed(() => [
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',
@ -57,34 +54,34 @@ const columns = computed(() => [
align: 'left',
label: t('supplier.list.tableVisibleColumns.payDay'),
name: 'payDat',
create: true,
component: 'input',
},
]);
</script>
<template>
<RightMenu>
<!-- <RightMenu>
<template #right-panel>
<SupplierListFilter data-key="SuppliersList" />
</template>
</RightMenu>
</RightMenu> -->
<VnTable
ref="SuppliersRef"
ref="tableRef"
data-key="SuppliersList"
:url="`Suppliers`"
save-url="Suppliers/crud"
redirect="supplier"
:create="{
urlCreate: 'suppliers',
urlCreate: 'Suppliers/newSupplier',
title: t('Create Supplier'),
onDataSaved: () => tableRef.reload(),
onDataSaved: ({ id }) => tableRef.redirect(id),
formInitialData: {},
}"
order="id ASC"
:columns="columns"
default-mode="table"
auto-load
:right-search="false"
:is-editable="true"
:use-model="true"
/>
</template>