Merge remote-tracking branch 'refs/remotes/yudao/dev' into develop
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { BpmModelApi } from '#/api/bpm/model';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmCategoryApi {
|
||||
@@ -11,6 +13,14 @@ export namespace BpmCategoryApi {
|
||||
status: number;
|
||||
sort: number; // 分类排序
|
||||
}
|
||||
|
||||
/** 模型分类信息 */
|
||||
// TODO @jason:这个应该非 api 的,可以考虑抽到页面里哈。
|
||||
export interface ModelCategoryInfo {
|
||||
id: number;
|
||||
name: string;
|
||||
modelList: BpmModelApi.ModelVO[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询流程分类分页 */
|
||||
@@ -30,15 +40,30 @@ export async function getCategory(id: number) {
|
||||
|
||||
/** 新增流程分类 */
|
||||
export async function createCategory(data: BpmCategoryApi.CategoryVO) {
|
||||
return requestClient.post('/bpm/category/create', data);
|
||||
return requestClient.post<number>('/bpm/category/create', data);
|
||||
}
|
||||
|
||||
/** 修改流程分类 */
|
||||
export async function updateCategory(data: BpmCategoryApi.CategoryVO) {
|
||||
return requestClient.put('/bpm/category/update', data);
|
||||
return requestClient.put<boolean>('/bpm/category/update', data);
|
||||
}
|
||||
|
||||
/** 删除流程分类 */
|
||||
export async function deleteCategory(id: number) {
|
||||
return requestClient.delete(`/bpm/category/delete?id=${id}`);
|
||||
return requestClient.delete<boolean>(`/bpm/category/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 查询流程分类列表 */
|
||||
export async function getCategorySimpleList() {
|
||||
return requestClient.get<BpmCategoryApi.CategoryVO[]>(
|
||||
`/bpm/category/simple-list`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 批量修改流程分类的排序 */
|
||||
export async function updateCategorySortBatch(ids: number[]) {
|
||||
const params = ids.join(',');
|
||||
return requestClient.put<boolean>(
|
||||
`/bpm/category/update-sort-batch?ids=${params}`,
|
||||
);
|
||||
}
|
||||
|
||||
109
apps/web-antd/src/api/bpm/model/index.ts
Normal file
109
apps/web-antd/src/api/bpm/model/index.ts
Normal file
@@ -0,0 +1,109 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmModelApi {
|
||||
/** 用户信息 TODO 这个是不是可以抽取出来定义在公共模块 */
|
||||
// TODO @芋艿:一起看看。
|
||||
export interface UserInfo {
|
||||
id: number;
|
||||
nickname: string;
|
||||
avatar?: string;
|
||||
deptId?: number;
|
||||
deptName?: string;
|
||||
}
|
||||
|
||||
/** 流程定义 VO */
|
||||
export interface ProcessDefinitionVO {
|
||||
id: string;
|
||||
version: number;
|
||||
deploymentTime: number;
|
||||
suspensionState: number;
|
||||
formType?: number;
|
||||
}
|
||||
|
||||
/** 流程模型 VO */
|
||||
export interface ModelVO {
|
||||
id: number;
|
||||
key: string;
|
||||
name: string;
|
||||
icon?: string;
|
||||
description: string;
|
||||
category: string;
|
||||
formName: string;
|
||||
formType: number;
|
||||
formId: number;
|
||||
formCustomCreatePath: string;
|
||||
formCustomViewPath: string;
|
||||
processDefinition: ProcessDefinitionVO;
|
||||
status: number;
|
||||
remark: string;
|
||||
createTime: string;
|
||||
bpmnXml: string;
|
||||
startUsers?: UserInfo[];
|
||||
}
|
||||
|
||||
/** 模型分类信息 */
|
||||
export interface ModelCategoryInfo {
|
||||
id: number;
|
||||
name: string;
|
||||
modelList: ModelVO[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 获取流程模型列表 */
|
||||
export async function getModelList(name: string | undefined) {
|
||||
return requestClient.get<BpmModelApi.ModelVO[]>('/bpm/model/list', {
|
||||
params: { name },
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取流程模型详情 */
|
||||
export async function getModel(id: string) {
|
||||
return requestClient.get<BpmModelApi.ModelVO>(`/bpm/model/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 更新流程模型 */
|
||||
export async function updateModel(data: BpmModelApi.ModelVO) {
|
||||
return requestClient.put('/bpm/model/update', data);
|
||||
}
|
||||
|
||||
/** 批量修改流程模型排序 */
|
||||
export async function updateModelSortBatch(ids: number[]) {
|
||||
const params = ids.join(',');
|
||||
return requestClient.put<boolean>(
|
||||
`/bpm/model/update-sort-batch?ids=${params}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 更新流程模型的 BPMN XML */
|
||||
export async function updateModelBpmn(data: BpmModelApi.ModelVO) {
|
||||
return requestClient.put('/bpm/model/update-bpmn', data);
|
||||
}
|
||||
|
||||
/** 更新流程模型状态 */
|
||||
export async function updateModelState(id: number, state: number) {
|
||||
const data = {
|
||||
id,
|
||||
state,
|
||||
};
|
||||
return requestClient.put('/bpm/model/update-state', data);
|
||||
}
|
||||
|
||||
/** 创建流程模型 */
|
||||
export async function createModel(data: BpmModelApi.ModelVO) {
|
||||
return requestClient.post('/bpm/model/create', data);
|
||||
}
|
||||
|
||||
/** 删除流程模型 */
|
||||
export async function deleteModel(id: number) {
|
||||
return requestClient.delete(`/bpm/model/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 部署流程模型 */
|
||||
export async function deployModel(id: number) {
|
||||
return requestClient.post(`/bpm/model/deploy?id=${id}`);
|
||||
}
|
||||
|
||||
/** 清理流程模型 */
|
||||
export async function cleanModel(id: number) {
|
||||
return requestClient.delete(`/bpm/model/clean?id=${id}`);
|
||||
}
|
||||
118
apps/web-antd/src/api/crm/business/index.ts
Normal file
118
apps/web-antd/src/api/crm/business/index.ts
Normal file
@@ -0,0 +1,118 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { CrmPermissionApi } from '#/api/crm/permission';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmBusinessApi {
|
||||
/** 商机产品信息 */
|
||||
export interface BusinessProduct {
|
||||
id: number;
|
||||
productId: number;
|
||||
productName: string;
|
||||
productNo: string;
|
||||
productUnit: number;
|
||||
productPrice: number;
|
||||
businessPrice: number;
|
||||
count: number;
|
||||
totalPrice: number;
|
||||
}
|
||||
|
||||
/** 商机信息 */
|
||||
export interface Business {
|
||||
id: number;
|
||||
name: string;
|
||||
customerId: number;
|
||||
customerName?: string;
|
||||
followUpStatus: boolean;
|
||||
contactLastTime: Date;
|
||||
contactNextTime: Date;
|
||||
ownerUserId: number;
|
||||
ownerUserName?: string; // 负责人的用户名称
|
||||
ownerUserDept?: string; // 负责人的部门名称
|
||||
statusTypeId: number;
|
||||
statusTypeName?: string;
|
||||
statusId: number;
|
||||
statusName?: string;
|
||||
endStatus: number;
|
||||
endRemark: string;
|
||||
dealTime: Date;
|
||||
totalProductPrice: number;
|
||||
totalPrice: number;
|
||||
discountPercent: number;
|
||||
remark: string;
|
||||
creator: string; // 创建人
|
||||
creatorName?: string; // 创建人名称
|
||||
createTime: Date; // 创建时间
|
||||
updateTime: Date; // 更新时间
|
||||
products?: BusinessProduct[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询商机列表 */
|
||||
export function getBusinessPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmBusinessApi.Business>>(
|
||||
'/crm/business/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询商机列表,基于指定客户 */
|
||||
export function getBusinessPageByCustomer(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmBusinessApi.Business>>(
|
||||
'/crm/business/page-by-customer',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询商机详情 */
|
||||
export function getBusiness(id: number) {
|
||||
return requestClient.get<CrmBusinessApi.Business>(
|
||||
`/crm/business/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得商机列表(精简) */
|
||||
export function getSimpleBusinessList() {
|
||||
return requestClient.get<CrmBusinessApi.Business[]>(
|
||||
'/crm/business/simple-all-list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增商机 */
|
||||
export function createBusiness(data: CrmBusinessApi.Business) {
|
||||
return requestClient.post('/crm/business/create', data);
|
||||
}
|
||||
|
||||
/** 修改商机 */
|
||||
export function updateBusiness(data: CrmBusinessApi.Business) {
|
||||
return requestClient.put('/crm/business/update', data);
|
||||
}
|
||||
|
||||
/** 修改商机状态 */
|
||||
export function updateBusinessStatus(data: CrmBusinessApi.Business) {
|
||||
return requestClient.put('/crm/business/update-status', data);
|
||||
}
|
||||
|
||||
/** 删除商机 */
|
||||
export function deleteBusiness(id: number) {
|
||||
return requestClient.delete(`/crm/business/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 导出商机 */
|
||||
export function exportBusiness(params: any) {
|
||||
return requestClient.download('/crm/business/export-excel', params);
|
||||
}
|
||||
|
||||
/** 联系人关联商机列表 */
|
||||
export function getBusinessPageByContact(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmBusinessApi.Business>>(
|
||||
'/crm/business/page-by-contact',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 商机转移 */
|
||||
export function transferBusiness(data: CrmPermissionApi.TransferReq) {
|
||||
return requestClient.put('/crm/business/transfer', data);
|
||||
}
|
||||
91
apps/web-antd/src/api/crm/business/status/index.ts
Normal file
91
apps/web-antd/src/api/crm/business/status/index.ts
Normal file
@@ -0,0 +1,91 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmBusinessStatusApi {
|
||||
/** 商机状态信息 */
|
||||
export interface BusinessStatus {
|
||||
id: number;
|
||||
name: string;
|
||||
percent: number;
|
||||
}
|
||||
|
||||
/** 商机状态组信息 */
|
||||
export interface BusinessStatusType {
|
||||
id: number;
|
||||
name: string;
|
||||
deptIds: number[];
|
||||
statuses?: BusinessStatus[];
|
||||
}
|
||||
|
||||
/** 默认商机状态 */
|
||||
export const DEFAULT_STATUSES = [
|
||||
{
|
||||
endStatus: 1,
|
||||
key: '结束',
|
||||
name: '赢单',
|
||||
percent: 100,
|
||||
},
|
||||
{
|
||||
endStatus: 2,
|
||||
key: '结束',
|
||||
name: '输单',
|
||||
percent: 0,
|
||||
},
|
||||
{
|
||||
endStatus: 3,
|
||||
key: '结束',
|
||||
name: '无效',
|
||||
percent: 0,
|
||||
},
|
||||
] as const;
|
||||
}
|
||||
|
||||
/** 查询商机状态组列表 */
|
||||
export function getBusinessStatusPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmBusinessStatusApi.BusinessStatusType>>(
|
||||
'/crm/business-status/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增商机状态组 */
|
||||
export function createBusinessStatus(
|
||||
data: CrmBusinessStatusApi.BusinessStatusType,
|
||||
) {
|
||||
return requestClient.post('/crm/business-status/create', data);
|
||||
}
|
||||
|
||||
/** 修改商机状态组 */
|
||||
export function updateBusinessStatus(
|
||||
data: CrmBusinessStatusApi.BusinessStatusType,
|
||||
) {
|
||||
return requestClient.put('/crm/business-status/update', data);
|
||||
}
|
||||
|
||||
/** 查询商机状态类型详情 */
|
||||
export function getBusinessStatus(id: number) {
|
||||
return requestClient.get<CrmBusinessStatusApi.BusinessStatusType>(
|
||||
`/crm/business-status/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 删除商机状态 */
|
||||
export function deleteBusinessStatus(id: number) {
|
||||
return requestClient.delete(`/crm/business-status/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得商机状态组列表 */
|
||||
export function getBusinessStatusTypeSimpleList() {
|
||||
return requestClient.get<CrmBusinessStatusApi.BusinessStatusType[]>(
|
||||
'/crm/business-status/type-simple-list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得商机阶段列表 */
|
||||
export function getBusinessStatusSimpleList(typeId: number) {
|
||||
return requestClient.get<CrmBusinessStatusApi.BusinessStatus[]>(
|
||||
'/crm/business-status/status-simple-list',
|
||||
{ params: { typeId } },
|
||||
);
|
||||
}
|
||||
86
apps/web-antd/src/api/crm/clue/index.ts
Normal file
86
apps/web-antd/src/api/crm/clue/index.ts
Normal file
@@ -0,0 +1,86 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { CrmPermissionApi } from '#/api/crm/permission';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmClueApi {
|
||||
/** 线索信息 */
|
||||
export interface Clue {
|
||||
id: number; // 编号
|
||||
name: string; // 线索名称
|
||||
followUpStatus: boolean; // 跟进状态
|
||||
contactLastTime: Date; // 最后跟进时间
|
||||
contactLastContent: string; // 最后跟进内容
|
||||
contactNextTime: Date; // 下次联系时间
|
||||
ownerUserId: number; // 负责人的用户编号
|
||||
ownerUserName?: string; // 负责人的用户名称
|
||||
ownerUserDept?: string; // 负责人的部门名称
|
||||
transformStatus: boolean; // 转化状态
|
||||
customerId: number; // 客户编号
|
||||
customerName?: string; // 客户名称
|
||||
mobile: string; // 手机号
|
||||
telephone: string; // 电话
|
||||
qq: string; // QQ
|
||||
wechat: string; // wechat
|
||||
email: string; // email
|
||||
areaId: number; // 所在地
|
||||
areaName?: string; // 所在地名称
|
||||
detailAddress: string; // 详细地址
|
||||
industryId: number; // 所属行业
|
||||
level: number; // 客户等级
|
||||
source: number; // 客户来源
|
||||
remark: string; // 备注
|
||||
creator: string; // 创建人
|
||||
creatorName?: string; // 创建人名称
|
||||
createTime: Date; // 创建时间
|
||||
updateTime: Date; // 更新时间
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询线索列表 */
|
||||
export function getCluePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmClueApi.Clue>>('/crm/clue/page', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询线索详情 */
|
||||
export function getClue(id: number) {
|
||||
return requestClient.get<CrmClueApi.Clue>(`/crm/clue/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 新增线索 */
|
||||
export function createClue(data: CrmClueApi.Clue) {
|
||||
return requestClient.post('/crm/clue/create', data);
|
||||
}
|
||||
|
||||
/** 修改线索 */
|
||||
export function updateClue(data: CrmClueApi.Clue) {
|
||||
return requestClient.put('/crm/clue/update', data);
|
||||
}
|
||||
|
||||
/** 删除线索 */
|
||||
export function deleteClue(id: number) {
|
||||
return requestClient.delete(`/crm/clue/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 导出线索 */
|
||||
export function exportClue(params: any) {
|
||||
return requestClient.download('/crm/clue/export-excel', params);
|
||||
}
|
||||
|
||||
/** 线索转移 */
|
||||
export function transferClue(data: CrmPermissionApi.TransferReq) {
|
||||
return requestClient.put('/crm/clue/transfer', data);
|
||||
}
|
||||
|
||||
/** 线索转化为客户 */
|
||||
export function transformClue(id: number) {
|
||||
return requestClient.put('/crm/clue/transform', { id });
|
||||
}
|
||||
|
||||
/** 获得分配给我的、待跟进的线索数量 */
|
||||
export function getFollowClueCount() {
|
||||
return requestClient.get<number>('/crm/clue/follow-count');
|
||||
}
|
||||
140
apps/web-antd/src/api/crm/contact/index.ts
Normal file
140
apps/web-antd/src/api/crm/contact/index.ts
Normal file
@@ -0,0 +1,140 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { CrmPermissionApi } from '#/api/crm/permission';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmContactApi {
|
||||
/** 联系人信息 */
|
||||
export interface Contact {
|
||||
id: number; // 编号
|
||||
name: string; // 联系人名称
|
||||
customerId: number; // 客户编号
|
||||
customerName?: string; // 客户名称
|
||||
contactLastTime: Date; // 最后跟进时间
|
||||
contactLastContent: string; // 最后跟进内容
|
||||
contactNextTime: Date; // 下次联系时间
|
||||
ownerUserId: number; // 负责人的用户编号
|
||||
ownerUserName?: string; // 负责人的用户名称
|
||||
ownerUserDept?: string; // 负责人的部门名称
|
||||
mobile: string; // 手机号
|
||||
telephone: string; // 电话
|
||||
qq: string; // QQ
|
||||
wechat: string; // wechat
|
||||
email: string; // email
|
||||
areaId: number; // 所在地
|
||||
areaName?: string; // 所在地名称
|
||||
detailAddress: string; // 详细地址
|
||||
sex: number; // 性别
|
||||
master: boolean; // 是否主联系人
|
||||
post: string; // 职务
|
||||
parentId: number; // 上级联系人编号
|
||||
parentName?: string; // 上级联系人名称
|
||||
remark: string; // 备注
|
||||
creator: string; // 创建人
|
||||
creatorName?: string; // 创建人名称
|
||||
createTime: Date; // 创建时间
|
||||
updateTime: Date; // 更新时间
|
||||
}
|
||||
|
||||
/** 联系人商机关联请求 */
|
||||
export interface ContactBusinessReq {
|
||||
contactId: number;
|
||||
businessIds: number[];
|
||||
}
|
||||
|
||||
/** 商机联系人关联请求 */
|
||||
export interface BusinessContactReq {
|
||||
businessId: number;
|
||||
contactIds: number[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询联系人列表 */
|
||||
export function getContactPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmContactApi.Contact>>(
|
||||
'/crm/contact/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询联系人列表,基于指定客户 */
|
||||
export function getContactPageByCustomer(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmContactApi.Contact>>(
|
||||
'/crm/contact/page-by-customer',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询联系人列表,基于指定商机 */
|
||||
export function getContactPageByBusiness(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmContactApi.Contact>>(
|
||||
'/crm/contact/page-by-business',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询联系人详情 */
|
||||
export function getContact(id: number) {
|
||||
return requestClient.get<CrmContactApi.Contact>(`/crm/contact/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 新增联系人 */
|
||||
export function createContact(data: CrmContactApi.Contact) {
|
||||
return requestClient.post('/crm/contact/create', data);
|
||||
}
|
||||
|
||||
/** 修改联系人 */
|
||||
export function updateContact(data: CrmContactApi.Contact) {
|
||||
return requestClient.put('/crm/contact/update', data);
|
||||
}
|
||||
|
||||
/** 删除联系人 */
|
||||
export function deleteContact(id: number) {
|
||||
return requestClient.delete(`/crm/contact/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 导出联系人 */
|
||||
export function exportContact(params: any) {
|
||||
return requestClient.download('/crm/contact/export-excel', params);
|
||||
}
|
||||
|
||||
/** 获得联系人列表(精简) */
|
||||
export function getSimpleContactList() {
|
||||
return requestClient.get<CrmContactApi.Contact[]>(
|
||||
'/crm/contact/simple-all-list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 批量新增联系人商机关联 */
|
||||
export function createContactBusinessList(
|
||||
data: CrmContactApi.ContactBusinessReq,
|
||||
) {
|
||||
return requestClient.post('/crm/contact/create-business-list', data);
|
||||
}
|
||||
|
||||
/** 批量新增商机联系人关联 */
|
||||
export function createBusinessContactList(
|
||||
data: CrmContactApi.BusinessContactReq,
|
||||
) {
|
||||
return requestClient.post('/crm/contact/create-business-list2', data);
|
||||
}
|
||||
|
||||
/** 解除联系人商机关联 */
|
||||
export function deleteContactBusinessList(
|
||||
data: CrmContactApi.ContactBusinessReq,
|
||||
) {
|
||||
return requestClient.delete('/crm/contact/delete-business-list', { data });
|
||||
}
|
||||
|
||||
/** 解除商机联系人关联 */
|
||||
export function deleteBusinessContactList(
|
||||
data: CrmContactApi.BusinessContactReq,
|
||||
) {
|
||||
return requestClient.delete('/crm/contact/delete-business-list2', { data });
|
||||
}
|
||||
|
||||
/** 联系人转移 */
|
||||
export function transferContact(data: CrmPermissionApi.TransferReq) {
|
||||
return requestClient.put('/crm/contact/transfer', data);
|
||||
}
|
||||
21
apps/web-antd/src/api/crm/contract/config/index.ts
Normal file
21
apps/web-antd/src/api/crm/contract/config/index.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmContractConfigApi {
|
||||
/** 合同配置信息 */
|
||||
export interface Config {
|
||||
notifyEnabled?: boolean;
|
||||
notifyDays?: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 获取合同配置 */
|
||||
export function getContractConfig() {
|
||||
return requestClient.get<CrmContractConfigApi.Config>(
|
||||
'/crm/contract-config/get',
|
||||
);
|
||||
}
|
||||
|
||||
/** 更新合同配置 */
|
||||
export function saveContractConfig(data: CrmContractConfigApi.Config) {
|
||||
return requestClient.put('/crm/contract-config/save', data);
|
||||
}
|
||||
132
apps/web-antd/src/api/crm/contract/index.ts
Normal file
132
apps/web-antd/src/api/crm/contract/index.ts
Normal file
@@ -0,0 +1,132 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { CrmPermissionApi } from '#/api/crm/permission';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmContractApi {
|
||||
/** 合同产品信息 */
|
||||
export interface ContractProduct {
|
||||
id: number;
|
||||
productId: number;
|
||||
productName: string;
|
||||
productNo: string;
|
||||
productUnit: number;
|
||||
productPrice: number;
|
||||
contractPrice: number;
|
||||
count: number;
|
||||
totalPrice: number;
|
||||
}
|
||||
|
||||
/** 合同信息 */
|
||||
export interface Contract {
|
||||
id: number;
|
||||
name: string;
|
||||
no: string;
|
||||
customerId: number;
|
||||
customerName?: string;
|
||||
businessId: number;
|
||||
businessName: string;
|
||||
contactLastTime: Date;
|
||||
ownerUserId: number;
|
||||
ownerUserName?: string;
|
||||
ownerUserDeptName?: string;
|
||||
processInstanceId: number;
|
||||
auditStatus: number;
|
||||
orderDate: Date;
|
||||
startTime: Date;
|
||||
endTime: Date;
|
||||
totalProductPrice: number;
|
||||
discountPercent: number;
|
||||
totalPrice: number;
|
||||
totalReceivablePrice: number;
|
||||
signContactId: number;
|
||||
signContactName?: string;
|
||||
signUserId: number;
|
||||
signUserName: string;
|
||||
remark: string;
|
||||
createTime?: Date;
|
||||
creator: string;
|
||||
creatorName: string;
|
||||
updateTime?: Date;
|
||||
products?: ContractProduct[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询合同列表 */
|
||||
export function getContractPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmContractApi.Contract>>(
|
||||
'/crm/contract/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询合同列表,基于指定客户 */
|
||||
export function getContractPageByCustomer(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmContractApi.Contract>>(
|
||||
'/crm/contract/page-by-customer',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询合同列表,基于指定商机 */
|
||||
export function getContractPageByBusiness(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmContractApi.Contract>>(
|
||||
'/crm/contract/page-by-business',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询合同详情 */
|
||||
export function getContract(id: number) {
|
||||
return requestClient.get<CrmContractApi.Contract>(
|
||||
`/crm/contract/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询合同下拉列表 */
|
||||
export function getContractSimpleList(customerId: number) {
|
||||
return requestClient.get<CrmContractApi.Contract[]>(
|
||||
`/crm/contract/simple-list?customerId=${customerId}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增合同 */
|
||||
export function createContract(data: CrmContractApi.Contract) {
|
||||
return requestClient.post('/crm/contract/create', data);
|
||||
}
|
||||
|
||||
/** 修改合同 */
|
||||
export function updateContract(data: CrmContractApi.Contract) {
|
||||
return requestClient.put('/crm/contract/update', data);
|
||||
}
|
||||
|
||||
/** 删除合同 */
|
||||
export function deleteContract(id: number) {
|
||||
return requestClient.delete(`/crm/contract/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 导出合同 */
|
||||
export function exportContract(params: any) {
|
||||
return requestClient.download('/crm/contract/export-excel', params);
|
||||
}
|
||||
|
||||
/** 提交审核 */
|
||||
export function submitContract(id: number) {
|
||||
return requestClient.put(`/crm/contract/submit?id=${id}`);
|
||||
}
|
||||
|
||||
/** 合同转移 */
|
||||
export function transferContract(data: CrmPermissionApi.TransferReq) {
|
||||
return requestClient.put('/crm/contract/transfer', data);
|
||||
}
|
||||
|
||||
/** 获得待审核合同数量 */
|
||||
export function getAuditContractCount() {
|
||||
return requestClient.get<number>('/crm/contract/audit-count');
|
||||
}
|
||||
|
||||
/** 获得即将到期(提醒)的合同数量 */
|
||||
export function getRemindContractCount() {
|
||||
return requestClient.get<number>('/crm/contract/remind-count');
|
||||
}
|
||||
146
apps/web-antd/src/api/crm/customer/index.ts
Normal file
146
apps/web-antd/src/api/crm/customer/index.ts
Normal file
@@ -0,0 +1,146 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { CrmPermissionApi } from '#/api/crm/permission';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmCustomerApi {
|
||||
/** 客户信息 */
|
||||
export interface Customer {
|
||||
id: number; // 编号
|
||||
name: string; // 客户名称
|
||||
followUpStatus: boolean; // 跟进状态
|
||||
contactLastTime: Date; // 最后跟进时间
|
||||
contactLastContent: string; // 最后跟进内容
|
||||
contactNextTime: Date; // 下次联系时间
|
||||
ownerUserId: number; // 负责人的用户编号
|
||||
ownerUserName?: string; // 负责人的用户名称
|
||||
ownerUserDept?: string; // 负责人的部门名称
|
||||
lockStatus?: boolean;
|
||||
dealStatus?: boolean;
|
||||
mobile: string; // 手机号
|
||||
telephone: string; // 电话
|
||||
qq: string; // QQ
|
||||
wechat: string; // wechat
|
||||
email: string; // email
|
||||
areaId: number; // 所在地
|
||||
areaName?: string; // 所在地名称
|
||||
detailAddress: string; // 详细地址
|
||||
industryId: number; // 所属行业
|
||||
level: number; // 客户等级
|
||||
source: number; // 客户来源
|
||||
remark: string; // 备注
|
||||
creator: string; // 创建人
|
||||
creatorName?: string; // 创建人名称
|
||||
createTime: Date; // 创建时间
|
||||
updateTime: Date; // 更新时间
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询客户列表 */
|
||||
export function getCustomerPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmCustomerApi.Customer>>(
|
||||
'/crm/customer/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询客户详情 */
|
||||
export function getCustomer(id: number) {
|
||||
return requestClient.get<CrmCustomerApi.Customer>(
|
||||
`/crm/customer/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增客户 */
|
||||
export function createCustomer(data: CrmCustomerApi.Customer) {
|
||||
return requestClient.post('/crm/customer/create', data);
|
||||
}
|
||||
|
||||
/** 修改客户 */
|
||||
export function updateCustomer(data: CrmCustomerApi.Customer) {
|
||||
return requestClient.put('/crm/customer/update', data);
|
||||
}
|
||||
|
||||
/** 删除客户 */
|
||||
export function deleteCustomer(id: number) {
|
||||
return requestClient.delete(`/crm/customer/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 导出客户 */
|
||||
export function exportCustomer(params: any) {
|
||||
return requestClient.download('/crm/customer/export-excel', params);
|
||||
}
|
||||
|
||||
/** 下载客户导入模板 */
|
||||
export function importCustomerTemplate() {
|
||||
return requestClient.download('/crm/customer/get-import-template');
|
||||
}
|
||||
|
||||
/** 导入客户 */
|
||||
export function importCustomer(file: File) {
|
||||
return requestClient.upload('/crm/customer/import', { file });
|
||||
}
|
||||
|
||||
/** 获取客户精简信息列表 */
|
||||
export function getCustomerSimpleList() {
|
||||
return requestClient.get<CrmCustomerApi.Customer[]>(
|
||||
'/crm/customer/simple-list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 客户转移 */
|
||||
export function transferCustomer(data: CrmPermissionApi.TransferReq) {
|
||||
return requestClient.put('/crm/customer/transfer', data);
|
||||
}
|
||||
|
||||
/** 锁定/解锁客户 */
|
||||
export function lockCustomer(id: number, lockStatus: boolean) {
|
||||
return requestClient.put('/crm/customer/lock', { id, lockStatus });
|
||||
}
|
||||
|
||||
/** 领取公海客户 */
|
||||
export function receiveCustomer(ids: number[]) {
|
||||
return requestClient.put('/crm/customer/receive', { ids: ids.join(',') });
|
||||
}
|
||||
|
||||
/** 分配公海给对应负责人 */
|
||||
export function distributeCustomer(ids: number[], ownerUserId: number) {
|
||||
return requestClient.put('/crm/customer/distribute', { ids, ownerUserId });
|
||||
}
|
||||
|
||||
/** 客户放入公海 */
|
||||
export function putCustomerPool(id: number) {
|
||||
return requestClient.put(`/crm/customer/put-pool?id=${id}`);
|
||||
}
|
||||
|
||||
/** 更新客户的成交状态 */
|
||||
export function updateCustomerDealStatus(id: number, dealStatus: boolean) {
|
||||
return requestClient.put('/crm/customer/update-deal-status', {
|
||||
id,
|
||||
dealStatus,
|
||||
});
|
||||
}
|
||||
|
||||
/** 进入公海客户提醒的客户列表 */
|
||||
export function getPutPoolRemindCustomerPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmCustomerApi.Customer>>(
|
||||
'/crm/customer/put-pool-remind-page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得待进入公海客户数量 */
|
||||
export function getPutPoolRemindCustomerCount() {
|
||||
return requestClient.get<number>('/crm/customer/put-pool-remind-count');
|
||||
}
|
||||
|
||||
/** 获得今日需联系客户数量 */
|
||||
export function getTodayContactCustomerCount() {
|
||||
return requestClient.get<number>('/crm/customer/today-contact-count');
|
||||
}
|
||||
|
||||
/** 获得分配给我、待跟进的线索数量的客户数量 */
|
||||
export function getFollowCustomerCount() {
|
||||
return requestClient.get<number>('/crm/customer/follow-count');
|
||||
}
|
||||
58
apps/web-antd/src/api/crm/customer/limitConfig/index.ts
Normal file
58
apps/web-antd/src/api/crm/customer/limitConfig/index.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmCustomerLimitConfigApi {
|
||||
/** 客户限制配置 */
|
||||
export interface CustomerLimitConfig {
|
||||
id?: number;
|
||||
type?: number;
|
||||
userIds?: string;
|
||||
deptIds?: string;
|
||||
maxCount?: number;
|
||||
dealCountEnabled?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户限制配置类型
|
||||
*/
|
||||
export enum LimitConfType {
|
||||
/** 锁定客户数限制 */
|
||||
CUSTOMER_LOCK_LIMIT = 2,
|
||||
/** 拥有客户数限制 */
|
||||
CUSTOMER_QUANTITY_LIMIT = 1,
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询客户限制配置列表 */
|
||||
export function getCustomerLimitConfigPage(params: PageParam) {
|
||||
return requestClient.get<
|
||||
PageResult<CrmCustomerLimitConfigApi.CustomerLimitConfig>
|
||||
>('/crm/customer-limit-config/page', { params });
|
||||
}
|
||||
|
||||
/** 查询客户限制配置详情 */
|
||||
export function getCustomerLimitConfig(id: number) {
|
||||
return requestClient.get<CrmCustomerLimitConfigApi.CustomerLimitConfig>(
|
||||
`/crm/customer-limit-config/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增客户限制配置 */
|
||||
export function createCustomerLimitConfig(
|
||||
data: CrmCustomerLimitConfigApi.CustomerLimitConfig,
|
||||
) {
|
||||
return requestClient.post('/crm/customer-limit-config/create', data);
|
||||
}
|
||||
|
||||
/** 修改客户限制配置 */
|
||||
export function updateCustomerLimitConfig(
|
||||
data: CrmCustomerLimitConfigApi.CustomerLimitConfig,
|
||||
) {
|
||||
return requestClient.put('/crm/customer-limit-config/update', data);
|
||||
}
|
||||
|
||||
/** 删除客户限制配置 */
|
||||
export function deleteCustomerLimitConfig(id: number) {
|
||||
return requestClient.delete(`/crm/customer-limit-config/delete?id=${id}`);
|
||||
}
|
||||
26
apps/web-antd/src/api/crm/customer/poolConfig/index.ts
Normal file
26
apps/web-antd/src/api/crm/customer/poolConfig/index.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmCustomerPoolConfigApi {
|
||||
/** 客户公海规则设置 */
|
||||
export interface CustomerPoolConfig {
|
||||
enabled?: boolean;
|
||||
contactExpireDays?: number;
|
||||
dealExpireDays?: number;
|
||||
notifyEnabled?: boolean;
|
||||
notifyDays?: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 获取客户公海规则设置 */
|
||||
export function getCustomerPoolConfig() {
|
||||
return requestClient.get<CrmCustomerPoolConfigApi.CustomerPoolConfig>(
|
||||
'/crm/customer-pool-config/get',
|
||||
);
|
||||
}
|
||||
|
||||
/** 更新客户公海规则设置 */
|
||||
export function saveCustomerPoolConfig(
|
||||
data: CrmCustomerPoolConfigApi.CustomerPoolConfig,
|
||||
) {
|
||||
return requestClient.put('/crm/customer-pool-config/save', data);
|
||||
}
|
||||
53
apps/web-antd/src/api/crm/followup/index.ts
Normal file
53
apps/web-antd/src/api/crm/followup/index.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmFollowUpApi {
|
||||
/** 关联商机信息 */
|
||||
export interface Business {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
/** 关联联系人信息 */
|
||||
export interface Contact {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
/** 跟进记录信息 */
|
||||
export interface FollowUpRecord {
|
||||
id: number; // 编号
|
||||
bizType: number; // 数据类型
|
||||
bizId: number; // 数据编号
|
||||
type: number; // 跟进类型
|
||||
content: string; // 跟进内容
|
||||
picUrls: string[]; // 图片
|
||||
fileUrls: string[]; // 附件
|
||||
nextTime: Date; // 下次联系时间
|
||||
businessIds: number[]; // 关联的商机编号数组
|
||||
businesses: Business[]; // 关联的商机数组
|
||||
contactIds: number[]; // 关联的联系人编号数组
|
||||
contacts: Contact[]; // 关联的联系人数组
|
||||
creator: string;
|
||||
creatorName?: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询跟进记录分页 */
|
||||
export function getFollowUpRecordPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmFollowUpApi.FollowUpRecord>>(
|
||||
'/crm/follow-up-record/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增跟进记录 */
|
||||
export function createFollowUpRecord(data: CrmFollowUpApi.FollowUpRecord) {
|
||||
return requestClient.post('/crm/follow-up-record/create', data);
|
||||
}
|
||||
|
||||
/** 删除跟进记录 */
|
||||
export function deleteFollowUpRecord(id: number) {
|
||||
return requestClient.delete(`/crm/follow-up-record/delete?id=${id}`);
|
||||
}
|
||||
31
apps/web-antd/src/api/crm/operateLog/index.ts
Normal file
31
apps/web-antd/src/api/crm/operateLog/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmOperateLogApi {
|
||||
/** 操作日志查询参数 */
|
||||
export interface OperateLogQuery extends PageParam {
|
||||
bizType: number;
|
||||
bizId: number;
|
||||
}
|
||||
|
||||
/** 操作日志信息 */
|
||||
export interface OperateLog {
|
||||
id: number;
|
||||
bizType: number;
|
||||
bizId: number;
|
||||
type: number;
|
||||
content: string;
|
||||
creator: string;
|
||||
creatorName?: string;
|
||||
createTime: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 获得操作日志 */
|
||||
export function getOperateLogPage(params: CrmOperateLogApi.OperateLogQuery) {
|
||||
return requestClient.get<PageResult<CrmOperateLogApi.OperateLog>>(
|
||||
'/crm/operate-log/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
79
apps/web-antd/src/api/crm/permission/index.ts
Normal file
79
apps/web-antd/src/api/crm/permission/index.ts
Normal file
@@ -0,0 +1,79 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmPermissionApi {
|
||||
/** 数据权限信息 */
|
||||
export interface Permission {
|
||||
id?: number; // 数据权限编号
|
||||
userId: number; // 用户编号
|
||||
bizType: number; // Crm 类型
|
||||
bizId: number; // Crm 类型数据编号
|
||||
level: number; // 权限级别
|
||||
toBizTypes?: number[]; // 同时添加至
|
||||
deptName?: string; // 部门名称
|
||||
nickname?: string; // 用户昵称
|
||||
postNames?: string[]; // 岗位名称数组
|
||||
createTime?: Date;
|
||||
ids?: number[];
|
||||
}
|
||||
|
||||
/** 数据权限转移请求 */
|
||||
export interface TransferReq {
|
||||
id: number; // 模块编号
|
||||
newOwnerUserId: number; // 新负责人的用户编号
|
||||
oldOwnerPermissionLevel?: number; // 老负责人加入团队后的权限级别
|
||||
toBizTypes?: number[]; // 转移客户时,需要额外有【联系人】【商机】【合同】的 checkbox 选择
|
||||
}
|
||||
|
||||
/**
|
||||
* CRM 业务类型枚举
|
||||
*/
|
||||
export enum BizType {
|
||||
CRM_BUSINESS = 4, // 商机
|
||||
CRM_CLUE = 1, // 线索
|
||||
CRM_CONTACT = 3, // 联系人
|
||||
CRM_CONTRACT = 5, // 合同
|
||||
CRM_CUSTOMER = 2, // 客户
|
||||
CRM_PRODUCT = 6, // 产品
|
||||
CRM_RECEIVABLE = 7, // 回款
|
||||
CRM_RECEIVABLE_PLAN = 8, // 回款计划
|
||||
}
|
||||
|
||||
/**
|
||||
* CRM 数据权限级别枚举
|
||||
*/
|
||||
export enum PermissionLevel {
|
||||
OWNER = 1, // 负责人
|
||||
READ = 2, // 只读
|
||||
WRITE = 3, // 读写
|
||||
}
|
||||
}
|
||||
|
||||
/** 获得数据权限列表(查询团队成员列表) */
|
||||
export function getPermissionList(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmPermissionApi.Permission>>(
|
||||
'/crm/permission/list',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 创建数据权限(新增团队成员) */
|
||||
export function createPermission(data: CrmPermissionApi.Permission) {
|
||||
return requestClient.post('/crm/permission/create', data);
|
||||
}
|
||||
|
||||
/** 编辑数据权限(修改团队成员权限级别) */
|
||||
export function updatePermission(data: CrmPermissionApi.Permission) {
|
||||
return requestClient.put('/crm/permission/update', data);
|
||||
}
|
||||
|
||||
/** 删除数据权限(删除团队成员) */
|
||||
export function deletePermissionBatch(ids: number[]) {
|
||||
return requestClient.delete(`/crm/permission/delete?ids=${ids.join(',')}`);
|
||||
}
|
||||
|
||||
/** 删除自己的数据权限(退出团队) */
|
||||
export function deleteSelfPermission(id: number) {
|
||||
return requestClient.delete(`/crm/permission/delete-self?id=${id}`);
|
||||
}
|
||||
46
apps/web-antd/src/api/crm/product/category/index.ts
Normal file
46
apps/web-antd/src/api/crm/product/category/index.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import type { PageParam } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmProductCategoryApi {
|
||||
/** 产品分类信息 */
|
||||
export interface ProductCategory {
|
||||
id: number;
|
||||
name: string;
|
||||
parentId: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询产品分类详情 */
|
||||
export function getProductCategory(id: number) {
|
||||
return requestClient.get<CrmProductCategoryApi.ProductCategory>(
|
||||
`/crm/product-category/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增产品分类 */
|
||||
export function createProductCategory(
|
||||
data: CrmProductCategoryApi.ProductCategory,
|
||||
) {
|
||||
return requestClient.post('/crm/product-category/create', data);
|
||||
}
|
||||
|
||||
/** 修改产品分类 */
|
||||
export function updateProductCategory(
|
||||
data: CrmProductCategoryApi.ProductCategory,
|
||||
) {
|
||||
return requestClient.put('/crm/product-category/update', data);
|
||||
}
|
||||
|
||||
/** 删除产品分类 */
|
||||
export function deleteProductCategory(id: number) {
|
||||
return requestClient.delete(`/crm/product-category/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 产品分类列表 */
|
||||
export function getProductCategoryList(params?: PageParam) {
|
||||
return requestClient.get<CrmProductCategoryApi.ProductCategory[]>(
|
||||
'/crm/product-category/list',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
57
apps/web-antd/src/api/crm/product/index.ts
Normal file
57
apps/web-antd/src/api/crm/product/index.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmProductApi {
|
||||
/** 产品信息 */
|
||||
export interface Product {
|
||||
id: number;
|
||||
name: string;
|
||||
no: string;
|
||||
unit: number;
|
||||
price: number;
|
||||
status: number;
|
||||
categoryId: number;
|
||||
categoryName?: string;
|
||||
description: string;
|
||||
ownerUserId: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询产品列表 */
|
||||
export function getProductPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmProductApi.Product>>(
|
||||
'/crm/product/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得产品精简列表 */
|
||||
export function getProductSimpleList() {
|
||||
return requestClient.get<CrmProductApi.Product[]>('/crm/product/simple-list');
|
||||
}
|
||||
|
||||
/** 查询产品详情 */
|
||||
export function getProduct(id: number) {
|
||||
return requestClient.get<CrmProductApi.Product>(`/crm/product/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 新增产品 */
|
||||
export function createProduct(data: CrmProductApi.Product) {
|
||||
return requestClient.post('/crm/product/create', data);
|
||||
}
|
||||
|
||||
/** 修改产品 */
|
||||
export function updateProduct(data: CrmProductApi.Product) {
|
||||
return requestClient.put('/crm/product/update', data);
|
||||
}
|
||||
|
||||
/** 删除产品 */
|
||||
export function deleteProduct(id: number) {
|
||||
return requestClient.delete(`/crm/product/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 导出产品 */
|
||||
export function exportProduct(params: any) {
|
||||
return requestClient.download('/crm/product/export-excel', params);
|
||||
}
|
||||
90
apps/web-antd/src/api/crm/receivable/index.ts
Normal file
90
apps/web-antd/src/api/crm/receivable/index.ts
Normal file
@@ -0,0 +1,90 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmReceivableApi {
|
||||
/** 合同信息 */
|
||||
export interface Contract {
|
||||
id?: number;
|
||||
name?: string;
|
||||
no: string;
|
||||
totalPrice: number;
|
||||
}
|
||||
|
||||
/** 回款信息 */
|
||||
export interface Receivable {
|
||||
id: number;
|
||||
no: string;
|
||||
planId?: number;
|
||||
period?: number;
|
||||
customerId?: number;
|
||||
customerName?: string;
|
||||
contractId?: number;
|
||||
contract?: Contract;
|
||||
auditStatus: number;
|
||||
processInstanceId: number;
|
||||
returnTime: Date;
|
||||
returnType: number;
|
||||
price: number;
|
||||
ownerUserId: number;
|
||||
ownerUserName?: string;
|
||||
remark: string;
|
||||
creator: string; // 创建人
|
||||
creatorName?: string; // 创建人名称
|
||||
createTime: Date; // 创建时间
|
||||
updateTime: Date; // 更新时间
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询回款列表 */
|
||||
export function getReceivablePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmReceivableApi.Receivable>>(
|
||||
'/crm/receivable/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询回款列表,基于指定客户 */
|
||||
export function getReceivablePageByCustomer(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmReceivableApi.Receivable>>(
|
||||
'/crm/receivable/page-by-customer',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询回款详情 */
|
||||
export function getReceivable(id: number) {
|
||||
return requestClient.get<CrmReceivableApi.Receivable>(
|
||||
`/crm/receivable/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增回款 */
|
||||
export function createReceivable(data: CrmReceivableApi.Receivable) {
|
||||
return requestClient.post('/crm/receivable/create', data);
|
||||
}
|
||||
|
||||
/** 修改回款 */
|
||||
export function updateReceivable(data: CrmReceivableApi.Receivable) {
|
||||
return requestClient.put('/crm/receivable/update', data);
|
||||
}
|
||||
|
||||
/** 删除回款 */
|
||||
export function deleteReceivable(id: number) {
|
||||
return requestClient.delete(`/crm/receivable/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 导出回款 */
|
||||
export function exportReceivable(params: any) {
|
||||
return requestClient.download('/crm/receivable/export-excel', params);
|
||||
}
|
||||
|
||||
/** 提交审核 */
|
||||
export function submitReceivable(id: number) {
|
||||
return requestClient.put(`/crm/receivable/submit?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得待审核回款数量 */
|
||||
export function getAuditReceivableCount() {
|
||||
return requestClient.get<number>('/crm/receivable/audit-count');
|
||||
}
|
||||
98
apps/web-antd/src/api/crm/receivable/plan/index.ts
Normal file
98
apps/web-antd/src/api/crm/receivable/plan/index.ts
Normal file
@@ -0,0 +1,98 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmReceivablePlanApi {
|
||||
/** 回款计划信息 */
|
||||
export interface Plan {
|
||||
id: number;
|
||||
period: number;
|
||||
receivableId: number;
|
||||
price: number;
|
||||
returnTime: Date;
|
||||
remindDays: number;
|
||||
returnType: number;
|
||||
remindTime: Date;
|
||||
customerId: number;
|
||||
customerName?: string;
|
||||
contractId?: number;
|
||||
contractNo?: string;
|
||||
ownerUserId: number;
|
||||
ownerUserName?: string;
|
||||
remark: string;
|
||||
creator: string;
|
||||
creatorName?: string;
|
||||
createTime: Date;
|
||||
updateTime: Date;
|
||||
receivable?: {
|
||||
price: number;
|
||||
returnTime: Date;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询回款计划列表 */
|
||||
export function getReceivablePlanPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmReceivablePlanApi.Plan>>(
|
||||
'/crm/receivable-plan/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询回款计划列表(按客户) */
|
||||
export function getReceivablePlanPageByCustomer(params: PageParam) {
|
||||
return requestClient.get<PageResult<CrmReceivablePlanApi.Plan>>(
|
||||
'/crm/receivable-plan/page-by-customer',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询回款计划详情 */
|
||||
export function getReceivablePlan(id: number) {
|
||||
return requestClient.get<CrmReceivablePlanApi.Plan>(
|
||||
'/crm/receivable-plan/get',
|
||||
{ params: { id } },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询回款计划下拉数据 */
|
||||
export function getReceivablePlanSimpleList(
|
||||
customerId: number,
|
||||
contractId: number,
|
||||
) {
|
||||
return requestClient.get<CrmReceivablePlanApi.Plan[]>(
|
||||
'/crm/receivable-plan/simple-list',
|
||||
{
|
||||
params: { customerId, contractId },
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增回款计划 */
|
||||
export function createReceivablePlan(data: CrmReceivablePlanApi.Plan) {
|
||||
return requestClient.post('/crm/receivable-plan/create', data);
|
||||
}
|
||||
|
||||
/** 修改回款计划 */
|
||||
export function updateReceivablePlan(data: CrmReceivablePlanApi.Plan) {
|
||||
return requestClient.put('/crm/receivable-plan/update', data);
|
||||
}
|
||||
|
||||
/** 删除回款计划 */
|
||||
export function deleteReceivablePlan(id: number) {
|
||||
return requestClient.delete('/crm/receivable-plan/delete', {
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
/** 导出回款计划 Excel */
|
||||
export function exportReceivablePlan(params: PageParam) {
|
||||
return requestClient.download('/crm/receivable-plan/export-excel', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 获得待回款提醒数量 */
|
||||
export function getReceivablePlanRemindCount() {
|
||||
return requestClient.get<number>('/crm/receivable-plan/remind-count');
|
||||
}
|
||||
191
apps/web-antd/src/api/crm/statistics/customer.ts
Normal file
191
apps/web-antd/src/api/crm/statistics/customer.ts
Normal file
@@ -0,0 +1,191 @@
|
||||
import type { PageParam } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmStatisticsCustomerApi {
|
||||
/** 客户总量分析(按日期) */
|
||||
export interface CustomerSummaryByDate {
|
||||
time: string;
|
||||
customerCreateCount: number;
|
||||
customerDealCount: number;
|
||||
}
|
||||
|
||||
/** 客户总量分析(按用户) */
|
||||
export interface CustomerSummaryByUser {
|
||||
ownerUserName: string;
|
||||
customerCreateCount: number;
|
||||
customerDealCount: number;
|
||||
contractPrice: number;
|
||||
receivablePrice: number;
|
||||
}
|
||||
|
||||
/** 客户跟进次数分析(按日期) */
|
||||
export interface FollowUpSummaryByDate {
|
||||
time: string;
|
||||
followUpRecordCount: number;
|
||||
followUpCustomerCount: number;
|
||||
}
|
||||
|
||||
/** 客户跟进次数分析(按用户) */
|
||||
export interface FollowUpSummaryByUser {
|
||||
ownerUserName: string;
|
||||
followupRecordCount: number;
|
||||
followupCustomerCount: number;
|
||||
}
|
||||
|
||||
/** 客户跟进方式统计 */
|
||||
export interface FollowUpSummaryByType {
|
||||
followUpType: string;
|
||||
followUpRecordCount: number;
|
||||
}
|
||||
|
||||
/** 合同摘要信息 */
|
||||
export interface CustomerContractSummary {
|
||||
customerName: string;
|
||||
contractName: string;
|
||||
totalPrice: number;
|
||||
receivablePrice: number;
|
||||
customerType: string;
|
||||
customerSource: string;
|
||||
ownerUserName: string;
|
||||
creatorUserName: string;
|
||||
createTime: Date;
|
||||
orderDate: Date;
|
||||
}
|
||||
|
||||
/** 客户公海分析(按日期) */
|
||||
export interface PoolSummaryByDate {
|
||||
time: string;
|
||||
customerPutCount: number;
|
||||
customerTakeCount: number;
|
||||
}
|
||||
|
||||
/** 客户公海分析(按用户) */
|
||||
export interface PoolSummaryByUser {
|
||||
ownerUserName: string;
|
||||
customerPutCount: number;
|
||||
customerTakeCount: number;
|
||||
}
|
||||
|
||||
/** 客户成交周期(按日期) */
|
||||
export interface CustomerDealCycleByDate {
|
||||
time: string;
|
||||
customerDealCycle: number;
|
||||
}
|
||||
|
||||
/** 客户成交周期(按用户) */
|
||||
export interface CustomerDealCycleByUser {
|
||||
ownerUserName: string;
|
||||
customerDealCycle: number;
|
||||
customerDealCount: number;
|
||||
}
|
||||
|
||||
/** 客户成交周期(按地区) */
|
||||
export interface CustomerDealCycleByArea {
|
||||
areaName: string;
|
||||
customerDealCycle: number;
|
||||
customerDealCount: number;
|
||||
}
|
||||
|
||||
/** 客户成交周期(按产品) */
|
||||
export interface CustomerDealCycleByProduct {
|
||||
productName: string;
|
||||
customerDealCycle: number;
|
||||
customerDealCount: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 客户总量分析(按日期) */
|
||||
export function getCustomerSummaryByDate(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsCustomerApi.CustomerSummaryByDate[]>(
|
||||
'/crm/statistics-customer/get-customer-summary-by-date',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 客户总量分析(按用户) */
|
||||
export function getCustomerSummaryByUser(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsCustomerApi.CustomerSummaryByUser[]>(
|
||||
'/crm/statistics-customer/get-customer-summary-by-user',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 客户跟进次数分析(按日期) */
|
||||
export function getFollowUpSummaryByDate(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsCustomerApi.FollowUpSummaryByDate[]>(
|
||||
'/crm/statistics-customer/get-follow-up-summary-by-date',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 客户跟进次数分析(按用户) */
|
||||
export function getFollowUpSummaryByUser(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsCustomerApi.FollowUpSummaryByUser[]>(
|
||||
'/crm/statistics-customer/get-follow-up-summary-by-user',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取客户跟进方式统计数 */
|
||||
export function getFollowUpSummaryByType(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsCustomerApi.FollowUpSummaryByType[]>(
|
||||
'/crm/statistics-customer/get-follow-up-summary-by-type',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 合同摘要信息(客户转化率页面) */
|
||||
export function getContractSummary(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsCustomerApi.CustomerContractSummary[]>(
|
||||
'/crm/statistics-customer/get-contract-summary',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取客户公海分析(按日期) */
|
||||
export function getPoolSummaryByDate(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsCustomerApi.PoolSummaryByDate[]>(
|
||||
'/crm/statistics-customer/get-pool-summary-by-date',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取客户公海分析(按用户) */
|
||||
export function getPoolSummaryByUser(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsCustomerApi.PoolSummaryByUser[]>(
|
||||
'/crm/statistics-customer/get-pool-summary-by-user',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取客户成交周期(按日期) */
|
||||
export function getCustomerDealCycleByDate(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsCustomerApi.CustomerDealCycleByDate[]>(
|
||||
'/crm/statistics-customer/get-customer-deal-cycle-by-date',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取客户成交周期(按用户) */
|
||||
export function getCustomerDealCycleByUser(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsCustomerApi.CustomerDealCycleByUser[]>(
|
||||
'/crm/statistics-customer/get-customer-deal-cycle-by-user',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取客户成交周期(按地区) */
|
||||
export function getCustomerDealCycleByArea(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsCustomerApi.CustomerDealCycleByArea[]>(
|
||||
'/crm/statistics-customer/get-customer-deal-cycle-by-area',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取客户成交周期(按产品) */
|
||||
export function getCustomerDealCycleByProduct(params: PageParam) {
|
||||
return requestClient.get<
|
||||
CrmStatisticsCustomerApi.CustomerDealCycleByProduct[]
|
||||
>('/crm/statistics-customer/get-customer-deal-cycle-by-product', { params });
|
||||
}
|
||||
67
apps/web-antd/src/api/crm/statistics/funnel.ts
Normal file
67
apps/web-antd/src/api/crm/statistics/funnel.ts
Normal file
@@ -0,0 +1,67 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmStatisticsFunnelApi {
|
||||
/** 销售漏斗统计数据 */
|
||||
export interface FunnelSummary {
|
||||
customerCount: number; // 客户数
|
||||
businessCount: number; // 商机数
|
||||
businessWinCount: number; // 赢单数
|
||||
}
|
||||
|
||||
/** 商机分析(按日期) */
|
||||
export interface BusinessSummaryByDate {
|
||||
time: string; // 时间
|
||||
businessCreateCount: number; // 商机数
|
||||
totalPrice: number | string; // 商机金额
|
||||
}
|
||||
|
||||
/** 商机转化率分析(按日期) */
|
||||
export interface BusinessInversionRateSummaryByDate {
|
||||
time: string; // 时间
|
||||
businessCount: number; // 商机数量
|
||||
businessWinCount: number; // 赢单商机数
|
||||
}
|
||||
}
|
||||
|
||||
/** 获取销售漏斗统计数据 */
|
||||
export function getFunnelSummary(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsFunnelApi.FunnelSummary>(
|
||||
'/crm/statistics-funnel/get-funnel-summary',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取商机结束状态统计 */
|
||||
export function getBusinessSummaryByEndStatus(params: PageParam) {
|
||||
return requestClient.get<Record<string, number>>(
|
||||
'/crm/statistics-funnel/get-business-summary-by-end-status',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取新增商机分析(按日期) */
|
||||
export function getBusinessSummaryByDate(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsFunnelApi.BusinessSummaryByDate[]>(
|
||||
'/crm/statistics-funnel/get-business-summary-by-date',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取商机转化率分析(按日期) */
|
||||
export function getBusinessInversionRateSummaryByDate(params: PageParam) {
|
||||
return requestClient.get<
|
||||
CrmStatisticsFunnelApi.BusinessInversionRateSummaryByDate[]
|
||||
>('/crm/statistics-funnel/get-business-inversion-rate-summary-by-date', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取商机列表(按日期) */
|
||||
export function getBusinessPageByDate(params: PageParam) {
|
||||
return requestClient.get<PageResult<any>>(
|
||||
'/crm/statistics-funnel/get-business-page-by-date',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
37
apps/web-antd/src/api/crm/statistics/performance.ts
Normal file
37
apps/web-antd/src/api/crm/statistics/performance.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import type { PageParam } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmStatisticsPerformanceApi {
|
||||
/** 员工业绩统计 */
|
||||
export interface Performance {
|
||||
time: string;
|
||||
currentMonthCount: number;
|
||||
lastMonthCount: number;
|
||||
lastYearCount: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 员工获得合同金额统计 */
|
||||
export function getContractPricePerformance(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsPerformanceApi.Performance[]>(
|
||||
'/crm/statistics-performance/get-contract-price-performance',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 员工获得回款统计 */
|
||||
export function getReceivablePricePerformance(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsPerformanceApi.Performance[]>(
|
||||
'/crm/statistics-performance/get-receivable-price-performance',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 员工获得签约合同数量统计 */
|
||||
export function getContractCountPerformance(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsPerformanceApi.Performance[]>(
|
||||
'/crm/statistics-performance/get-contract-count-performance',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
69
apps/web-antd/src/api/crm/statistics/portrait.ts
Normal file
69
apps/web-antd/src/api/crm/statistics/portrait.ts
Normal file
@@ -0,0 +1,69 @@
|
||||
import type { PageParam } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmStatisticsPortraitApi {
|
||||
/** 客户基础统计信息 */
|
||||
export interface CustomerBase {
|
||||
customerCount: number;
|
||||
dealCount: number;
|
||||
dealPortion: number | string;
|
||||
}
|
||||
|
||||
/** 客户行业统计信息 */
|
||||
export interface CustomerIndustry extends CustomerBase {
|
||||
industryId: number;
|
||||
industryPortion: number | string;
|
||||
}
|
||||
|
||||
/** 客户来源统计信息 */
|
||||
export interface CustomerSource extends CustomerBase {
|
||||
source: number;
|
||||
sourcePortion: number | string;
|
||||
}
|
||||
|
||||
/** 客户级别统计信息 */
|
||||
export interface CustomerLevel extends CustomerBase {
|
||||
level: number;
|
||||
levelPortion: number | string;
|
||||
}
|
||||
|
||||
/** 客户地区统计信息 */
|
||||
export interface CustomerArea extends CustomerBase {
|
||||
areaId: number;
|
||||
areaName: string;
|
||||
areaPortion: number | string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 获取客户行业统计数据 */
|
||||
export function getCustomerIndustry(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsPortraitApi.CustomerIndustry[]>(
|
||||
'/crm/statistics-portrait/get-customer-industry-summary',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取客户来源统计数据 */
|
||||
export function getCustomerSource(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsPortraitApi.CustomerSource[]>(
|
||||
'/crm/statistics-portrait/get-customer-source-summary',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取客户级别统计数据 */
|
||||
export function getCustomerLevel(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsPortraitApi.CustomerLevel[]>(
|
||||
'/crm/statistics-portrait/get-customer-level-summary',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取客户地区统计数据 */
|
||||
export function getCustomerArea(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsPortraitApi.CustomerArea[]>(
|
||||
'/crm/statistics-portrait/get-customer-area-summary',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
76
apps/web-antd/src/api/crm/statistics/rank.ts
Normal file
76
apps/web-antd/src/api/crm/statistics/rank.ts
Normal file
@@ -0,0 +1,76 @@
|
||||
import type { PageParam } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CrmStatisticsRankApi {
|
||||
/** 排行统计数据 */
|
||||
export interface Rank {
|
||||
count: number;
|
||||
nickname: string;
|
||||
deptName: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 获得合同排行榜 */
|
||||
export function getContractPriceRank(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsRankApi.Rank[]>(
|
||||
'/crm/statistics-rank/get-contract-price-rank',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得回款排行榜 */
|
||||
export function getReceivablePriceRank(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsRankApi.Rank[]>(
|
||||
'/crm/statistics-rank/get-receivable-price-rank',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 签约合同排行 */
|
||||
export function getContractCountRank(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsRankApi.Rank[]>(
|
||||
'/crm/statistics-rank/get-contract-count-rank',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 产品销量排行 */
|
||||
export function getProductSalesRank(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsRankApi.Rank[]>(
|
||||
'/crm/statistics-rank/get-product-sales-rank',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增客户数排行 */
|
||||
export function getCustomerCountRank(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsRankApi.Rank[]>(
|
||||
'/crm/statistics-rank/get-customer-count-rank',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增联系人数排行 */
|
||||
export function getContactsCountRank(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsRankApi.Rank[]>(
|
||||
'/crm/statistics-rank/get-contacts-count-rank',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 跟进次数排行 */
|
||||
export function getFollowCountRank(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsRankApi.Rank[]>(
|
||||
'/crm/statistics-rank/get-follow-count-rank',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 跟进客户数排行 */
|
||||
export function getFollowCustomerCountRank(params: PageParam) {
|
||||
return requestClient.get<CrmStatisticsRankApi.Rank[]>(
|
||||
'/crm/statistics-rank/get-follow-customer-count-rank',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
@@ -23,12 +23,13 @@ export namespace InfraFileApi {
|
||||
configId: number; // 文件配置编号
|
||||
uploadUrl: string; // 文件上传 URL
|
||||
url: string; // 文件 URL
|
||||
path: string; // 文件路径
|
||||
}
|
||||
|
||||
/** 上传文件 */
|
||||
export interface FileUploadReqVO {
|
||||
file: globalThis.File;
|
||||
path?: string;
|
||||
directory?: string;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,11 +46,11 @@ export function deleteFile(id: number) {
|
||||
}
|
||||
|
||||
/** 获取文件预签名地址 */
|
||||
export function getFilePresignedUrl(path: string) {
|
||||
export function getFilePresignedUrl(name: string, directory?: string) {
|
||||
return requestClient.get<InfraFileApi.FilePresignedUrlRespVO>(
|
||||
'/infra/file/presigned-url',
|
||||
{
|
||||
params: { path },
|
||||
params: { name, directory },
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -64,5 +65,9 @@ export function uploadFile(
|
||||
data: InfraFileApi.FileUploadReqVO,
|
||||
onUploadProgress?: AxiosProgressEvent,
|
||||
) {
|
||||
// 特殊:由于 upload 内部封装,即使 directory 为 undefined,也会传递给后端
|
||||
if (!data.directory) {
|
||||
delete data.directory;
|
||||
}
|
||||
return requestClient.upload('/infra/file/upload', data, { onUploadProgress });
|
||||
}
|
||||
|
||||
63
apps/web-antd/src/api/pay/app/index.ts
Normal file
63
apps/web-antd/src/api/pay/app/index.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace PayAppApi {
|
||||
/** 支付应用信息 */
|
||||
export interface App {
|
||||
id?: number;
|
||||
appKey: string;
|
||||
name: string;
|
||||
status: number;
|
||||
remark: string;
|
||||
payNotifyUrl: string;
|
||||
refundNotifyUrl: string;
|
||||
transferNotifyUrl: string;
|
||||
merchantId: number;
|
||||
merchantName: string;
|
||||
createTime?: Date;
|
||||
}
|
||||
|
||||
/** 更新状态请求 */
|
||||
export interface UpdateStatusReq {
|
||||
id: number;
|
||||
status: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询支付应用列表 */
|
||||
export function getAppPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<PayAppApi.App>>('/pay/app/page', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询支付应用详情 */
|
||||
export function getApp(id: number) {
|
||||
return requestClient.get<PayAppApi.App>(`/pay/app/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 新增支付应用 */
|
||||
export function createApp(data: PayAppApi.App) {
|
||||
return requestClient.post('/pay/app/create', data);
|
||||
}
|
||||
|
||||
/** 修改支付应用 */
|
||||
export function updateApp(data: PayAppApi.App) {
|
||||
return requestClient.put('/pay/app/update', data);
|
||||
}
|
||||
|
||||
/** 修改支付应用状态 */
|
||||
export function changeAppStatus(data: PayAppApi.UpdateStatusReq) {
|
||||
return requestClient.put('/pay/app/update-status', data);
|
||||
}
|
||||
|
||||
/** 删除支付应用 */
|
||||
export function deleteApp(id: number) {
|
||||
return requestClient.delete(`/pay/app/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获取支付应用列表 */
|
||||
export function getAppList() {
|
||||
return requestClient.get<PayAppApi.App[]>('/pay/app/list');
|
||||
}
|
||||
54
apps/web-antd/src/api/pay/channel/index.ts
Normal file
54
apps/web-antd/src/api/pay/channel/index.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace PayChannelApi {
|
||||
/** 支付渠道信息 */
|
||||
export interface Channel {
|
||||
id: number;
|
||||
code: string;
|
||||
config: string;
|
||||
status: number;
|
||||
remark: string;
|
||||
feeRate: number;
|
||||
appId: number;
|
||||
createTime: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询支付渠道列表 */
|
||||
export function getChannelPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<PayChannelApi.Channel>>(
|
||||
'/pay/channel/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询支付渠道详情 */
|
||||
export function getChannel(appId: string, code: string) {
|
||||
return requestClient.get<PayChannelApi.Channel>('/pay/channel/get', {
|
||||
params: { appId, code },
|
||||
});
|
||||
}
|
||||
|
||||
/** 新增支付渠道 */
|
||||
export function createChannel(data: PayChannelApi.Channel) {
|
||||
return requestClient.post('/pay/channel/create', data);
|
||||
}
|
||||
|
||||
/** 修改支付渠道 */
|
||||
export function updateChannel(data: PayChannelApi.Channel) {
|
||||
return requestClient.put('/pay/channel/update', data);
|
||||
}
|
||||
|
||||
/** 删除支付渠道 */
|
||||
export function deleteChannel(id: number) {
|
||||
return requestClient.delete(`/pay/channel/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 导出支付渠道 */
|
||||
export function exportChannel(params: PageParam) {
|
||||
return requestClient.download('/pay/channel/export-excel', { params });
|
||||
}
|
||||
38
apps/web-antd/src/api/pay/demo/index.ts
Normal file
38
apps/web-antd/src/api/pay/demo/index.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace PayDemoApi {
|
||||
/** 示例订单信息 */
|
||||
export interface DemoOrder {
|
||||
spuId: number;
|
||||
createTime: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 创建示例订单 */
|
||||
export function createDemoOrder(data: PayDemoApi.DemoOrder) {
|
||||
return requestClient.post('/pay/demo-order/create', data);
|
||||
}
|
||||
|
||||
/** 获得示例订单 */
|
||||
export function getDemoOrder(id: number) {
|
||||
return requestClient.get<PayDemoApi.DemoOrder>(
|
||||
`/pay/demo-order/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得示例订单分页 */
|
||||
export function getDemoOrderPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<PayDemoApi.DemoOrder>>(
|
||||
'/pay/demo-order/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 退款示例订单 */
|
||||
export function refundDemoOrder(id: number) {
|
||||
return requestClient.put(`/pay/demo-order/refund?id=${id}`);
|
||||
}
|
||||
29
apps/web-antd/src/api/pay/demo/transfer/index.ts
Normal file
29
apps/web-antd/src/api/pay/demo/transfer/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace PayDemoTransferApi {
|
||||
/** 示例转账单信息 */
|
||||
export interface DemoTransfer {
|
||||
price: number;
|
||||
type: number;
|
||||
userName: string;
|
||||
alipayLogonId: string;
|
||||
openid: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 创建示例转账单 */
|
||||
export function createDemoTransfer(data: PayDemoTransferApi.DemoTransfer) {
|
||||
return requestClient.post('/pay/demo-transfer/create', data);
|
||||
}
|
||||
|
||||
/** 获得示例转账单分页 */
|
||||
export function getDemoTransferPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<PayDemoTransferApi.DemoTransfer>>(
|
||||
'/pay/demo-transfer/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
15
apps/web-antd/src/api/pay/notify/index.ts
Normal file
15
apps/web-antd/src/api/pay/notify/index.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import type { PageParam } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/** 获得支付通知明细 */
|
||||
export function getNotifyTaskDetail(id: number) {
|
||||
return requestClient.get(`/pay/notify/get-detail?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得支付通知分页 */
|
||||
export function getNotifyTaskPage(params: PageParam) {
|
||||
return requestClient.get('/pay/notify/page', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
118
apps/web-antd/src/api/pay/order/index.ts
Normal file
118
apps/web-antd/src/api/pay/order/index.ts
Normal file
@@ -0,0 +1,118 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace PayOrderApi {
|
||||
/** 支付订单信息 */
|
||||
export interface Order {
|
||||
id: number;
|
||||
merchantId: number;
|
||||
appId: number;
|
||||
channelId: number;
|
||||
channelCode: string;
|
||||
merchantOrderId: string;
|
||||
subject: string;
|
||||
body: string;
|
||||
notifyUrl: string;
|
||||
notifyStatus: number;
|
||||
amount: number;
|
||||
channelFeeRate: number;
|
||||
channelFeeAmount: number;
|
||||
status: number;
|
||||
userIp: string;
|
||||
expireTime: Date;
|
||||
successTime: Date;
|
||||
notifyTime: Date;
|
||||
successExtensionId: number;
|
||||
refundStatus: number;
|
||||
refundTimes: number;
|
||||
refundAmount: number;
|
||||
channelUserId: string;
|
||||
channelOrderNo: string;
|
||||
createTime: Date;
|
||||
}
|
||||
|
||||
/** 支付订单分页请求 */
|
||||
export interface OrderPageReqVO extends PageParam {
|
||||
merchantId?: number;
|
||||
appId?: number;
|
||||
channelId?: number;
|
||||
channelCode?: string;
|
||||
merchantOrderId?: string;
|
||||
subject?: string;
|
||||
body?: string;
|
||||
notifyUrl?: string;
|
||||
notifyStatus?: number;
|
||||
amount?: number;
|
||||
channelFeeRate?: number;
|
||||
channelFeeAmount?: number;
|
||||
status?: number;
|
||||
expireTime?: Date[];
|
||||
successTime?: Date[];
|
||||
notifyTime?: Date[];
|
||||
successExtensionId?: number;
|
||||
refundStatus?: number;
|
||||
refundTimes?: number;
|
||||
channelUserId?: string;
|
||||
channelOrderNo?: string;
|
||||
createTime?: Date[];
|
||||
}
|
||||
|
||||
/** 支付订单导出请求 */
|
||||
export interface OrderExportReqVO {
|
||||
merchantId?: number;
|
||||
appId?: number;
|
||||
channelId?: number;
|
||||
channelCode?: string;
|
||||
merchantOrderId?: string;
|
||||
subject?: string;
|
||||
body?: string;
|
||||
notifyUrl?: string;
|
||||
notifyStatus?: number;
|
||||
amount?: number;
|
||||
channelFeeRate?: number;
|
||||
channelFeeAmount?: number;
|
||||
status?: number;
|
||||
expireTime?: Date[];
|
||||
successTime?: Date[];
|
||||
notifyTime?: Date[];
|
||||
successExtensionId?: number;
|
||||
refundStatus?: number;
|
||||
refundTimes?: number;
|
||||
channelUserId?: string;
|
||||
channelOrderNo?: string;
|
||||
createTime?: Date[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询支付订单列表 */
|
||||
export function getOrderPage(params: PayOrderApi.OrderPageReqVO) {
|
||||
return requestClient.get<PageResult<PayOrderApi.Order>>('/pay/order/page', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询支付订单详情 */
|
||||
export function getOrder(id: number, sync?: boolean) {
|
||||
return requestClient.get<PayOrderApi.Order>('/pay/order/get', {
|
||||
params: {
|
||||
id,
|
||||
sync,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/** 获得支付订单的明细 */
|
||||
export function getOrderDetail(id: number) {
|
||||
return requestClient.get<PayOrderApi.Order>(`/pay/order/get-detail?id=${id}`);
|
||||
}
|
||||
|
||||
/** 提交支付订单 */
|
||||
export function submitOrder(data: any) {
|
||||
return requestClient.post('/pay/order/submit', data);
|
||||
}
|
||||
|
||||
/** 导出支付订单 */
|
||||
export function exportOrder(params: PayOrderApi.OrderExportReqVO) {
|
||||
return requestClient.download('/pay/order/export-excel', { params });
|
||||
}
|
||||
129
apps/web-antd/src/api/pay/refund/index.ts
Normal file
129
apps/web-antd/src/api/pay/refund/index.ts
Normal file
@@ -0,0 +1,129 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace PayRefundApi {
|
||||
/** 退款订单信息 */
|
||||
export interface Refund {
|
||||
id: number;
|
||||
merchantId: number;
|
||||
appId: number;
|
||||
channelId: number;
|
||||
channelCode: string;
|
||||
orderId: string;
|
||||
tradeNo: string;
|
||||
merchantOrderId: string;
|
||||
merchantRefundNo: string;
|
||||
notifyUrl: string;
|
||||
notifyStatus: number;
|
||||
status: number;
|
||||
type: number;
|
||||
payAmount: number;
|
||||
refundAmount: number;
|
||||
reason: string;
|
||||
userIp: string;
|
||||
channelOrderNo: string;
|
||||
channelRefundNo: string;
|
||||
channelErrorCode: string;
|
||||
channelErrorMsg: string;
|
||||
channelExtras: string;
|
||||
expireTime: Date;
|
||||
successTime: Date;
|
||||
notifyTime: Date;
|
||||
createTime: Date;
|
||||
updateTime: Date;
|
||||
}
|
||||
|
||||
/** 退款订单分页请求 */
|
||||
export interface RefundPageReqVO extends PageParam {
|
||||
merchantId?: number;
|
||||
appId?: number;
|
||||
channelId?: number;
|
||||
channelCode?: string;
|
||||
orderId?: string;
|
||||
tradeNo?: string;
|
||||
merchantOrderId?: string;
|
||||
merchantRefundNo?: string;
|
||||
notifyUrl?: string;
|
||||
notifyStatus?: number;
|
||||
status?: number;
|
||||
type?: number;
|
||||
payAmount?: number;
|
||||
refundAmount?: number;
|
||||
reason?: string;
|
||||
userIp?: string;
|
||||
channelOrderNo?: string;
|
||||
channelRefundNo?: string;
|
||||
channelErrorCode?: string;
|
||||
channelErrorMsg?: string;
|
||||
channelExtras?: string;
|
||||
expireTime?: Date[];
|
||||
successTime?: Date[];
|
||||
notifyTime?: Date[];
|
||||
createTime?: Date[];
|
||||
}
|
||||
|
||||
/** 退款订单导出请求 */
|
||||
export interface RefundExportReqVO {
|
||||
merchantId?: number;
|
||||
appId?: number;
|
||||
channelId?: number;
|
||||
channelCode?: string;
|
||||
orderId?: string;
|
||||
tradeNo?: string;
|
||||
merchantOrderId?: string;
|
||||
merchantRefundNo?: string;
|
||||
notifyUrl?: string;
|
||||
notifyStatus?: number;
|
||||
status?: number;
|
||||
type?: number;
|
||||
payAmount?: number;
|
||||
refundAmount?: number;
|
||||
reason?: string;
|
||||
userIp?: string;
|
||||
channelOrderNo?: string;
|
||||
channelRefundNo?: string;
|
||||
channelErrorCode?: string;
|
||||
channelErrorMsg?: string;
|
||||
channelExtras?: string;
|
||||
expireTime?: Date[];
|
||||
successTime?: Date[];
|
||||
notifyTime?: Date[];
|
||||
createTime?: Date[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询退款订单列表 */
|
||||
export function getRefundPage(params: PayRefundApi.RefundPageReqVO) {
|
||||
return requestClient.get<PageResult<PayRefundApi.Refund>>(
|
||||
'/pay/refund/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询退款订单详情 */
|
||||
export function getRefund(id: number) {
|
||||
return requestClient.get<PayRefundApi.Refund>(`/pay/refund/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 创建退款订单 */
|
||||
export function createRefund(data: PayRefundApi.Refund) {
|
||||
return requestClient.post('/pay/refund/create', data);
|
||||
}
|
||||
|
||||
/** 更新退款订单 */
|
||||
export function updateRefund(data: PayRefundApi.Refund) {
|
||||
return requestClient.put('/pay/refund/update', data);
|
||||
}
|
||||
|
||||
/** 删除退款订单 */
|
||||
export function deleteRefund(id: number) {
|
||||
return requestClient.delete(`/pay/refund/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 导出退款订单 */
|
||||
export function exportRefund(params: PayRefundApi.RefundExportReqVO) {
|
||||
return requestClient.download('/pay/refund/export-excel', { params });
|
||||
}
|
||||
58
apps/web-antd/src/api/pay/transfer/index.ts
Normal file
58
apps/web-antd/src/api/pay/transfer/index.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace PayTransferApi {
|
||||
/** 转账单信息 */
|
||||
export interface Transfer {
|
||||
id: number;
|
||||
appId: number;
|
||||
channelId: number;
|
||||
channelCode: string;
|
||||
merchantTransferId: string;
|
||||
type: number;
|
||||
price: number;
|
||||
subject: string;
|
||||
userName: string;
|
||||
alipayLogonId: string;
|
||||
openid: string;
|
||||
status: number;
|
||||
createTime: Date;
|
||||
}
|
||||
|
||||
/** 转账单分页请求 */
|
||||
export interface TransferPageReqVO extends PageParam {
|
||||
appId?: number;
|
||||
channelId?: number;
|
||||
channelCode?: string;
|
||||
merchantTransferId?: string;
|
||||
type?: number;
|
||||
price?: number;
|
||||
subject?: string;
|
||||
userName?: string;
|
||||
status?: number;
|
||||
createTime?: Date[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询转账单列表 */
|
||||
export function getTransferPage(params: PayTransferApi.TransferPageReqVO) {
|
||||
return requestClient.get<PageResult<PayTransferApi.Transfer>>(
|
||||
'/pay/transfer/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询转账单详情 */
|
||||
export function getTransfer(id: number) {
|
||||
return requestClient.get<PayTransferApi.Transfer>(
|
||||
`/pay/transfer/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 创建转账单 */
|
||||
export function createTransfer(data: PayTransferApi.Transfer) {
|
||||
return requestClient.post('/pay/transfer/create', data);
|
||||
}
|
||||
53
apps/web-antd/src/api/pay/wallet/balance/index.ts
Normal file
53
apps/web-antd/src/api/pay/wallet/balance/index.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace PayWalletApi {
|
||||
/** 用户钱包查询参数 */
|
||||
export interface PayWalletUserReqVO {
|
||||
userId: number;
|
||||
}
|
||||
|
||||
/** 钱包信息 */
|
||||
export interface WalletVO {
|
||||
id: number;
|
||||
userId: number;
|
||||
userType: number;
|
||||
balance: number;
|
||||
totalExpense: number;
|
||||
totalRecharge: number;
|
||||
freezePrice: number;
|
||||
}
|
||||
|
||||
/** 钱包分页请求 */
|
||||
export interface WalletPageReqVO extends PageParam {
|
||||
userId?: number;
|
||||
userType?: number;
|
||||
balance?: number;
|
||||
totalExpense?: number;
|
||||
totalRecharge?: number;
|
||||
freezePrice?: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询用户钱包详情 */
|
||||
export function getWallet(params: PayWalletApi.PayWalletUserReqVO) {
|
||||
return requestClient.get<PayWalletApi.WalletVO>('/pay/wallet/get', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询会员钱包列表 */
|
||||
export function getWalletPage(params: PayWalletApi.WalletPageReqVO) {
|
||||
return requestClient.get<PageResult<PayWalletApi.WalletVO>>(
|
||||
'/pay/wallet/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 修改会员钱包余额 */
|
||||
export function updateWalletBalance(data: PayWalletApi.WalletVO) {
|
||||
return requestClient.put('/pay/wallet/update-balance', data);
|
||||
}
|
||||
46
apps/web-antd/src/api/pay/wallet/rechargePackage/index.ts
Normal file
46
apps/web-antd/src/api/pay/wallet/rechargePackage/index.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace WalletRechargePackageApi {
|
||||
/** 充值套餐信息 */
|
||||
export interface Package {
|
||||
id?: number;
|
||||
name: string;
|
||||
payPrice: number;
|
||||
bonusPrice: number;
|
||||
status: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询充值套餐列表 */
|
||||
export function getPackagePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<WalletRechargePackageApi.Package>>(
|
||||
'/pay/wallet-recharge-package/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询充值套餐详情 */
|
||||
export function getPackage(id: number) {
|
||||
return requestClient.get<WalletRechargePackageApi.Package>(
|
||||
`/pay/wallet-recharge-package/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增充值套餐 */
|
||||
export function createPackage(data: WalletRechargePackageApi.Package) {
|
||||
return requestClient.post('/pay/wallet-recharge-package/create', data);
|
||||
}
|
||||
|
||||
/** 修改充值套餐 */
|
||||
export function updatePackage(data: WalletRechargePackageApi.Package) {
|
||||
return requestClient.put('/pay/wallet-recharge-package/update', data);
|
||||
}
|
||||
|
||||
/** 删除充值套餐 */
|
||||
export function deletePackage(id: number) {
|
||||
return requestClient.delete(`/pay/wallet-recharge-package/delete?id=${id}`);
|
||||
}
|
||||
24
apps/web-antd/src/api/pay/wallet/transaction/index.ts
Normal file
24
apps/web-antd/src/api/pay/wallet/transaction/index.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace WalletTransactionApi {
|
||||
/** 钱包交易流水信息 */
|
||||
export interface Transaction {
|
||||
id: number;
|
||||
walletId: number;
|
||||
title: string;
|
||||
price: number;
|
||||
balance: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询钱包交易流水列表 */
|
||||
export function getTransactionPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<WalletTransactionApi.Transaction>>(
|
||||
'/pay/wallet-transaction/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user