0
0
Fork 0

fix: refs #6553 fix summary

This commit is contained in:
Carlos Satorres 2025-01-13 12:23:36 +01:00
parent b479ce83e0
commit 5a869f0722
3 changed files with 56 additions and 32 deletions

View File

@ -660,6 +660,8 @@ worker:
department: Departament
workerBusinessCategory: Worker Business Category
notes: Notes
workCenter: Center
professionalCategory: Professional Category
notificationsManager:
activeNotifications: Active notifications
availableNotifications: Available notifications

View File

@ -663,6 +663,8 @@ worker:
department: Departamento
workerBusinessCategory: Categoria profesional
notes: Notas
workCenter: Centro
professionalCategory: Categoria profesional
notificationsManager:
activeNotifications: Notificaciones activas
availableNotifications: Notificaciones disponibles

View File

@ -11,6 +11,7 @@ import VnTitle from 'src/components/common/VnTitle.vue';
import RoleDescriptorProxy from 'src/pages/Account/Role/Card/RoleDescriptorProxy.vue';
import DepartmentDescriptorProxy from 'src/pages/Department/Card/DepartmentDescriptorProxy.vue';
import { useAdvancedSummary } from 'src/composables/useAdvancedSummary';
import axios from 'axios';
const route = useRoute();
const { t } = useI18n();
@ -69,36 +70,52 @@ const filter = {
{
relation: 'sip',
},
// {
// relation: 'business',
// scope: {
// include: [
// {
// relation: 'department',
// scope: {
// fields: ['id', 'name'],
// },
// },
// {
// relation: 'reasonEnd',
// scope: {
// fields: ['id', 'reason'],
// },
// },
// {
// relation: 'workerBusinessProfessionalCategory',
// scope: {
// fields: ['id', 'description'],
// },
// },
// ],
// },
// },
{
relation: 'business',
scope: {
include: [
{
relation: 'department',
scope: {
fields: ['id', 'name'],
},
},
{
relation: 'reasonEnd',
scope: {
fields: ['id', 'reason'],
},
},
{
relation: 'workerBusinessProfessionalCategory',
scope: {
fields: ['id', 'description'],
},
},
],
},
},
],
};
let business = ref(null);
const workerCurrentBusiness = ref(null);
const businessCurrent = async () => {
await getWorker();
console.log('workerCurrentBusiness: ', workerCurrentBusiness.value);
const { data } = await axios.get(`Businesses/${workerCurrentBusiness.value}`, {});
business.value = data;
console.log('business: ', business.value);
};
const getWorker = async () => {
const { data } = await axios.get(`Workers/${entityId.value}`, {});
workerCurrentBusiness.value = data.businessFk;
return workerCurrentBusiness.value;
};
onBeforeMount(async () => {
advancedSummary.value = await useAdvancedSummary('Workers', entityId.value);
basicDataUrl.value = `#/worker/${entityId.value}/basic-data`;
businessCurrent();
});
</script>
@ -214,24 +231,27 @@ onBeforeMount(async () => {
:url="`#/worker/${entityId}/business`"
:text="t('worker.summary.business')"
/>
{{ worker.business }}
<VnLv
:label="t('worker.summary.started')"
:value="toDate(worker?.business[0]?.started)"
:value="toDate(business?.started)"
/>
<VnLv
:label="t('worker.summary.ended')"
:value="toDate(worker?.business[0]?.ended)"
:value="toDate(business?.ended)"
/>
<VnLv
:label="t('worker.summary.professionalCategory')"
:value="business?.WorkerBusinessProfessionalCategory?.description"
/>
<VnLv
:label="t('worker.summary.reasonEnd')"
:value="worker?.business[0]?.reasonEnd?.reason"
:value="business?.reasonEnd?.reason"
/>
<VnLv
:label="t('worker.summary.notes')"
:value="worker?.business[0]?.notes"
:label="t('worker.summary.workCenter')"
:value="business?.WorkCenter?.name"
/>
<VnLv :label="t('worker.summary.notes')" :value="business?.notes" />
</QCard>
</template>
</CardSummary>