| | |
| | | import { getAuthHeaders } from '@/api/authHeaders'; |
| | | import { request } from '@/api/request'; |
| | | import type { TenantCustomerPageQuery, TenantCustomerPageResult } from './types'; |
| | | import type { |
| | | TenantCustomerDetailRequest, |
| | | TenantCustomerDetailResponse, |
| | | TenantCustomerFollowUpListRequest, |
| | | TenantCustomerFollowUpListResponse, |
| | | TenantCustomerPageQuery, |
| | | TenantCustomerPageResult, |
| | | } from './types'; |
| | | |
| | | /** 查询本租户客户列表(只读)。 */ |
| | | export const getCustomerList = (params: TenantCustomerPageQuery) => |
| | |
| | | params, |
| | | headers: getAuthHeaders(), |
| | | }); |
| | | |
| | | /** 查询客户详情(只读)。 */ |
| | | export const getCustomerDetail = ({ id }: TenantCustomerDetailRequest) => |
| | | request<TenantCustomerDetailRequest, TenantCustomerDetailResponse>({ |
| | | url: `/tenant/customers/${id}`, |
| | | method: 'GET', |
| | | headers: getAuthHeaders(), |
| | | }); |
| | | |
| | | /** 查询客户跟进历史(只读,按 followAt 倒序)。 */ |
| | | export const getCustomerFollowUps = ({ id, ...params }: TenantCustomerFollowUpListRequest) => |
| | | request<TenantCustomerFollowUpListRequest, TenantCustomerFollowUpListResponse>({ |
| | | url: `/tenant/customers/${id}/follow-ups`, |
| | | method: 'GET', |
| | | params, |
| | | headers: getAuthHeaders(), |
| | | }); |