fix(sale): 修复客户列表数据处理和统计数据获取逻辑

移除冗余注释并优化客户列表数据处理,防止空值异常
将统计数据的获取移至页面加载时执行,确保数据完整性
This commit is contained in:
2025-09-02 10:27:28 +08:00
parent d5792be702
commit e9a8605073
2 changed files with 775 additions and 683 deletions

1452
my-vue-app/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -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()