From 9f5303aea62322aac15f5dd91031f78e18a567d9 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 17 Feb 2026 09:52:46 +0800 Subject: [PATCH] =?UTF-8?q?feat(mes-cal):=20=E6=96=B0=E5=A2=9E=E6=8E=92?= =?UTF-8?q?=E7=8F=AD=E8=AE=A1=E5=88=92=E5=92=8C=E7=8F=AD=E6=AC=A1=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增班次管理独立页面(index.vue + CalShiftForm.vue),支持 CRUD + 导出 - 新增排班计划列表页(index.vue),支持按编码/名称/轮班方式/状态搜索 - 新增排班计划表单(CalPlanForm.vue),含编码生成、条件显示倒班方式/天数、确认计划操作 - 新增班次子表面板(CalShiftPanel.vue),嵌入计划表单 Tab - 新增班组子表面板(CalPlanTeamPanel.vue),嵌入计划表单 Tab - 新增 shift/plan/plan-team 三个 API 文件 - dict.ts 新增 4 个字典类型常量(shift_type/shift_method/calendar_type/plan_status) --- src/api/mes/cal/plan/index.ts | 53 ++++ src/api/mes/cal/plan/team.ts | 34 +++ src/api/mes/cal/shift/index.ts | 56 +++++ src/views/mes/cal/plan/CalPlanForm.vue | 257 ++++++++++++++++++++ src/views/mes/cal/plan/CalPlanTeamPanel.vue | 134 ++++++++++ src/views/mes/cal/plan/CalShiftPanel.vue | 179 ++++++++++++++ src/views/mes/cal/plan/index.vue | 230 ++++++++++++++++++ src/views/mes/cal/shift/CalShiftForm.vue | 128 ++++++++++ src/views/mes/cal/shift/index.vue | 185 ++++++++++++++ 9 files changed, 1256 insertions(+) create mode 100644 src/api/mes/cal/plan/index.ts create mode 100644 src/api/mes/cal/plan/team.ts create mode 100644 src/api/mes/cal/shift/index.ts create mode 100644 src/views/mes/cal/plan/CalPlanForm.vue create mode 100644 src/views/mes/cal/plan/CalPlanTeamPanel.vue create mode 100644 src/views/mes/cal/plan/CalShiftPanel.vue create mode 100644 src/views/mes/cal/plan/index.vue create mode 100644 src/views/mes/cal/shift/CalShiftForm.vue create mode 100644 src/views/mes/cal/shift/index.vue diff --git a/src/api/mes/cal/plan/index.ts b/src/api/mes/cal/plan/index.ts new file mode 100644 index 000000000..fc942b001 --- /dev/null +++ b/src/api/mes/cal/plan/index.ts @@ -0,0 +1,53 @@ +import request from '@/config/axios' + +// MES 排班计划 VO +export interface CalPlanVO { + id: number + code: string // 计划编码 + name: string // 计划名称 + calendarType: number // 班组类型 + startDate: number // 开始日期 + endDate: number // 结束日期 + shiftType: number // 轮班方式 + shiftMethod: number // 倒班方式 + shiftCount: number // 倒班天数 + status: number // 状态 + remark: string // 备注 + attribute1: string + attribute2: string + attribute3: number + attribute4: number +} + +// MES 排班计划 API +export const CalPlanApi = { + // 查询排班计划分页 + getPlanPage: async (params: any) => { + return await request.get({ url: `/mes/cal/plan/page`, params }) + }, + + // 查询排班计划详情 + getPlan: async (id: number) => { + return await request.get({ url: `/mes/cal/plan/get?id=` + id }) + }, + + // 新增排班计划 + createPlan: async (data: CalPlanVO) => { + return await request.post({ url: `/mes/cal/plan/create`, data }) + }, + + // 修改排班计划 + updatePlan: async (data: CalPlanVO) => { + return await request.put({ url: `/mes/cal/plan/update`, data }) + }, + + // 删除排班计划 + deletePlan: async (id: number) => { + return await request.delete({ url: `/mes/cal/plan/delete?id=` + id }) + }, + + // 导出排班计划 Excel + exportPlan: async (params: any) => { + return await request.download({ url: `/mes/cal/plan/export-excel`, params }) + } +} diff --git a/src/api/mes/cal/plan/team.ts b/src/api/mes/cal/plan/team.ts new file mode 100644 index 000000000..19e11c043 --- /dev/null +++ b/src/api/mes/cal/plan/team.ts @@ -0,0 +1,34 @@ +import request from '@/config/axios' + +// MES 计划班组关联 VO +// TODO @AI:挪到 plan/team 目录下 +export interface CalPlanTeamVO { + id: number + planId: number // 排班计划编号 + teamId: number // 班组编号 + teamCode: string // 班组编码 + teamName: string // 班组名称 + remark: string // 备注 + attribute1: string + attribute2: string + attribute3: number + attribute4: number +} + +// MES 计划班组关联 API +export const CalPlanTeamApi = { + // 查询指定排班计划的班组列表 + getPlanTeamListByPlan: async (planId: number) => { + return await request.get({ url: `/mes/cal/plan-team/list-by-plan?planId=` + planId }) + }, + + // 新增计划班组关联 + createPlanTeam: async (data: CalPlanTeamVO) => { + return await request.post({ url: `/mes/cal/plan-team/create`, data }) + }, + + // 删除计划班组关联 + deletePlanTeam: async (id: number) => { + return await request.delete({ url: `/mes/cal/plan-team/delete?id=` + id }) + } +} diff --git a/src/api/mes/cal/shift/index.ts b/src/api/mes/cal/shift/index.ts new file mode 100644 index 000000000..7b1335b8d --- /dev/null +++ b/src/api/mes/cal/shift/index.ts @@ -0,0 +1,56 @@ +import request from '@/config/axios' + +// TODO @AI:挪到 plan/shift 目录下 + +// MES 计划班次 VO +export interface CalShiftVO { + id: number + planId: number // 排班计划编号 + sort: number // 显示顺序 + name: string // 班次名称 + startTime: string // 开始时间 + endTime: string // 结束时间 + remark: string // 备注 + attribute1: string + attribute2: string + attribute3: number + attribute4: number +} + +// MES 计划班次 API +export const CalShiftApi = { + // 查询计划班次分页 + getShiftPage: async (params: any) => { + return await request.get({ url: `/mes/cal/shift/page`, params }) + }, + + // 查询计划班次详情 + getShift: async (id: number) => { + return await request.get({ url: `/mes/cal/shift/get?id=` + id }) + }, + + // 查询指定排班计划的班次列表 + getShiftListByPlan: async (planId: number) => { + return await request.get({ url: `/mes/cal/shift/list-by-plan?planId=` + planId }) + }, + + // 新增计划班次 + createShift: async (data: CalShiftVO) => { + return await request.post({ url: `/mes/cal/shift/create`, data }) + }, + + // 修改计划班次 + updateShift: async (data: CalShiftVO) => { + return await request.put({ url: `/mes/cal/shift/update`, data }) + }, + + // 删除计划班次 + deleteShift: async (id: number) => { + return await request.delete({ url: `/mes/cal/shift/delete?id=` + id }) + }, + + // 导出计划班次 Excel + exportShift: async (params: any) => { + return await request.download({ url: `/mes/cal/shift/export-excel`, params }) + } +} diff --git a/src/views/mes/cal/plan/CalPlanForm.vue b/src/views/mes/cal/plan/CalPlanForm.vue new file mode 100644 index 000000000..09fba8cb1 --- /dev/null +++ b/src/views/mes/cal/plan/CalPlanForm.vue @@ -0,0 +1,257 @@ + + + diff --git a/src/views/mes/cal/plan/CalPlanTeamPanel.vue b/src/views/mes/cal/plan/CalPlanTeamPanel.vue new file mode 100644 index 000000000..34578a625 --- /dev/null +++ b/src/views/mes/cal/plan/CalPlanTeamPanel.vue @@ -0,0 +1,134 @@ + + + + diff --git a/src/views/mes/cal/plan/CalShiftPanel.vue b/src/views/mes/cal/plan/CalShiftPanel.vue new file mode 100644 index 000000000..bd2840196 --- /dev/null +++ b/src/views/mes/cal/plan/CalShiftPanel.vue @@ -0,0 +1,179 @@ + + + diff --git a/src/views/mes/cal/plan/index.vue b/src/views/mes/cal/plan/index.vue new file mode 100644 index 000000000..cfdb37c67 --- /dev/null +++ b/src/views/mes/cal/plan/index.vue @@ -0,0 +1,230 @@ + + + diff --git a/src/views/mes/cal/shift/CalShiftForm.vue b/src/views/mes/cal/shift/CalShiftForm.vue new file mode 100644 index 000000000..18dd181c0 --- /dev/null +++ b/src/views/mes/cal/shift/CalShiftForm.vue @@ -0,0 +1,128 @@ + + + + diff --git a/src/views/mes/cal/shift/index.vue b/src/views/mes/cal/shift/index.vue new file mode 100644 index 000000000..0b75bc0b9 --- /dev/null +++ b/src/views/mes/cal/shift/index.vue @@ -0,0 +1,185 @@ + + + +