zhujing 2 долоо хоног өмнө
parent
commit
d8b43bddff

+ 2 - 0
ui/smarttrade-platform/src/api/customer/index.js

@@ -4,4 +4,6 @@ export const getCustomerList = (data = {}) => post('/router/rest/customerTrade/l
 
 export const getCustomerDetail = (params = {}) => get('/router/rest/customerTrade/getById', params)
 
+export const getCustomerStats = (params = {}) => get('/router/rest/customerTrade/stats', params)
+
 export const blocking = (data = {}) => post('/router/rest/chat/blocking', data,{ timeout: 90000 })

+ 10 - 2
ui/smarttrade-platform/src/assets/styles/customer.css

@@ -17,7 +17,13 @@
 .form-select { background: var(--bg-card); border: none; color: var(--text-primary);width: auto;padding: 0; }
 .form-select :deep(.el-input__wrapper){ background: var(--bg-card);box-shadow:none;border: 1px solid var(--border);border-radius: 8px;padding: 3px 10px;}
 .form-select :deep(.el-input__wrapper .el-input__inner){color:#fff;}
-.form-select :deep(.el-input__wrapper .el-input__inner::placeholder){color:#64748b;}
+.form-select :deep(.el-input__wrapper .el-input__inner::placeholder),
+.filter-customer :deep(.el-select__placeholder.is-transparent){
+  color:#64748b;
+}
+.filter-customer :deep(.el-select__placeholder){
+  color:#fff;
+}
 .filter-customer .form-select{
   flex: 1;
 }
@@ -26,7 +32,7 @@
 .filter-customer :deep(.el-select .el-select__wrapper),
 .filter-customer :deep(.el-input-number__wrapper),
 .filter-customer :deep(.el-date-editor.el-input__wrapper) {
-    background: var(--bg-dark);
+    background: var(--bg-card);
     border: 1px solid var(--border);
     box-shadow: none;
     border-radius: 8px;
@@ -34,6 +40,8 @@
     width: 100%;
     box-sizing: border-box;
     min-width: 0;
+    color:#fff;
+    height: 38px;
 }
 .customer-card { display: flex; align-items: center; gap: 16px; padding: 16px; background: var(--bg-card); border-radius: 12px; margin-bottom: 12px; border: 1px solid var(--border); cursor: pointer; transition: all 0.2s; }
 .customer-card:hover { border-color: var(--primary); }

+ 52 - 44
ui/smarttrade-platform/src/views/CustomersView.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="data-page">
     <div class="data-header">
-      <div class="data-title">📋 客户池 - 共{{ customerStats.total }}家</div>
+      <div class="data-title">📋 客户池 - 共{{ customerStats.totalCustomerCount }}家</div>
       <div style="display: flex; gap: 8px;">
         <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> -->
@@ -12,46 +12,48 @@
     <div class="stat-row">
       <div class="stat-card-lg"> <!-- @click="filterTab = 'all'" -->
         <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 class="stat-card-lg"><!-- @click="filterTab = 'prospect'" -->
         <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 class="stat-card-lg"><!-- @click="filterTab = 'intent'" -->
         <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 class="stat-card-lg"><!-- @click="filterTab = 'deal'" -->
         <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 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-content-lg"><h3>{{ customerStats.silent }}</h3><p>沉默客户</p></div>
+        <div class="stat-content-lg"><h3>{{ customerStats.invalidCustomerCount }}</h3><p>无效客户</p></div>
       </div>
     </div>
 
     <!-- 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>
         <input type="text" v-model="searchQuery" class="search-input" placeholder="搜索公司名称、联系人、邮箱..." @change="getCustomerData">
       </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 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">
           <el-select v-model="customerParams.customerSourceDictValue" clearable placeholder="客户来源" @change="getCustomerData()">
               <el-option label="搜索引擎(例:Google)" value="1" />
@@ -193,7 +195,7 @@
 
 <script setup>
 import { ref, computed } from 'vue'
-import { getCustomerList,getCustomerDetail,blocking } from '../api/customer'
+import { getCustomerList,getCustomerStats } from '../api/customer'
 import {region} from '@/utils/region';
 // 引入添加客户组件
 import AddCustomerModal from '../components/addCustomer.vue'
@@ -214,21 +216,18 @@ const aiContentLoading = ref(false)
 const formattedText = ref('')
 const detailLoading = ref(false)
 
-const customerParams = ref({
-    customerStatusDictValue: '',
-    customerTypeDictValue: '',
-    customerLevelDictValue: '',
-    customerSourceDictValue: ''
-})
 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([
   { key: 'all', label: '全部客户', count: 0 },
@@ -244,26 +243,35 @@ const params = ref({
   pageSize: 10,
   blurry:null,
   country:null,
-  ...customerParams.value
+})
+const customerParams = ref({
+    customerStatusDictValue: '',
+    customerTypeDictValue: '',
+    customerLevelDictValue: '',
+    customerSourceDictValue: ''
 })
 const getCustomer = (type) => {
+    let paramsData = {
+      ...params.value,
+      ...customerParams.value
+    }
     dataLoading.value= true
-    params.value.blurry = searchQuery.value
+    paramsData.blurry = searchQuery.value
     if(customerClassify.value == 1) {
-        params.hasPublicCustomer = 1
+        paramsData.hasPublicCustomer = 1
     }else if(customerClassify.value == 2) {
-        params.hasGarbageCustomer = 1
+        paramsData.hasGarbageCustomer = 1
     }else if(customerClassify.value == 3) {
-        params.hasFollowCustomer = 1
+        paramsData.hasFollowCustomer = 1
     }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
-    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
     customers.value = res.result.records
   })