ref #6175 VnLinkPhone and MicroSIP icon created #87

Merged
jorgep merged 12 commits from 6175-addMicrosipLink into dev 2023-12-07 15:09:19 +00:00
9 changed files with 152 additions and 34 deletions
Showing only changes of commit 3a3ae14dc5 - Show all commits

View File

@ -0,0 +1,36 @@
<script setup>
import { useI18n } from 'vue-i18n';
const props = defineProps({
phoneNumber: { type: [String, Number], default: null },
icon: { type: Boolean, default: true },
showNumber: { type: Boolean, default: true },
schemeUrl: { type: String, default: 'tel' },
});
const { t } = useI18n();
</script>
<template>
<div v-if="props.phoneNumber">
jorgep marked this conversation as resolved Outdated

si este v-if lo pones bajo en el QBtn no usamos menos codigo y no usamos las variables mas de una vez, simplemente que muestre el botón o no. El resto igual

si este v-if lo pones bajo en el QBtn no usamos menos codigo y no usamos las variables mas de una vez, simplemente que muestre el botón o no. El resto igual
<span v-if="props.icon">
<span v-if="props.showNumber">
{{ props.phoneNumber }}
</span>
<QBtn
flat
round
:icon="'phone'"
size="sm"
class="q-ml-xs"
color="primary"
padding="none"
:href="`${props.schemeUrl}:${props.phoneNumber}`"
:title="t('globals.microsip')"
@click.stop
/>
</span>
<a v-else :href="`tel:${props.phoneNumber}`" class="link">
{{ props.phoneNumber }}
</a>
</div>
<span v-else>-</span>
</template>
<style scoped></style>

View File

