92 lines
2.3 KiB
TypeScript
Raw Normal View History

2023-10-16 23:56:34 +08:00
import request from '@/config/axios'
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
2024-02-22 21:53:39 +08:00
no: string
2023-10-16 23:56:34 +08:00
customerId: number
2024-02-22 21:53:39 +08:00
customerName?: string
2023-10-16 23:56:34 +08:00
businessId: number
2024-02-03 20:47:50 +08:00
businessName: string
2024-02-22 21:53:39 +08:00
contactLastTime: Date
ownerUserId: number
ownerUserName?: string
ownerUserDeptName?: string
2023-10-16 23:56:34 +08:00
processInstanceId: number
2024-02-22 21:53:39 +08:00
auditStatus: number
2023-10-16 23:56:34 +08:00
orderDate: Date
startTime: Date
endTime: Date
2024-02-22 21:53:39 +08:00
totalProductPrice: number
2023-10-16 23:56:34 +08:00
discountPercent: number
2024-02-22 21:53:39 +08:00
totalPrice: number
signContactId: number
signContactName?: string
2023-10-16 23:56:34 +08:00
signUserId: number
2024-02-03 20:47:50 +08:00
signUserName: string
2023-10-16 23:56:34 +08:00
remark: string
2024-02-22 21:53:39 +08:00
createTime?: Date
creator: string
2024-01-28 01:32:49 +08:00
creatorName: string
updateTime?: Date
2024-02-22 21:53:39 +08:00
products?: [
{
id: number
productId: number
productName: string
productNo: string
productUnit: number
productPrice: number
contractPrice: number
count: number
totalPrice: number
}
]
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
// 提交审核
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
}