2023-12-17 17:34:32 +08:00
|
|
|
/*
|
|
|
|
* @Author: zyna
|
|
|
|
* @Date: 2023-12-02 13:08:56
|
|
|
|
* @LastEditTime: 2023-12-17 16:28:20
|
|
|
|
* @FilePath: \yudao-ui-admin-vue3\src\api\crm\business\index.ts
|
|
|
|
* @Description:
|
|
|
|
*/
|
2023-11-24 14:21:21 +08:00
|
|
|
import request from '@/config/axios'
|
|
|
|
|
|
|
|
export interface BusinessVO {
|
|
|
|
id: number
|
|
|
|
name: string
|
|
|
|
statusTypeId: number
|
|
|
|
statusId: number
|
|
|
|
contactNextTime: Date
|
|
|
|
customerId: number
|
|
|
|
dealTime: Date
|
|
|
|
price: number
|
|
|
|
discountPercent: number
|
|
|
|
productPrice: number
|
|
|
|
remark: string
|
|
|
|
ownerUserId: number
|
|
|
|
roUserIds: string
|
|
|
|
rwUserIds: string
|
|
|
|
endStatus: number
|
|
|
|
endRemark: string
|
|
|
|
contactLastTime: Date
|
|
|
|
followUpStatus: number
|
|
|
|
}
|
|
|
|
|
2023-11-30 20:21:45 +08:00
|
|
|
// 查询 CRM 商机列表
|
2023-11-24 14:21:21 +08:00
|
|
|
export const getBusinessPage = async (params) => {
|
|
|
|
return await request.get({ url: `/crm/business/page`, params })
|
|
|
|
}
|
|
|
|
|
2023-11-30 20:21:45 +08:00
|
|
|
// 查询 CRM 商机列表,基于指定客户
|
|
|
|
export const getBusinessPageByCustomer = async (params) => {
|
|
|
|
return await request.get({ url: `/crm/business/page-by-customer`, params })
|
|
|
|
}
|
|
|
|
|
|
|
|
// 查询 CRM 商机详情
|
2023-11-24 14:21:21 +08:00
|
|
|
export const getBusiness = async (id: number) => {
|
|
|
|
return await request.get({ url: `/crm/business/get?id=` + id })
|
|
|
|
}
|
|
|
|
|
2023-11-30 20:21:45 +08:00
|
|
|
// 新增 CRM 商机
|
2023-11-24 14:21:21 +08:00
|
|
|
export const createBusiness = async (data: BusinessVO) => {
|
|
|
|
return await request.post({ url: `/crm/business/create`, data })
|
|
|
|
}
|
|
|
|
|
2023-11-30 20:21:45 +08:00
|
|
|
// 修改 CRM 商机
|
2023-11-24 14:21:21 +08:00
|
|
|
export const updateBusiness = async (data: BusinessVO) => {
|
|
|
|
return await request.put({ url: `/crm/business/update`, data })
|
|
|
|
}
|
|
|
|
|
2023-11-30 20:21:45 +08:00
|
|
|
// 删除 CRM 商机
|
2023-11-24 14:21:21 +08:00
|
|
|
export const deleteBusiness = async (id: number) => {
|
|
|
|
return await request.delete({ url: `/crm/business/delete?id=` + id })
|
|
|
|
}
|
|
|
|
|
2023-11-30 20:21:45 +08:00
|
|
|
// 导出 CRM 商机 Excel
|
2023-11-24 14:21:21 +08:00
|
|
|
export const exportBusiness = async (params) => {
|
|
|
|
return await request.download({ url: `/crm/business/export-excel`, params })
|
|
|
|
}
|
2023-12-17 17:34:32 +08:00
|
|
|
|
|
|
|
//联系人关联商机列表
|
|
|
|
export const getBusinessPageByContact = async (params) => {
|
|
|
|
return await request.get({ url: `/crm/business/page-by-contact`, params })
|
|
|
|
}
|