2023-10-16 23:56:34 +08:00
|
|
|
import request from '@/config/axios'
|
2024-01-27 23:11:43 +08:00
|
|
|
import { ProductExpandVO } from '@/api/crm/product'
|
2024-01-28 01:32:49 +08:00
|
|
|
import { TransferReqVO } from '@/api/crm/customer'
|
2023-10-16 23:56:34 +08:00
|
|
|
|
|
|
|
export interface ContractVO {
|
|
|
|
id: number
|
|
|
|
name: string
|
|
|
|
customerId: number
|
|
|
|
businessId: number
|
2024-02-03 20:47:50 +08:00
|
|
|
businessName: string
|
2023-10-16 23:56:34 +08:00
|
|
|
processInstanceId: number
|
|
|
|
orderDate: Date
|
|
|
|
ownerUserId: number
|
|
|
|
no: string
|
|
|
|
startTime: Date
|
|
|
|
endTime: Date
|
|
|
|
price: number
|
|
|
|
discountPercent: number
|
|
|
|
productPrice: number
|
|
|
|
contactId: number
|
|
|
|
signUserId: number
|
2024-02-03 20:47:50 +08:00
|
|
|
signUserName: string
|
2023-10-16 23:56:34 +08:00
|
|
|
contactLastTime: Date
|
2024-02-03 20:47:50 +08:00
|
|
|
auditStatus: number
|
2023-10-16 23:56:34 +08:00
|
|
|
remark: string
|
2024-01-27 23:11:43 +08:00
|
|
|
productItems: ProductExpandVO[]
|
2024-01-28 01:32:49 +08:00
|
|
|
creatorName: string
|
|
|
|
updateTime?: Date
|
|
|
|
createTime?: Date
|
|
|
|
customerName: string
|
|
|
|
contactName: string
|
|
|
|
ownerUserName: string
|
2023-10-16 23:56:34 +08:00
|
|
|
}
|
|
|
|
|
2023-11-30 19:12:57 +08:00
|
|
|
// 查询 CRM 合同列表
|
2023-10-16 23:56:34 +08:00
|
|
|
export const getContractPage = async (params) => {
|
|
|
|
return await request.get({ url: `/crm/contract/page`, params })
|
|
|
|
}
|
|
|
|
|
2023-11-30 19:12:57 +08:00
|
|
|
// 查询 CRM 联系人列表,基于指定客户
|
|
|
|
export const getContractPageByCustomer = async (params: any) => {
|
|
|
|
return await request.get({ url: `/crm/contract/page-by-customer`, params })
|
|
|
|
}
|
|
|
|
|
|
|
|
// 查询 CRM 合同详情
|
2023-10-16 23:56:34 +08:00
|
|
|
export const getContract = async (id: number) => {
|
|
|
|
return await request.get({ url: `/crm/contract/get?id=` + id })
|
|
|
|
}
|
|
|
|
|
2023-11-30 19:12:57 +08:00
|
|
|
// 新增 CRM 合同
|
2023-10-16 23:56:34 +08:00
|
|
|
export const createContract = async (data: ContractVO) => {
|
|
|
|
return await request.post({ url: `/crm/contract/create`, data })
|
|
|
|
}
|
|
|
|
|
2023-11-30 19:12:57 +08:00
|
|
|
// 修改 CRM 合同
|
2023-10-16 23:56:34 +08:00
|
|
|
export const updateContract = async (data: ContractVO) => {
|
|
|
|
return await request.put({ url: `/crm/contract/update`, data })
|
|
|
|
}
|
|
|
|
|
2023-11-30 19:12:57 +08:00
|
|
|
// 删除 CRM 合同
|
2023-10-16 23:56:34 +08:00
|
|
|
export const deleteContract = async (id: number) => {
|
|
|
|
return await request.delete({ url: `/crm/contract/delete?id=` + id })
|
|
|
|
}
|
|
|
|
|
2023-11-30 19:12:57 +08:00
|
|
|
// 导出 CRM 合同 Excel
|
2023-10-16 23:56:34 +08:00
|
|
|
export const exportContract = async (params) => {
|
|
|
|
return await request.download({ url: `/crm/contract/export-excel`, params })
|
|
|
|
}
|
2024-01-27 23:43:30 +08:00
|
|
|
|
|
|
|
// 提交审核
|
2024-02-04 12:57:39 +08:00
|
|
|
export const submitContract = async (id: number) => {
|
|
|
|
return await request.put({ url: `/crm/contract/submit?id=${id}` })
|
2024-01-27 23:43:30 +08:00
|
|
|
}
|
2024-01-28 01:32:49 +08:00
|
|
|
|
|
|
|
// 合同转移
|
2024-02-03 20:47:50 +08:00
|
|
|
export const transferContract = async (data: TransferReqVO) => {
|
2024-02-03 22:17:45 +08:00
|
|
|
return await request.put({ url: '/crm/contract/transfer', data })
|
2024-01-28 01:32:49 +08:00
|
|
|
}
|