0
0
Fork 0

refs #6553 fix front trad

This commit is contained in:
Carlos Satorres 2024-05-29 14:20:49 +02:00
parent 81e6870f71
commit 0e691436e9
3 changed files with 119 additions and 17 deletions

View File

@ -901,6 +901,24 @@ worker:
iban: IBAN iban: IBAN
bankEntity: Swift / BIC bankEntity: Swift / BIC
imageNotFound: Image not found imageNotFound: Image not found
business:
tableVisibleColumns:
started: Start Date
ended: End Date
company: Company
reasondEnd: Reason for Termination
department: Department
professionalCategory: Professional Category
calendarType: Work Calendar
workCenter: Work Center
payrollCategories: Contract Category
occupationCode: Contribution Code
rate: Rate
businessType: Contract Type
amount: Salary
basicSalary: Transport Workers Salary
notes: Notes
wagon: wagon:
pageTitles: pageTitles:
wagons: Wagons wagons: Wagons

View File

@ -890,6 +890,23 @@ worker:
iban: IBAN iban: IBAN
bankEntity: Swift / BIC bankEntity: Swift / BIC
imageNotFound: No se ha encontrado la imagen imageNotFound: No se ha encontrado la imagen
business:
tableVisibleColumns:
started: Fecha inicio
ended: Fecha fin
company: Empresa
reasondEnd: Motivo finalización
department: Departamento
professionalCategory: Categoria profesional
calendarType: Calendario laboral
workCenter: Centro
payrollCategories: Categoria contrato
occupationCode: Cotización
rate: Tarifa
businessType: Contrato
amount: Salario
basicSalary: Salario transportistas
notes: Notas
wagon: wagon:
pageTitles: pageTitles:
wagons: Vagones wagons: Vagones

View File

