Skip to content

Commit 39da43c

Browse files
committed
Merge remote-tracking branch 'yudao/dev' into crm-msg
2 parents 2484933 + 9fa769b commit 39da43c

File tree

27 files changed

+1306
-210
lines changed

27 files changed

+1306
-210
lines changed

src/api/crm/business/index.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
/*
2-
* @Author: zyna
3-
* @Date: 2023-12-02 13:08:56
4-
* @LastEditTime: 2023-12-17 16:28:20
5-
* @FilePath: \yudao-ui-admin-vue3\src\api\crm\business\index.ts
6-
* @Description:
7-
*/
81
import request from '@/config/axios'
92

103
export interface BusinessVO {
@@ -43,6 +36,11 @@ export const getBusiness = async (id: number) => {
4336
return await request.get({ url: `/crm/business/get?id=` + id })
4437
}
4538

39+
// 获得 CRM 商机列表(精简)
40+
export const getSimpleBusinessList = async () => {
41+
return await request.get({ url: `/crm/business/simple-all-list` })
42+
}
43+
4644
// 新增 CRM 商机
4745
export const createBusiness = async (data: BusinessVO) => {
4846
return await request.post({ url: `/crm/business/create`, data })
@@ -63,7 +61,12 @@ export const exportBusiness = async (params) => {
6361
return await request.download({ url: `/crm/business/export-excel`, params })
6462
}
6563

66-
//联系人关联商机列表
64+
// 联系人关联商机列表
6765
export const getBusinessPageByContact = async (params) => {
6866
return await request.get({ url: `/crm/business/page-by-contact`, params })
6967
}
68+
69+
// 获得 CRM 商机列表
70+
export const getBusinessListByIds = async (val: number[]) => {
71+
return await request.get({ url: '/crm/business/list-by-ids', params: { ids: val.join(',') } })
72+
}

src/api/crm/contact/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ export const getSimpleContactList = async () => {
7171
return await request.get({ url: `/crm/contact/simple-all-list` })
7272
}
7373

74+
// 获得 CRM 联系人列表
75+
export const getContactListByIds = async (val: number[]) => {
76+
return await request.get({ url: '/crm/contact/list-by-ids', params: { ids: val.join(',') } })
77+
}
78+
7479
// 批量新增联系人商机关联
7580
export const createContactBusinessList = async (data: ContactBusinessReqVO) => {
7681
return await request.post({ url: `/crm/contact/create-business-list`, data })
@@ -84,4 +89,4 @@ export const deleteContactBusinessList = async (data: ContactBusinessReqVO) => {
8489
// 查询联系人操作日志
8590
export const getOperateLogPage = async (params: any) => {
8691
return await request.get({ url: '/crm/contact/operate-log-page', params })
87-
}
92+
}

src/api/crm/customer/index.ts

Lines changed: 15 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
// 查询客户操作日志
@@ -75,18 +75,28 @@ export const getOperateLogPage = async (id: number) => {
7575

7676
// ======================= 业务操作 =======================
7777

78+
export interface TransferReqVO {
79+
id: number | undefined // 客户编号
80+
newOwnerUserId: number | undefined // 新负责人的用户编号
81+
oldOwnerPermissionLevel: number | undefined // 老负责人加入团队后的权限级别
82+
}
83+
84+
// 客户转移
85+
export const transfer = async (data: TransferReqVO) => {
86+
return await request.put({ url: '/crm/customer/transfer', data })
87+
}
88+
7889
// 锁定/解锁客户
7990
export const lockCustomer = async (id: number, lockStatus: boolean) => {
8091
return await request.put({ url: `/crm/customer/lock`, data: { id, lockStatus } })
8192
}
8293

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

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

src/api/crm/followup/index.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import request from '@/config/axios'
2+
3+
// 跟进记录 VO
4+
export interface FollowUpRecordVO {
5+
id: number // 编号
6+
bizType: number // 数据类型
7+
bizId: number // 数据编号
8+
type: number // 跟进类型
9+
content: string // 跟进内容
10+
nextTime: Date // 下次联系时间
11+
businessIds: number[] // 关联的商机编号数组
12+
contactIds: number[] // 关联的联系人编号数组
13+
}
14+
15+
// 跟进记录 API
16+
export const FollowUpRecordApi = {
17+
// 查询跟进记录分页
18+
getFollowUpRecordPage: async (params: any) => {
19+
return await request.get({ url: `/crm/follow-up-record/page`, params })
20+
},
21+
22+
// 查询跟进记录详情
23+
getFollowUpRecord: async (id: number) => {
24+
return await request.get({ url: `/crm/follow-up-record/get?id=` + id })
25+
},
26+
27+
// 新增跟进记录
28+
createFollowUpRecord: async (data: FollowUpRecordVO) => {
29+
return await request.post({ url: `/crm/follow-up-record/create`, data })
30+
},
31+
32+
// 修改跟进记录
33+
updateFollowUpRecord: async (data: FollowUpRecordVO) => {
34+
return await request.put({ url: `/crm/follow-up-record/update`, data })
35+
},
36+
37+
// 删除跟进记录
38+
deleteFollowUpRecord: async (id: number) => {
39+
return await request.delete({ url: `/crm/follow-up-record/delete?id=` + id })
40+
},
41+
42+
// 导出跟进记录 Excel
43+
exportFollowUpRecord: async (params) => {
44+
return await request.download({ url: `/crm/follow-up-record/export-excel`, params })
45+
}
46+
}

src/api/crm/message/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export interface CustomerVO {
3434
}
3535

3636
// 查询客户列表
37+
// TODO @芋艿:看看是不是后续融合到 getCustomerPage 里;
3738
export const getTodayCustomerPage = async (params) => {
3839
return await request.get({ url: `/crm/message/todayCustomer`, params })
3940
}

src/components/OperateLogV2/src/OperateLogV2.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
<!-- 某个记录的操作日志列表,目前主要用于 CRM 客户、商机等详情界面 -->
12
<template>
2-
<!-- TODO @puhui999:左边不用有空隙哈 -->
3-
<div class="p-20px">
3+
<div class="pt-20px">
44
<el-timeline>
55
<el-timeline-item
66
v-for="(log, index) in logList"
@@ -58,7 +58,7 @@ const getUserTypeColor = (type: number) => {
5858
<style lang="scss" scoped>
5959
// 时间线样式调整
6060
:deep(.el-timeline) {
61-
margin: 10px 0 0 160px;
61+
margin: 10px 0 0 110px;
6262
6363
.el-timeline-item__wrapper {
6464
position: relative;

src/router/modules/remaining.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
537537
noCache: true,
538538
hidden: true
539539
},
540+
// TODO @db52:后面搞,搞成菜单
540541
component: () => import('@/views/crm/message/index.vue')
541542
}
542543
]

src/utils/dict.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,7 @@ export enum DICT_TYPE {
162162
MEMBER_EXPERIENCE_BIZ_TYPE = 'member_experience_biz_type', // 会员经验业务类型
163163

164164
// ========== MALL - 商品模块 ==========
165-
PRODUCT_UNIT = 'product_unit', // 商品单位
166165
PRODUCT_SPU_STATUS = 'product_spu_status', //商品状态
167-
PROMOTION_TYPE_ENUM = 'promotion_type_enum', // 营销类型枚举
168166

169167
// ========== MALL - 交易模块 ==========
170168
EXPRESS_CHARGE_MODE = 'trade_delivery_express_charge_mode', //快递的计费方式
@@ -204,5 +202,6 @@ export enum DICT_TYPE {
204202
CRM_CUSTOMER_SOURCE = 'crm_customer_source',
205203
CRM_PRODUCT_STATUS = 'crm_product_status',
206204
CRM_PERMISSION_LEVEL = 'crm_permission_level', // CRM 数据权限的级别
207-
CRM_PRODUCT_UNIT = 'crm_product_unit' // 产品单位
205+
CRM_PRODUCT_UNIT = 'crm_product_unit', // 产品单位
206+
CRM_FOLLOW_UP_TYPE = 'crm_follow_up_type' // 跟进方式
208207
}

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)