liu
2026-10-24 741f0a8f842df6d84be3b3b19dc558f110b10e4c
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
import type { PageParam, PageResult } from '@vben/request';
 
import { requestClient } from '#/api/request';
 
export namespace MesCalPlanApi {
  /** MES 排班计划 */
  export interface Plan {
    id?: number; // 计划编号
    code?: string; // 计划编码
    name?: string; // 计划名称
    calendarType?: number; // 班组类型
    startDate?: number; // 开始日期
    endDate?: number; // 结束日期
    shiftType?: number; // 轮班方式
    shiftMethod?: number; // 倒班方式
    shiftCount?: number; // 倒班天数
    status?: number; // 状态
    remark?: string; // 备注
    createTime?: Date; // 创建时间
  }
}
 
/** 查询排班计划分页 */
export function getPlanPage(params: PageParam) {
  return requestClient.get<PageResult<MesCalPlanApi.Plan>>(
    '/mes/cal/plan/page',
    { params },
  );
}
 
/** 查询排班计划详情 */
export function getPlan(id: number) {
  return requestClient.get<MesCalPlanApi.Plan>(`/mes/cal/plan/get?id=${id}`);
}
 
/** 新增排班计划 */
export function createPlan(data: MesCalPlanApi.Plan) {
  return requestClient.post<number>('/mes/cal/plan/create', data);
}
 
/** 修改排班计划 */
export function updatePlan(data: MesCalPlanApi.Plan) {
  return requestClient.put('/mes/cal/plan/update', data);
}
 
/** 确认排班计划 */
export function confirmPlan(id: number) {
  return requestClient.put(`/mes/cal/plan/confirm?id=${id}`);
}
 
/** 删除排班计划 */
export function deletePlan(id: number) {
  return requestClient.delete(`/mes/cal/plan/delete?id=${id}`);
}
 
/** 导出排班计划 */
export function exportPlan(params: any) {
  return requestClient.download('/mes/cal/plan/export-excel', { params });
}
 
/** 下载排班计划导入模板 */
export function importPlanTemplate() {
  return requestClient.download('/mes/cal/plan/get-import-template');
}
 
/** 导入排班计划 */
export function importPlan(file: File, updateSupport: boolean) {
  return requestClient.upload(
    `/mes/cal/plan/import?updateSupport=${updateSupport}`,
    { file },
  );
}