修改耗材/诊疗绑定,耗材项目药品的缺失
This commit is contained in:
@@ -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