diff --git a/src/api/mes/holiday/index.ts b/src/api/mes/holiday/index.ts new file mode 100644 index 000000000..546a0ee16 --- /dev/null +++ b/src/api/mes/holiday/index.ts @@ -0,0 +1,53 @@ +import request from '@/config/axios' + +export interface HolidayVO { + id: number + status: string + remark: string + holidayYear: string + holidayType: string + keyDate: string + holidayName: string + holidayDate: Date +} + +// 查询节假日设置列表 +export const getHolidayPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/mes/holiday/senior', data }) + } else { + return await request.get({ url: `/mes/holiday/page`, params }) + } +} + +// 查询节假日设置详情 +export const getHoliday = async (id: number) => { + return await request.get({ url: `/mes/holiday/get?id=` + id }) +} + +// 新增节假日设置 +export const createHoliday = async (data: HolidayVO) => { + return await request.post({ url: `/mes/holiday/create`, data }) +} + +// 修改节假日设置 +export const updateHoliday = async (data: HolidayVO) => { + return await request.put({ url: `/mes/holiday/update`, data }) +} + +// 删除节假日设置 +export const deleteHoliday = async (id: number) => { + return await request.delete({ url: `/mes/holiday/delete?id=` + id }) +} + +// 导出节假日设置 Excel +export const exportHoliday = async (params) => { + return await request.download({ url: `/mes/holiday/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/mes/holiday/get-import-template' }) +} \ No newline at end of file diff --git a/src/api/mes/workcalendar/index.ts b/src/api/mes/workcalendar/index.ts new file mode 100644 index 000000000..2769ea2ce --- /dev/null +++ b/src/api/mes/workcalendar/index.ts @@ -0,0 +1,81 @@ +import request from '@/config/axios' + + + +// 查询节假日 +export const getDismantlingDetailPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/mes/workCalendar/senior', data }) + } else { + return await request.get({ url: `/mes/workCalendar/page`, params }) + } +} + +//班组排班 信息 +export interface SchedulingcalendarCreateReqVO{ + keyDate:String, + //班组编码 + teamCode:String, +//班组名称 + teamName:String, +//班组类别" + teamType:String, +//班次名称" + shiftName:String, +//班次编码 +shiftCode:String, +//上班时间 +startTime:String, +//下班时间" +endTime:String, +//工作日期 +workDate:String, +//倒班规则 +shiftRule:String, +//倒班类型 +shiftRate:String, +sort:number +} +// +// 查询班组列表 +export const getTeamList = async (params) => { + return await request.get({ url: `/wms/team/page`, params }) +} + +// 保存排班信息 +export const saveWorkPlan = async (data:SchedulingcalendarCreateReqVO ) => { + return await request.post({ url: `/mes/schedulingcalendar/create`, data }) +} +// 删除班组排班信息 +export const deleteWorkPlan = async (data) => { + return await request.post({ url: `/mes/schedulingcalendar/deleteTeam`, data}) +} +//批量保存排班信息 +export const createBatch = async (data:any) => { + return await request.post({ url: `/mes/schedulingcalendar/createBatch`, data }) +} +//批量对象方式保存排班信息--保留 +export const createObj= async (data:any) => { + return await request.post({ url: `/mes/schedulingcalendar/createObj`, data }) +} + +// 查询排班信息 code startTime:开始时间" endTime:结束时间") +export const getWorkPlan = async (params ) => { + return await request.get({ url: `/mes/schedulingcalendar/getList`,params }) +} +// 查询班次信息 +export const getShiftInfos = async (code:any) => { + return await request.get({ url: `/mes/schedulingcalendar/shift?code=`+code}) +} +//查询节假日信息 +export const getHolidays = async (year:any) => { + return await request.get({ url: `/mes/holiday/listByYear?year=`+year}) +} + +// 导出排班信息 +export const exportWorkPlan = async (params) => { + return await request.download({ url: `/mes/schedulingcalendar/export-excel`, params }) +} + diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 3bfea0b0c..3d446fbaf 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -288,6 +288,7 @@ export enum DICT_TYPE { MES_TASK_MODE='mes_task_mode', //生产模式 派工方式、领工方式 MES_PLANDO_STATUS='mes_plando_status', //计划执行状 PLAN_TYPE_MES='plan_type_mes', + HOLIDAY_TYPE='holiday_type', //节假日类型 //========== QMS ========== SAMPLING_TYPE = "sampling_type", // 取样类型 diff --git a/src/views/mes/calendar/index.vue b/src/views/mes/calendar/index.vue deleted file mode 100644 index 0c8f8ba99..000000000 --- a/src/views/mes/calendar/index.vue +++ /dev/null @@ -1,641 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/views/mes/holiday/holiday.data.ts b/src/views/mes/holiday/holiday.data.ts new file mode 100644 index 000000000..02bdde572 --- /dev/null +++ b/src/views/mes/holiday/holiday.data.ts @@ -0,0 +1,109 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const HolidayRules = reactive({ +}) + +export const Holiday = useCrudSchemas(reactive([ + { + label: '主键', + field: 'id', + sort: 'custom', + isForm: false, + }, + + + { + label: 'KEY', + field: 'keyDate', + sort: 'custom', + isSearch: false, + isTable:false, + isForm:false + }, + { + label: '节日名称', + field: 'holidayName', + sort: 'custom', + isSearch: true, + }, + { + label: '节日类型;', + field: 'holidayType', + sort: 'custom', + isSearch: true, + dictType: DICT_TYPE.HOLIDAY_TYPE, + dictClass: 'string', + form: { + component: 'Select', + value: '1', + }, + }, + { + label: '节日年份', + field: 'holidayYear', + sort: 'custom', + isSearch: true, + isForm:false, + isTable:true, + form: { + component: 'InputNumber', + value: '2023', + }, + }, + { + label: '节日日期', + field: 'holidayDate', + sort: 'custom', + formatter: dateFormatter, + isSearch: true, + search: { + component: 'DatePicker', + componentProps: { + type: 'date', + valueFormat: 'YYYY-MM-DD', + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'date', + valueFormat: 'x' + } + }, + }, + { + label: '状态', + field: 'status', + sort: 'custom', + dictType: DICT_TYPE.QUALIFY_STATUS, + dictClass: 'string', + isForm: true, + isSearch: false, + isTable: true, + form: { + component: 'Switch', + value: '1', + componentProps: { + inactiveValue: '2', + activeValue: '1' + } + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: false, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) diff --git a/src/views/mes/holiday/index.vue b/src/views/mes/holiday/index.vue new file mode 100644 index 000000000..835874a00 --- /dev/null +++ b/src/views/mes/holiday/index.vue @@ -0,0 +1,226 @@ + + + diff --git a/src/views/mes/workcalendar/index.vue b/src/views/mes/workcalendar/index.vue new file mode 100644 index 000000000..4876ec101 --- /dev/null +++ b/src/views/mes/workcalendar/index.vue @@ -0,0 +1,879 @@ + + + + \ No newline at end of file