liusheng
13 小时以前 9903954c85f651dd5cc6d4b538cfe66b17fc5baa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import axios from 'axios'
import { getToken } from '@/utils/auth'
 
/**
 * 当前登录人待处理随访任务统计(按出院年月分组)
 *
 * 后端口径:service_subtask 中
 *   service_type = '2' 出院随访 / '3' 门诊随访(分开计数)
 *   current_preachform = '1'(人工)
 *   待随访状态(sendstate in 1,2,3,5,7)
 *   出院时间 endtime 早于等于今天 - 7 天
 *   只统计最近 4 个出院月份(含当月)
 *
 * 该接口用于右下角常驻卡片,属于后台轮询:
 * 不走 @/utils/request 的全局拦截器,避免接口未部署/网络异常时反复弹全局错误提示,
 * 失败信息由卡片内部自行展示。
 *
 * @returns {Promise<{userName: string, nickName: string, total: number,
 *   months: Array<{month: string, dischargeCount: number, outpatientCount: number}>}>}
 *   months 只包含有数据的月份,没数据的月份由卡片补 0
 */
export function getPendingTaskMonthStats() {
  return axios({
    baseURL: process.env.VUE_APP_BASE_API,
    url: '/smartor/serviceSubtask/pendingTaskMonthStats',
    method: 'post',
    timeout: 15000,
    headers: {
      Authorization: 'Bearer ' + getToken()
    }
  }).then(res => res.data)
}