诊断:
-
+ @change="handleDiagnosisChange"
+ >
+
+
费用性质:
d.definitionId === val);
+ if (!item) return;
diagnosisName.value = item.name;
conditionId.value = item.conditionId;
encounterDiagnosisId.value = item.encounterDiagnosisId;
diff --git a/healthlink-his-ui/src/views/doctorstation/components/tcm/tcmAdvice.vue b/healthlink-his-ui/src/views/doctorstation/components/tcm/tcmAdvice.vue
index a381ab6d8..ed4c8c2fa 100755
--- a/healthlink-his-ui/src/views/doctorstation/components/tcm/tcmAdvice.vue
+++ b/healthlink-his-ui/src/views/doctorstation/components/tcm/tcmAdvice.vue
@@ -93,13 +93,13 @@
v-model="prescription.conditionDefinitionId"
placeholder="诊断"
style="width: 180px"
+ @change="(val) => handleDiagnosisChange(val, pIndex)"
>
费用性质:
@@ -288,7 +288,7 @@
placeholder=" "
>
{
- if (res.data.illness.length > 0) {
- res.data.illness.forEach((item, index) => {
- diagnosisList.value.push({
- name: item.name + '-' + res.data.symptom[index].name,
+ console.log('【中医诊断】开始获取就诊诊断, encounterId:', props.patientInfo.encounterId)
+
+ // 同时获取中医就诊诊断和西医就诊诊断
+ const p1 = getTcmDiagnosis({ encounterId: props.patientInfo.encounterId });
+ const p2 = getEncounterDiagnosis(props.patientInfo.encounterId);
+
+ Promise.all([p1, p2]).then(([tcmRes, westernRes]) => {
+ const mergedList = [];
+
+ // 1. 解析中医诊断
+ if (tcmRes && tcmRes.data && tcmRes.data.illness && tcmRes.data.illness.length > 0) {
+ const symptomList = tcmRes.data.symptom || [];
+ tcmRes.data.illness.forEach((item, index) => {
+ const symptomName = symptomList[index]?.name || '';
+ mergedList.push({
+ name: item.name + (symptomName ? '-' + symptomName : '') + ' (中医)',
definitionId: item.definitionId,
encounterDiagnosisId: item.encounterDiagnosisId,
conditionId: item.conditionId,
});
});
}
- console.log('【中医诊断】获取数据成功,诊断数量:', diagnosisList.value.length)
- // 默认选择第一个诊断
- if (diagnosisList.value.length > 0) {
- const firstDiagnosis = diagnosisList.value[0];
- tcmPrescriptionList.value.forEach((prescription) => {
- prescription.diagnosisName = firstDiagnosis.name;
- prescription.conditionId = firstDiagnosis.conditionId;
- prescription.encounterDiagnosisId = firstDiagnosis.encounterDiagnosisId;
- prescription.conditionDefinitionId = firstDiagnosis.definitionId;
+
+ // 2. 解析西医诊断
+ const westernData = westernRes?.data || westernRes || [];
+ if (Array.isArray(westernData) && westernData.length > 0) {
+ westernData.forEach((item) => {
+ mergedList.push({
+ name: item.name + ' (西医)',
+ definitionId: item.definitionId,
+ encounterDiagnosisId: item.encounterDiagnosisId,
+ conditionId: item.conditionId,
+ });
});
}
+
+ diagnosisList.value = mergedList;
+ console.log('【中医诊断】获取数据成功,总诊断数量:', diagnosisList.value.length)
+
+ // 默认选择第一个诊断 (仅当没有选择或原本选择的值不在列表中时)
+ if (diagnosisList.value.length > 0) {
+ tcmPrescriptionList.value.forEach((prescription) => {
+ const exists = diagnosisList.value.some(d => d.definitionId === prescription.conditionDefinitionId);
+ if (!exists || !prescription.conditionDefinitionId) {
+ const firstDiagnosis = diagnosisList.value[0];
+ prescription.diagnosisName = firstDiagnosis.name;
+ prescription.conditionId = firstDiagnosis.conditionId;
+ prescription.encounterDiagnosisId = firstDiagnosis.encounterDiagnosisId;
+ prescription.conditionDefinitionId = firstDiagnosis.definitionId;
+ }
+ });
+ }
+ }).catch(err => {
+ console.error('【中医诊断】获取诊断信息失败:', err);
});
}
@@ -852,7 +897,9 @@ function clickRowDb(row, pIndex) {
}
}
-function handleDiagnosisChange(item, pIndex) {
+function handleDiagnosisChange(val, pIndex) {
+ const item = diagnosisList.value.find(d => d.definitionId === val);
+ if (!item) return;
const prescription = tcmPrescriptionList.value[pIndex];
prescription.diagnosisName = item.name;
prescription.conditionId = item.conditionId;
diff --git a/healthlink-his-ui/src/views/inpatientDoctor/home/components/diagnosis/diagnosis.vue b/healthlink-his-ui/src/views/inpatientDoctor/home/components/diagnosis/diagnosis.vue
index cd8c78174..3b7fef9e7 100755
--- a/healthlink-his-ui/src/views/inpatientDoctor/home/components/diagnosis/diagnosis.vue
+++ b/healthlink-his-ui/src/views/inpatientDoctor/home/components/diagnosis/diagnosis.vue
@@ -274,11 +274,11 @@
filterable
clearable
style="width: 100%"
- @focus="loadSyndromeOptions(scope.row.ybNo)"
+ @focus="loadSyndromeOptions(scope.row)"
@change="(val) => handleSyndromeSelect(val, scope.row)"
>
{
+ const syndromeCode = res.data.symptom[index]?.ybNo || '';
+ const syndromeName = res.data.symptom[index]?.name || '';
+ const syndromeId = res.data.symptom[index]?.definitionId || '';
newList.push({
conditionId: item.conditionId || '',
encounterDiagnosisId: item.encounterDiagnosisId || '',
@@ -575,9 +579,10 @@ function getList() {
ybNo: item.ybNo,
definitionId: item.definitionId || '',
diagnosisSystem: '中医',
- tcmSyndromeCode: res.data.symptom[index]?.ybNo || '',
- tcmSyndromeName: res.data.symptom[index]?.name || '',
- syndromeDefinitionId: res.data.symptom[index]?.definitionId || '',
+ tcmSyndromeCode: syndromeCode,
+ tcmSyndromeName: syndromeName,
+ syndromeDefinitionId: syndromeId,
+ syndromeOptions: syndromeCode ? [{ value: syndromeCode, label: syndromeName, id: syndromeId }] : [],
diagSrtNo: item.diagSrtNo,
medTypeCode: item.medTypeCode,
maindiseFlag: item.maindiseFlag,
@@ -793,6 +798,7 @@ function addDiagnosisItem() {
tcmSyndromeName: '',
syndromeDefinitionId: '',
syndromeGroupNo: '',
+ syndromeOptions: [],
verificationStatusEnum: 4,
medTypeCode: undefined,
diagSrtNo: form.value.diagnosisList.length + 1,
@@ -825,17 +831,18 @@ function handleDiagnosisSystemChange(row) {
}
// 加载中医证候选项(按诊断名称关联过滤)
-function loadSyndromeOptions(conditionCode) {
+function loadSyndromeOptions(row) {
+ const conditionCode = row.ybNo;
const params = conditionCode ? { conditionCode } : {};
getTcmSyndrome(params).then((res) => {
if (res.data && res.data.records) {
- syndromeOptions.value = res.data.records.map((item) => ({
+ row.syndromeOptions = res.data.records.map((item) => ({
value: item.ybNo,
label: item.name,
id: item.id,
}));
} else {
- syndromeOptions.value = [];
+ row.syndromeOptions = [];
}
});
}
@@ -843,7 +850,7 @@ function loadSyndromeOptions(conditionCode) {
// 中医证候选中赋值
function handleSyndromeSelect(val, row) {
if (val) {
- const selected = syndromeOptions.value.find((item) => item.value === val);
+ const selected = (row.syndromeOptions || []).find((item) => item.value === val);
row.tcmSyndromeName = selected ? selected.label : '';
row.syndromeDefinitionId = selected ? selected.id : '';
} else {
@@ -1166,6 +1173,7 @@ function handleNodeClick(data) {
tcmSyndromeName: '',
syndromeDefinitionId: '',
syndromeGroupNo: '',
+ syndromeOptions: [],
verificationStatusEnum: 4,
medTypeCode: undefined,
diagSrtNo: form.value.diagnosisList.length + 1,
diff --git a/healthlink-his-ui/src/views/inpatientDoctor/home/components/order/index.vue b/healthlink-his-ui/src/views/inpatientDoctor/home/components/order/index.vue
index 54c53c609..02e8e484c 100755
--- a/healthlink-his-ui/src/views/inpatientDoctor/home/components/order/index.vue
+++ b/healthlink-his-ui/src/views/inpatientDoctor/home/components/order/index.vue
@@ -811,6 +811,7 @@ const popoverJustClosedByKey = ref(null);
// 医嘱检索下拉浮框对齐:跟踪表格水平滚动偏移与主体区域边界限制
const tableScrollLeft = ref(0);
+const scrollLeftAtOpen = ref(0);
const mainBoundary = ref(null);
const advicePopperWidth = computed(() => {
// 取主体区域宽度与 900px 中较小值,避免小屏幕溢出;下限 500px
@@ -819,15 +820,17 @@ const advicePopperWidth = computed(() => {
});
const advicePopperStyle = computed(() => ({
padding: '0',
- marginLeft: `-${tableScrollLeft.value}px`,
+ marginLeft: `-${tableScrollLeft.value - scrollLeftAtOpen.value}px`,
}));
const advicePopperOptions = computed(() => ({
modifiers: [
{
name: 'preventOverflow',
- options: {
- boundary: mainBoundary.value || 'viewport',
- },
+ enabled: false,
+ },
+ {
+ name: 'flip',
+ enabled: false,
},
],
}));
@@ -1066,6 +1069,12 @@ function refresh() {
}
// 获取列表信息
function getListInfo(addNewRow) {
+ if (!localPatient.value || !localPatient.value.encounterId) {
+ loading.value = false;
+ prescriptionList.value = [];
+ isCategoryLoaded.value = false;
+ return;
+ }
loading.value = true;
isAdding.value = false;
collapseAllExpanded();
@@ -1229,6 +1238,10 @@ const filterPrescriptionList = computed(() => {
});
function getDiagnosisInfo() {
+ if (!localPatient.value || !localPatient.value.encounterId) {
+ diagnosisList.value = [];
+ return;
+ }
getEncounterDiagnosis(localPatient.value.encounterId).then((res) => {
diagnosisList.value = res.data;
let diagnosisInfo = diagnosisList.value.filter((item) => {
@@ -1477,6 +1490,10 @@ function handleFocus(row, index) {
const scrollWrapper = document.querySelector('.vxe-table--body-wrapper');
if (scrollWrapper) {
tableScrollLeft.value = scrollWrapper.scrollLeft || 0;
+ scrollLeftAtOpen.value = scrollWrapper.scrollLeft || 0;
+ } else {
+ tableScrollLeft.value = 0;
+ scrollLeftAtOpen.value = 0;
}
// 文字医嘱(type=8)不弹药品搜索框,直接展开填写面板
const adviceType = row.adviceType !== undefined ? row.adviceType : adviceQueryParams.value.adviceType;
@@ -1531,6 +1548,14 @@ function handleChange(value, row, index) {
adviceQueryParams.value.searchKey = value;
// popover 被 blur 关闭后,用户继续输入时自行打开
if (!row.showPopover) {
+ const scrollWrapper = document.querySelector('.vxe-table--body-wrapper');
+ if (scrollWrapper) {
+ tableScrollLeft.value = scrollWrapper.scrollLeft || 0;
+ scrollLeftAtOpen.value = scrollWrapper.scrollLeft || 0;
+ } else {
+ tableScrollLeft.value = 0;
+ scrollLeftAtOpen.value = 0;
+ }
row.showPopover = true;
}
const tableRef = getAdviceTableRef();
From acbcd6eacf45c919766c8e6abb1af542bd455b70 Mon Sep 17 00:00:00 2001
From: wangjian963 <15215920+aprilry@user.noreply.gitee.com>
Date: Wed, 24 Jun 2026 11:54:26 +0800
Subject: [PATCH 5/5] =?UTF-8?q?=20fix:=20=E4=BF=AE=E5=A4=8D=E8=8F=9C?=
=?UTF-8?q?=E5=8D=95parentId=E4=B8=BANULL=E6=97=B6=E8=8E=B7=E5=8F=96?=
=?UTF-8?q?=E8=B7=AF=E7=94=B1NPE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
路由构建时 SysMenu.getParentId() 可能返回 NULL(数据库 parent_id 为 NULL),
在 buildMenus/getRouterPath/getComponent/isMenuFrame/isParentView/getChildList
中直接调用 .intValue()/.longValue() 触发自动拆箱 NPE,导致前端路由加载失败。
---
.../system/service/impl/SysMenuServiceImpl.java | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/healthlink-his-server/core-system/src/main/java/com/core/system/service/impl/SysMenuServiceImpl.java b/healthlink-his-server/core-system/src/main/java/com/core/system/service/impl/SysMenuServiceImpl.java
index 9bd3fb7f2..0ab622bf8 100755
--- a/healthlink-his-server/core-system/src/main/java/com/core/system/service/impl/SysMenuServiceImpl.java
+++ b/healthlink-his-server/core-system/src/main/java/com/core/system/service/impl/SysMenuServiceImpl.java
@@ -176,7 +176,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
children.setQuery(menu.getQuery());
childrenList.add(children);
router.setChildren(childrenList);
- } else if (menu.getParentId().intValue() == 0 && isInnerLink(menu)) {
+ } else if ((menu.getParentId() == null || menu.getParentId() == 0) && isInnerLink(menu)) {
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), false, null, menu.getVisible()));
router.setPath("/");
List childrenList = new ArrayList();
@@ -524,11 +524,11 @@ public class SysMenuServiceImpl implements ISysMenuService {
public String getRouterPath(SysMenu menu) {
String routerPath = menu.getPath();
// 内链打开外网方式
- if (menu.getParentId().intValue() != 0 && isInnerLink(menu)) {
+ if (menu.getParentId() != null && menu.getParentId() != 0 && isInnerLink(menu)) {
routerPath = innerLinkReplaceEach(routerPath);
}
// 非外链并且是一级目录(类型为目录)
- if (0 == menu.getParentId().intValue() && UserConstants.TYPE_DIR.equals(menu.getMenuType())
+ if ((menu.getParentId() == null || menu.getParentId() == 0) && UserConstants.TYPE_DIR.equals(menu.getMenuType())
&& UserConstants.NO_FRAME.equals(menu.getIsFrame())) {
routerPath = "/" + menu.getPath();
}
@@ -549,7 +549,8 @@ public class SysMenuServiceImpl implements ISysMenuService {
String component = UserConstants.LAYOUT;
if (StringUtils.isNotEmpty(menu.getComponent()) && !isMenuFrame(menu)) {
component = menu.getComponent();
- } else if (StringUtils.isEmpty(menu.getComponent()) && menu.getParentId().intValue() != 0
+ } else if (StringUtils.isEmpty(menu.getComponent()) && menu.getParentId() != null
+ && menu.getParentId() != 0
&& isInnerLink(menu)) {
component = UserConstants.INNER_LINK;
} else if (StringUtils.isEmpty(menu.getComponent()) && isParentView(menu)) {
@@ -565,7 +566,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
* @return 结果
*/
public boolean isMenuFrame(SysMenu menu) {
- return menu.getParentId().intValue() == 0 && UserConstants.TYPE_MENU.equals(menu.getMenuType())
+ return (menu.getParentId() == null || menu.getParentId() == 0) && UserConstants.TYPE_MENU.equals(menu.getMenuType())
&& menu.getIsFrame().equals(UserConstants.NO_FRAME);
}
@@ -586,7 +587,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
* @return 结果
*/
public boolean isParentView(SysMenu menu) {
- return menu.getParentId().intValue() != 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType());
+ return menu.getParentId() != null && menu.getParentId() != 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType());
}
/**
@@ -634,7 +635,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
Iterator it = list.iterator();
while (it.hasNext()) {
SysMenu n = (SysMenu)it.next();
- if (n.getParentId().longValue() == t.getMenuId().longValue()) {
+ if (n.getParentId() != null && n.getParentId().longValue() == t.getMenuId().longValue()) {
tlist.add(n);
}
}