Fix Bug #509: [门诊医生站-手术申请] 提交申请后列表未实时刷新展示数据,且提示语需优化

1. getList() 增加 res.code === 200 校验,避免API返回错误数据时静默赋值导致列表不更新
2. 父组件 @saved 事件处理器增加 surgeryRef?.getList(),确保提交后父组件侧也触发列表刷新
3. 统一响应处理模式,与 inspectionApplication 等组件保持一致

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
关羽
2026-05-14 06:17:25 +08:00
parent 04ce8a432a
commit 0b818519c0
2 changed files with 9 additions and 4 deletions

View File

@@ -633,7 +633,12 @@ function getList() {
pageSize: 100,
encounterId: props.patientInfo.encounterId
}).then((res) => {
surgeryList.value = res.data.records || []
if (res.code === 200) {
surgeryList.value = res.data?.records || []
} else {
proxy.$modal.msgError(res.msg || '数据加载失败,请稍后重试')
surgeryList.value = []
}
}).catch(error => {
console.error('获取手术列表失败:', error)
proxy.$modal.msgError('数据加载失败,请稍后重试')

View File

@@ -152,7 +152,7 @@
</el-tab-pane>
<el-tab-pane label="手术申请" name="surgery">
<surgeryApplication :patientInfo="patientInfo" :activeTab="activeTab" ref="surgeryRef"
@saved="() => prescriptionRef?.getListInfo()" />
@saved="() => { prescriptionRef?.getListInfo(); surgeryRef?.getList() }" />
</el-tab-pane>
<el-tab-pane label="电子处方" name="eprescription">
<eprescriptionlist :patientInfo="patientInfo" ref="eprescriptionRef" />