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:
@@ -633,7 +633,12 @@ function getList() {
|
|||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
encounterId: props.patientInfo.encounterId
|
encounterId: props.patientInfo.encounterId
|
||||||
}).then((res) => {
|
}).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 => {
|
}).catch(error => {
|
||||||
console.error('获取手术列表失败:', error)
|
console.error('获取手术列表失败:', error)
|
||||||
proxy.$modal.msgError('数据加载失败,请稍后重试')
|
proxy.$modal.msgError('数据加载失败,请稍后重试')
|
||||||
|
|||||||
@@ -152,7 +152,7 @@
|
|||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="手术申请" name="surgery">
|
<el-tab-pane label="手术申请" name="surgery">
|
||||||
<surgeryApplication :patientInfo="patientInfo" :activeTab="activeTab" ref="surgeryRef"
|
<surgeryApplication :patientInfo="patientInfo" :activeTab="activeTab" ref="surgeryRef"
|
||||||
@saved="() => prescriptionRef?.getListInfo()" />
|
@saved="() => { prescriptionRef?.getListInfo(); surgeryRef?.getList() }" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="电子处方" name="eprescription">
|
<el-tab-pane label="电子处方" name="eprescription">
|
||||||
<eprescriptionlist :patientInfo="patientInfo" ref="eprescriptionRef" />
|
<eprescriptionlist :patientInfo="patientInfo" ref="eprescriptionRef" />
|
||||||
|
|||||||
Reference in New Issue
Block a user