import { requestClient } from '#/api/request';

const prefix = 'process/';
/**
 * 分页查询用户列表
 * @param data
 */
export async function getProcessList(data: any) {
  return requestClient.get<any>(`${prefix}list`, { params: data });
}
/**
 * 分页查询用户列表
 * @param data
 */
export async function getProcessOption(data: any) {
  return requestClient.get<any>(`${prefix}option`, { params: data });
}
/**
 * 分页查询用户列表
 */
export async function getProcessOptionPidApi() {
  return requestClient.get<any>(`${prefix}option`, { params: {
      pid: 0,
    },
  });
}

/**
 * 获取加工费详情
 * @param id
 */
export async function getProcessInfo(id: number) {
  return requestClient.get<any>(`${prefix}detail`, { params: { id } });
}

/**
 * 新增加工费
 * @param data
 */
export async function createProcess(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}create`, data);
}

/**
 * 编辑加工费
 * @param data
 */
export async function updateProcess(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}update`, data);
}

/**
 * 删除加工费
 * @param data
 */
export async function deleteProcess(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}delete`, data);
}
