gaoluyang
2026-06-29 27cd042df9aca0383a49f3514bc21958dd890912
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import type { PageParam, PageResult } from '../../../../packages/effects/request/src';
 
import { requestClient } from '#/api/request';
 
export namespace ErpCustomerApi {
  /** 客户信息 */
  export interface Customer {
    id?: number; // 客户编号
    name: string; // 客户名称
    contact: string; // 联系人
    mobile: string; // 手机号码
    telephone: string; // 联系电话
    email: string; // 电子邮箱
    fax: string; // 传真
    remark: string; // 备注
    status: number; // 开启状态
    sort: number; // 排序
    taxNo: string; // 纳税人识别号
    taxPercent: number; // 税率
    bankName: string; // 开户行
    bankAccount: string; // 开户账号
    bankAddress: string; // 开户地址
  }
}
 
/** 查询客户分页 */
export function getCustomerPage(params: PageParam) {
  return requestClient.get<PageResult<ErpCustomerApi.Customer>>(
    '/erp/customer/page',
    { params },
  );
}
 
/** 查询客户精简列表 */
export function getCustomerSimpleList() {
  return requestClient.get<ErpCustomerApi.Customer[]>(
    '/erp/customer/simple-list',
  );
}
 
/** 查询客户详情 */
export function getCustomer(id: number) {
  return requestClient.get<ErpCustomerApi.Customer>(
    `/erp/customer/get?id=${id}`,
  );
}
 
/** 新增客户 */
export function createCustomer(data: ErpCustomerApi.Customer) {
  return requestClient.post('/erp/customer/create', data);
}
 
/** 修改客户 */
export function updateCustomer(data: ErpCustomerApi.Customer) {
  return requestClient.put('/erp/customer/update', data);
}
 
/** 删除客户 */
export function deleteCustomer(id: number) {
  return requestClient.delete(`/erp/customer/delete?id=${id}`);
}
 
/** 导出客户 Excel */
export function exportCustomer(params: any) {
  return requestClient.download('/erp/customer/export-excel', { params });
}