gaoluyang
9 天以前 86966ec9a83b93decbd93fc8ce2be1882d4c9775
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
import type { PageParam, PageResult } from '@vben/request';
 
import { requestClient } from '#/api/request';
 
export namespace MesProWorkRecordApi {
  /** MES 工作记录流水 */
  export interface WorkRecordLog {
    id?: number; // 编号
    userId?: number; // 用户编号
    userNickname?: string; // 用户昵称
    workstationId?: number; // 工作站编号
    workstationCode?: string; // 工作站编码
    workstationName?: string; // 工作站名称
    type?: number; // 1=上工 2=下工
    remark?: string; // 备注
    createTime?: Date; // 创建时间
  }
 
  /** MES 当前用户工作站绑定状态 */
  export interface MyWorkRecord {
    userId?: number; // 用户编号
    userNickname?: string; // 用户昵称
    workstationId?: number; // 工作站编号
    workstationCode?: string; // 工作站编码
    workstationName?: string; // 工作站名称
    type?: number; // 1=上工 2=下工
    clockInTime?: Date; // 上工时间
    clockOutTime?: Date; // 下工时间
  }
}
 
/** 查询工作记录分页 */
export function getWorkRecordLogPage(params: PageParam) {
  return requestClient.get<PageResult<MesProWorkRecordApi.WorkRecordLog>>(
    '/mes/pro/workrecord/log/page',
    { params },
  );
}
 
/** 查询工作记录详情 */
export function getWorkRecordLog(id: number) {
  return requestClient.get<MesProWorkRecordApi.WorkRecordLog>(
    `/mes/pro/workrecord/log/get?id=${id}`,
  );
}
 
/** 导出工作记录 */
export function exportWorkRecordLog(params: any) {
  return requestClient.download('/mes/pro/workrecord/log/export-excel', {
    params,
  });
}
 
/** 上工(绑定工作站) */
export function clockInWorkRecord(workstationId: number) {
  return requestClient.put('/mes/pro/workrecord/clock-in', null, {
    params: { workstationId },
  });
}
 
/** 下工(解绑工作站) */
export function clockOutWorkRecord() {
  return requestClient.put('/mes/pro/workrecord/clock-out');
}
 
/** 查询当前用户绑定的工作站 */
export function getMyWorkRecord() {
  return requestClient.get<MesProWorkRecordApi.MyWorkRecord>(
    '/mes/pro/workrecord/get-my',
  );
}