essApplication.js 881 B

12345678910111213141516171819202122232425
  1. import request from '@/utils/request';
  2. function unwrap(response) {
  3. const result = response?.data || {};
  4. if (Number(result.code) === 0) return result.data;
  5. const error = new Error(result.message || '服务调用失败');
  6. if (response?.__toastShown) error.__toastShown = true;
  7. return Promise.reject(error);
  8. }
  9. /**
  10. * 管理端:统一申请详情(M09 员工自助申请索引主键)
  11. * GET /hr/ess/admin/applications/{id}
  12. *
  13. * 该视图只返回「来源引用 + 脱敏摘要 + 状态 + 当前节点」,
  14. * 业务明细需要按返回的 businessId 走对应来源业务接口。
  15. */
  16. export async function getAdminApplicationDetail(id) {
  17. if (id === undefined || id === null || id === '') return null;
  18. const response = await request({
  19. url: `/hr/ess/admin/applications/${encodeURIComponent(String(id))}`,
  20. method: 'get'
  21. });
  22. return unwrap(response);
  23. }