diff --git a/src/components/ui/VnPaginate.vue b/src/components/ui/VnPaginate.vue index 58dd0d3136..d3000bc642 100644 --- a/src/components/ui/VnPaginate.vue +++ b/src/components/ui/VnPaginate.vue @@ -26,6 +26,10 @@ const props = defineProps({ type: Object, default: null, }, + userFilter: { + type: Object, + default: null, + }, where: { type: Object, default: null, @@ -78,6 +82,7 @@ const arrayData = useArrayData(props.dataKey, { where: props.where, limit: props.limit, order: props.order, + userFilter: props.userFilter, userParams: props.userParams, exprBuilder: props.exprBuilder, keepOpts: props.keepOpts, diff --git a/src/pages/Worker/Card/WorkerFormation.vue b/src/pages/Worker/Card/WorkerFormation.vue index c8fd50303e..02a3cdba20 100644 --- a/src/pages/Worker/Card/WorkerFormation.vue +++ b/src/pages/Worker/Card/WorkerFormation.vue @@ -30,9 +30,14 @@ const columns = computed(() => [ name: 'trainingCourseTypeFk', label: t('worker.formation.tableVisibleColumns.course'), isTitle: true, - component: 'select', - field: 'trainingCourseTypeFk', create: true, + component: 'select', + attrs: { + url: 'TrainingCourseTypes', + fields: ['id', 'name'], + }, + disable: false, + inWhere: true, }, { align: 'left', @@ -41,6 +46,7 @@ const columns = computed(() => [ component: VnInputDate, field: 'started', create: true, + cardVisible: true, }, { align: 'left', @@ -54,9 +60,15 @@ const columns = computed(() => [ align: 'left', name: 'centerFk', label: t('worker.formation.tableVisibleColumns.center'), - component: 'select', field: 'centerFk', create: true, + component: 'select', + attrs: { + url: 'TrainingCenters', + fields: ['id', 'name'], + }, + disable: false, + inWhere: true, }, { align: 'left', @@ -77,16 +89,21 @@ const columns = computed(() => [ align: 'left', name: 'remark', label: t('worker.formation.tableVisibleColumns.remark'), - component: 'checkbox', - field: 'remark', create: true, + chip: { + color: null, + condition: (value) => value, + }, }, { align: 'left', name: 'hasDiploma', label: t('worker.formation.tableVisibleColumns.hasDiploma'), - field: 'hasDiploma', create: true, + chip: { + color: null, + condition: (value) => value, + }, }, ]); @@ -96,14 +113,13 @@ const columns = computed(() => [ data-key="WorkerFormation" :url="`Workers/${entityId}/trainingCourse`" :url-create="`Workers/${entityId}/trainingCourse`" - :filter="courseFilter" + :user-filter="courseFilter" :create="{ - urlCreate: 'Workers/trainingCourse', + urlCreate: 'trainingCourses', title: 'Create trainingCourse', - onDataSaved: ({ id }) => tableRef.redirect(id), + onDataSaved: () => tableRef.reload(), formInitialData: { - active: true, - isEqualizated: false, + workerFk: entityId, }, }" order="id DESC"