0
0
Fork 0

refs #7409 front section

This commit is contained in:
Carlos Satorres 2024-06-17 13:55:16 +02:00
parent cb4a5f8d1b
commit 25ab5a1b9f
2 changed files with 91 additions and 0 deletions

View File

@ -0,0 +1,81 @@
<script setup>
import { ref, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import VnTable from 'components/VnTable/VnTable.vue';
const tableRef = ref();
const { t } = useI18n();
const route = useRoute();
const entityId = computed(() => route.params.id);
const columns = computed(() => [
{
align: 'left',
name: 'paymentDate',
label: t('worker.balance.tableVisibleColumns.paymentDate'),
create: true,
component: 'date',
field: 'paymentDate',
},
{
align: 'left',
name: 'incomeTypeFk',
label: t('worker.balance.tableVisibleColumns.incomeType'),
create: true,
component: 'select',
attrs: {
url: 'payrollComponents',
fields: ['id', 'name'],
},
},
{
align: 'left',
name: 'debit',
label: t('worker.balance.tableVisibleColumns.debit'),
create: true,
component: 'input',
field: 'debit',
},
{
align: 'left',
name: 'credit',
label: t('worker.balance.tableVisibleColumns.credit'),
create: true,
component: 'input',
field: 'credit',
},
{
align: 'left',
name: 'concept',
label: t('worker.balance.tableVisibleColumns.concept'),
create: true,
component: 'input',
field: 'concept',
},
]);
</script>
<template>
<VnTable
ref="tableRef"
data-key="WorkerBalance"
:url="`WorkerIncomes/${entityId}`"
:url-create="`WorkerIncomes/${entityId}`"
save-url="WorkerIncomes/crud"
:create="{
urlCreate: 'workerIncomes',
title: 'Create workerIncomes',
onDataSaved: () => tableRef.reload(),
formInitialData: {
workerFk: entityId,
},
}"
order="paymentDate DESC"
:columns="columns"
default-mode="table"
auto-load
:right-search="false"
:is-editable="true"
:use-model="true"
/>
</template>

View File

@ -23,6 +23,7 @@ export default {
'WorkerDms', 'WorkerDms',
'WorkerTimeControl', 'WorkerTimeControl',
'WorkerLocker', 'WorkerLocker',
'WorkerBalance',
], ],
departmentCard: ['BasicData'], departmentCard: ['BasicData'],
}, },
@ -177,6 +178,15 @@ export default {
}, },
component: () => import('src/pages/Worker/Card/WorkerLocker.vue'), component: () => import('src/pages/Worker/Card/WorkerLocker.vue'),
}, },
{
name: 'WorkerBalance',
path: 'balance',
meta: {
title: 'balance',
icon: 'balance',
},
component: () => import('src/pages/Worker/Card/WorkerBalance.vue'),
},
], ],
}, },
], ],