门诊医生站-》开立医嘱系统根据选中的药品名称
判断医嘱类型。
This commit is contained in:
@@ -103,7 +103,7 @@ watch(
|
||||
queryParams.value.searchKey = newValue.searchKey || '';
|
||||
|
||||
// 处理类型筛选
|
||||
if (newValue.adviceType) {
|
||||
if (newValue.adviceType !== undefined && newValue.adviceType !== null && newValue.adviceType !== '') {
|
||||
// 单个类型
|
||||
queryParams.value.adviceTypes = newValue.adviceType.toString();
|
||||
} else {
|
||||
@@ -111,6 +111,13 @@ watch(
|
||||
queryParams.value.adviceTypes = '1,2,3';
|
||||
}
|
||||
|
||||
// 设置categoryCode筛选条件(用于筛选西药和中成药)
|
||||
if (newValue.categoryCode) {
|
||||
queryParams.value.categoryCode = newValue.categoryCode;
|
||||
} else {
|
||||
queryParams.value.categoryCode = undefined;
|
||||
}
|
||||
|
||||
console.log('发送请求参数:', queryParams.value);
|
||||
getList();
|
||||
},
|
||||
@@ -131,14 +138,31 @@ function getList() {
|
||||
|
||||
getAdviceBaseInfo(queryParams.value).then((res) => {
|
||||
if (res.data.records && res.data.records.length > 0) {
|
||||
adviceBaseList.value = res.data.records.filter((item) => {
|
||||
let filteredRecords = res.data.records.filter((item) => {
|
||||
// 后端已经根据adviceTypes参数进行了筛选,这里只需要进行前端补充筛选
|
||||
|
||||
// 过滤库存(药品和耗材需要检查库存,诊疗不需要检查库存)
|
||||
if (item.adviceType == 1 || item.adviceType == 2) {
|
||||
return handleQuantity(item) != 0;
|
||||
} else {
|
||||
return true;
|
||||
if (handleQuantity(item) == 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 如果设置了categoryCode筛选条件,进行筛选(用于区分西药和中成药)
|
||||
// categoryCode = '1' 表示中成药,categoryCode = '2' 表示西药
|
||||
// 注意:只有药品类型(adviceType=1)才需要根据categoryCode筛选
|
||||
if (queryParams.value.categoryCode && item.adviceType == 1) {
|
||||
// 只筛选药品类型
|
||||
if (item.categoryCode != queryParams.value.categoryCode) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
adviceBaseList.value = filteredRecords;
|
||||
|
||||
console.log('过滤后数据显示:', adviceBaseList.value.length, '条');
|
||||
|
||||
total.value = res.data.total;
|
||||
|
||||
Reference in New Issue
Block a user