YunaiV ff84ef64a5 CRM:合同的 code review
(cherry picked from commit 956f19d9d08930f2617ca76a96e841e86b7a9e91)
2024-03-11 12:49:03 +08:00

78 lines
2.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import request from '@/config/axios'
import { ProductExpandVO } from '@/api/crm/product'
import { TransferReqVO } from '@/api/crm/customer'
export interface ContractVO {
id: number
name: string
customerId: number
businessId: number
processInstanceId: number
orderDate: Date
ownerUserId: number
no: string
startTime: Date
endTime: Date
price: number
discountPercent: number
productPrice: number
contactId: number
signUserId: number
contactLastTime: Date
status: number
remark: string
productItems: ProductExpandVO[]
creatorName: string
updateTime?: Date
createTime?: Date
customerName: string
contactName: string
ownerUserName: string
}
// 查询 CRM 合同列表
export const getContractPage = async (params) => {
return await request.get({ url: `/crm/contract/page`, params })
}
// 查询 CRM 联系人列表,基于指定客户
export const getContractPageByCustomer = async (params: any) => {
return await request.get({ url: `/crm/contract/page-by-customer`, params })
}
// 查询 CRM 合同详情
export const getContract = async (id: number) => {
return await request.get({ url: `/crm/contract/get?id=` + id })
}
// 新增 CRM 合同
export const createContract = async (data: ContractVO) => {
return await request.post({ url: `/crm/contract/create`, data })
}
// 修改 CRM 合同
export const updateContract = async (data: ContractVO) => {
return await request.put({ url: `/crm/contract/update`, data })
}
// 删除 CRM 合同
export const deleteContract = async (id: number) => {
return await request.delete({ url: `/crm/contract/delete?id=` + id })
}
// 导出 CRM 合同 Excel
export const exportContract = async (params) => {
return await request.download({ url: `/crm/contract/export-excel`, params })
}
// 提交审核
export const handleApprove = async (id: number) => {
return await request.put({ url: `/crm/contract/approve?id=${id}` })
}
// 合同转移
// TODO @puhui999transfer 相关方法,这块要补充下;
export const transfer = async (data: TransferReqVO) => {
return await request.put({ url: '/crm/contract/transfer', data })
}