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

const prefix = 'non-drug/';

/**
 * 分页查询非药品列表
 * @param data
 */
export async function getNonDrugList(data: any) {
  return requestClient.get<any>(`${prefix}list`, { params: data });
}

/**
 * 获取非药品下拉选项
 * @param data
 */
export async function getNonDrugOption(data: any) {
  return requestClient.get<any>(`${prefix}option`, { params: data });
}

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

/**
 * 导出非药品
 */
export async function exportNonDrugApi() {
  return requestClient.download(`${prefix}export`);
}

/**
 * 新增非药品
 * @param data
 */
export async function createNonDrug(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}create`, data);
}

/**
 * 编辑非药品
 * @param data
 */
export async function updateNonDrug(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}update`, data);
}

/**
 * 删除非药品
 * @param data
 */
export async function deleteNonDrug(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}delete`, data);
}

/**
 * 导入非药品
 * @param data
 */
export async function importNonDrugApi(data: Record<string, any>) {
  return requestClient.upload(`${prefix}import`, data);
}

/**
 * 更新非药品分区分类
 * @param data
 */
export async function updateZoneCategory(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}update-zone-category`, data);
}

/**
 * 同步空拼音（首拼/全拼/数字串）
 */
export async function syncNonDrugPinyin() {
  return requestClient.post<any>(`${prefix}sync-pinyin`, {});
}








