diff --git a/src/api/mes/productionPlan/index.ts b/src/api/mes/productionPlan/index.ts new file mode 100644 index 000000000..de60663ba --- /dev/null +++ b/src/api/mes/productionPlan/index.ts @@ -0,0 +1,61 @@ +import request from '@/config/axios' + +export interface ProductionPlanVO { + id: number + planCode: string + planName: string + teamType: string + endTime: Date + shiftMode: string + billState: number + deleteTime: Date + status: string + concurrencyStamp: number + remark: string + deleter: string + siteId: number + textOne: string + textTwo: string + textThree: string +} + +// 查询生产排产计划列表 +export const getProductionPlanPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/mes/productionPlan/senior', data }) + } else { + return await request.get({ url: `/mes/productionPlan/page`, params }) + } +} + +// 查询生产排产计划详情 +export const getProductionPlan = async (id: number) => { + return await request.get({ url: `/mes/productionPlan/get?id=` + id }) +} + +// 新增生产排产计划 +export const createProductionPlan = async (data: ProductionPlanVO) => { + return await request.post({ url: `/mes/productionPlan/create`, data }) +} + +// 修改生产排产计划 +export const updateProductionPlan = async (data: ProductionPlanVO) => { + return await request.put({ url: `/mes/productionPlan/update`, data }) +} + +// 删除生产排产计划 +export const deleteProductionPlan = async (id: number) => { + return await request.delete({ url: `/mes/productionPlan/delete?id=` + id }) +} + +// 导出生产排产计划 Excel +export const exportProductionPlan = async (params) => { + return await request.download({ url: `/mes/productionPlan/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/mes/productionPlan/get-import-template' }) +} \ No newline at end of file diff --git a/src/views/mes/productionPlan/index.vue b/src/views/mes/productionPlan/index.vue new file mode 100644 index 000000000..1c9271bea --- /dev/null +++ b/src/views/mes/productionPlan/index.vue @@ -0,0 +1,244 @@ + + + diff --git a/src/views/mes/productionPlan/productionPlan.data.ts b/src/views/mes/productionPlan/productionPlan.data.ts new file mode 100644 index 000000000..539264c0e --- /dev/null +++ b/src/views/mes/productionPlan/productionPlan.data.ts @@ -0,0 +1,182 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const ProductionPlanRules = reactive({ + endTime: [required], + concurrencyStamp: [required], +}) + +export const ProductionPlan = useCrudSchemas(reactive([ + { + label: 'id', + field: 'id', + sort: 'custom', + isForm: false, + }, + { + label: '计划编号', + field: 'planCode', + sort: 'custom', + isSearch: true, + }, + { + label: '计划名称', + field: 'planName', + sort: 'custom', + isSearch: true, + }, + { + label: '班组类型', + field: 'teamType', + sort: 'custom', + isSearch: true, + // form: { + // component: 'SelectV2' + // }, + }, + { + label: '结束时间', + field: 'endTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: true, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + }, + { + label: '轮班方式', + field: 'shiftMode', + sort: 'custom', + isSearch: true, + }, + { + label: '单据状态', + field: 'billState', + sort: 'custom', + isSearch: true, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '删除时间', + field: 'deleteTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: true, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + }, + { + label: '状态', + field: 'status', + sort: 'custom', + isSearch: true, + form: { + component: 'Radio' + }, + }, + { + label: '并发乐观锁', + field: 'concurrencyStamp', + sort: 'custom', + isSearch: false, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: true, + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: true, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + isForm: false, + }, + { + label: '删除用户名', + field: 'deleter', + sort: 'custom', + isSearch: true, + }, + { + label: '位置ID', + field: 'siteId', + sort: 'custom', + isSearch: false, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '备用字段一', + field: 'textOne', + sort: 'custom', + isSearch: false, + }, + { + label: '备用字段二', + field: 'textTwo', + sort: 'custom', + isSearch: false, + }, + { + label: '备用字段三', + field: 'textThree', + sort: 'custom', + isSearch: false, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +]))