Compare commits
2 Commits
d3d144bb18
...
5cfb091d0b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5cfb091d0b | ||
|
|
5bd49fb580 |
@@ -1141,7 +1141,9 @@ function submitForm() {
|
||||
// 保存麻醉方式
|
||||
sessionStorage.setItem('anesthesiaType', form.value.anesthesiaTypeEnum)
|
||||
open.value = false
|
||||
// 由父组件 @saved 事件负责刷新列表(带延迟确保后端事务已提交)
|
||||
// 子组件自身主动刷新列表(立即),确保数据展示不依赖父组件事件
|
||||
getList()
|
||||
// 通知父组件刷新医嘱列表(父组件也会带延迟再次刷新手术列表作为兜底)
|
||||
emit('saved')
|
||||
} else {
|
||||
proxy.$modal.msgError(res.msg || '新增手术失败,请检查表单信息')
|
||||
@@ -1158,6 +1160,8 @@ function submitForm() {
|
||||
// 保存麻醉方式
|
||||
sessionStorage.setItem('anesthesiaType', form.value.anesthesiaTypeEnum)
|
||||
open.value = false
|
||||
// 子组件自身主动刷新列表(立即)
|
||||
getList()
|
||||
// 由父组件 @saved 事件负责刷新列表
|
||||
emit('saved')
|
||||
} else {
|
||||
|
||||
@@ -863,13 +863,22 @@ function clickRowDb(row, column, event) {
|
||||
}
|
||||
row.showPopover = false;
|
||||
// 仅”待签发(statusEnum==1)”允许编辑;”已签发(statusEnum==2)”及之后状态不允许编辑
|
||||
if (row.statusEnum == 1) {
|
||||
// 使用 Number() 做类型转换,确保后端返回的数值能正确比较
|
||||
if (Number(row.statusEnum) === 1) {
|
||||
// 确保治疗类型为字符串,方便与单选框 label 对齐,默认为长期医嘱('1')
|
||||
row.therapyEnum = String(row.therapyEnum ?? '1');
|
||||
row.isEdit = true;
|
||||
const index = prescriptionList.value.findIndex((item) => item.uniqueKey === row.uniqueKey);
|
||||
prescriptionList.value[index] = row;
|
||||
expandOrder.value = [row.uniqueKey];
|
||||
if (index !== -1) {
|
||||
prescriptionList.value.splice(index, 1, row);
|
||||
// 使用 nextTick 确保数据更新后再设置展开状态,保证 el-table 能正确识别 row-key
|
||||
nextTick(() => {
|
||||
expandOrder.value = [row.uniqueKey];
|
||||
});
|
||||
} else {
|
||||
console.warn('⚠️ clickRowDb 未找到匹配行: uniqueKey=', row.uniqueKey, ', row=', row);
|
||||
proxy.$modal.msgWarning('无法进入编辑模式,请刷新列表后重试');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user