251229
This commit is contained in:
113
src/api/clinic/prescriptionOrderItem/index.ts
Normal file
113
src/api/clinic/prescriptionOrderItem/index.ts
Normal file
@@ -0,0 +1,113 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { PrescriptionOrderItem, PrescriptionOrderItemParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询处方明细表
|
||||
|
||||
*/
|
||||
export async function pagePrescriptionOrderItem(params: PrescriptionOrderItemParam) {
|
||||
const res = await request.get<ApiResult<PageResult<PrescriptionOrderItem>>>(
|
||||
MODULES_API_URL + '/clinic/prescription-order-item/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询处方明细表
|
||||
列表
|
||||
*/
|
||||
export async function listPrescriptionOrderItem(params?: PrescriptionOrderItemParam) {
|
||||
const res = await request.get<ApiResult<PrescriptionOrderItem[]>>(
|
||||
MODULES_API_URL + '/clinic/prescription-order-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 addPrescriptionOrderItem(data: PrescriptionOrderItem) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/clinic/prescription-order-item',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改处方明细表
|
||||
|
||||
*/
|
||||
export async function updatePrescriptionOrderItem(data: PrescriptionOrderItem) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/clinic/prescription-order-item',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除处方明细表
|
||||
|
||||
*/
|
||||
export async function removePrescriptionOrderItem(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/clinic/prescription-order-item/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除处方明细表
|
||||
|
||||
*/
|
||||
export async function removeBatchPrescriptionOrderItem(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/clinic/prescription-order-item/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询处方明细表
|
||||
|
||||
*/
|
||||
export async function getPrescriptionOrderItem(id: number) {
|
||||
const res = await request.get<ApiResult<PrescriptionOrderItem>>(
|
||||
MODULES_API_URL + '/clinic/prescription-order-item/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
Reference in New Issue
Block a user