Skip to content

Commit a401fff

Browse files
committed
✨ CRM:完成客户的分配接入
1 parent 4362251 commit a401fff

File tree

13 files changed

+224
-95
lines changed

13 files changed

+224
-95
lines changed

src/api/crm/backlog/index.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
11
import request from '@/config/axios'
22
// TODO 芋艿:融合下
33

4-
// 1. 获得今日需联系客户数量
5-
export const getTodayCustomerCount = async () => {
6-
return await request.get({ url: '/crm/customer/today-customer-count' })
7-
}
8-
94
// 3. 获得分配给我的客户数量
105
export const getFollowCustomerCount = async () => {
116
return await request.get({ url: '/crm/customer/follow-customer-count' })
127
}
138

14-
// 4. 获得待进入公海的客户数量
15-
export const getPutInPoolCustomerRemindCount = async () => {
16-
return await request.get({ url: '/crm/customer/put-in-pool-remind-count' })
17-
}
18-
199
// 5. 获得待审核合同数量
2010
export const getCheckContractCount = async () => {
2111
return await request.get({ url: '/crm/contract/check-contract-count' })

src/api/crm/customer/index.ts

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,26 @@ export const getCustomerPage = async (params) => {
3535
return await request.get({ url: `/crm/customer/page`, params })
3636
}
3737

38+
// 进入公海客户提醒的客户列表
39+
export const getPutPoolRemindCustomerPage = async (params) => {
40+
return await request.get({ url: `/crm/customer/put-pool-remind-page`, params })
41+
}
42+
43+
// 获得待进入公海客户数量
44+
export const getPutPoolRemindCustomerCount = async () => {
45+
return await request.get({ url: `/crm/customer/put-pool-remind-count` })
46+
}
47+
48+
// 获得今日需联系客户数量
49+
export const getTodayContactCustomerCount = async () => {
50+
return await request.get({ url: `/crm/customer/today-contact-count` })
51+
}
52+
53+
// 获得分配给我、待跟进的线索数量的客户数量
54+
export const getFollowCustomerCount = async () => {
55+
return await request.get({ url: `/crm/customer/follow-count` })
56+
}
57+
3858
// 查询客户详情
3959
export const getCustomer = async (id: number) => {
4060
return await request.get({ url: `/crm/customer/get?id=` + id })
@@ -71,8 +91,8 @@ export const importCustomerTemplate = () => {
7191
}
7292

7393
// 客户列表
74-
export const getSimpleCustomerList = async () => {
75-
return await request.get({ url: `/crm/customer/list-all-simple` })
94+
export const getCustomerSimpleList = async () => {
95+
return await request.get({ url: `/crm/customer/simple-list` })
7696
}
7797

7898
// ======================= 业务操作 =======================
@@ -98,12 +118,15 @@ export const receiveCustomer = async (ids: any[]) => {
98118
return await request.put({ url: '/crm/customer/receive', params: { ids: ids.join(',') } })
99119
}
100120

121+
// 分配公海给对应负责人
122+
export const distributeCustomer = async (ids: any[], ownerUserId: number) => {
123+
return await request.put({
124+
url: '/crm/customer/distribute',
125+
data: { ids: ids, ownerUserId }
126+
})
127+
}
128+
101129
// 客户放入公海
102130
export const putCustomerPool = async (id: number) => {
103131
return await request.put({ url: `/crm/customer/put-pool?id=${id}` })
104132
}
105-
106-
// 进入公海客户提醒
107-
export const getPutInPoolRemindCustomerPage = async (params) => {
108-
return await request.get({ url: `/crm/customer/put-in-pool-remind-page`, params })
109-
}

src/views/crm/backlog/tables/FollowCustomer.vue renamed to src/views/crm/backlog/components/CustomerFollowList.vue

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,32 +31,31 @@
3131
<!-- 列表 -->
3232
<ContentWrap>
3333
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true">
34-
<el-table-column align="center" label="编号" prop="id" />
35-
<el-table-column align="center" label="客户名称" prop="name" width="160">
34+
<el-table-column align="center" label="客户名称" fixed="left" prop="name" width="160">
3635
<template #default="scope">
3736
<el-link :underline="false" type="primary" @click="openDetail(scope.row.id)">
3837
{{ scope.row.name }}
3938
</el-link>
4039
</template>
4140
</el-table-column>
42-
<el-table-column align="center" label="手机" prop="mobile" width="120" />
43-
<el-table-column align="center" label="电话" prop="telephone" width="120" />
4441
<el-table-column align="center" label="客户来源" prop="source" width="100">
4542
<template #default="scope">
4643
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_SOURCE" :value="scope.row.source" />
4744
</template>
4845
</el-table-column>
49-
<el-table-column align="center" label="所属行业" prop="industryId" width="120">
46+
<el-table-column label="手机" align="center" prop="mobile" width="120" />
47+
<el-table-column label="电话" align="center" prop="telephone" width="130" />
48+
<el-table-column label="邮箱" align="center" prop="email" width="180" />
49+
<el-table-column align="center" label="客户级别" prop="level" width="135">
5050
<template #default="scope">
51-
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_INDUSTRY" :value="scope.row.industryId" />
51+
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_LEVEL" :value="scope.row.level" />
5252
</template>
5353
</el-table-column>
54-
<el-table-column align="center" label="客户级别" prop="level" width="120">
54+
<el-table-column align="center" label="客户行业" prop="industryId" width="100">
5555
<template #default="scope">
56-
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_LEVEL" :value="scope.row.level" />
56+
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_INDUSTRY" :value="scope.row.industryId" />
5757
</template>
5858
</el-table-column>
59-
<el-table-column align="center" label="网址" prop="website" width="200" />
6059
<el-table-column
6160
:formatter="dateFormatter"
6261
align="center"
@@ -65,25 +64,34 @@
6564
width="180px"
6665
/>
6766
<el-table-column align="center" label="备注" prop="remark" width="200" />
67+
<el-table-column align="center" label="锁定状态" prop="lockStatus">
68+
<template #default="scope">
69+
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.lockStatus" />
70+
</template>
71+
</el-table-column>
6872
<el-table-column align="center" label="成交状态" prop="dealStatus">
6973
<template #default="scope">
7074
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.dealStatus" />
7175
</template>
7276
</el-table-column>
73-
<el-table-column align="center" label="距离进入公海" prop="poolDay">
74-
<template #default="scope"> {{ scope.row.poolDay }} 天</template>
75-
</el-table-column>
7677
<el-table-column
7778
:formatter="dateFormatter"
7879
align="center"
7980
label="最后跟进时间"
8081
prop="contactLastTime"
8182
width="180px"
8283
/>
84+
<el-table-column align="center" label="最后跟进记录" prop="contactLastContent" width="200" />
85+
<el-table-column label="地址" align="center" prop="detailAddress" width="180" />
86+
<el-table-column align="center" label="距离进入公海天数" prop="poolDay" width="140">
87+
<template #default="scope"> {{ scope.row.poolDay }} 天</template>
88+
</el-table-column>
89+
<el-table-column align="center" label="负责人" prop="ownerUserName" width="100px" />
90+
<el-table-column align="center" label="所属部门" prop="ownerUserDeptName" width="100px" />
8391
<el-table-column
8492
:formatter="dateFormatter"
8593
align="center"
86-
label="创建时间"
94+
label="更新时间"
8795
prop="updateTime"
8896
width="180px"
8997
/>
@@ -94,8 +102,6 @@
94102
prop="createTime"
95103
width="180px"
96104
/>
97-
<el-table-column align="center" label="负责人" prop="ownerUserName" width="100px" />
98-
<el-table-column align="center" label="所属部门" prop="ownerUserDeptName" width="100px" />
99105
<el-table-column align="center" label="创建人" prop="creatorName" width="100px" />
100106
</el-table>
101107
<!-- 分页 -->
@@ -108,12 +114,14 @@
108114
</ContentWrap>
109115
</template>
110116

111-
<script setup lang="ts" name="FollowCustomer">
117+
<script setup lang="ts">
112118
import * as CustomerApi from '@/api/crm/customer'
113119
import { DICT_TYPE } from '@/utils/dict'
114120
import { dateFormatter } from '@/utils/formatTime'
115121
import { FOLLOWUP_STATUS } from './common'
116122
123+
defineOptions({ name: 'CrmCustomerFollowList' })
124+
117125
const { push } = useRouter()
118126
119127
const loading = ref(true) // 列表的加载中

src/views/crm/backlog/tables/PutInPoolRemind.vue renamed to src/views/crm/backlog/components/CustomerPutPoolRemindList.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,13 @@
104104
</ContentWrap>
105105
</template>
106106

107-
<script lang="ts" setup name="PutInPoolRemind">
107+
<script lang="ts" setup>
108108
import * as CustomerApi from '@/api/crm/customer'
109109
import { DICT_TYPE } from '@/utils/dict'
110110
import { dateFormatter } from '@/utils/formatTime'
111111
import { SCENE_TYPES } from './common'
112112
113-
const { push } = useRouter()
113+
defineOptions({ name: 'CrmCustomerPutPoolRemindList' })
114114
115115
const loading = ref(true) // 列表的加载中
116116
const total = ref(0) // 列表的总页数
@@ -127,7 +127,7 @@ const queryFormRef = ref() // 搜索的表单
127127
const getList = async () => {
128128
loading.value = true
129129
try {
130-
const data = await CustomerApi.getPutInPoolRemindCustomerPage(queryParams.value)
130+
const data = await CustomerApi.getPutPoolRemindCustomerPage(queryParams.value)
131131
list.value = data.list
132132
total.value = data.total
133133
} finally {
@@ -142,10 +142,16 @@ const handleQuery = () => {
142142
}
143143
144144
/** 打开客户详情 */
145+
const { push } = useRouter()
145146
const openDetail = (id: number) => {
146147
push({ name: 'CrmCustomerDetail', params: { id } })
147148
}
148149
150+
/** 激活时 */
151+
onActivated(async () => {
152+
await getList()
153+
})
154+
149155
/** 初始化 **/
150156
onMounted(() => {
151157
getList()

src/views/crm/backlog/tables/TodayCustomer.vue renamed to src/views/crm/backlog/components/CustomerTodayContactList.vue

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,32 +43,31 @@
4343
</ContentWrap>
4444
<ContentWrap>
4545
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" :stripe="true">
46-
<el-table-column align="center" label="编号" fixed="left" prop="id" />
4746
<el-table-column align="center" label="客户名称" fixed="left" prop="name" width="160">
4847
<template #default="scope">
4948
<el-link :underline="false" type="primary" @click="openDetail(scope.row.id)">
5049
{{ scope.row.name }}
5150
</el-link>
5251
</template>
5352
</el-table-column>
54-
<el-table-column align="center" label="手机" prop="mobile" width="120" />
55-
<el-table-column align="center" label="电话" prop="telephone" width="120" />
5653
<el-table-column align="center" label="客户来源" prop="source" width="100">
5754
<template #default="scope">
5855
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_SOURCE" :value="scope.row.source" />
5956
</template>
6057
</el-table-column>
61-
<el-table-column align="center" label="所属行业" prop="industryId" width="120">
58+
<el-table-column label="手机" align="center" prop="mobile" width="120" />
59+
<el-table-column label="电话" align="center" prop="telephone" width="130" />
60+
<el-table-column label="邮箱" align="center" prop="email" width="180" />
61+
<el-table-column align="center" label="客户级别" prop="level" width="135">
6262
<template #default="scope">
63-
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_INDUSTRY" :value="scope.row.industryId" />
63+
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_LEVEL" :value="scope.row.level" />
6464
</template>
6565
</el-table-column>
66-
<el-table-column align="center" label="客户级别" prop="level" width="120">
66+
<el-table-column align="center" label="客户行业" prop="industryId" width="100">
6767
<template #default="scope">
68-
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_LEVEL" :value="scope.row.level" />
68+
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_INDUSTRY" :value="scope.row.industryId" />
6969
</template>
7070
</el-table-column>
71-
<el-table-column align="center" label="网址" prop="website" width="200" />
7271
<el-table-column
7372
:formatter="dateFormatter"
7473
align="center"
@@ -77,23 +76,34 @@
7776
width="180px"
7877
/>
7978
<el-table-column align="center" label="备注" prop="remark" width="200" />
79+
<el-table-column align="center" label="锁定状态" prop="lockStatus">
80+
<template #default="scope">
81+
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.lockStatus" />
82+
</template>
83+
</el-table-column>
8084
<el-table-column align="center" label="成交状态" prop="dealStatus">
8185
<template #default="scope">
8286
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.dealStatus" />
8387
</template>
8488
</el-table-column>
85-
<el-table-column align="center" label="距进入公海天数" prop="poolDay" width="130" />
8689
<el-table-column
8790
:formatter="dateFormatter"
8891
align="center"
8992
label="最后跟进时间"
9093
prop="contactLastTime"
9194
width="180px"
9295
/>
96+
<el-table-column align="center" label="最后跟进记录" prop="contactLastContent" width="200" />
97+
<el-table-column label="地址" align="center" prop="detailAddress" width="180" />
98+
<el-table-column align="center" label="距离进入公海天数" prop="poolDay" width="140">
99+
<template #default="scope"> {{ scope.row.poolDay }} 天</template>
100+
</el-table-column>
101+
<el-table-column align="center" label="负责人" prop="ownerUserName" width="100px" />
102+
<el-table-column align="center" label="所属部门" prop="ownerUserDeptName" width="100px" />
93103
<el-table-column
94104
:formatter="dateFormatter"
95105
align="center"
96-
label="创建时间"
106+
label="更新时间"
97107
prop="updateTime"
98108
width="180px"
99109
/>
@@ -104,8 +114,6 @@
104114
prop="createTime"
105115
width="180px"
106116
/>
107-
<el-table-column align="center" label="负责人" prop="ownerUserName" width="100px" />
108-
<el-table-column align="center" label="所属部门" prop="ownerUserDeptName" width="100px" />
109117
<el-table-column align="center" label="创建人" prop="creatorName" width="100px" />
110118
</el-table>
111119
<!-- 分页 -->
@@ -118,13 +126,13 @@
118126
</ContentWrap>
119127
</template>
120128

121-
<script lang="ts" setup name="TodayCustomer">
129+
<script lang="ts" setup>
122130
import * as CustomerApi from '@/api/crm/customer'
123131
import { DICT_TYPE } from '@/utils/dict'
124132
import { dateFormatter } from '@/utils/formatTime'
125133
import { CONTACT_STATUS, SCENE_TYPES } from './common'
126134
127-
// defineOptions({ name: 'TodayCustomer' }) TODO @dhb52:1)定义改成这种;2)命名要不要改成 CustomerTodayTable,就是 模块+形容词+表格(更容易识别),然后把 tables 目录改成 components 目录
135+
defineOptions({ name: 'CrmCustomerTodayContactList' })
128136
129137
const { push } = useRouter()
130138

0 commit comments

Comments
 (0)