0
0
Fork 0

Merge pull request '#6938 rollback phone' (!355) from 6938-hotfix-rollbackHidePhone into master

Reviewed-on: verdnatura/salix-front#355
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
Jorge Penadés 2024-05-07 10:44:05 +00:00
commit 095e62ebac
3 changed files with 69 additions and 9 deletions

View File

@ -27,7 +27,6 @@ const workerFilter = {
},
{ relation: 'sip', scope: { fields: ['extension', 'secret'] } },
{ relation: 'department', scope: { include: { relation: 'department' } } },
{ relation: 'client', scope: {fields:['phone']} },
],
};
const workersFilter = {
@ -87,7 +86,6 @@ const maritalStatus = [
:label="t('Mobile extension')"
clearable
/>
<VnInput v-model="data.client.phone" :label="t('Personal phone')" clearable />
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
@ -159,7 +157,6 @@ es:
Last name: Apellidos
Business phone: Teléfono de empresa
Mobile extension: Extensión móvil
Personal phone: Teléfono personal
Boss: Jefe
Marital status: Estado civil
Married: Casado/a

View File

@ -31,7 +31,29 @@ const entityId = computed(() => {
});
const worker = ref();
const filter = { where: { id: entityId } };
const filter = {
include: [
{
relation: 'user',
scope: {
fields: ['email', 'name', 'nickname'],
},
},
{
relation: 'department',
scope: {
include: [
{
relation: 'department',
},
],
},
},
{
relation: 'sip',
},
],
};
const sip = ref(null);
@ -60,7 +82,7 @@ const setData = (entity) => {
<CardDescriptor
module="Worker"
data-key="workerData"
url="Workers/summary"
:url="`Workers/${entityId}`"
:filter="filter"
:title="data.title"
:subtitle="data.subtitle"

View File

@ -10,7 +10,7 @@ import CardSummary from 'components/ui/CardSummary.vue';
import VnUserLink from 'src/components/ui/VnUserLink.vue';
import VnTitle from 'src/components/common/VnTitle.vue';
const { params } = useRoute();
const route = useRoute();
const { t } = useI18n();
const $props = defineProps({
@ -20,18 +20,53 @@ const $props = defineProps({
},
});
const entityId = computed(() => $props.id || params.id);
const entityId = computed(() => $props.id || route.params.id);
const workerUrl = ref();
onMounted(async () => {
workerUrl.value = (await getUrl('')) + `worker/${entityId.value}/`;
});
const filter = { where: { id: entityId.value } };
const filter = {
include: [
{
relation: 'user',
scope: {
fields: ['email', 'name', 'nickname', 'roleFk'],
include: {
relation: 'role',
scope: {
fields: ['name'],
},
},
},
},
{
relation: 'department',
scope: {
include: {
relation: 'department',
scope: {
fields: ['name'],
},
},
},
},
{
relation: 'boss',
},
{
relation: 'client',
},
{
relation: 'sip',
},
],
};
</script>
<template>
<CardSummary ref="summary" :url="`Workers/summary`" :filter="filter">
<CardSummary ref="summary" :url="`Workers/${entityId}`" :filter="filter">
<template #header="{ entity }">
<div>{{ entity.id }} - {{ entity.firstName }} {{ entity.lastName }}</div>
</template>
@ -68,6 +103,12 @@ const filter = { where: { id: entityId.value } };
<VnLinkPhone :phone-number="worker.phone" />
</template>
</VnLv>
<VnLv :value="worker.client?.phone">
<template #label>
{{ t('worker.summary.personalPhone') }}
<VnLinkPhone :phone-number="worker.client?.phone" />
</template>
</VnLv>
<VnLv :label="t('worker.summary.locker')" :value="worker.locker" />
</QCard>
<QCard class="vn-one">