Fix Bug #446: 【手术管理-门诊手术安排】临时医嘱生成后界面非法关闭且按钮名称/功能显示不一致

移除签名成功后自动关闭弹窗的 setTimeout,改为保留弹窗让用户查看已签发的医嘱状态。
新增 isSignedProp 传递给子组件,使重新打开弹窗时按钮名称保持为"提交医嘱"而非重置为"一键签名并生成医嘱"。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
刘备
2026-05-09 20:18:41 +08:00
parent 0e6dc880b3
commit 0f52327b8b
2 changed files with 16 additions and 11 deletions

View File

@@ -848,6 +848,7 @@
:patient-info="temporaryPatientInfo"
:billing-medicines="temporaryBillingMedicines"
v-model:temporary-advices="temporaryAdvices"
:is-signed-prop="temporarySigned"
@submit="handleTemporaryMedicalSubmit"
@cancel="handleTemporaryMedicalCancel"
@refresh="handleTemporaryMedicalRefresh"
@@ -1032,6 +1033,7 @@ watch(temporaryAdvices, (newVal, oldVal) => {
}, { deep: true })
const temporaryMedicalLoading = ref(false) // 🔧 新增:临时医嘱加载状态
const temporarySigned = ref(false) // 🔧 新增:签名状态,用于保持按钮名称一致性
// 下拉列表数据
const orgList = ref([])
@@ -1464,6 +1466,7 @@ function handleMedicalAdvice(row) {
// 先清空旧数据
temporaryBillingMedicines.value = []
temporaryAdvices.value = []
temporarySigned.value = false // 🔧 重置签名状态
temporaryMedicalLoading.value = true // 🔧 新增:开始加载
// 调用计费接口获取数据
@@ -1688,21 +1691,19 @@ function handleTemporaryMedicalSubmit(data) {
temporaryBillingMedicines.value = []
}
// 显示成功提示
ElMessage.success('临时医嘱已生成,弹窗即将关闭')
// 延迟关闭弹窗,让用户看到成功提示
setTimeout(() => {
showTemporaryMedical.value = false
}, 1000)
// 🔧 设置签名状态,保持按钮名称一致
temporarySigned.value = true
// 显示成功提示,不关闭弹窗,让用户可以查看已签发的医嘱状态
ElMessage.success('临时医嘱已生成(已签发),可继续查看或修改')
}
// 处理临时医嘱取消
function handleTemporaryMedicalCancel() {
// 🔧 修复:用户点击取消时才清空数据,因为用户可能要放弃修改
temporaryPatientInfo.value = {}
temporaryBillingMedicines.value = []
temporaryAdvices.value = []
temporarySigned.value = false // 🔧 重置签名状态
closeTemporaryMedical()
}

View File

@@ -244,10 +244,14 @@ const props = defineProps({
default: () => []
},
// 二区域:临时医嘱预览(已生成医嘱)- v-model:temporary-advices 对应 prop 名
// 🔧 修复:使用驼峰命名,因为 v-model:temporary-advices 会映射到 temporaryAdvices prop
temporaryAdvices: {
type: Array,
default: () => []
},
// 签名状态:用于保持按钮名称一致性
isSignedProp: {
type: Boolean,
default: false
}
})
@@ -306,8 +310,8 @@ const getMethodCodeDict = computed(() => {
return dict
})
// 响应式数据
const isSigned = ref(false)
// 响应式数据 - isSigned 从父组件传入的 prop 初始化
const isSigned = ref(props.isSignedProp)
const signatureTime = ref('')
const showSignDialog = ref(false)
const signPassword = ref('')