forked from verdnatura/salix-front
fix(WorkerBusiness): fix card label
This commit is contained in:
parent
ba57c2fcd9
commit
8d60754682
|
@ -4,7 +4,6 @@ import { useI18n } from 'vue-i18n';
|
|||
import { useRoute } from 'vue-router';
|
||||
import VnTable from 'components/VnTable/VnTable.vue';
|
||||
import { toDate } from 'src/filters';
|
||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||
import worker from 'src/router/modules/worker';
|
||||
import { useQuasar } from 'quasar';
|
||||
|
||||
|
@ -63,12 +62,12 @@ const businessFilter = {
|
|||
fields: ['id', 'name'],
|
||||
},
|
||||
},
|
||||
{
|
||||
relation: 'workerBusinessAgreement',
|
||||
scope: {
|
||||
fields: ['id', 'name'],
|
||||
},
|
||||
},
|
||||
// { Falla
|
||||
// relation: 'workerBusinessAgreement',
|
||||
// scope: {
|
||||
// fields: ['id', 'name'],
|
||||
// },
|
||||
// },
|
||||
],
|
||||
};
|
||||
|
||||
|
@ -90,67 +89,59 @@ async function reactivateWorker(value) {
|
|||
|
||||
const columns = computed(() => [
|
||||
{
|
||||
align: 'left',
|
||||
attrs: {
|
||||
label: t('worker.business.tableVisibleColumns.started'),
|
||||
},
|
||||
name: 'started',
|
||||
label: t('worker.business.tableVisibleColumns.started'),
|
||||
align: 'left',
|
||||
format: ({ started }) => toDate(started),
|
||||
component: VnInputDate,
|
||||
component: 'date',
|
||||
cardVisible: true,
|
||||
create: true,
|
||||
},
|
||||
|
||||
{
|
||||
align: 'left',
|
||||
attrs: {
|
||||
label: t('worker.business.tableVisibleColumns.ended'),
|
||||
'@update:model-value': 'reactivateWorker()',
|
||||
},
|
||||
name: 'ended',
|
||||
label: t('worker.business.tableVisibleColumns.ended'),
|
||||
align: 'left',
|
||||
format: ({ ended }) => toDate(ended),
|
||||
component: VnInputDate,
|
||||
component: 'date',
|
||||
cardVisible: true,
|
||||
create: true,
|
||||
},
|
||||
{
|
||||
label: t('worker.business.tableVisibleColumns.company'),
|
||||
align: 'left',
|
||||
name: 'companyCodeFk',
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'Companies',
|
||||
fields: ['code'],
|
||||
optionValue: 'id',
|
||||
optionLabel: 'code',
|
||||
label: t('worker.business.tableVisibleColumns.company'),
|
||||
optionValue: 'code',
|
||||
},
|
||||
disable: false,
|
||||
cardVisible: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'reasonEndFk',
|
||||
component: 'select',
|
||||
label: t('worker.business.tableVisibleColumns.reasonEnd'),
|
||||
attrs: {
|
||||
url: 'BusinessReasonEnds',
|
||||
fields: ['id', 'reason'],
|
||||
optionLabel: 'reason',
|
||||
label: t('worker.business.tableVisibleColumns.reasonEnd'),
|
||||
},
|
||||
disable: false,
|
||||
cardVisible: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'departmentFk',
|
||||
component: 'select',
|
||||
label: t('worker.business.tableVisibleColumns.department'),
|
||||
attrs: {
|
||||
url: 'Departments',
|
||||
fields: ['id', 'name'],
|
||||
optionLabel: 'name',
|
||||
label: t('worker.business.tableVisibleColumns.department'),
|
||||
},
|
||||
disable: false,
|
||||
cardVisible: true,
|
||||
create: true,
|
||||
},
|
||||
|
@ -158,13 +149,12 @@ const columns = computed(() => [
|
|||
align: 'left',
|
||||
name: 'professionalCategoryFk',
|
||||
component: 'select',
|
||||
label: t('worker.business.tableVisibleColumns.professionalCategory'),
|
||||
attrs: {
|
||||
url: 'WorkerBusinessProfessionalCategories',
|
||||
fields: ['id', 'description', 'code'],
|
||||
optionLabel: 'description',
|
||||
label: t('worker.business.tableVisibleColumns.professionalCategory'),
|
||||
},
|
||||
disable: false,
|
||||
cardVisible: true,
|
||||
create: true,
|
||||
},
|
||||
|
@ -172,13 +162,12 @@ const columns = computed(() => [
|
|||
align: 'left',
|
||||
name: 'calendarTypeFk',
|
||||
component: 'select',
|
||||
label: t('worker.business.tableVisibleColumns.calendarType'),
|
||||
attrs: {
|
||||
url: 'CalendarTypes',
|
||||
fields: ['id', 'description'],
|
||||
optionLabel: 'description',
|
||||
label: t('worker.business.tableVisibleColumns.calendarType'),
|
||||
},
|
||||
disable: false,
|
||||
cardVisible: true,
|
||||
create: true,
|
||||
},
|
||||
|
@ -186,13 +175,12 @@ const columns = computed(() => [
|
|||
align: 'left',
|
||||
name: 'workCenterFk',
|
||||
component: 'select',
|
||||
label: t('worker.business.tableVisibleColumns.workCenter'),
|
||||
attrs: {
|
||||
url: 'WorkCenters',
|
||||
fields: ['id', 'name'],
|
||||
optionLabel: 'name',
|
||||
label: t('worker.business.tableVisibleColumns.workCenter'),
|
||||
},
|
||||
disable: false,
|
||||
cardVisible: true,
|
||||
create: true,
|
||||
},
|
||||
|
@ -200,13 +188,12 @@ const columns = computed(() => [
|
|||
align: 'left',
|
||||
name: 'workerBusinessCategoryFk',
|
||||
component: 'select',
|
||||
label: t('worker.business.tableVisibleColumns.payrollCategories'),
|
||||
attrs: {
|
||||
url: 'payrollCategories',
|
||||
fields: ['id', 'description'],
|
||||
optionLabel: 'description',
|
||||
label: t('worker.business.tableVisibleColumns.payrollCategories'),
|
||||
},
|
||||
disable: false,
|
||||
cardVisible: true,
|
||||
create: true,
|
||||
},
|
||||
|
@ -214,69 +201,55 @@ const columns = computed(() => [
|
|||
align: 'left',
|
||||
name: 'occupationCodeFk',
|
||||
component: 'select',
|
||||
label: t('worker.business.tableVisibleColumns.occupationCode'),
|
||||
attrs: {
|
||||
url: 'OccupationCodes',
|
||||
fields: ['code', 'name'],
|
||||
optionValue: 'code',
|
||||
label: t('worker.business.tableVisibleColumns.occupationCode'),
|
||||
},
|
||||
disable: false,
|
||||
cardVisible: true,
|
||||
create: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'rate',
|
||||
attrs: {
|
||||
label: t('worker.business.tableVisibleColumns.rate'),
|
||||
},
|
||||
component: 'input',
|
||||
disable: false,
|
||||
cardVisible: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'workerBusinessTypeFk',
|
||||
component: 'select',
|
||||
label: t('worker.business.tableVisibleColumns.businessType'),
|
||||
attrs: {
|
||||
url: 'WorkerBusinessTypes',
|
||||
fields: ['code', 'name'],
|
||||
label: t('worker.business.tableVisibleColumns.businessType'),
|
||||
},
|
||||
disable: false,
|
||||
cardVisible: true,
|
||||
create: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
attrs: {
|
||||
label: t('worker.business.tableVisibleColumns.amount'),
|
||||
},
|
||||
name: 'amount',
|
||||
component: 'input',
|
||||
disable: false,
|
||||
cardVisible: true,
|
||||
create: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
attrs: {
|
||||
label: t('worker.business.tableVisibleColumns.basicSalary'),
|
||||
},
|
||||
name: 'basicSalary',
|
||||
component: 'input',
|
||||
disable: false,
|
||||
cardVisible: true,
|
||||
create: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
attrs: {
|
||||
label: t('worker.business.tableVisibleColumns.notes'),
|
||||
},
|
||||
name: 'notes',
|
||||
label: t('worker.business.tableVisibleColumns.notes'),
|
||||
align: 'left',
|
||||
component: 'input',
|
||||
disable: false,
|
||||
cardVisible: true,
|
||||
},
|
||||
]);
|
||||
|
@ -287,20 +260,22 @@ const columns = computed(() => [
|
|||
ref="tableRef"
|
||||
data-key="WorkerBusiness"
|
||||
:url="`Workers/${entityId}/Business`"
|
||||
save-url="/Businesses/crud"
|
||||
:create="{
|
||||
urlCreate: `Workers/${entityId}/Business`,
|
||||
title: 'Create business',
|
||||
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||
onDataSaved: () => tableRef.reload(),
|
||||
formInitialData: {},
|
||||
}"
|
||||
order="id DESC"
|
||||
:columns="columns"
|
||||
:user-filter="businessFilter"
|
||||
:filter="businessFilter"
|
||||
default-mode="card"
|
||||
auto-load
|
||||
:right-search="false"
|
||||
card-class="grid-two q-gutter-x-md"
|
||||
></VnTable>
|
||||
:is-editable="true"
|
||||
/>
|
||||
</template>
|
||||
<style lang="scss" scoped></style>
|
||||
<i18n>
|
||||
|
|
Loading…
Reference in New Issue