0
0
Fork 0

refs #7406 table formation

This commit is contained in:
Carlos Satorres 2024-05-27 09:40:48 +02:00
parent 89e1b3581a
commit d4fbd99473
1 changed files with 84 additions and 0 deletions

View File

@ -0,0 +1,84 @@
<script setup>
import { ref, computed, onMounted } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import VnTable from 'components/VnTable/VnTable.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
const tableRef = ref();
const { t } = useI18n();
const columns = computed(() => [
{
align: 'left',
name: 'course',
label: t('worker.formation.tableVisibleColumns.course'),
isTitle: true,
component: 'select',
attrs: {
url: 'Workers/trainingCourse',
fields: ['id', 'name'],
},
create: true,
},
{
align: 'left',
name: 'startDate',
label: t('worker.formation.tableVisibleColumns.startDate'),
isTitle: true,
component: VnInputDate,
props: (prop) => ({
disable: true,
'model-value': prop.row.started,
}),
create: true,
},
{
align: 'left',
name: 'endDate',
label: t('worker.formation.tableVisibleColumns.endDate'),
isTitle: true,
component: VnInputDate,
props: (prop) => ({
disable: true,
'model-value': prop.row.ended,
}),
create: true,
},
{
align: 'left',
name: 'center',
label: t('worker.formation.tableVisibleColumns.center'),
isTitle: true,
component: 'select',
attrs: {
url: 'Workers/trainingCenter',
fields: ['id', 'name'],
},
create: true,
},
{
align: 'left',
name: 'invoice',
},
]);
</script>
<template>
<VnTable
ref="tableRef"
data-key="WorkerFormation"
url="Workers/trainingCourse"
url-create="Workers/trainingCourse"
:create="{
urlCreate: 'Workers/trainingCourse',
title: 'Create trainingCourse',
onDataSaved: ({ id }) => tableRef.redirect(id),
formInitialData: {
active: true,
isEqualizated: false,
},
}"
order="id DESC"
:columns="columns"
default-mode="table"
auto-load
></VnTable>
</template>