修改耗材/诊疗绑定,耗材项目药品的缺失
This commit is contained in:
@@ -18,7 +18,7 @@ export function getBindList(queryParams) {
|
||||
})
|
||||
}
|
||||
|
||||
// 获取耗材列表
|
||||
// 获取耗材列表(受限制的API,只返回单次消耗类耗材)
|
||||
export function getDeviceList(queryParams) {
|
||||
return request({
|
||||
url: '/personalization/activity-device/device-page',
|
||||
@@ -27,6 +27,15 @@ export function getDeviceList(queryParams) {
|
||||
})
|
||||
}
|
||||
|
||||
// 获取完整的器材目录列表(使用原始API,不限制categoryCode)
|
||||
export function getFullDeviceList(queryParams) {
|
||||
return request({
|
||||
url: '/data-dictionary/device/information-page',
|
||||
method: 'get',
|
||||
params: queryParams
|
||||
})
|
||||
}
|
||||
|
||||
// 获取耗材列表
|
||||
export function init() {
|
||||
return request({
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getDeviceList } from './api';
|
||||
import { getFullDeviceList } from './api';
|
||||
import { watch } from 'vue';
|
||||
import { throttle } from 'lodash-es';
|
||||
|
||||
@@ -27,10 +27,12 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(['selectRow']);
|
||||
const queryParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 50,
|
||||
itemType: props.itemType,
|
||||
// 修改查询参数,添加searchKey字段以匹配搜索框输入
|
||||
const queryParams = reactive({
|
||||
searchKey: '',
|
||||
pageNo: 1, // 新API使用pageNo而不是pageNum
|
||||
pageSize: 50
|
||||
// 移除categoryCode参数,避免任何可能的限制
|
||||
});
|
||||
const deviceList = ref([]);
|
||||
|
||||
@@ -43,18 +45,22 @@ const throttledGetList = throttle(
|
||||
{ leading: true, trailing: true }
|
||||
);
|
||||
|
||||
// 初始化时设置搜索关键字
|
||||
queryParams.searchKey = props.searchKey;
|
||||
|
||||
watch(
|
||||
() => props,
|
||||
() => props.searchKey,
|
||||
(newValue) => {
|
||||
queryParams.value.searchKey = newValue.searchKey;
|
||||
queryParams.searchKey = newValue;
|
||||
throttledGetList();
|
||||
},
|
||||
{ immdiate: true, deep: true }
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
getList();
|
||||
function getList() {
|
||||
getDeviceList(queryParams.value).then((res) => {
|
||||
// 使用新的不受限制的API,不设置任何会限制查询范围的参数
|
||||
getFullDeviceList(queryParams).then((res) => {
|
||||
deviceList.value = res.data.records;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user