|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="data-page">
|
|
<div class="data-page">
|
|
|
<div class="data-header">
|
|
<div class="data-header">
|
|
|
- <div class="data-title">📋 客户池 - 共{{ customerStats.total }}家</div>
|
|
|
|
|
|
|
+ <div class="data-title">📋 客户池 - 共{{ customerStats.totalCustomerCount }}家</div>
|
|
|
<div style="display: flex; gap: 8px;">
|
|
<div style="display: flex; gap: 8px;">
|
|
|
<button class="btn btn-secondary"><i class="fas fa-download"></i> 导出</button>
|
|
<button class="btn btn-secondary"><i class="fas fa-download"></i> 导出</button>
|
|
|
<!-- <button class="btn btn-primary" @click="showAddModal = true"><i class="fas fa-plus"></i> 添加客户</button> -->
|
|
<!-- <button class="btn btn-primary" @click="showAddModal = true"><i class="fas fa-plus"></i> 添加客户</button> -->
|
|
@@ -12,46 +12,48 @@
|
|
|
<div class="stat-row">
|
|
<div class="stat-row">
|
|
|
<div class="stat-card-lg"> <!-- @click="filterTab = 'all'" -->
|
|
<div class="stat-card-lg"> <!-- @click="filterTab = 'all'" -->
|
|
|
<div class="stat-icon-lg blue"><i class="fas fa-users"></i></div>
|
|
<div class="stat-icon-lg blue"><i class="fas fa-users"></i></div>
|
|
|
- <div class="stat-content-lg"><h3>{{ customerStats.total }}</h3><p>总客户数</p></div>
|
|
|
|
|
|
|
+ <div class="stat-content-lg"><h3>{{ customerStats.totalCustomerCount }}</h3><p>总客户数</p></div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="stat-card-lg"><!-- @click="filterTab = 'prospect'" -->
|
|
<div class="stat-card-lg"><!-- @click="filterTab = 'prospect'" -->
|
|
|
<div class="stat-icon-lg purple"><i class="fas fa-user-clock"></i></div>
|
|
<div class="stat-icon-lg purple"><i class="fas fa-user-clock"></i></div>
|
|
|
- <div class="stat-content-lg"><h3>{{ customerStats.prospect }}</h3><p>潜在客户</p></div>
|
|
|
|
|
|
|
+ <div class="stat-content-lg"><h3>{{ customerStats.keyCustomerCount }}</h3><p>重点客户</p></div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="stat-card-lg"><!-- @click="filterTab = 'intent'" -->
|
|
<div class="stat-card-lg"><!-- @click="filterTab = 'intent'" -->
|
|
|
<div class="stat-icon-lg orange"><i class="fas fa-star"></i></div>
|
|
<div class="stat-icon-lg orange"><i class="fas fa-star"></i></div>
|
|
|
- <div class="stat-content-lg"><h3>{{ customerStats.intent }}</h3><p>意向客户</p></div>
|
|
|
|
|
|
|
+ <div class="stat-content-lg"><h3>{{ customerStats.dealCustomerCount }}</h3><p>成交客户</p></div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="stat-card-lg"><!-- @click="filterTab = 'deal'" -->
|
|
<div class="stat-card-lg"><!-- @click="filterTab = 'deal'" -->
|
|
|
<div class="stat-icon-lg green"><i class="fas fa-handshake"></i></div>
|
|
<div class="stat-icon-lg green"><i class="fas fa-handshake"></i></div>
|
|
|
- <div class="stat-content-lg"><h3>{{ customerStats.deal }}</h3><p>成交客户</p></div>
|
|
|
|
|
|
|
+ <div class="stat-content-lg"><h3>{{ customerStats.publicCustomerCount }}</h3><p>公海客户</p></div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="stat-card-lg"><!-- @click="filterTab = 'silent'" -->
|
|
<div class="stat-card-lg"><!-- @click="filterTab = 'silent'" -->
|
|
|
<div class="stat-icon-lg" style="background: rgba(148, 163, 184, 0.2); color: var(--text-secondary);"><i class="fas fa-moon"></i></div>
|
|
<div class="stat-icon-lg" style="background: rgba(148, 163, 184, 0.2); color: var(--text-secondary);"><i class="fas fa-moon"></i></div>
|
|
|
- <div class="stat-content-lg"><h3>{{ customerStats.silent }}</h3><p>沉默客户</p></div>
|
|
|
|
|
|
|
+ <div class="stat-content-lg"><h3>{{ customerStats.invalidCustomerCount }}</h3><p>无效客户</p></div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- Search & Filter -->
|
|
<!-- Search & Filter -->
|
|
|
- <div style="display: flex; gap: 16px; margin-bottom: 20px;">
|
|
|
|
|
- <div class="search-box" style="flex: 1;">
|
|
|
|
|
|
|
+ <div style="display: flex; gap: 16px; margin-bottom: 20px;width:100%;" class="filter-customer">
|
|
|
|
|
+ <div class="search-box" style="flex: 1;">
|
|
|
<i class="fas fa-search search-icon"></i>
|
|
<i class="fas fa-search search-icon"></i>
|
|
|
<input type="text" v-model="searchQuery" class="search-input" placeholder="搜索公司名称、联系人、邮箱..." @change="getCustomerData">
|
|
<input type="text" v-model="searchQuery" class="search-input" placeholder="搜索公司名称、联系人、邮箱..." @change="getCustomerData">
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="form-select">
|
|
|
|
|
- <el-cascader placeholder="区域名称" :options="region"
|
|
|
|
|
- v-model="regionValue" clearable filterable @change="getRegion" />
|
|
|
|
|
|
|
+ <div style="flex: 1;display: flex; gap: 16px;width:100%;" >
|
|
|
|
|
+ <div class="form-select">
|
|
|
|
|
+ <el-cascader placeholder="区域名称" :options="region"
|
|
|
|
|
+ v-model="regionValue" clearable filterable @change="getRegion" style="width: 100%;"/>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-select">
|
|
|
|
|
+ <el-select v-model="customerClassify" clearable placeholder="客户分类" @change="getCustomerData()">
|
|
|
|
|
+ <el-option label="公海客户" value="1" />
|
|
|
|
|
+ <el-option label="无效客户" value="2" />
|
|
|
|
|
+ <el-option label="重点客户" value="3" />
|
|
|
|
|
+ <el-option label="成交客户" value="4" />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div style="display: flex; gap: 16px; margin-bottom: 20px;width:100%;" class="filter-customer">
|
|
<div style="display: flex; gap: 16px; margin-bottom: 20px;width:100%;" class="filter-customer">
|
|
|
- <div class="form-select">
|
|
|
|
|
- <el-select v-model="customerClassify" clearable placeholder="客户分类" @change="getCustomerData()">
|
|
|
|
|
- <el-option label="公海客户" value="1" />
|
|
|
|
|
- <el-option label="无效客户" value="2" />
|
|
|
|
|
- <el-option label="重点客户" value="3" />
|
|
|
|
|
- <el-option label="成交客户" value="4" />
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </div>
|
|
|
|
|
<div class="form-select">
|
|
<div class="form-select">
|
|
|
<el-select v-model="customerParams.customerSourceDictValue" clearable placeholder="客户来源" @change="getCustomerData()">
|
|
<el-select v-model="customerParams.customerSourceDictValue" clearable placeholder="客户来源" @change="getCustomerData()">
|
|
|
<el-option label="搜索引擎(例:Google)" value="1" />
|
|
<el-option label="搜索引擎(例:Google)" value="1" />
|
|
@@ -193,7 +195,7 @@
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
import { ref, computed } from 'vue'
|
|
import { ref, computed } from 'vue'
|
|
|
-import { getCustomerList,getCustomerDetail,blocking } from '../api/customer'
|
|
|
|
|
|
|
+import { getCustomerList,getCustomerStats } from '../api/customer'
|
|
|
import {region} from '@/utils/region';
|
|
import {region} from '@/utils/region';
|
|
|
// 引入添加客户组件
|
|
// 引入添加客户组件
|
|
|
import AddCustomerModal from '../components/addCustomer.vue'
|
|
import AddCustomerModal from '../components/addCustomer.vue'
|
|
@@ -214,21 +216,18 @@ const aiContentLoading = ref(false)
|
|
|
const formattedText = ref('')
|
|
const formattedText = ref('')
|
|
|
const detailLoading = ref(false)
|
|
const detailLoading = ref(false)
|
|
|
|
|
|
|
|
-const customerParams = ref({
|
|
|
|
|
- customerStatusDictValue: '',
|
|
|
|
|
- customerTypeDictValue: '',
|
|
|
|
|
- customerLevelDictValue: '',
|
|
|
|
|
- customerSourceDictValue: ''
|
|
|
|
|
-})
|
|
|
|
|
const customerClassify = ref('')
|
|
const customerClassify = ref('')
|
|
|
|
|
|
|
|
-const customerStats = ref({
|
|
|
|
|
- total: 0,
|
|
|
|
|
- prospect: 0,
|
|
|
|
|
- intent: 0,
|
|
|
|
|
- deal: 0,
|
|
|
|
|
- silent: 0
|
|
|
|
|
-})
|
|
|
|
|
|
|
+const customerStats = ref({})
|
|
|
|
|
+
|
|
|
|
|
+const getStats = ()=>{
|
|
|
|
|
+ getCustomerStats({}).then(res => {
|
|
|
|
|
+ if(res.success){
|
|
|
|
|
+ customerStats.value = res.result
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+getStats()
|
|
|
|
|
|
|
|
const tabs = ref([
|
|
const tabs = ref([
|
|
|
{ key: 'all', label: '全部客户', count: 0 },
|
|
{ key: 'all', label: '全部客户', count: 0 },
|
|
@@ -244,26 +243,35 @@ const params = ref({
|
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
|
blurry:null,
|
|
blurry:null,
|
|
|
country:null,
|
|
country:null,
|
|
|
- ...customerParams.value
|
|
|
|
|
|
|
+})
|
|
|
|
|
+const customerParams = ref({
|
|
|
|
|
+ customerStatusDictValue: '',
|
|
|
|
|
+ customerTypeDictValue: '',
|
|
|
|
|
+ customerLevelDictValue: '',
|
|
|
|
|
+ customerSourceDictValue: ''
|
|
|
})
|
|
})
|
|
|
const getCustomer = (type) => {
|
|
const getCustomer = (type) => {
|
|
|
|
|
+ let paramsData = {
|
|
|
|
|
+ ...params.value,
|
|
|
|
|
+ ...customerParams.value
|
|
|
|
|
+ }
|
|
|
dataLoading.value= true
|
|
dataLoading.value= true
|
|
|
- params.value.blurry = searchQuery.value
|
|
|
|
|
|
|
+ paramsData.blurry = searchQuery.value
|
|
|
if(customerClassify.value == 1) {
|
|
if(customerClassify.value == 1) {
|
|
|
- params.hasPublicCustomer = 1
|
|
|
|
|
|
|
+ paramsData.hasPublicCustomer = 1
|
|
|
}else if(customerClassify.value == 2) {
|
|
}else if(customerClassify.value == 2) {
|
|
|
- params.hasGarbageCustomer = 1
|
|
|
|
|
|
|
+ paramsData.hasGarbageCustomer = 1
|
|
|
}else if(customerClassify.value == 3) {
|
|
}else if(customerClassify.value == 3) {
|
|
|
- params.hasFollowCustomer = 1
|
|
|
|
|
|
|
+ paramsData.hasFollowCustomer = 1
|
|
|
}else if(customerClassify.value == 4) {
|
|
}else if(customerClassify.value == 4) {
|
|
|
- params.hasOrderForm = 1
|
|
|
|
|
- params.hasPublicCustomer = 0
|
|
|
|
|
|
|
+ paramsData.hasOrderForm = 1
|
|
|
|
|
+ paramsData.hasPublicCustomer = 0
|
|
|
}
|
|
}
|
|
|
- getCustomerList(params.value).then(res => {
|
|
|
|
|
|
|
+ getCustomerList(paramsData).then(res => {
|
|
|
dataLoading.value= false
|
|
dataLoading.value= false
|
|
|
- if(type=='init'){ //页面初始记录客户总数量
|
|
|
|
|
- customerStats.value.total = res.result.total
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if(type=='init'){ //页面初始记录客户总数量
|
|
|
|
|
+ // customerStats.value.total = res.result.total
|
|
|
|
|
+ // }
|
|
|
customerTotal.value = tabs.value[0].count = res.result.total
|
|
customerTotal.value = tabs.value[0].count = res.result.total
|
|
|
customers.value = res.result.records
|
|
customers.value = res.result.records
|
|
|
})
|
|
})
|