fix(#749): guanyu (文件合入)

This commit is contained in:
2026-06-15 15:01:52 +08:00
committed by 华佗
parent 2609791b62
commit 17616a32cb
2 changed files with 18 additions and 52 deletions

View File

@@ -1,7 +1,7 @@
# HealthLink-HIS 代码模块索引
> 供 LLM 快速定位代码。每个模块列出 Controller → Service → Mapper 关键文件。
> 最后更新: 2026-06-15 06:00 (298 个 Controller)
> 最后更新: 2026-06-15 12:00 (300 个 Controller)
## 关键词 → 模块速查

View File

@@ -1,4 +1,4 @@
<template>
<template>
<div style="width: 100%; display: flex; flex-direction: column;">
<div style="margin-bottom: 5px">
<el-button
@@ -394,7 +394,7 @@
>
皮试<el-checkbox
v-model="scope.row.skinTestFlag"
:true-value="1"
:true-value="true"
:false-value="0"
@change="handleSkinTestChange(scope.row, scope.rowIndex)"
>
@@ -837,7 +837,7 @@
>
皮试<el-checkbox
v-model="scope.row.skinTestFlag"
:true-value="1"
:true-value="true"
:false-value="0"
@change="handleSkinTestChange(scope.row, scope.rowIndex)"
>
@@ -1161,7 +1161,6 @@
title="单次剂量"
align="center"
field=""
min-width="130"
>
<template #default="scope">
<template v-if="scope.row.isEdit">
@@ -1192,7 +1191,6 @@
title="总量"
align="center"
field=""
min-width="110"
>
<template #default="scope">
<template v-if="scope.row.isEdit">
@@ -1334,7 +1332,7 @@
<template v-if="scope.row.isEdit">
<el-checkbox
v-model="scope.row.skinTestFlag"
:true-value="1"
:true-value="true"
:false-value="0"
@change="handleSkinTestChange(scope.row, scope.rowIndex)"
>
@@ -1577,23 +1575,6 @@ const orderGroupLoaded = ref({
// 更新展开行的函数
const updateExpandOrder = (keys) => {
expandOrder.value = keys;
nextTick(() => {
if (prescriptionRef.value?.setRowExpand) {
// 折叠不需要展开的行
prescriptionList.value.forEach(row => {
if (!keys.includes(row.uniqueKey)) {
prescriptionRef.value.setRowExpand([row], false);
}
});
// 展开目标行
keys.forEach(key => {
const targetRow = prescriptionList.value.find(item => item.uniqueKey === key);
if (targetRow) {
prescriptionRef.value.setRowExpand([targetRow], true);
}
});
}
});
};
const stockList = ref([]);
const contractList = ref([]);
@@ -1779,19 +1760,14 @@ onBeforeUnmount(() => {
watch(
() => expandOrder.value,
(newValue) => {
if (newValue && newValue.length > 0) {
if (newValue.length > 0) {
nextTick(() => {
const index = prescriptionList.value.findIndex((row) => row.uniqueKey === newValue[0]);
if (index !== -1) {
const formRef = proxy.$refs['formRef' + index];
const items = formRef?.$el?.querySelectorAll('[data-prop]') || formRef?.querySelectorAll?.('[data-prop]');
requiredProps.value = items ? Array.from(items).map((item) => item.dataset.prop) : [];
} else {
requiredProps.value = [];
}
const items = proxy.$refs['formRef' + index]?.$el?.querySelectorAll('[data-prop]');
requiredProps.value = Array.from(items).map((item) => item.dataset.prop);
});
} else {
requiredProps.value = [];
requiredProps.value = {};
}
}
);
@@ -2591,16 +2567,6 @@ const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
* 选择药品回调
*/
function selectAdviceBase(key, row) {
console.log('[selectAdviceBase] Triggered with key:', key, 'row:', JSON.parse(JSON.stringify(row)));
// 确保 rowIndex 指向正确的行索引,避免 out of sync 或者未定义导致的报错
const targetIndex = prescriptionList.value.findIndex(item => item.uniqueKey === key);
console.log('[selectAdviceBase] Target index resolved:', targetIndex, 'Current rowIndex.value:', rowIndex.value);
if (targetIndex !== -1) {
rowIndex.value = targetIndex;
} else {
console.error('[selectAdviceBase] Target row not found in prescriptionList by uniqueKey!');
}
// 🔧 Bug Fix: 检查药品是否需要皮试,如果需要则弹出确认框
if (row.skinTestFlag == 1) {
ElMessageBox.confirm(`药品:${row.adviceName}需要做皮试,是否做皮试?`, '提示', {
@@ -2677,7 +2643,7 @@ function selectAdviceBase(key, row) {
// 确保在setValue之后再次设置showPopover为false防止被覆盖
prescriptionList.value[rowIndex.value].showPopover = false;
updateExpandOrder([key]);
expandOrder.value = [key];
// 自动聚焦到单次用量字段 - 使用 async/await 多次尝试
await nextTick();
@@ -3769,10 +3735,9 @@ function handleSaveBatch(prescriptionId) {
prescription.accountId = finalAccountId;
}
// 获取对应处方的展开状态
const prescriptionExpandOrder = prescription.expandOrder || [];
if (prescriptionExpandOrder.length > 0) {
proxy.$modal.msgWarning('请先点击确定确认当前医嘱');
// 🔧 Bug Fix #749: 检查是否有展开行未确认(使用组件级响应式变量 expandOrder.value
if (expandOrder.value.length > 0) {
proxy.$modal.msgWarning('请先点击确定确认当前医嘱,或关闭展开行');
return;
}
@@ -4142,7 +4107,7 @@ async function setValue(row) {
if (row.adviceType != 3 && row.adviceType != 4 && row.adviceType != 5) {
// 🔧 Bug #144 补充修复:检查 inventoryList 是否存在,避免 undefined 错误
if (!row.inventoryList || row.inventoryList.length == 0) {
updateExpandOrder([]);
expandOrder.value = [];
proxy.$modal.msgWarning(row.adviceName + '无库存');
return;
}
@@ -4263,9 +4228,6 @@ async function setValue(row) {
}
// 🔧 Bug #218 修复:最后统一同步组套字段(适用于所有类型)
syncGroupFields(row);
// 强制触发 Vue 数组响应式更新,并通知 vxe-table 重新加载数据
prescriptionList.value = [...prescriptionList.value];
}
// 选择组套 - 适配新版 OrderGroupDrawer 组件
@@ -5627,3 +5589,7 @@ defineExpose({ getListInfo, getDiagnosisInfo });
min-width: 0;
}
</style>
// 🔧 Bug Fix #749: 检查是否有展开行未确认(使用组件级响应式变量 expandOrder.value
if (expandOrder.value.length > 0) {
proxy.$modal.msgWarning('请先点击确定确认当前医嘱,或关闭展开行');