forked from verdnatura/salix-front
ref #6175 simplify the component
This commit is contained in:
parent
48b4fd96e5
commit
e4efffb336
|
@ -2,34 +2,21 @@
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
phoneNumber: { type: [String, Number], default: null },
|
phoneNumber: { type: [String, Number], default: null },
|
||||||
icon: { type: Boolean, default: true },
|
|
||||||
showNumber: { type: Boolean, default: true },
|
|
||||||
});
|
});
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div v-if="props.phoneNumber">
|
|
||||||
<span v-if="props.icon">
|
|
||||||
<span v-if="props.showNumber">
|
|
||||||
{{ props.phoneNumber }}
|
|
||||||
</span>
|
|
||||||
<QBtn
|
<QBtn
|
||||||
|
v-if="props.phoneNumber"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
:icon="'phone'"
|
icon="phone"
|
||||||
size="sm"
|
size="sm"
|
||||||
class="q-ml-xs"
|
|
||||||
color="primary"
|
color="primary"
|
||||||
padding="none"
|
padding="xs"
|
||||||
:href="`sip:${props.phoneNumber}`"
|
:href="`sip:${props.phoneNumber}`"
|
||||||
:title="t('globals.microsip')"
|
:title="t('globals.microsip')"
|
||||||
@click.stop
|
@click.stop
|
||||||
/>
|
/>
|
||||||
</span>
|
|
||||||
<a v-else :href="`tel:${props.phoneNumber}`" class="link">
|
|
||||||
{{ props.phoneNumber }}
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<span v-else>-</span>
|
|
||||||
</template>
|
</template>
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
|
|
@ -72,13 +72,13 @@ const creditWarning = computed(() => {
|
||||||
<VnLv :value="entity.phone">
|
<VnLv :value="entity.phone">
|
||||||
<template #label>
|
<template #label>
|
||||||
{{ t('customer.summary.phone') }}
|
{{ t('customer.summary.phone') }}
|
||||||
<VnLinkPhone :phone-number="entity.phone" :show-number="false" />
|
<VnLinkPhone :phone-number="entity.phone" />
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :value="entity.mobile">
|
<VnLv :value="entity.mobile">
|
||||||
<template #label>
|
<template #label>
|
||||||
{{ t('customer.summary.mobile') }}
|
{{ t('customer.summary.mobile') }}
|
||||||
<VnLinkPhone :phone-number="entity.mobile" :show-number="false" />
|
<VnLinkPhone :phone-number="entity.mobile" />
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :label="t('customer.summary.email')" :value="entity.email" />
|
<VnLv :label="t('customer.summary.email')" :value="entity.email" />
|
||||||
|
|
|
@ -10,6 +10,7 @@ import CustomerFilter from './CustomerFilter.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import CardList from 'src/components/ui/CardList.vue';
|
import CardList from 'src/components/ui/CardList.vue';
|
||||||
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
|
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
|
||||||
|
import { dashIfEmpty } from 'src/filters';
|
||||||
|
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
@ -80,6 +81,7 @@ function viewSummary(id) {
|
||||||
<VnLv :label="t('customer.list.email')" :value="row.email" />
|
<VnLv :label="t('customer.list.email')" :value="row.email" />
|
||||||
<VnLv :label="t('customer.list.phone')">
|
<VnLv :label="t('customer.list.phone')">
|
||||||
<template #value>
|
<template #value>
|
||||||
|
{{ dashIfEmpty(row.phone) }}
|
||||||
<VnLinkPhone :phone-number="row.phone" />
|
<VnLinkPhone :phone-number="row.phone" />
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
|
|
|
@ -181,7 +181,7 @@ async function changeState(value) {
|
||||||
<VnLv :label="t('ticket.summary.route')" :value="ticket.routeFk" />
|
<VnLv :label="t('ticket.summary.route')" :value="ticket.routeFk" />
|
||||||
<VnLv :label="t('ticket.summary.invoice')">
|
<VnLv :label="t('ticket.summary.invoice')">
|
||||||
<template #value>
|
<template #value>
|
||||||
<span class="link">
|
<span :class="{ link: ticket.refFk }">
|
||||||
{{ dashIfEmpty(ticket.refFk) }}
|
{{ dashIfEmpty(ticket.refFk) }}
|
||||||
<InvoiceOutDescriptorProxy
|
<InvoiceOutDescriptorProxy
|
||||||
:id="ticket.id"
|
:id="ticket.id"
|
||||||
|
@ -211,21 +211,25 @@ async function changeState(value) {
|
||||||
<VnLv :label="t('ticket.summary.packages')" :value="ticket.packages" />
|
<VnLv :label="t('ticket.summary.packages')" :value="ticket.packages" />
|
||||||
<VnLv :label="t('ticket.summary.consigneePhone')">
|
<VnLv :label="t('ticket.summary.consigneePhone')">
|
||||||
<template #value>
|
<template #value>
|
||||||
|
{{ dashIfEmpty(ticket.address.phone) }}
|
||||||
<VnLinkPhone :phone-number="ticket.address.phone" />
|
<VnLinkPhone :phone-number="ticket.address.phone" />
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :label="t('ticket.summary.consigneeMobile')">
|
<VnLv :label="t('ticket.summary.consigneeMobile')">
|
||||||
<template #value>
|
<template #value>
|
||||||
|
{{ dashIfEmpty(ticket.address.mobile) }}
|
||||||
<VnLinkPhone :phone-number="ticket.address.mobile" />
|
<VnLinkPhone :phone-number="ticket.address.mobile" />
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :label="t('ticket.summary.clientPhone')">
|
<VnLv :label="t('ticket.summary.clientPhone')">
|
||||||
<template #value>
|
<template #value>
|
||||||
|
{{ dashIfEmpty(ticket.client.phone) }}
|
||||||
<VnLinkPhone :phone-number="ticket.client.phone" />
|
<VnLinkPhone :phone-number="ticket.client.phone" />
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :label="t('ticket.summary.clientMobile')">
|
<VnLv :label="t('ticket.summary.clientMobile')">
|
||||||
<template #value>
|
<template #value>
|
||||||
|
{{ dashIfEmpty(ticket.client.mobile) }}
|
||||||
<VnLinkPhone :phone-number="ticket.client.mobile" />
|
<VnLinkPhone :phone-number="ticket.client.mobile" />
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
|
|
|
@ -101,13 +101,13 @@ const setData = (entity) =>
|
||||||
<VnLv :value="entity.phone">
|
<VnLv :value="entity.phone">
|
||||||
<template #label>
|
<template #label>
|
||||||
{{ t('worker.card.phone') }}
|
{{ t('worker.card.phone') }}
|
||||||
<VnLinkPhone :phone-number="entity.phone" :show-number="false" />
|
<VnLinkPhone :phone-number="entity.phone" />
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :value="sip">
|
<VnLv :value="sip">
|
||||||
<template #label>
|
<template #label>
|
||||||
{{ t('worker.summary.sipExtension') }}
|
{{ t('worker.summary.sipExtension') }}
|
||||||
<VnLinkPhone v-if="sip" :phone-number="sip" :show-number="false" />
|
<VnLinkPhone v-if="sip" :phone-number="sip" />
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -95,16 +95,19 @@ const filter = {
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :label="t('worker.summary.phoneExtension')">
|
<VnLv :label="t('worker.summary.phoneExtension')">
|
||||||
<template #value>
|
<template #value>
|
||||||
|
{{ dashIfEmpty(worker.mobileExtension) }}
|
||||||
<VnLinkPhone :phone-number="worker.mobileExtension" />
|
<VnLinkPhone :phone-number="worker.mobileExtension" />
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :label="t('worker.summary.entPhone')">
|
<VnLv :label="t('worker.summary.entPhone')">
|
||||||
<template #value>
|
<template #value>
|
||||||
|
{{ dashIfEmpty(worker.phone) }}
|
||||||
<VnLinkPhone :phone-number="worker.phone" />
|
<VnLinkPhone :phone-number="worker.phone" />
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :label="t('worker.summary.personalPhone')">
|
<VnLv :label="t('worker.summary.personalPhone')">
|
||||||
<template #value>
|
<template #value>
|
||||||
|
{{ dashIfEmpty(worker.client.phone) }}
|
||||||
<VnLinkPhone :phone-number="worker.client.phone" />
|
<VnLinkPhone :phone-number="worker.client.phone" />
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
|
@ -119,6 +122,7 @@ const filter = {
|
||||||
<VnLv :label="t('worker.summary.role')" :value="worker.user.role.name" />
|
<VnLv :label="t('worker.summary.role')" :value="worker.user.role.name" />
|
||||||
<VnLv :label="t('worker.summary.sipExtension')">
|
<VnLv :label="t('worker.summary.sipExtension')">
|
||||||
<template #value>
|
<template #value>
|
||||||
|
{{ dashIfEmpty(worker?.sip?.extension) }}
|
||||||
<VnLinkPhone :phone-number="worker?.sip?.extension" />
|
<VnLinkPhone :phone-number="worker?.sip?.extension" />
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
|
|
Loading…
Reference in New Issue