fix: show sla details on deal list view
This commit is contained in:
parent
78b9353735
commit
562200cd4c
@ -135,6 +135,9 @@ class CRMDeal(Document):
|
|||||||
"email",
|
"email",
|
||||||
"mobile_no",
|
"mobile_no",
|
||||||
"deal_owner",
|
"deal_owner",
|
||||||
|
"sla_status",
|
||||||
|
"first_response_time",
|
||||||
|
"first_responded_on",
|
||||||
"modified",
|
"modified",
|
||||||
]
|
]
|
||||||
return {'columns': columns, 'rows': rows}
|
return {'columns': columns, 'rows': rows}
|
||||||
|
|||||||
@ -44,9 +44,31 @@
|
|||||||
<PhoneIcon class="h-4 w-4" />
|
<PhoneIcon class="h-4 w-4" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<div v-if="['modified', 'creation'].includes(column.key)" class="truncate text-base">
|
<div
|
||||||
|
v-if="
|
||||||
|
[
|
||||||
|
'modified',
|
||||||
|
'creation',
|
||||||
|
'first_response_time',
|
||||||
|
'first_responded_on',
|
||||||
|
].includes(column.key)
|
||||||
|
"
|
||||||
|
class="truncate text-base"
|
||||||
|
>
|
||||||
{{ item.timeAgo }}
|
{{ item.timeAgo }}
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
v-else-if="column.key === 'sla_status'"
|
||||||
|
class="truncate text-base"
|
||||||
|
>
|
||||||
|
<Badge
|
||||||
|
v-if="item.label"
|
||||||
|
:variant="'subtle'"
|
||||||
|
:theme="item.color"
|
||||||
|
size="md"
|
||||||
|
:label="item.label"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<div v-else-if="column.type === 'Check'">
|
<div v-else-if="column.type === 'Check'">
|
||||||
<FormControl
|
<FormControl
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
@ -74,6 +96,7 @@ import {
|
|||||||
ListRowItem,
|
ListRowItem,
|
||||||
ListSelectBanner,
|
ListSelectBanner,
|
||||||
FormControl,
|
FormControl,
|
||||||
|
Badge,
|
||||||
} from 'frappe-ui'
|
} from 'frappe-ui'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|||||||
@ -71,6 +71,7 @@ import {
|
|||||||
dateTooltipFormat,
|
dateTooltipFormat,
|
||||||
timeAgo,
|
timeAgo,
|
||||||
formatNumberIntoCurrency,
|
formatNumberIntoCurrency,
|
||||||
|
formatTime,
|
||||||
} from '@/utils'
|
} from '@/utils'
|
||||||
import {
|
import {
|
||||||
FeatherIcon,
|
FeatherIcon,
|
||||||
@ -154,6 +155,16 @@ const rows = computed(() => {
|
|||||||
label: deal.status,
|
label: deal.status,
|
||||||
color: getDealStatus(deal.status)?.iconColorClass,
|
color: getDealStatus(deal.status)?.iconColorClass,
|
||||||
}
|
}
|
||||||
|
} else if (row == 'sla_status') {
|
||||||
|
_rows[row] = {
|
||||||
|
label: deal.sla_status,
|
||||||
|
color:
|
||||||
|
deal.sla_status === 'Failed'
|
||||||
|
? 'red'
|
||||||
|
: deal.sla_status === 'Fulfilled'
|
||||||
|
? 'green'
|
||||||
|
: 'gray',
|
||||||
|
}
|
||||||
} else if (row == 'deal_owner') {
|
} else if (row == 'deal_owner') {
|
||||||
_rows[row] = {
|
_rows[row] = {
|
||||||
label: deal.deal_owner && getUser(deal.deal_owner).full_name,
|
label: deal.deal_owner && getUser(deal.deal_owner).full_name,
|
||||||
@ -164,6 +175,17 @@ const rows = computed(() => {
|
|||||||
label: dateFormat(deal[row], dateTooltipFormat),
|
label: dateFormat(deal[row], dateTooltipFormat),
|
||||||
timeAgo: timeAgo(deal[row]),
|
timeAgo: timeAgo(deal[row]),
|
||||||
}
|
}
|
||||||
|
} else if (['first_response_time', 'first_responded_on'].includes(row)) {
|
||||||
|
_rows[row] = {
|
||||||
|
label: deal.first_responded_on
|
||||||
|
? dateFormat(deal.first_responded_on, dateTooltipFormat)
|
||||||
|
: '',
|
||||||
|
timeAgo: deal[row]
|
||||||
|
? row == 'first_responded_on'
|
||||||
|
? timeAgo(deal[row])
|
||||||
|
: formatTime(deal[row])
|
||||||
|
: '',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return _rows
|
return _rows
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user