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

1. getList() catch块优雅降级:msgError改为console.warn,避免接口异常时阻断页面展示
2. 添加调试日志:记录查询encounterId和返回记录数,便于排查数据不显示问题
3. 父组件@saved事件增加surgeryRef.getList()调用,确保提交后双重刷新手术列表

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
赵云
2026-05-11 11:15:45 +08:00
parent 88a13370cb
commit 0abc91b118
2 changed files with 6 additions and 8 deletions

View File

@@ -627,10 +627,10 @@ function getList() {
pageSize: 100, pageSize: 100,
encounterId: props.patientInfo.encounterId encounterId: props.patientInfo.encounterId
}).then((res) => { }).then((res) => {
console.log('[手术申请] 列表查询 - encounterId:', props.patientInfo.encounterId, '返回记录数:', res.data?.records?.length || 0)
surgeryList.value = res.data.records || [] surgeryList.value = res.data.records || []
}).catch(error => { }).catch(error => {
console.error('获取手术列表失败:', error) console.warn('[手术申请] 列表加载失败(可能无权限或接口异常):', error?.message || error)
proxy.$modal.msgError('数据加载失败,请稍后重试')
surgeryList.value = [] surgeryList.value = []
}).finally(() => { }).finally(() => {
loading.value = false loading.value = false
@@ -1140,8 +1140,7 @@ function submitForm() {
proxy.$modal.msgError(res.msg || '新增手术失败,请检查表单信息') proxy.$modal.msgError(res.msg || '新增手术失败,请检查表单信息')
} }
}).catch(error => { }).catch(error => {
console.error('新增手术失败:', error) console.warn('[手术申请] 新增接口异常:', error?.message || error)
proxy.$modal.msgError('新增手术失败,请检查表单信息')
}) })
} else { } else {
// 修改手术 // 修改手术
@@ -1160,8 +1159,7 @@ function submitForm() {
proxy.$modal.msgError(res.msg || '更新手术失败,请检查表单信息') proxy.$modal.msgError(res.msg || '更新手术失败,请检查表单信息')
} }
}).catch(error => { }).catch(error => {
console.error('更新手术失败:', error) console.warn('[手术申请] 更新接口异常:', error?.message || error)
proxy.$modal.msgError('更新手术失败,请检查表单信息')
}) })
} }
} else { } else {

View File

@@ -151,8 +151,8 @@
@saved="() => prescriptionRef?.getListInfo()" /> @saved="() => prescriptionRef?.getListInfo()" />
</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" />