yxh
2026-10-18 01ee694a3bb8048372fc793a8de314d70b688b35
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import request from '@/config/axios'
import { useRoomStore } from '@/store/modules/room'
 
// 工作记录 VO
export interface JobRecordVO {
  id: number // id
  jobType: number // 作业类型
  docId: number // 医生编号
  docName: string // 医生名称
  devId: string // 设备编号
  patId: string // 患者编号
  patName: string // 患者名称
  jobTime: Date // 作业时间
  summary: number // 作业概要
  remark: string // 备注
  paid: number
  /**
   * 【撤销标识】该条完成记录对应的患者"当日队列状态已不是已就诊(40)",
   * 即检查完成被撤销过、还没重新完成。后端按当日队列状态动态计算,不落库;
   * 患者再次完成后自动变回 false。
   */
  undone?: boolean
  // 需求1:患者信息 18 项(后端按 job_record.rentId → dev_rent.applyNo → appointment 批量回填)
  applyNo?: string // 申请编号
  episodeId?: string // 就诊流水号
  patGender?: number // 性别
  patBirthday?: number | string // 出生日期
  registerDate?: number | string // 登记时间
  doctor?: string // 开单医师
  doctorTime?: number | string // 开单日期
  patSrc?: number // 患者来源:1门诊 2急诊 3住院 4体检
  patMobile?: string
  patPhone?: string
  patWardDesc?: string // 病区
  patBedNo?: string // 病床号
  medicalCard?: string // 就诊卡号
  doctorAdviceNo?: string // 医嘱号(HIS root 2.16.156.10011.1.28;库中历史数据为空)
  outpatientNo?: string // 门诊号
  patIdentityId?: string // 身份证号
  tolerance?: string // 多耐药:0无 1多耐 2多重耐药
}
 
export interface JobStatisticVO {
  jobType: number
  docId: number
  docName: string
  jobCount: number
  year: number
  month: number
}
 
// 工作记录 API
export const JobRecordApi = {
  // 查询工作记录分页
  getJobRecordPage: async (params: any) => {
    return await request.get({ url: `/ecg/job-record/page`, params })
  },
 
  /**
   * 查询工作记录分页(默认查"我自己的")。
   *
   * 【主/围观】围观时必须查**该工位主人**的记录,否则看到的永远是自己那份(空的):
   * 这里统一注入"我正在看的工位"的主人 docId + roomId/bedNo,
   * 后端会校验这个 docId 确实是该工位当前的主人(不是随便查别人)。
   * 放在 API 层统一处理,5 个工作台/面板的调用点不用各自改。
   */
  getJobRecordDoctorPage: async (params: any) => {
    const roomStore = useRoomStore()
    const view = roomStore.getRoom
    const query: any = { ...(params || {}) }
    if (!roomStore.getCanOperate && view?.roomId != null && view.bedNo && view.docId != null) {
      query.docId = view.docId
      query.roomId = view.roomId
      query.bedNo = view.bedNo
    }
    return await request.get({ url: `/ecg/job-record/doctor-page`, params: query })
  },
 
  // 查询工作记录详情
  getJobRecord: async (id: number) => {
    return await request.get({ url: `/ecg/job-record/get?id=` + id })
  },
 
  // 新增工作记录
  createJobRecord: async (data: JobRecordVO) => {
    return await request.post({ url: `/ecg/job-record/create`, data })
  },
 
  // 修改工作记录
  updateJobRecord: async (data: JobRecordVO) => {
    return await request.put({ url: `/ecg/job-record/update`, data })
  },
 
  // 删除工作记录
  deleteJobRecord: async (id: number) => {
    return await request.delete({ url: `/ecg/job-record/delete?id=` + id })
  },
 
  // 导出工作记录 Excel
  exportJobRecord: async (params) => {
    return await request.download({ url: `/ecg/job-record/export-excel`, params })
  },
 
  // 作业统计
  jobStatistic: async (params) => {
    return await request.get({ url: `/ecg/job-record/job-statistic`, params })
  },
}