diff --git a/frontend/src/views/desktop/CustomerManage.vue b/frontend/src/views/desktop/CustomerManage.vue index 4db2c65..f5569d8 100644 --- a/frontend/src/views/desktop/CustomerManage.vue +++ b/frontend/src/views/desktop/CustomerManage.vue @@ -36,6 +36,12 @@ const feeCustomUnit = ref('') const detailVisible = ref(false) const detailCustomer = ref(null) +const detailActiveTab = ref('visits') +const detailVisits = ref([]) +const detailPlans = ref([]) +const detailMini = ref([]) +const detailKeyVisits = ref([]) +const detailLoading = ref(false) const managers = ref([]) const selectedIds = ref([]) @@ -205,7 +211,30 @@ function mgrTextColor(name: string) { } async function openDetail(customer: any) { - try { const res = await customersApi.get(customer.id); detailCustomer.value = res.data; detailVisible.value = true } catch (_) {} + try { + const res = await customersApi.get(customer.id) + detailCustomer.value = res.data + detailActiveTab.value = 'visits' + detailVisible.value = true + loadDetailData(customer.id) + } catch (_) {} +} + +async function loadDetailData(customerId: string) { + detailLoading.value = true + try { + const [visits, plans, mini, keyVisits] = await Promise.all([ + api.get('/visits/', { params: { customer_id: customerId } }), + api.get('/work-plans/', { params: { customer_id: customerId } }), + api.get('/mini-business/', { params: { customer_id: customerId } }), + api.get('/key-visits/', { params: { customer_id: customerId } }), + ]) + detailVisits.value = Array.isArray(visits.data) ? visits.data : (visits.data.items || []) + detailPlans.value = Array.isArray(plans.data) ? plans.data : (plans.data.items || []) + detailMini.value = Array.isArray(mini.data) ? mini.data : (mini.data.items || []) + detailKeyVisits.value = Array.isArray(keyVisits.data) ? keyVisits.data : (keyVisits.data.items || []) + } catch (_) {} + finally { detailLoading.value = false } } async function handleDelete(customer: any) { @@ -403,25 +432,73 @@ async function handleImport() { - - + + +
+ 行业:{{ detailCustomer.industry || '-' }} + | + 地址:{{ detailCustomer.address || '-' }} + | + 费用:{{ detailCustomer.monthly_fee || '-' }} + | + 客户经理:{{ detailCustomer.primary_manager_name || '-' }} +
+
+ 在用业务:{{ detailCustomer.in_use_services }} +
+
+ 联系人:{{ detailCustomer.contacts.map((c:any) => c.name + (c.phone ? ' '+c.phone : '')).join('、') }} +
+ + + + +
+ + + + + + +
暂无拜访记录
+
+
+ +
+ + + + + + +
暂无工作计划
+
+
+ +
+ + + + + + + +
暂无商机记录
+
+
+ +
+ + + + + + +
暂不要客记录
+
+
+
+