@ -36,6 +36,7 @@ export default {
summary: {
basicData: 'Basic data',
},
microsip: 'Open in MicroSIP',
},
errors: {
statusUnauthorized: 'Access denied',

View File

@ -36,6 +36,7 @@ export default {
summary: {
basicData: 'Datos básicos',
},
microsip: 'Abrir en MicroSIP',
},
errors: {
statusUnauthorized: 'Acceso denegado',

View File

@ -6,6 +6,7 @@ import { toCurrency, toPercentage, toDate } from 'src/filters';
import CardSummary from 'components/ui/CardSummary.vue';
import { getUrl } from 'src/composables/getUrl';
import VnLv from 'src/components/ui/VnLv.vue';
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
const route = useRoute();
const { t } = useI18n();
@ -68,8 +69,26 @@ const creditWarning = computed(() => {
<VnLv :label="t('customer.summary.customerId')" :value="entity.id" />
<VnLv :label="t('customer.summary.name')" :value="entity.name" />
<VnLv :label="t('customer.summary.contact')" :value="entity.contact" />
<VnLv :label="t('customer.summary.phone')" :value="entity.phone" />
<VnLv :label="t('customer.summary.mobile')" :value="entity.mobile" />
<VnLv :value="entity.phone">
<template #label>
{{ t('customer.summary.phone') }}
<VnLinkPhone
:phone-number="entity.phone"
scheme-url="sip"
:show-number="false"
/>
</template>
</VnLv>
<VnLv :value="entity.mobile">
<template #label>
{{ t('customer.summary.mobile') }}
<VnLinkPhone
:phone-number="entity.mobile"
scheme-url="sip"
:show-number="false"
/>
</template>
</VnLv>
<VnLv :label="t('customer.summary.email')" :value="entity.email" />
<VnLv
:label="t('customer.summary.salesPerson')"

View File

@ -9,6 +9,7 @@ import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import CustomerFilter from './CustomerFilter.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import CardList from 'src/components/ui/CardList.vue';
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
const stateStore = useStateStore();
const router = useRouter();
@ -77,7 +78,14 @@ function viewSummary(id) {
<template #list-items>
<VnLv label="ID" :value="row.id" />
<VnLv :label="t('customer.list.email')" :value="row.email" />
<VnLv :label="t('customer.list.phone')" :value="row.phone" />
<VnLv :label="t('customer.list.phone')">
<template #value>
<VnLinkPhone
:phone-number="row.phone"
scheme-url="sip"
/>
</template>
</VnLv>
</template>
<template #actions>
<QBtn

View File

@ -8,6 +8,7 @@ import CardDescriptor from 'components/ui/CardDescriptor.vue';
import TicketDescriptorMenu from './TicketDescriptorMenu.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import useCardDescription from 'src/composables/useCardDescription';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
const $props = defineProps({
id: {

View File

@ -10,6 +10,7 @@ import FetchedTags from 'components/ui/FetchedTags.vue';
import InvoiceOutDescriptorProxy from 'pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
import WorkerDescriptorProxy from 'pages/Worker/Card/WorkerDescriptorProxy.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
import { getUrl } from 'src/composables/getUrl';
onUpdated(() => summaryRef.value.fetch());
@ -208,22 +209,38 @@ async function changeState(value) {
:value="toDate(ticket.landed)"
/>
<VnLv :label="t('ticket.summary.packages')" :value="ticket.packages" />
<VnLv
:label="t('ticket.summary.consigneePhone')"
:value="ticket.address.phone"
/>
<VnLv
:label="t('ticket.summary.consigneeMobile')"
:value="ticket.address.mobile"
/>
<VnLv
:label="t('ticket.summary.clientPhone')"
:value="ticket.client.phone"
/>
<VnLv
:label="t('ticket.summary.clientMobile')"
:value="ticket.client.mobile"
/>
<VnLv :label="t('ticket.summary.consigneePhone')">
<template #value>
<VnLinkPhone
:phone-number="ticket.address.phone"
scheme-url="sip"
/>
</template>
</VnLv>
<VnLv :label="t('ticket.summary.consigneeMobile')">
<template #value>
<VnLinkPhone
:phone-number="ticket.address.mobile"
scheme-url="sip"
/>
</template>
</VnLv>
<VnLv :label="t('ticket.summary.clientPhone')">
<template #value>
<VnLinkPhone
:phone-number="ticket.client.phone"
scheme-url="sip"
/>
</template>
</VnLv>
<VnLv :label="t('ticket.summary.clientMobile')">
<template #value>
<VnLinkPhone
:phone-number="ticket.client.mobile"
scheme-url="sip"
/>
</template>
</VnLv>
<VnLv
:label="t('ticket.summary.consignee')"
:value="formattedAddress()"

View File

@ -5,7 +5,9 @@ import { useI18n } from 'vue-i18n';
import { useSession } from 'src/composables/useSession';
import CardDescriptor from 'src/components/ui/CardDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
import useCardDescription from 'src/composables/useCardDescription';
const $props = defineProps({
id: {
type: Number,
@ -96,8 +98,27 @@ const setData = (entity) =>
:label="t('worker.list.department')"
:value="entity.department ? entity.department.department.name : null"
/>
<VnLv :label="t('worker.card.phone')" :value="entity.phone" />
<VnLv :label="t('worker.summary.sipExtension')" :value="sip" />
<VnLv :value="entity.phone">
<template #label>
{{ t('worker.card.phone') }}
<VnLinkPhone
:phone-number="entity.phone"
scheme-url="sip"
:show-number="false"
/>
</template>
</VnLv>
<VnLv :value="sip">
<template #label>
{{ t('worker.summary.sipExtension') }}
<VnLinkPhone
v-if="sip"
:phone-number="sip"
scheme-url="sip"
jorgep marked this conversation as resolved Outdated

en todos has puesto scheme-url="sip"
no puede esto ir en el componente?

en todos has puesto scheme-url="sip" no puede esto ir en el componente?

Crear un VnLinkPhoneSip?

Crear un VnLinkPhoneSip?

vnLinkPhone yo creo que ya es suficiente, no tendremos otro linkPhone en verdnatura que no sea sip

vnLinkPhone yo creo que ya es suficiente, no tendremos otro linkPhone en verdnatura que no sea sip

vale, pues lo pongo para que sea siempre en sip.

vale, pues lo pongo para que sea siempre en sip.
:show-number="false"
/>
</template>
</VnLv>
</template>
</CardDescriptor>
</template>

View File

@ -8,6 +8,7 @@ import { getUrl } from 'src/composables/getUrl';
import VnLv from 'src/components/ui/VnLv.vue';
import WorkerDescriptorProxy from './WorkerDescriptorProxy.vue';
import { dashIfEmpty } from 'src/filters';
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
const route = useRoute();
const { t } = useI18n();
@ -92,15 +93,27 @@ const filter = {
</span>
</template>
</VnLv>
<VnLv
:label="t('worker.summary.phoneExtension')"
:value="worker.mobileExtension"
/>
<VnLv :label="t('worker.summary.entPhone')" :value="worker.phone" />
<VnLv
:label="t('worker.summary.personalPhone')"
:value="worker.client.phone"
/>
<VnLv :label="t('worker.summary.phoneExtension')">
<template #value>
<VnLinkPhone
:phone-number="worker.mobileExtension"
scheme-url="sip"
/>
</template>
</VnLv>
<VnLv :label="t('worker.summary.entPhone')">
<template #value>
<VnLinkPhone :phone-number="worker.phone" scheme-url="sip" />
</template>
</VnLv>
<VnLv :label="t('worker.summary.personalPhone')">
<template #value>
<VnLinkPhone
:phone-number="worker.client.phone"
scheme-url="sip"
jorgep marked this conversation as resolved Outdated

scheme-url="sip"
no se puede poner en el componente para no repetirlo?

scheme-url="sip" no se puede poner en el componente para no repetirlo?
/>
</template>
</VnLv>
<VnLv :label="t('worker.summary.locker')" :value="worker.locker" />
</QCard>
<QCard class="vn-one">
@ -110,10 +123,11 @@ const filter = {
<VnLv :label="t('worker.summary.userId')" :value="worker.user.id" />
<VnLv :label="t('worker.card.name')" :value="worker.user.nickname" />
<VnLv :label="t('worker.summary.role')" :value="worker.user.role.name" />
<VnLv
:label="t('worker.summary.sipExtension')"
:value="worker?.sip?.extension"
/>
<VnLv :label="t('worker.summary.sipExtension')">
<template #value>
<VnLinkPhone :phone-number="worker?.sip?.extension" />
</template>
</VnLv>
</QCard>
</template>
</CardSummary>