+
{{
scope.row.adviceName +
@@ -711,7 +680,7 @@
@@ -723,7 +692,6 @@
v-if="item.type != unitMap['dose']"
:value="item.value"
:label="item.label"
- style="width: 70px; margin-right: 20px"
@click="
() => {
scope.row.unitCode_dictText = item.label;
@@ -750,23 +718,21 @@
: '0.00 元'
}}
+
+ 确定
+
+
+ 取消
+
-
- 确定
-
-
+
{{
scope.row.adviceName +
@@ -801,7 +767,7 @@
@@ -813,7 +779,6 @@
v-if="item.type != unitMap['dose']"
:value="item.value"
:label="item.label"
- style="width: 70px; margin-right: 20px"
@click="
() => {
scope.row.unitCode_dictText = item.label;
@@ -853,17 +818,22 @@
: '0.00 元'
}}
+
+ 确定
+
+
+ 取消
+
-
- 确定
-
-
@@ -1161,19 +1133,21 @@
title="单次剂量"
align="center"
field=""
- width="120"
+ width="160"
>
-
- {{ scope.row.doseUnitCode_dictText }}
+
+
+ {{ scope.row.doseUnitCode_dictText }}
+
{{
@@ -1192,21 +1166,23 @@
title="总量"
align="center"
field=""
- width="100"
+ width="140"
>
-
- {{ resolveTotalQuantityUnit(scope.row) }}
+
+
+ {{ resolveTotalQuantityUnit(scope.row) }}
+
{{ formatTotalQuantityWithUnit(scope.row) }}
@@ -1578,6 +1554,19 @@ const orderGroupLoaded = ref({
const updateExpandOrder = (keys) => {
expandOrder.value = keys;
};
+
+// 收起所有展开行(vxe-table v4: expandRowKeys只在初始化生效,必须调实例方法收起行)
+function collapseAllExpanded() {
+ expandOrder.value = [];
+ if (prescriptionRef.value?.clearRowExpand) {
+ prescriptionRef.value.clearRowExpand();
+ } else if (prescriptionRef.value?.setRowExpand) {
+ const allRows = prescriptionRef.value.getData?.() || [];
+ if (allRows.length > 0) {
+ prescriptionRef.value.setRowExpand(allRows, false);
+ }
+ }
+}
const stockList = ref([]);
const contractList = ref([]);
const conditionId = ref('');
@@ -1766,7 +1755,7 @@ watch(
nextTick(() => {
const index = prescriptionList.value.findIndex((row) => row.uniqueKey === newValue[0]);
const items = proxy.$refs['formRef' + index]?.$el?.querySelectorAll('[data-prop]');
- requiredProps.value = Array.from(items).map((item) => item.dataset.prop);
+ requiredProps.value = items ? Array.from(items).map((item) => item.dataset.prop) : [];
});
} else {
requiredProps.value = {};
@@ -1878,7 +1867,7 @@ function handlePrintCommand(command) {
// 智能打印 - 根据选中数据的adviceType自动选择打印方式
async function printPrescription() {
// const selectedRows = prescriptionList.value.filter((item) => item.check);
- const selectedRows = prescriptionRef.value.getSelectionRows();
+ const selectedRows = prescriptionRef.value.getCheckboxRecords();
console.log('123456selectedRows', selectedRows);
if (selectedRows.length === 0) {
ElMessage.warning('未选择要打印的项目,请重新选择,打印失败');
@@ -2005,7 +1994,7 @@ async function printPrescription() {
// 处方打印 - 专门打印处方类型的数据
async function prescriptionPrint() {
// const selectedRows = prescriptionList.value.filter((item) => item.check);
- const selectedRows = prescriptionRef.value.getSelectionRows();
+ const selectedRows = prescriptionRef.value.getCheckboxRecords();
if (selectedRows.length === 0) {
ElMessage.warning('未选择要打印的项目,请重新选择,打印失败');
return;
@@ -2088,7 +2077,7 @@ async function prescriptionPrint() {
async function disposalPrint() {
console.log('处置打印开始');
// const selectedRows = prescriptionList.value.filter((item) => item.check);
- const selectedRows = prescriptionRef.value.getSelectionRows();
+ const selectedRows = prescriptionRef.value.getCheckboxRecords();
if (selectedRows.length === 0) {
ElMessage.warning('未选择要打印的项目,请重新选择,打印失败');
return;
@@ -2357,14 +2346,17 @@ function getDiagnosisInfo() {
}
// 选择框改变时的处理
-function handleSelectionChange(selection, row) {
- const isSelected = selection.some((item) => item.uniqueKey === row.uniqueKey);
+function handleSelectionChange({ checked, selection, row }) {
+ if (!row) return;
+ // 优先使用selection,回退到checked(兼容不同vxe-table版本)
+ const isSelected = selection ? selection.some((item) => item.uniqueKey === row.uniqueKey) : !!checked;
+ if (!row.groupId) return;
prescriptionList.value
.filter((item) => {
- return item.groupId && item.groupId == row?.groupId;
+ return item.groupId && item.groupId == row.groupId && item.uniqueKey !== row.uniqueKey;
})
- .forEach((row) => {
- prescriptionRef.value.toggleCheckboxRow(row, isSelected);
+ .forEach((item) => {
+ prescriptionRef.value.toggleCheckboxRow(item, isSelected);
});
}
@@ -2421,7 +2413,7 @@ function handleAddPrescription(prescriptionId, showWarning = true) {
});
getGroupMarkers();
nextTick(() => {
- const adviceRefName = 'adviceRef_' + (prescriptionId || currentPrescriptionId.value) + '_0';
+ const adviceRefName = 'adviceRef' + 0;
const adviceRef = proxy.$refs[adviceRefName];
if (adviceRef && adviceRef.focus) {
adviceRef.focus();
@@ -2521,7 +2513,11 @@ function handleFocus(row, index) {
function handleBlur(row) {
setTimeout(() => {
- row.showPopover = false;
+ // 通过uniqueKey找到当前行,确保popover关闭
+ const currentRow = prescriptionList.value.find(r => r.uniqueKey === row.uniqueKey);
+ if (currentRow) {
+ currentRow.showPopover = false;
+ }
}, 200);
}
@@ -2620,32 +2616,38 @@ function selectAdviceBase(key, row) {
async function setNewRow(key, row) {
console.log('[BugFix] setNewRow - row.adviceType:', row.adviceType, 'row.adviceType_dictText:', row.adviceType_dictText, 'row.adviceTableName:', row.adviceTableName);
- // 每次选择药品时,将当前行数据完全重置,清空所有旧数据
- const preservedData = {
- uniqueKey: prescriptionList.value[rowIndex.value].uniqueKey,
- isEdit: true,
- statusEnum: 1,
- showPopover: false, // 确保popover关闭
- };
+ // 不再替换行对象引用,保持vxe-table的行引用不变,确保插槽模板正确响应数据更新
+ const currentRow = prescriptionList.value[rowIndex.value];
+ if (!currentRow) return;
+ // 保持编辑状态
+ currentRow.isEdit = true;
+ currentRow.statusEnum = 1;
+ // 立即设置adviceName,确保输入框即时显示选中项名称
+ currentRow.adviceName = row.adviceName;
+ currentRow.showPopover = false;
- // 完全替换整个对象,只保留必要的初始字段
- prescriptionList.value[rowIndex.value] = preservedData;
-
- setValue(row);
+ await setValue(row);
console.log('[BugFix] setNewRow after setValue - prescriptionList[rowIndex].adviceType:', prescriptionList.value[rowIndex.value].adviceType, 'adviceType_dictText:', prescriptionList.value[rowIndex.value].adviceType_dictText);
// 🔧 Bug #220 修复:确保在setValue之后重新计算耗材类型的总金额
// 耗材(adviceType=4)和诊疗(adviceType=3)需要重新计算以确保显示正确
- const currentRow = prescriptionList.value[rowIndex.value];
- if (currentRow && (currentRow.adviceType == 3 || currentRow.adviceType == 4)) {
+ if (currentRow.adviceType == 3 || currentRow.adviceType == 4) {
calculateTotalPrice(currentRow, rowIndex.value);
}
// 确保在setValue之后再次设置showPopover为false,防止被覆盖
- prescriptionList.value[rowIndex.value].showPopover = false;
+ currentRow.showPopover = false;
expandOrder.value = [key];
+ // vxe-table v4: expandRowKeys只在初始化生效,必须调实例方法展开行
+ await nextTick();
+ if (prescriptionRef.value?.setRowExpand) {
+ const rowObj = prescriptionList.value.find(item => item.uniqueKey === key);
+ if (rowObj) {
+ prescriptionRef.value.setRowExpand([rowObj], true);
+ }
+ }
// 自动聚焦到单次用量字段 - 使用 async/await 多次尝试
await nextTick();
@@ -2719,7 +2721,7 @@ function getInspectionApplyNoFromAdviceRow(row) {
}
function handleDelete() {
- let selectRows = prescriptionRef.value.getSelectionRows();
+ let selectRows = prescriptionRef.value.getCheckboxRecords();
console.log('BugFix#219: handleDelete called, selectRows=', selectRows);
if (selectRows.length == 0) {
@@ -2885,7 +2887,7 @@ function handleDelete() {
console.log('BugFix#219: 普通医嘱删除列表, deleteList=', deleteList.length, 'sum=', sum);
handleEmrTreatment();
- updateExpandOrder([]);
+ collapseAllExpanded();
isAdding.value = false;
adviceQueryParams.value.adviceTypes = undefined; // 🎯 修复:改为 adviceTypes(复数)
@@ -3000,11 +3002,11 @@ function handleSave(prescriptionId) {
if (prescriptionList.value[0]?.isEdit && !prescriptionList.value[0].adviceType) {
prescriptionList.value.shift();
isAdding.value = false;
- updateExpandOrder([]);
+ collapseAllExpanded();
}
// --- 【修改点1:优先获取选中行】 ---
- const selectedRows = prescriptionRef.value ? prescriptionRef.value.getSelectionRows() : [];
+ const selectedRows = prescriptionRef.value ? prescriptionRef.value.getCheckboxRecords() : [];
let sourceList = [];
// 如果用户有勾选,只处理勾选的;否则处理当前列表所有数据
@@ -3498,6 +3500,19 @@ function handleSkinTest(selectRows) {
);
}
+// 取消编辑 - 关闭展开区域
+function handleCancelEdit(row, index) {
+ if (isAdding.value && !row.requestId) {
+ // 新增行取消:移除该行
+ prescriptionList.value.splice(index, 1);
+ isAdding.value = false;
+ } else {
+ // 已有行取消:恢复非编辑状态
+ row.isEdit = false;
+ }
+ collapseAllExpanded();
+}
+
// 单行处方保存
function handleSaveSign(row, index, prescriptionId) {
// 如果传入了处方ID,先切换到该处方
@@ -3582,7 +3597,7 @@ function handleSaveSign(row, index, prescriptionId) {
}
row.isEdit = false;
isAdding.value = false;
- updateExpandOrder([]);
+ collapseAllExpanded();
row.contentJson = undefined;
row.patientId = props.patientInfo.patientId;
row.encounterId = props.patientInfo.encounterId;
@@ -3753,7 +3768,7 @@ function handleSaveBatch(prescriptionId) {
// --- 【修改开始:优先使用选中行】 ---
// 1. 获取表格当前选中的行
- const selectedRows = prescriptionRef.value ? prescriptionRef.value.getSelectionRows() : [];
+ const selectedRows = prescriptionRef.value ? prescriptionRef.value.getCheckboxRecords() : [];
// 2. 确定数据源
// 逻辑:如果用户有勾选,就只处理勾选的;如果没勾选,就处理所有数据(一键保存)
@@ -4053,22 +4068,34 @@ async function setValue(row) {
? (typeof row.skinTestFlag === 'number' ? row.skinTestFlag : (row.skinTestFlag ? 1 : 0))
: 0;
- // 创建一个新的对象,而不是合并旧数据,以避免残留数据问题
+ // 不再替换行对象引用,保持vxe-table的行引用不变,确保插槽模板正确响应数据更新
console.log('[BugFix] setValue - row.adviceType:', row.adviceType, 'row.adviceType_dictText:', row.adviceType_dictText, 'row.adviceTableName:', row.adviceTableName);
- prescriptionList.value[rowIndex.value] = {
- ...JSON.parse(JSON.stringify(row)),
- // 确保adviceType为数字类型,避免类型不匹配导致的显示问题
- adviceType: Number(row.adviceType),
- // 🔧 Bug Fix: 确保adviceType_dictText被正确设置,避免展开行时显示错误
- adviceType_dictText: row.adviceType_dictText || mapAdviceTypeLabel(row.adviceType, row.adviceTableName),
- skinTestFlag: skinTestFlag, // 确保皮试字段是数字类型
- skinTestFlag_enumText: skinTestFlag == 1 ? '是' : '否', // 更新显示文本
- // 保留原来设置的初始状态值
- uniqueKey: prescriptionList.value[rowIndex.value].uniqueKey,
- isEdit: prescriptionList.value[rowIndex.value].isEdit,
- statusEnum: prescriptionList.value[rowIndex.value].statusEnum,
- showPopover: false, // 确保查询框关闭
- };
+ const existingRow = prescriptionList.value[rowIndex.value];
+ if (!existingRow) return;
+
+ // 保存需要保留的字段
+ const preservedKey = existingRow.uniqueKey;
+ const preservedIsEdit = existingRow.isEdit;
+ const preservedStatus = existingRow.statusEnum;
+
+ // 清除行上所有自有属性(避免残留旧数据)
+ Object.keys(existingRow).forEach(key => {
+ delete existingRow[key];
+ });
+
+ // 从选中项复制所有属性到现有行对象
+ const rowData = JSON.parse(JSON.stringify(row));
+ Object.assign(existingRow, rowData);
+
+ // 覆盖需要特殊处理的字段
+ existingRow.adviceType = Number(row.adviceType);
+ existingRow.adviceType_dictText = row.adviceType_dictText || mapAdviceTypeLabel(row.adviceType, row.adviceTableName);
+ existingRow.skinTestFlag = skinTestFlag;
+ existingRow.skinTestFlag_enumText = skinTestFlag == 1 ? '是' : '否';
+ existingRow.uniqueKey = preservedKey;
+ existingRow.isEdit = preservedIsEdit;
+ existingRow.statusEnum = preservedStatus;
+ existingRow.showPopover = false;
console.log('[BugFix] setValue - prescriptionList[rowIndex].adviceType_dictText:', prescriptionList.value[rowIndex.value].adviceType_dictText);
// 🔧 Bug #455: 诊疗医嘱(adviceType=3)的执行科室默认使用患者就诊科室,
// 不使用positionId(诊疗目录配置的执行科室),避免配置ID不在机构树中导致显示原始ID
@@ -4491,7 +4518,7 @@ function escKeyListener(e) {
index = prescriptionList.value.findIndex((item) => item.uniqueKey == expandOrder.value[0]);
}
if (index == 0) {
- updateExpandOrder([]);
+ collapseAllExpanded();
}
prescriptionList.value.shift();
isAdding.value = false;
@@ -4502,7 +4529,7 @@ function escKeyListener(e) {
// 签退/撤回
function handleSingOut() {
- let selectRows = prescriptionRef.value.getSelectionRows();
+ let selectRows = prescriptionRef.value.getCheckboxRecords();
console.log('BugFix#219: handleSingOut called, selectRows=', selectRows);
console.log('BugFix#219: 选中行详情:', selectRows.map(item => ({
adviceType: item.adviceType,
@@ -4688,7 +4715,7 @@ function handleGroupId(paramList) {
// 组合
function combination() {
- let selectRows = prescriptionRef.value.getSelectionRows();
+ let selectRows = prescriptionRef.value.getCheckboxRecords();
if (selectRows.length <= 1) {
proxy.$modal.msgWarning('至少选择两项');
return;
@@ -4750,7 +4777,7 @@ function combination() {
// 拆组
function split() {
- let selectRows = prescriptionRef.value.getSelectionRows();
+ let selectRows = prescriptionRef.value.getCheckboxRecords();
if (selectRows.length < 1) {
proxy.$modal.msgWarning('至少选择一项');
return;
@@ -5344,8 +5371,8 @@ const orderSetDialogScope = ref('personal');
function openOrderSetDialog(scope) {
orderSetDialogScope.value = scope || 'personal';
const selectedRaw =
- prescriptionRef.value && prescriptionRef.value.getSelectionRows
- ? prescriptionRef.value.getSelectionRows()
+ prescriptionRef.value && prescriptionRef.value.getCheckboxRecords
+ ? prescriptionRef.value.getCheckboxRecords()
: [];
const selected = (selectedRaw || []).map((row) => {
@@ -5437,6 +5464,8 @@ defineExpose({ getListInfo, getDiagnosisInfo });
display: flex;
align-items: center;
gap: 8px;
+ flex-wrap: nowrap;
+ white-space: nowrap;
background: #fff;
padding: 6px 10px;
border-radius: 4px;
@@ -5444,6 +5473,18 @@ defineExpose({ getListInfo, getDiagnosisInfo });
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}
+.edit-form-row {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ flex-wrap: nowrap;
+ margin-top: 10px;
+}
+
+.edit-form-row .el-form-item {
+ margin-bottom: 0;
+}
+
/* 调整element组件默认间距 */
// .el-select,
// .el-input-number {
diff --git a/healthlink-his-ui/src/views/doctorstation/components/prescription/refundListDialog.vue b/healthlink-his-ui/src/views/doctorstation/components/prescription/refundListDialog.vue
index eadad539c..889d9223f 100755
--- a/healthlink-his-ui/src/views/doctorstation/components/prescription/refundListDialog.vue
+++ b/healthlink-his-ui/src/views/doctorstation/components/prescription/refundListDialog.vue
@@ -1,6 +1,7 @@
!val && emit('close')"
title="退费单"
width="1300px"
teleported
@@ -221,7 +222,7 @@ function tableSpanMethod({ row, column, rowIndex }) {
function submit() {
// 1. 获取当前选中行并提取去重的 paymentId 列表
- const selectedRows = proxy.$refs['refundListRef'].getSelectionRows();
+ const selectedRows = proxy.$refs['refundListRef'].getCheckboxRecords();
const selectedPaymentIds = [...new Set(selectedRows.map((row) => row.paymentId))];
// 2. 遍历 refundList,筛选出符合条件的数据并设置 refundFlag
diff --git a/healthlink-his-ui/src/views/doctorstation/components/prescription/skinTestInfo.vue b/healthlink-his-ui/src/views/doctorstation/components/prescription/skinTestInfo.vue
index d815e8f2d..583ee87e7 100755
--- a/healthlink-his-ui/src/views/doctorstation/components/prescription/skinTestInfo.vue
+++ b/healthlink-his-ui/src/views/doctorstation/components/prescription/skinTestInfo.vue
@@ -50,7 +50,7 @@
align="center"
width="120"
>
-
+
{{ '1' }}
@@ -166,7 +166,7 @@ const handleDeleteRow = (row) => {
// 提交处理
const handleSubmit = () => {
- const selectedRows = consumableTableRef.value.getSelectionRows();
+ const selectedRows = consumableTableRef.value.getCheckboxRecords();
// 保存到本地存储
// localStorage.setItem('doctor' + userStore.id.toString(), dontShowAgain.value);
if (selectedRows.length === 0) {
From 193a08acbdf94c9edf44da6ba596c5403e2b5d8f Mon Sep 17 00:00:00 2001
From: guanyu
Date: Tue, 16 Jun 2026 12:01:52 +0800
Subject: [PATCH 3/3] =?UTF-8?q?fix(#776):=20guanyu=20(=E6=96=87=E4=BB=B6?=
=?UTF-8?q?=E5=90=88=E5=85=A5)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
MD/MODULE_INDEX.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MD/MODULE_INDEX.md b/MD/MODULE_INDEX.md
index c8d71d889..d0752eebc 100644
--- a/MD/MODULE_INDEX.md
+++ b/MD/MODULE_INDEX.md
@@ -1,7 +1,7 @@
# HealthLink-HIS 代码模块索引
> 供 LLM 快速定位代码。每个模块列出 Controller → Service → Mapper 关键文件。
-> 最后更新: 2026-06-16 06:00 (300 个 Controller)
+> 最后更新: 2026-06-16 12:00 (300 个 Controller)
## 关键词 → 模块速查