diff --git a/openhis-ui-vue3/src/views/doctorstation/components/adviceBaseList.vue b/openhis-ui-vue3/src/views/doctorstation/components/adviceBaseList.vue index d009eeec..47bd2f6a 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/adviceBaseList.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/adviceBaseList.vue @@ -67,7 +67,7 @@ import { throttle } from 'lodash-es'; const props = defineProps({ adviceQueryParams: { type: Object, - default: '', + required: true }, patientInfo: { type: Object, @@ -97,39 +97,25 @@ const throttledGetList = throttle( watch( () => props.adviceQueryParams, (newValue) => { - queryParams.value.searchKey = newValue.searchKey; - // queryParams.value.adviceType = newValue.adviceType; + console.log('adviceBaseList 接收到参数变化:', newValue); + + // 直接更新查询参数 + queryParams.value.searchKey = newValue.searchKey || ''; + + // 处理类型筛选 if (newValue.adviceType) { - queryParams.value.adviceTypes = [newValue.adviceType].join(','); + // 单个类型 + queryParams.value.adviceTypes = newValue.adviceType.toString(); } else { + // 全部类型 queryParams.value.adviceTypes = '1,2,3'; } - throttledGetList(); + + console.log('发送请求参数:', queryParams.value); + getList(); }, - { deep: true } + { deep: true, immediate: true } ); - -getList(); -function getList() { - queryParams.value.organizationId = props.patientInfo.orgId; - getAdviceBaseInfo(queryParams.value).then((res) => { - console.log('ssssssssss', res.data.records); - if (res.data.records.length > 0) { - adviceBaseList.value = res.data.records.filter((item) => { - if (item.adviceType == 1 || item.adviceType == 2) { - return handleQuantity(item) != 0; - } else { - return true; - } - }); - total.value = res.data.total; - nextTick(() => { - currentIndex.value = 0; - adviceBaseRef.value.setCurrentRow(adviceBaseList.value[0]); - }); - } - }); -} // 从priceList列表中获取价格 function getPriceFromInventory(row) { if (row.priceList && row.priceList.length > 0) { @@ -138,6 +124,38 @@ function getPriceFromInventory(row) { } return '-'; } +function getList() { + queryParams.value.organizationId = props.patientInfo.orgId; + + console.log('发送API请求:', queryParams.value); + + getAdviceBaseInfo(queryParams.value).then((res) => { + if (res.data.records && res.data.records.length > 0) { + adviceBaseList.value = res.data.records.filter((item) => { + if (item.adviceType == 1 || item.adviceType == 2) { + return handleQuantity(item) != 0; + } else { + return true; + } + }); + + console.log('过滤后数据显示:', adviceBaseList.value.length, '条'); + + total.value = res.data.total; + nextTick(() => { + currentIndex.value = 0; + if (adviceBaseList.value.length > 0) { + adviceBaseRef.value.setCurrentRow(adviceBaseList.value[0]); + } + }); + } else { + adviceBaseList.value = []; + } + }).catch(error => { + console.error('获取数据失败:', error); + adviceBaseList.value = []; + }); +} // 处理键盘事件 const handleKeyDown = (event) => { const key = event.key; diff --git a/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/diagnosis.vue b/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/diagnosis.vue index a64571c9..9f963171 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/diagnosis.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/diagnosis/diagnosis.vue @@ -99,7 +99,7 @@ > - - - + + @@ -43,6 +35,7 @@