@ -1,12 +1,14 @@
<script setup> <script setup>
import { ref, computed } from 'vue'; import { ref, computed } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router'; import { useRoute } from 'vue-router';
import VnTable from 'components/VnTable/VnTable.vue'; import VnTable from 'components/VnTable/VnTable.vue';
import { toDate } from 'src/filters'; import { toDate } from 'src/filters';
import VnInputDate from './common/VnInputDate.vue'; import VnInputDate from 'src/components/common/VnInputDate.vue';
const { t } = useI18n(); const { t } = useI18n();
const route = useRoute();
const tableRef = ref(); const tableRef = ref();
const entityId = computed(() => route.params.id);
const columns = computed(() => [ const columns = computed(() => [
{ {
align: 'left', align: 'left',
@ -14,6 +16,7 @@ const columns = computed(() => [
name: 'started', name: 'started',
format: ({ started }) => toDate(started), format: ({ started }) => toDate(started),
component: VnInputDate, component: VnInputDate,
cardVisible: true,
}, },
{ {
align: 'left', align: 'left',
@ -21,76 +24,147 @@ const columns = computed(() => [
name: 'ended', name: 'ended',
format: ({ ended }) => toDate(ended), format: ({ ended }) => toDate(ended),
component: VnInputDate, component: VnInputDate,
cardVisible: true,
}, },
{ {
align: 'left', align: 'left',
label: t('worker.business.tableVisibleColumns.company'), label: t('worker.business.tableVisibleColumns.company'),
name: 'companyCodeFk', name: 'companyCodeFk',
component: 'select',
attrs: {
url: 'Companies',
fields: ['code'],
},
disable: false,
cardVisible: true,
}, },
{ {
align: 'left', align: 'left',
label: t('worker.business.tableVisibleColumns.reasondEnd'), label: t('worker.business.tableVisibleColumns.reasondEnd'),
name: 'reasondEndFk', name: 'reasondEndFk',
component: 'select',
attrs: {
url: 'BusinessReasonEnds',
fields: ['id', 'reason'],
}, },
{ disable: false,
align: 'left', cardVisible: true,
label: t('worker.business.tableVisibleColumns.reasondEnd'),
name: 'reasondEndFk',
}, },
{ {
align: 'left', align: 'left',
label: t('worker.business.tableVisibleColumns.department'), label: t('worker.business.tableVisibleColumns.department'),
name: 'departmentFk', name: 'departmentFk',
component: 'select',
attrs: {
url: 'Departments',
fields: ['id', 'name'],
},
disable: false,
cardVisible: true,
}, },
{ {
align: 'left', align: 'left',
label: t('worker.business.tableVisibleColumns.professionalCategory'), label: t('worker.business.tableVisibleColumns.professionalCategory'),
name: 'professionalCategoryFk', name: 'professionalCategoryFk',
component: 'select',
attrs: {
url: 'WorkerBusinessProfessionalCategories',
fields: ['id', 'description', 'code'],
},
disable: false,
cardVisible: true,
}, },
{ {
align: 'left', align: 'left',
label: t('worker.business.tableVisibleColumns.calendarType'), label: t('worker.business.tableVisibleColumns.calendarType'),
name: 'calendarTypeFk', name: 'calendarTypeFk',
component: 'select',
attrs: {
url: 'CalendarTypes',
fields: ['id', 'description'],
},
disable: false,
cardVisible: true,
}, },
{ {
align: 'left', align: 'left',
label: t('worker.business.tableVisibleColumns.workCenter'), label: t('worker.business.tableVisibleColumns.workCenter'),
name: 'workCenterFk', name: 'workCenterFk',
component: 'select',
attrs: {
url: 'WorkCenters',
fields: ['id', 'name'],
},
disable: false,
cardVisible: true,
}, },
{ {
align: 'left', align: 'left',
label: t('worker.business.tableVisibleColumns.payrollCategories'), label: t('worker.business.tableVisibleColumns.payrollCategories'),
name: 'payrollCategoriesFk', name: 'payrollCategoriesFk',
component: 'select',
attrs: {
url: 'BusinessReasonEnd',
fields: ['id', 'description'],
},
disable: false,
cardVisible: true,
}, },
{ {
align: 'left', align: 'left',
label: t('worker.business.tableVisibleColumns.occupationCode'), label: t('worker.business.tableVisibleColumns.occupationCode'),
name: 'occupationCodeFk', name: 'occupationCodeFk',
component: 'select',
attrs: {
url: 'OccupationCodes',
fields: ['id', 'name'],
},
disable: false,
cardVisible: true,
}, },
{ {
align: 'left', align: 'left',
label: t('worker.business.tableVisibleColumns.rate'), label: t('worker.business.tableVisibleColumns.rate'),
name: 'rate', name: 'rate',
component: 'input',
disable: false,
cardVisible: true,
}, },
{ {
align: 'left', align: 'left',
label: t('worker.business.tableVisibleColumns.businessType'), label: t('worker.business.tableVisibleColumns.businessType'),
name: 'workerBusinessTypeFk', name: 'workerBusinessTypeFk',
component: 'select',
attrs: {
url: 'WorkerBusinessTypes',
fields: ['id', 'name'],
},
disable: false,
cardVisible: true,
}, },
{ {
align: 'left', align: 'left',
label: t('worker.business.tableVisibleColumns.amount'), label: t('worker.business.tableVisibleColumns.amount'),
name: 'amount', name: 'amount',
component: 'input',
disable: false,
cardVisible: true,
}, },
{ {
align: 'left', align: 'left',
label: t('worker.business.tableVisibleColumns.basicSalary'), label: t('worker.business.tableVisibleColumns.basicSalary'),
name: 'basicSalary', name: 'basicSalary',
component: 'input',
disable: false,
cardVisible: true,
}, },
{ {
align: 'left', align: 'left',
label: t('worker.business.tableVisibleColumns.notes'), label: t('worker.business.tableVisibleColumns.notes'),
name: 'notes', name: 'notes',
component: 'input',
disable: false,
cardVisible: true,
}, },
]); ]);
</script> </script>
@ -99,19 +173,12 @@ const columns = computed(() => [
<VnTable <VnTable
ref="tableRef" ref="tableRef"
data-key="WorkerBusiness" data-key="WorkerBusiness"
url="Clients/Business" :url="`Workers/${entityId}/Business`"
url-create="Clients/Business"
:create="{
urlCreate: 'Clients/createWithUser',
title: 'Create client',
onDataSaved: ({ id }) => tableRef.redirect(id),
formInitialData: {},
}"
order="id DESC" order="id DESC"
:columns="columns" :columns="columns"
default-mode="table" default-mode="card"
redirect="customer"
auto-load auto-load
:right-search="false"
></VnTable> ></VnTable>
</template> </template>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>