- 新增挂号模块,包括分页查询、列表查询、添加、修改、删除及批量删除功能 - 新增医生入驻申请模块,包含完整的CRUD操作接口- 新增医疗记录模块,支持分页及列表查询、增删改查功能 - 新增分销商用户记录表模块,提供完整的数据管理接口- 新增病例模块,实现分页查询、列表查询及数据操作功能 - 新增药品库模块,支持药品信息的增删改查及分页查询- 新增出入库模块,提供完整的库存变动记录管理接口 - 新增药品库存模块,包含库存信息的查询、添加、修改及删除功能 - 新增处方订单模块,实现订单信息的全面管理接口
113 lines
2.7 KiB
TypeScript
113 lines
2.7 KiB
TypeScript
import request from '@/utils/request';
|
|
import type { ApiResult, PageResult } from '@/api';
|
|
import type { ClinicPrescriptionItem, ClinicPrescriptionItemParam } from './model';
|
|
|
|
/**
|
|
* 分页查询处方明细表
|
|
|
|
*/
|
|
export async function pageClinicPrescriptionItem(params: ClinicPrescriptionItemParam) {
|
|
const res = await request.get<ApiResult<PageResult<ClinicPrescriptionItem>>>(
|
|
'/clinic/clinic-prescription-item/page',
|
|
{
|
|
params
|
|
}
|
|
);
|
|
if (res.data.code === 0) {
|
|
return res.data.data;
|
|
}
|
|
return Promise.reject(new Error(res.data.message));
|
|
}
|
|
|
|
/**
|
|
* 查询处方明细表
|
|
列表
|
|
*/
|
|
export async function listClinicPrescriptionItem(params?: ClinicPrescriptionItemParam) {
|
|
const res = await request.get<ApiResult<ClinicPrescriptionItem[]>>(
|
|
'/clinic/clinic-prescription-item',
|
|
{
|
|
params
|
|
}
|
|
);
|
|
if (res.data.code === 0 && res.data.data) {
|
|
return res.data.data;
|
|
}
|
|
return Promise.reject(new Error(res.data.message));
|
|
}
|
|
|
|
/**
|
|
* 添加处方明细表
|
|
|
|
*/
|
|
export async function addClinicPrescriptionItem(data: ClinicPrescriptionItem) {
|
|
const res = await request.post<ApiResult<unknown>>(
|
|
'/clinic/clinic-prescription-item',
|
|
data
|
|
);
|
|
if (res.data.code === 0) {
|
|
return res.data.message;
|
|
}
|
|
return Promise.reject(new Error(res.data.message));
|
|
}
|
|
|
|
/**
|
|
* 修改处方明细表
|
|
|
|
*/
|
|
export async function updateClinicPrescriptionItem(data: ClinicPrescriptionItem) {
|
|
const res = await request.put<ApiResult<unknown>>(
|
|
'/clinic/clinic-prescription-item',
|
|
data
|
|
);
|
|
if (res.data.code === 0) {
|
|
return res.data.message;
|
|
}
|
|
return Promise.reject(new Error(res.data.message));
|
|
}
|
|
|
|
/**
|
|
* 删除处方明细表
|
|
|
|
*/
|
|
export async function removeClinicPrescriptionItem(id?: number) {
|
|
const res = await request.delete<ApiResult<unknown>>(
|
|
'/clinic/clinic-prescription-item/' + id
|
|
);
|
|
if (res.data.code === 0) {
|
|
return res.data.message;
|
|
}
|
|
return Promise.reject(new Error(res.data.message));
|
|
}
|
|
|
|
/**
|
|
* 批量删除处方明细表
|
|
|
|
*/
|
|
export async function removeBatchClinicPrescriptionItem(data: (number | undefined)[]) {
|
|
const res = await request.delete<ApiResult<unknown>>(
|
|
'/clinic/clinic-prescription-item/batch',
|
|
{
|
|
data
|
|
}
|
|
);
|
|
if (res.data.code === 0) {
|
|
return res.data.message;
|
|
}
|
|
return Promise.reject(new Error(res.data.message));
|
|
}
|
|
|
|
/**
|
|
* 根据id查询处方明细表
|
|
|
|
*/
|
|
export async function getClinicPrescriptionItem(id: number) {
|
|
const res = await request.get<ApiResult<ClinicPrescriptionItem>>(
|
|
'/clinic/clinic-prescription-item/' + id
|
|
);
|
|
if (res.data.code === 0 && res.data.data) {
|
|
return res.data.data;
|
|
}
|
|
return Promise.reject(new Error(res.data.message));
|
|
}
|