fix(sale): 修复客户列表数据处理和统计数据获取逻辑
移除冗余注释并优化客户列表数据处理,防止空值异常 将统计数据的获取移至页面加载时执行,确保数据完整性
This commit is contained in:
1452
my-vue-app/pnpm-lock.yaml
generated
1452
my-vue-app/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -415,7 +415,6 @@ async function getTimeline() {
|
||||
value: parseInt(count) || 0
|
||||
}))
|
||||
}
|
||||
// 处理客户列表数据
|
||||
if (res.data.all_customers_list) {
|
||||
customersList.value = res.data.all_customers_list
|
||||
}
|
||||
@@ -639,7 +638,7 @@ const formattedCustomersList = computed(() => {
|
||||
return [];
|
||||
}
|
||||
|
||||
return customersList.value.map(customer => ({
|
||||
return customersList.value?.map(customer => ({
|
||||
id: customer.customer_name, // 使用客户姓名作为唯一标识
|
||||
name: customer.customer_name,
|
||||
phone: customer.phone,
|
||||
@@ -689,7 +688,7 @@ const selectContact = (id) => {
|
||||
// 当选中客户后,获取客户表单数据
|
||||
nextTick(async () => {
|
||||
if (selectedContact.value && selectedContact.value.name) {
|
||||
await getStatisticsData()
|
||||
|
||||
await getCustomerForm();
|
||||
await getCustomerChat();
|
||||
await getCustomerCall();
|
||||
@@ -949,6 +948,7 @@ onMounted(async () => {
|
||||
console.log('Sale页面缓存系统已初始化,缓存时长:', CACHE_DURATION / (1000 * 60), '分钟')
|
||||
|
||||
isPageLoading.value = true
|
||||
await getStatisticsData()
|
||||
await getCoreKpi()
|
||||
await CenterGetGoldContactTime()
|
||||
await CenterGetSalesFunnel()
|
||||
|
||||
Reference in New Issue
Block a user