feat: 111
This commit is contained in:
@@ -23,14 +23,14 @@ const medicinalApi = {
|
||||
},
|
||||
|
||||
/** 获取药材消耗记录 */
|
||||
getConsumptionRecords(id: number) {
|
||||
return http.get<any>(`${id}/consumption-records`);
|
||||
getConsumptionRecords(params: { id: number; pageNum?: number; pageSize?: number }) {
|
||||
console.log("获取添加记录,请求参数=", params);
|
||||
return http.get<ResPage<any>>(`consumption-records`, params); // 透传分页参数
|
||||
},
|
||||
|
||||
/** 获取药材添加记录 */
|
||||
getAdditionRecords(id: number, params?: { pageNum?: number; pageSize?: number }) {
|
||||
// 注意:这里把 id 放到路径里,分页走 params
|
||||
return http.get<any>(`/${id}/addition-records`, { params });
|
||||
getAdditionRecords(params: { id: number; pageNum?: number; pageSize?: number }) {
|
||||
return http.get<ResPage<any>>(`addition-records`, params);
|
||||
},
|
||||
|
||||
/** 添加药材 */
|
||||
@@ -39,13 +39,13 @@ const medicinalApi = {
|
||||
},
|
||||
|
||||
/** 修改药材添加记录 */
|
||||
updateAdditionRecord(id: number, params: UpdateMedicinalAddLogInput) {
|
||||
return http.put(`addition-records/${id}`, params);
|
||||
updateAdditionRecord(params: UpdateMedicinalAddLogInput) {
|
||||
return http.post(`addition-records`, params);
|
||||
},
|
||||
|
||||
/** 删除药材添加记录 */
|
||||
deleteAdditionRecord(id: number) {
|
||||
return http.delete(`addition-records/${id}`);
|
||||
deleteAdditionRecord(params: { id: number }) {
|
||||
return http.post(`addition-delete`, params);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -62,14 +62,15 @@ export interface MedicinalInfo {
|
||||
export interface AddMedicinalInput {
|
||||
medicinalTypeId: number;
|
||||
addWeight: number;
|
||||
unitPrice: number;
|
||||
totalPrice: number;
|
||||
medicinalName: string;
|
||||
}
|
||||
|
||||
/** 修改添加记录 */
|
||||
export interface UpdateMedicinalAddLogInput {
|
||||
id: number;
|
||||
addWeight: number;
|
||||
unitPrice: number;
|
||||
totalPrice: number;
|
||||
}
|
||||
|
||||
export { medicinalApi };
|
||||
|
||||
@@ -1,41 +1,149 @@
|
||||
import { moduleRequest } from "@/api/request";
|
||||
import { ResPage } from "@/api/interface";
|
||||
|
||||
const http = moduleRequest("/biz/weibingju/prescription/");
|
||||
|
||||
// -----------------------------
|
||||
// 类型定义(对应后端 DTO)
|
||||
// -----------------------------
|
||||
|
||||
/** 人员类型 */
|
||||
export enum PersonType {
|
||||
Employee = 1,
|
||||
Relative = 2
|
||||
}
|
||||
|
||||
/** 处方列表 DTO */
|
||||
export interface PrescriptionDto {
|
||||
id: number;
|
||||
personId: number;
|
||||
personName: string;
|
||||
personType: PersonType;
|
||||
employeeName?: string;
|
||||
visitDate?: string;
|
||||
canEdit: boolean;
|
||||
}
|
||||
|
||||
/** 处方药材 DTO */
|
||||
export interface PrescriptionHerbDto {
|
||||
Id: number;
|
||||
medicinalName: string;
|
||||
amountG: number;
|
||||
note?: string;
|
||||
}
|
||||
|
||||
/** 人员详情 DTO */
|
||||
export interface PersonDetailDto {
|
||||
id?: number;
|
||||
name: string;
|
||||
age?: number;
|
||||
weight?: number;
|
||||
height?: number;
|
||||
isEmployee: boolean;
|
||||
employeeId?: number;
|
||||
employeeName?: string;
|
||||
relationShip?: number;
|
||||
relationShipName?: string;
|
||||
}
|
||||
|
||||
/** 处方详情 DTO */
|
||||
export interface PrescriptionDetailDto {
|
||||
id: number;
|
||||
person: PersonDetailDto;
|
||||
diagnosisResult: string;
|
||||
userMedicinaAdvice: string;
|
||||
visitDate?: string;
|
||||
herbs: PrescriptionHerbDto[];
|
||||
canEdit: boolean;
|
||||
}
|
||||
|
||||
/** 保存处方输入 DTO */
|
||||
export interface SavePrescriptionInput {
|
||||
id?: number;
|
||||
person: PersonInputDto;
|
||||
diagnosisResult: string;
|
||||
userMedicinaAdvice: string;
|
||||
visitDate?: string;
|
||||
herbs: PrescriptionHerbInputDto[];
|
||||
}
|
||||
|
||||
/** 人员输入 DTO */
|
||||
export interface PersonInputDto {
|
||||
id?: number;
|
||||
name: string;
|
||||
age?: number;
|
||||
weight?: number;
|
||||
height?: number;
|
||||
isEmployee: boolean;
|
||||
employeeId?: number;
|
||||
relationShip?: number;
|
||||
}
|
||||
|
||||
/** 处方药材输入 DTO */
|
||||
export interface PrescriptionHerbInputDto {
|
||||
Id: number;
|
||||
amountG: number;
|
||||
note?: string;
|
||||
}
|
||||
|
||||
/** 人员 DTO(列表用) */
|
||||
export interface PersonDto {
|
||||
id: number;
|
||||
name: string;
|
||||
age?: number;
|
||||
employeeId?: number;
|
||||
}
|
||||
|
||||
/** 添加人员输入 DTO */
|
||||
export interface AddPersonInput {
|
||||
name: string;
|
||||
age?: number;
|
||||
weight?: number;
|
||||
height?: number;
|
||||
isEmployee: boolean;
|
||||
employeeId?: number;
|
||||
relationShip?: number;
|
||||
}
|
||||
|
||||
/** 关系类型 DTO */
|
||||
export interface RelationTypeDto {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
// -----------------------------
|
||||
// API 方法(对应后端接口)
|
||||
// -----------------------------
|
||||
|
||||
const prescriptionApi = {
|
||||
/** 获取处方列表(分页) */
|
||||
/** 获取处方列表 */
|
||||
getList(params: any) {
|
||||
return http.get<any>("list", params);
|
||||
return http.get<ResPage<PrescriptionDto>>("list", params);
|
||||
},
|
||||
|
||||
/** 获取处方详情 */
|
||||
getDetail(params: any) {
|
||||
return http.get<any>("detail", params);
|
||||
getDetail(id: number) {
|
||||
return http.get<PrescriptionDetailDto>(`getprescriptiondetile?id=${id}`);
|
||||
},
|
||||
|
||||
/** 保存处方(新增/编辑) */
|
||||
save(params: any) {
|
||||
const url = params.id ? "edit" : "add";
|
||||
return http.post<any>(url, params);
|
||||
save(params: SavePrescriptionInput) {
|
||||
return http.post<number>("add", params);
|
||||
},
|
||||
|
||||
/** 获取人员列表 */
|
||||
getPersonList(params: any) {
|
||||
return http.get<any>("persons", params, { loading: false });
|
||||
getPersonList(params: { type?: PersonType; employeeId?: number }) {
|
||||
return http.get<PersonDto[]>("persons", params);
|
||||
},
|
||||
|
||||
/** 新增人员 */
|
||||
addPerson(params: any) {
|
||||
return http.post<any>("addpersons", params);
|
||||
/** 添加人员 */
|
||||
addPerson(params: AddPersonInput) {
|
||||
return http.post<number>("addpersons", params);
|
||||
},
|
||||
|
||||
/** 获取亲属关系列表 */
|
||||
/** 获取关系类型 */
|
||||
getRelationTypes() {
|
||||
return http.get<any>("relation-types", {}, { loading: false });
|
||||
},
|
||||
|
||||
/** 搜索药材 */
|
||||
searchMedicinals(params: any) {
|
||||
return http.get<any>("medicinals/search", params, { loading: false });
|
||||
return http.get<RelationTypeDto[]>("relation-types");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -15,5 +15,5 @@
|
||||
|
||||
export * from "./organization";
|
||||
export * from "./ops";
|
||||
export * from "./WeiBingJu/medicinal";
|
||||
export * from "./WeiBingJu/prescription";
|
||||
export * from "./weibingju/medicinal";
|
||||
export * from "./weibingju/prescription";
|
||||
|
||||
@@ -134,10 +134,12 @@ export default class RequestHttp {
|
||||
this.apiNameArray.forEach(apiName => {
|
||||
let responseApiArray = responseUrl.split("/"); //分割
|
||||
let method = responseApiArray[responseApiArray.length - 1]; //取最后一个
|
||||
console.log("method=", method);
|
||||
console.log("noMessageApiNameArray=", this.noMessageApiNameArray);
|
||||
let result = this.noMessageApiNameArray.includes(method); //判断是否在不提示的数组中
|
||||
if (!result && responseUrl.includes(apiName)) {
|
||||
//如果不在不提示的数组中并且请求地址包含指定的方法
|
||||
ElMessage.success(data.msg);
|
||||
// ElMessage.success(data.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user