From ce451b963f58dad72cb5a8ccc289ce1177fc1ff9 Mon Sep 17 00:00:00 2001 From: zhousq Date: Wed, 17 Apr 2024 08:15:03 +0800 Subject: [PATCH] =?UTF-8?q?2024-0--17=20=E4=BF=AE=E5=A4=8Dbug=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=8E=92=E4=BA=A7=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mes/orderDay/index.ts | 4 +- src/api/mes/orderDayConfig/index.ts | 2 +- src/api/mes/workScheduling/index.ts | 46 ++++ .../mes/orderDay/components/schedule.vue | 30 ++- src/views/mes/workScheduling/index.vue | 244 ++++++++++++++++++ .../mes/workScheduling/workScheduling.data.ts | 143 ++++++++++ 6 files changed, 463 insertions(+), 6 deletions(-) create mode 100644 src/api/mes/workScheduling/index.ts create mode 100644 src/views/mes/workScheduling/index.vue create mode 100644 src/views/mes/workScheduling/workScheduling.data.ts diff --git a/src/api/mes/orderDay/index.ts b/src/api/mes/orderDay/index.ts index 852c8f0e3..00f348d3e 100644 --- a/src/api/mes/orderDay/index.ts +++ b/src/api/mes/orderDay/index.ts @@ -98,8 +98,8 @@ export const getPlanDevices = async (params) => { } ///发布计划 -export const publishPlan = async (params) => { - return await request.post({ url: `/mes/orderday/publishPlan`,params }) +export const publishPlan = async (data: OrderDayVO) => { + return await request.post({ url: `/mes/orderday/publishPlan`,data }) } //终止计划 export const stopPlan = async (params) => { diff --git a/src/api/mes/orderDayConfig/index.ts b/src/api/mes/orderDayConfig/index.ts index 1b7cdae4c..b5134d9c5 100644 --- a/src/api/mes/orderDayConfig/index.ts +++ b/src/api/mes/orderDayConfig/index.ts @@ -34,4 +34,4 @@ export const getConfigProcessWorker = async (params) => { // 查询已经的工序工位设备 export const getConfigProcessEquipment = async (params) => { return await request.get({ url: `/mes/orderDayequipment/getByOrder`, params }) -} \ No newline at end of file +} diff --git a/src/api/mes/workScheduling/index.ts b/src/api/mes/workScheduling/index.ts new file mode 100644 index 000000000..08591d25b --- /dev/null +++ b/src/api/mes/workScheduling/index.ts @@ -0,0 +1,46 @@ +import request from '@/config/axios' + +export interface WorkSchedulingVO { + flagDo: string +} + +// 查询生产任务排产列表 +export const getWorkSchedulingPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/mes/work-scheduling/senior', data }) + } else { + return await request.get({ url: `/mes/work-scheduling/page`, params }) + } +} + +// 查询生产任务排产详情 +export const getWorkScheduling = async (id: number) => { + return await request.get({ url: `/mes/work-scheduling/get?id=` + id }) +} + +// 新增生产任务排产 +export const createWorkScheduling = async (data: WorkSchedulingVO) => { + return await request.post({ url: `/mes/work-scheduling/create`, data }) +} + +// 修改生产任务排产 +export const updateWorkScheduling = async (data: WorkSchedulingVO) => { + return await request.put({ url: `/mes/work-scheduling/update`, data }) +} + +// 删除生产任务排产 +export const deleteWorkScheduling = async (id: number) => { + return await request.delete({ url: `/mes/work-scheduling/delete?id=` + id }) +} + +// 导出生产任务排产 Excel +export const exportWorkScheduling = async (params) => { + return await request.download({ url: `/mes/work-scheduling/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/mes/work-scheduling/get-import-template' }) +} \ No newline at end of file diff --git a/src/views/mes/orderDay/components/schedule.vue b/src/views/mes/orderDay/components/schedule.vue index 7fdd2bd63..27e8dadf9 100644 --- a/src/views/mes/orderDay/components/schedule.vue +++ b/src/views/mes/orderDay/components/schedule.vue @@ -99,7 +99,7 @@ @@ -115,7 +115,8 @@ import { createGraph, getNewNode } from '@/views/mes/processroute/components/graphbase.data' -import * as orderDayconfigApi from '@/api/mes/orderDayconfig' +import * as orderDayconfigApi from '@/api/mes/orderDayConfig' +import * as OrderDayApi from '@/api/mes/orderDay' import {ProcessSearch} from '../../publicUtil/processSearch.data' import * as ProcessApi from '@/api/wms/process' import { SearchTable } from '@/components/SearchTable' @@ -286,7 +287,30 @@ const opensearchTable = ( true ) } - +const publishPlan= async ()=>{ + let data ={ + id: detailData.value.id, + status: detailData.value.status, + remark: detailData.value.remark, + planNoMonth: detailData.value.planNoMonth, + planNoDay: detailData.value.planNoDay, + productCode: detailData.value.productCode, + workroomCode: detailData.value.workroomCode, + lineCode: detailData.value.lineCode, + planCount: detailData.value.planCount, + processrouteCode: detailData.value.processrouteCode, + tempProcessroute: detailData.value.tempProcessroute, + standardBom: detailData.value.standardBom, + tempBom: detailData.value.tempBom, + workMode: detailData.value.workMode, + planDate: detailData.value.planDate, + startTime: detailData.value.planDate, + endTime: detailData.value.endTime, + taskMode: detailData.value.taskMode +} + console.log("-------",data) + await OrderDayApi.publishPlan(data) +} // 弹层确定返回所选数据 // val : 弹层列表row 数据 const searchTableSuccess = (formField, searchField, val, type, row) => { diff --git a/src/views/mes/workScheduling/index.vue b/src/views/mes/workScheduling/index.vue new file mode 100644 index 000000000..9df35398a --- /dev/null +++ b/src/views/mes/workScheduling/index.vue @@ -0,0 +1,244 @@ + + + diff --git a/src/views/mes/workScheduling/workScheduling.data.ts b/src/views/mes/workScheduling/workScheduling.data.ts new file mode 100644 index 000000000..16bda9f81 --- /dev/null +++ b/src/views/mes/workScheduling/workScheduling.data.ts @@ -0,0 +1,143 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const WorkSchedulingRules = reactive({ +}) + +export const WorkScheduling = useCrudSchemas(reactive([ + { + label: '主键', + field: 'id', + sort: 'custom', + isForm: false, + }, + { + label: '状态', + field: 'status', + sort: 'custom', + isSearch: true, + isForm: false, + }, + { + 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: 'planMaserCode', + sort: 'custom', + isSearch: true, + isForm: false, + }, + { + label: '任务编号', + field: 'schedulingCode', + sort: 'custom', + isSearch: true, + isForm: false, + }, + { + label: '产品编号', + field: 'productCode', + sort: 'custom', + isSearch: true, + isForm: false, + }, + { + label: '车间', + field: 'workroomCode', + sort: 'custom', + isSearch: true, + isForm: false, + }, + { + label: '产线', + field: 'lineCode', + sort: 'custom', + isSearch: true, + isForm: false, + }, + { + label: '工艺路线', + field: 'prouteCode', + sort: 'custom', + isSearch: true, + isForm: false, + }, + { + label: '计划数量', + field: 'planCount', + sort: 'custom', + isForm: false, + }, + { + label: '完工数量', + field: 'finishCount', + sort: 'custom', + isForm: false, + }, + { + label: '合格数量', + field: 'qualifiedCount', + sort: 'custom', + isForm: false, + }, + { + label: '不合格数量', + field: 'unqualifiedCount', + sort: 'custom', + isForm: false, + }, + { + label: '执行状态', + field: 'flagDo', + sort: 'custom', + isSearch: true, + }, + { + label: '当前工序', + field: 'workingNode', + sort: 'custom', + isForm: false, + }, + { + label: '当前任务号', + field: 'workingTaskSort', + sort: 'custom', + isForm: false, + }, + { + label: '工单模式', + field: 'formType', + sort: 'custom', + isForm: false, + }, + { + label: '生产序号', + field: 'workSort', + sort: 'custom', + isForm: false, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +]))