Fix Bug #408: 门诊医生站:检查标签页:选中检查申请记录后,"检查明细"标签页显示"暂无数据"
根因:Axios拦截器已返回 res.data(AjaxResult体),handleRowClick 中再次执行 res.data 导致 d 被赋为 ExamApply 实体对象(不含 items),明细列表永远无法加载。 修复:通过 res.code 判断 res 是否已是 AjaxResult 体,避免二次解包。
This commit is contained in:
@@ -992,7 +992,9 @@ function handleRowClick(row) {
|
||||
selectedItems.value = [];
|
||||
activeDetailTab.value = 'applyForm';
|
||||
request({ url: `/exam/apply/${row.applyNo}`, method: 'get' }).then(async res => {
|
||||
const d = res.data || res;
|
||||
// Axios interceptor already returns res.data (AjaxResult body: {code, data, items})
|
||||
// Don't double-unwrap: if res has 'code', use res directly; otherwise fall back to res.data
|
||||
const d = (res && res.code !== undefined) ? res : (res.data || res);
|
||||
if (d.data) Object.assign(form, d.data);
|
||||
if (d.items && Array.isArray(d.items)) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user