Skip to content

Commit 5151824

Browse files
author
puhui999
committed
crm-客户:公海抽离,完善跟进
1 parent d29dfef commit 5151824

File tree

10 files changed

+411
-83
lines changed

10 files changed

+411
-83
lines changed

src/api/crm/business/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ export const getBusiness = async (id: number) => {
3636
return await request.get({ url: `/crm/business/get?id=` + id })
3737
}
3838

39+
// 获得 CRM 商机列表(精简)
40+
export const getSimpleBusinessList = async () => {
41+
return await request.get({ url: `/crm/business/simple-all-list` })
42+
}
43+
3944
// 新增 CRM 商机
4045
export const createBusiness = async (data: BusinessVO) => {
4146
return await request.post({ url: `/crm/business/create`, data })
@@ -63,5 +68,5 @@ export const getBusinessPageByContact = async (params) => {
6368

6469
// 获得 CRM 商机列表
6570
export const getBusinessListByIds = async (val: number[]) => {
66-
return await request.get({ url: '/crm/business/list-by-ids', params: { ids: val } })
71+
return await request.get({ url: '/crm/business/list-by-ids', params: { ids: val.join(',') } })
6772
}

src/api/crm/contact/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export const getSimpleContactList = async () => {
7373

7474
// 获得 CRM 联系人列表
7575
export const getContactListByIds = async (val: number[]) => {
76-
return await request.get({ url: '/crm/contact/list-by-ids', params: { ids: val } })
76+
return await request.get({ url: '/crm/contact/list-by-ids', params: { ids: val.join(',') } })
7777
}
7878

7979
// 批量新增联系人商机关联

src/api/crm/customer/index.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ export const exportCustomer = async (params: any) => {
6464
}
6565

6666
// 客户列表
67-
export const queryAllList = async () => {
68-
return await request.get({ url: `/crm/customer/query-all-list` })
67+
export const getSimpleCustomerList = async () => {
68+
return await request.get({ url: `/crm/customer/list-all-simple` })
6969
}
7070

7171
// 查询客户操作日志
@@ -80,13 +80,12 @@ export const lockCustomer = async (id: number, lockStatus: boolean) => {
8080
return await request.put({ url: `/crm/customer/lock`, data: { id, lockStatus } })
8181
}
8282

83-
// TODO @puhui999:方法名,改成和后端一致哈
8483
// 领取公海客户
85-
export const receive = async (ids: any[]) => {
84+
export const receiveCustomer = async (ids: any[]) => {
8685
return await request.put({ url: '/crm/customer/receive', params: { ids: ids.join(',') } })
8786
}
8887

8988
// 客户放入公海
90-
export const putPool = async (id: number) => {
89+
export const putCustomerPool = async (id: number) => {
9190
return await request.put({ url: `/crm/customer/put-pool?id=${id}` })
9291
}

src/router/modules/remaining.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,8 @@ const remainingRouter: AppRouteRecordRaw[] = [
504504
meta: {
505505
title: '客户详情',
506506
noCache: true,
507-
hidden: true
507+
hidden: true,
508+
activeMenu: '/crm/customer/index'
508509
},
509510
component: () => import('@/views/crm/customer/detail/index.vue')
510511
},
@@ -514,7 +515,8 @@ const remainingRouter: AppRouteRecordRaw[] = [
514515
meta: {
515516
title: '联系人详情',
516517
noCache: true,
517-
hidden: true
518+
hidden: true,
519+
activeMenu: '/crm/contact'
518520
},
519521
component: () => import('@/views/crm/contact/detail/index.vue')
520522
}

src/views/crm/contact/ContactForm.vue

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
<template>
2-
<Dialog :title="dialogTitle" v-model="dialogVisible" :width="820">
2+
<Dialog v-model="dialogVisible" :title="dialogTitle" :width="820">
33
<el-form
44
ref="formRef"
5+
v-loading="formLoading"
56
:model="formData"
67
:rules="formRules"
78
label-width="110px"
8-
v-loading="formLoading"
99
>
1010
<el-row :gutter="20">
1111
<el-col :span="12">
1212
<el-form-item label="姓名" prop="name">
13-
<el-input input-style="width:190px;" v-model="formData.name" placeholder="请输入姓名" />
13+
<el-input v-model="formData.name" input-style="width:190px;" placeholder="请输入姓名" />
1414
</el-form-item>
1515
</el-col>
1616
<el-col :span="12">
1717
<el-form-item label="负责人" prop="ownerUserId">
1818
<el-select
1919
v-model="formData.ownerUserId"
20+
lable-key="nickname"
2021
placeholder="请选择负责人"
2122
value-key="id"
22-
lable-key="nickname"
2323
>
2424
<el-option
2525
v-for="item in userList"
@@ -36,9 +36,9 @@
3636
<el-form-item label="客户名称" prop="customerName">
3737
<el-select
3838
v-model="formData.customerId"
39+
lable-key="name"
3940
placeholder="请选择客户"
4041
value-key="id"
41-
lable-key="name"
4242
>
4343
<el-option
4444
v-for="item in customerList"
@@ -66,8 +66,8 @@
6666
<el-col :span="12">
6767
<el-form-item label="手机号" prop="mobile">
6868
<el-input
69-
input-style="width:190px;"
7069
v-model="formData.mobile"
70+
input-style="width:190px;"
7171
placeholder="请输入手机号"
7272
/>
7373
</el-form-item>
@@ -82,8 +82,8 @@
8282
<el-col :span="12">
8383
<el-form-item label="邮箱" prop="email">
8484
<el-input
85-
input-style="width:190px;"
8685
v-model="formData.email"
86+
input-style="width:190px;"
8787
placeholder="请输入邮箱"
8888
/>
8989
</el-form-item>
@@ -98,8 +98,8 @@
9898
<el-col :span="12">
9999
<el-form-item label="微信" prop="wechat">
100100
<el-input
101-
input-style="width:190px;"
102101
v-model="formData.wechat"
102+
input-style="width:190px;"
103103
placeholder="请输入微信"
104104
/>
105105
</el-form-item>
@@ -108,9 +108,9 @@
108108
<el-form-item label="下次联系时间" prop="contactNextTime">
109109
<el-date-picker
110110
v-model="formData.contactNextTime"
111+
placeholder="选择下次联系时间"
111112
type="datetime"
112113
value-format="x"
113-
placeholder="选择下次联系时间"
114114
/>
115115
</el-form-item>
116116
</el-col>
@@ -129,8 +129,8 @@
129129
<el-col :span="12">
130130
<el-form-item label="地址" prop="detailAddress">
131131
<el-input
132-
input-style="width:190px;"
133132
v-model="formData.detailAddress"
133+
input-style="width:190px;"
134134
placeholder="请输入地址"
135135
/>
136136
</el-form-item>
@@ -143,16 +143,16 @@
143143
<el-option
144144
v-for="item in allContactList"
145145
:key="item.id"
146+
:disabled="item.id == formData.id"
146147
:label="item.name"
147148
:value="item.id"
148-
:disabled="item.id == formData.id"
149149
/>
150150
</el-select>
151151
</el-form-item>
152152
</el-col>
153153
<el-col :span="12">
154154
<el-form-item label="职位" prop="post">
155-
<el-input input-style="width:190px;" v-model="formData.post" placeholder="请输入职位" />
155+
<el-input v-model="formData.post" input-style="width:190px;" placeholder="请输入职位" />
156156
</el-form-item>
157157
</el-col>
158158
</el-row>
@@ -180,14 +180,14 @@
180180
</el-row>
181181
</el-form>
182182
<template #footer>
183-
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
183+
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
184184
<el-button @click="dialogVisible = false">取 消</el-button>
185185
</template>
186186
</Dialog>
187187
</template>
188-
<script setup lang="ts">
188+
<script lang="ts" setup>
189189
import * as ContactApi from '@/api/crm/contact'
190-
import { DICT_TYPE, getIntDictOptions, getBoolDictOptions } from '@/utils/dict'
190+
import { DICT_TYPE, getBoolDictOptions, getIntDictOptions } from '@/utils/dict'
191191
import * as UserApi from '@/api/system/user'
192192
import * as CustomerApi from '@/api/crm/customer'
193193
import * as AreaApi from '@/api/system/area'
@@ -242,7 +242,7 @@ const open = async (type: string, id?: number) => {
242242
resetForm()
243243
allContactList.value = await ContactApi.getSimpleContactList()
244244
userList.value = await UserApi.getSimpleUserList()
245-
customerList.value = await CustomerApi.queryAllList()
245+
customerList.value = await CustomerApi.getSimpleCustomerList()
246246
areaList.value = await AreaApi.getAreaTree()
247247
// 修改时,设置数据
248248
if (id) {

0 commit comments

Comments
 (0)