1
0
forked from test/crm

fix: added icon for email/phone and formatted number to currency value in list view

This commit is contained in:
Shariq Ansari 2023-09-01 11:42:50 +05:30
parent 67480656a3
commit 142a583255
5 changed files with 33 additions and 7 deletions

View File

@ -13,7 +13,13 @@
</Tooltip>
</template>
<script setup>
import { dateFormat, timeAgo, dateTooltipFormat, htmlToText } from '@/utils'
import {
dateFormat,
timeAgo,
dateTooltipFormat,
htmlToText,
formatNumberIntoCurrency,
} from '@/utils'
import { Tooltip } from 'frappe-ui'
import { computed } from 'vue'
@ -47,6 +53,9 @@ const label = computed(() => {
if (props.type === 'html') {
return htmlToText(props.value?.toString())
}
if (props.type === 'currency') {
return formatNumberIntoCurrency(props.value)
}
return props.value?.toString()
})
</script>

View File

@ -75,6 +75,12 @@
class="h-3 w-3"
/>
</div>
<div v-else-if="column.type === 'email'">
<FeatherIcon name="mail" class="h-3 w-3" />
</div>
<div v-else-if="column.type === 'phone'">
<FeatherIcon name="phone" class="h-3 w-3" />
</div>
</template>
<div v-if="column.type === 'badge'">
<Badge

View File

@ -147,7 +147,7 @@ const columns = [
{
label: 'Amount',
key: 'annual_revenue',
type: 'data',
type: 'currency',
size: 'w-24',
},
{
@ -166,7 +166,7 @@ const columns = [
label: 'Mobile no',
key: 'mobile_no',
type: 'phone',
size: 'w-32',
size: 'w-36',
},
{
label: 'Lead owner',

View File

@ -153,25 +153,25 @@ const columns = [
label: 'Organization',
key: 'organization_name',
type: 'logo',
size: 'w-40',
size: 'w-36',
},
{
label: 'Status',
key: 'status',
type: 'indicator',
size: 'w-36',
size: 'w-32',
},
{
label: 'Email',
key: 'email',
type: 'email',
size: 'w-40',
size: 'w-44',
},
{
label: 'Mobile no',
key: 'mobile_no',
type: 'phone',
size: 'w-32',
size: 'w-36',
},
{
label: 'Lead owner',

View File

@ -122,3 +122,14 @@ export function secondsToDuration(seconds) {
}
return `${hours}h ${minutes}m ${_seconds}s`
}
export function formatNumberIntoCurrency(value) {
if (value) {
return value.toLocaleString('en-IN', {
maximumFractionDigits: 2,
style: 'currency',
currency: 'INR',
})
}
return ''
}