fix: refs #6553 workerBusiness #1469
|
@ -3,7 +3,7 @@ import { ref, computed } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } 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 { dashIfEmpty, toDate } from 'src/filters';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ const quasar = useQuasar();
|
||||||
|
|
||||||
async function reactivateWorker() {
|
async function reactivateWorker() {
|
||||||
const hasToReactive = tableRef.value.CrudModelRef.formData.find(
|
const hasToReactive = tableRef.value.CrudModelRef.formData.find(
|
||||||
(data) => !data.ended
|
(data) => !data.ended,
|
||||||
);
|
);
|
||||||
if (hasToReactive) {
|
if (hasToReactive) {
|
||||||
quasar
|
quasar
|
||||||
|
@ -38,25 +38,25 @@ const columns = computed(() => [
|
||||||
{
|
{
|
||||||
name: 'started',
|
name: 'started',
|
||||||
label: t('worker.business.tableVisibleColumns.started'),
|
label: t('worker.business.tableVisibleColumns.started'),
|
||||||
align: 'left',
|
|
||||||
format: ({ started }) => toDate(started),
|
format: ({ started }) => toDate(started),
|
||||||
component: 'date',
|
component: 'date',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '90px',
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: 'ended',
|
name: 'ended',
|
||||||
label: t('worker.business.tableVisibleColumns.ended'),
|
label: t('worker.business.tableVisibleColumns.ended'),
|
||||||
align: 'left',
|
|
||||||
format: ({ ended }) => toDate(ended),
|
format: ({ ended }) => toDate(ended),
|
||||||
component: 'date',
|
component: 'date',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '90px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('worker.business.tableVisibleColumns.company'),
|
label: t('worker.business.tableVisibleColumns.company'),
|
||||||
align: 'left',
|
toolTip: t('worker.business.tableVisibleColumns.company'),
|
||||||
name: 'companyCodeFk',
|
name: 'companyCodeFk',
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
|
@ -65,23 +65,23 @@ const columns = computed(() => [
|
||||||
optionLabel: 'code',
|
optionLabel: 'code',
|
||||||
optionValue: 'code',
|
optionValue: 'code',
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '60px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
|
||||||
name: 'reasonEndFk',
|
name: 'reasonEndFk',
|
||||||
component: 'select',
|
component: 'select',
|
||||||
label: t('worker.business.tableVisibleColumns.reasonEnd'),
|
label: t('worker.business.tableVisibleColumns.reasonEnd'),
|
||||||
|
toolTip: t('worker.business.tableVisibleColumns.reasonEnd'),
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'BusinessReasonEnds',
|
url: 'BusinessReasonEnds',
|
||||||
fields: ['id', 'reason'],
|
fields: ['id', 'reason'],
|
||||||
optionLabel: 'reason',
|
optionLabel: 'reason',
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
|
format: ({ reason }, dashIfEmpty) => dashIfEmpty(reason),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
|
||||||
name: 'departmentFk',
|
name: 'departmentFk',
|
||||||
component: 'select',
|
component: 'select',
|
||||||
label: t('worker.business.tableVisibleColumns.department'),
|
label: t('worker.business.tableVisibleColumns.department'),
|
||||||
|
@ -89,15 +89,19 @@ const columns = computed(() => [
|
||||||
url: 'Departments',
|
url: 'Departments',
|
||||||
fields: ['id', 'name'],
|
fields: ['id', 'name'],
|
||||||
optionLabel: 'name',
|
optionLabel: 'name',
|
||||||
|
optionValue: 'id',
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '80px',
|
||||||
|
format: ({ departmentName }, dashIfEmpty) => dashIfEmpty(departmentName),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'workerBusinessProfessionalCategoryFk',
|
name: 'workerBusinessProfessionalCategoryFk',
|
||||||
component: 'select',
|
component: 'select',
|
||||||
label: t('worker.business.tableVisibleColumns.professionalCategory'),
|
label: t('worker.business.tableVisibleColumns.professionalCategory'),
|
||||||
|
toolTip: t('worker.business.tableVisibleColumns.professionalCategory'),
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'WorkerBusinessProfessionalCategories',
|
url: 'WorkerBusinessProfessionalCategories',
|
||||||
fields: ['id', 'description', 'code'],
|
fields: ['id', 'description', 'code'],
|
||||||
|
@ -105,6 +109,9 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '100px',
|
||||||
|
format: ({ professionalDescription }, dashIfEmpty) =>
|
||||||
|
dashIfEmpty(professionalDescription),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -118,6 +125,8 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
format: ({ calendarTypeDescription }, dashIfEmpty) =>
|
||||||
|
dashIfEmpty(calendarTypeDescription),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -131,6 +140,8 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '100px',
|
||||||
|
format: ({ workCenterName }, dashIfEmpty) => dashIfEmpty(workCenterName),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -144,6 +155,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
format: ({ payrollDescription }, dashIfEmpty) => dashIfEmpty(payrollDescription),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -157,6 +169,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
format: ({ occupationName }, dashIfEmpty) => dashIfEmpty(occupationName),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -165,6 +178,7 @@ const columns = computed(() => [
|
||||||
component: 'input',
|
component: 'input',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '50px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -177,6 +191,8 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
format: ({ workerBusinessTypeName }, dashIfEmpty) =>
|
||||||
|
dashIfEmpty(workerBusinessTypeName),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -185,6 +201,7 @@ const columns = computed(() => [
|
||||||
component: 'input',
|
component: 'input',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '70px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -193,6 +210,7 @@ const columns = computed(() => [
|
||||||
component: 'input',
|
component: 'input',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '70px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'notes',
|
name: 'notes',
|
||||||
|
@ -208,7 +226,7 @@ const columns = computed(() => [
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="WorkerBusiness"
|
data-key="WorkerBusiness"
|
||||||
:url="`Workers/${entityId}/Business`"
|
:url="`Workers/${entityId}/getWorkerBusiness`"
|
||||||
save-url="/Businesses/crud"
|
save-url="/Businesses/crud"
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: `Workers/${entityId}/Business`,
|
urlCreate: `Workers/${entityId}/Business`,
|
||||||
|
@ -218,13 +236,12 @@ const columns = computed(() => [
|
||||||
}"
|
}"
|
||||||
order="id DESC"
|
order="id DESC"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
default-mode="card"
|
|
||||||
auto-load
|
auto-load
|
||||||
:disable-option="{ table: true }"
|
:disable-option="{ card: true }"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
card-class="grid-two q-gutter-x-xl q-gutter-y-md q-pr-lg q-py-lg"
|
|
||||||
:is-editable="true"
|
:is-editable="true"
|
||||||
:use-model="true"
|
:use-model="true"
|
||||||
|
:right-search-icon="false"
|
||||||
@save-changes="(data) => reactivateWorker(data)"
|
@save-changes="(data) => reactivateWorker(data)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -112,6 +112,7 @@ const handlePhotoUpdated = (evt = false) => {
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv :label="t('globals.user')" :value="entity.user?.name" />
|
<VnLv :label="t('globals.user')" :value="entity.user?.name" />
|
||||||
<VnLv
|
<VnLv
|
||||||
|
class="ellipsis-text"
|
||||||
:label="t('globals.params.email')"
|
:label="t('globals.params.email')"
|
||||||
:value="entity.user?.emailUser?.email"
|
:value="entity.user?.emailUser?.email"
|
||||||
copy
|
copy
|
||||||
|
@ -178,6 +179,12 @@ const handlePhotoUpdated = (evt = false) => {
|
||||||
.photo {
|
.photo {
|
||||||
height: 256px;
|
height: 256px;
|
||||||
}
|
}
|
||||||
|
.ellipsis-text {
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
|
|
Loading…
Reference in New Issue