feat: 新增客户管理全模块功能

实现客户信息、客户部门、客户账号三个子模块的完整CRUD,包含:
1. 数据库实体、DTO、控制器、服务层代码
2. RBAC权限映射与菜单种子数据扩展
3. 前端路由与API封装
4. 数据权限隔离与鉴权逻辑
5. 配套工具脚本与测试验证清单
This commit is contained in:
andyesfly committed 2026-08-23 19:15:54 +08:00
1 parent 026ec34471
commit 1c80a24d1d
31 files changed
+26321 -653

No files matched your search

+92
View File
@@ -0,0 +1,92 @@
import request from '@/utils/request';
export interface CustomerInfo {
id: number;
customerNo: string;
customerName: string;
province?: string;
city?: string;
district?: string;
address?: string;
contactPerson?: string;
contactPhone?: string;
postalCode?: string;
fax?: string;
customerLevel?: string;
status: number;
salesmanId?: number;
createdAt: string;
updatedAt: string;
}
export interface CustomerQuery {
page?: number;
pageSize?: number;
keyword?: string;
status?: number;
salesmanId?: number;
}
export interface CustomerListResult {
list: CustomerInfo[];
total: number;
page: number;
pageSize: number;
}
export interface CustomerCreateParams {
customerName: string;
province?: string;
city?: string;
district?: string;
address?: string;
contactPerson?: string;
contactPhone?: string;
postalCode?: string;
fax?: string;
customerLevel?: string;
status?: number;
salesmanId?: number;
}
export interface CustomerUpdateParams {
customerName?: string;
province?: string;
city?: string;
district?: string;
address?: string;
contactPerson?: string;
contactPhone?: string;
postalCode?: string;
fax?: string;
customerLevel?: string;
status?: number;
salesmanId?: number;
}
export interface CustomerStatusParams {
status: number;
}
export const customerApi = {
getCustomerList: (params: CustomerQuery) =>
request.get<CustomerListResult>('/customers', { params }),
getCustomerDetail: (id: number) =>
request.get<CustomerInfo>(`/customers/${id}`),
getCustomerOptions: () =>
request.get<CustomerInfo[]>('/customers/options/all'),
createCustomer: (data: CustomerCreateParams) =>
request.post('/customers', data),
updateCustomer: (id: number, data: CustomerUpdateParams) =>
request.put(`/customers/${id}`, data),
deleteCustomer: (id: number) =>
request.delete(`/customers/${id}`),
updateCustomerStatus: (id: number, status: number) =>
request.put(`/customers/${id}/status`, { status }),
};