| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- import type { CustomerEntity, PageConfig } from '@vben/types';
- import { parseQueryValues } from '@vben/utils';
- import { requestClient } from '#/api/request';
- interface CustomerPartialEntity
- extends Partial<Omit<CustomerEntity, 'usersname' | 'usersphone'>> {
- usersphone?: string;
- usersname?: string;
- }
- interface CustomerQueryParams extends CustomerPartialEntity, PageConfig {
- [key: `${string}.value`]: boolean | number | string;
- }
- /**
- * 客户信息_列表
- */
- export async function getCustomerListApi(params: CustomerQueryParams) {
- const queryParams = params;
- if (params.usersnature) {
- queryParams['usersnature.value'] = params.usersnature;
- }
- return requestClient.post<any>('/api/query/list?pagevalue=17', {
- ...params,
- });
- }
- /**
- * 客户信息_详情
- */
- export async function getCustomerDetailApi(data: { usersid: string }) {
- return requestClient.post<any>(
- '/api/query/view?pagevalue=19',
- {
- ...parseQueryValues(data),
- },
- { formatData: true }, // 格式化返回数据
- );
- }
- /**
- * 客户信息_新增
- */
- export async function addCustomerApi(data: CustomerEntity) {
- return requestClient.post<any>('/api/add?pagevalue=20', { ...data });
- }
- /**
- * 客户信息_编辑
- */
- export async function editCustomerApi(data: CustomerEntity) {
- return requestClient.post<any>('/api/up?pagevalue=21', { ...data });
- }
- /**
- * 客户信息_删除
- */
- export async function deleteCustomerApi(data: { 'usersid.value': string }) {
- return requestClient.post<any>('/api/del?pagevalue=22', { ...data });
- }
|