From f4605b1af797151d73c62f7cdfc01eb58d5b610b Mon Sep 17 00:00:00 2001 From: wzk <2438381872@qq.com> Date: Mon, 27 Oct 2025 14:57:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E6=8B=89=E5=88=97=E8=A1=A8=E7=9A=84?= =?UTF-8?q?=E5=88=B7=E9=80=89=E5=8A=9F=E8=83=BD=E5=A4=B1=E6=95=88=EF=BC=8C?= =?UTF-8?q?=E6=8C=89=E7=85=A7=E4=B8=8B=E6=8B=89=E9=80=89=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E5=8C=BB=E5=98=B1=E7=B1=BB=E5=9E=8B=E8=83=BD=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E5=87=BA=E5=AF=B9=E5=BA=94=E6=94=B6=E8=B4=B9=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=8C=BB=E7=94=9F=E8=BF=9B=E8=A1=8C=E5=BC=80=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/adviceBaseList.vue | 74 ++++++++++++------- .../prescription/prescriptionlist.vue | 37 ++++++++-- 2 files changed, 77 insertions(+), 34 deletions(-) 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/prescription/prescriptionlist.vue b/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue index 5ce3a36c..9f5b14e7 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue @@ -561,9 +561,20 @@ (value) => { expandOrder = []; prescriptionList[scope.$index].adviceName = undefined; - adviceQueryParams.adviceType = value; - } - " + + // 直接更新查询参数 + adviceQueryParams.value.adviceType = value; + adviceQueryParams.value.searchKey = ''; + + console.log('医嘱类型改变为:', value, '查询参数:', adviceQueryParams.value); + + // 确保弹窗重新打开 + nextTick(() => { + row.showPopover = true; + handleFocus(scope.row, scope.$index); + }); + } + " > { + row.showPopover = false; + }, 200); } function handleChange(value) { @@ -1096,7 +1120,7 @@ function selectAdviceBase(key, row) { prescriptionList.value[rowIndex.value].orgId = JSON.parse(JSON.stringify(row)).positionId; prescriptionList.value[rowIndex.value].unitPrice = row.priceList[0].price; } - expandOrder.value = [key]; + expandOrder.value = [key]; nextTick(() => { if (row.adviceType == 1) { if (row.injectFlag == 1) { @@ -1108,6 +1132,7 @@ function selectAdviceBase(key, row) { inputRefs.value['quantity']?.focus(); } }); + } function getOrgList() {