From 72b46e7de60b264bc2bea8a7463404c272959046 Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Mon, 1 Apr 2024 14:13:13 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E9=87=87=E6=A0=B7=E8=BF=87=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/qms/samplingProcess/index.ts | 53 ++++ src/utils/dict.ts | 4 + src/views/qms/samplingProcess/index.vue | 244 ++++++++++++++++++ .../samplingProcess/samplingProcess.data.ts | 84 ++++++ 4 files changed, 385 insertions(+) create mode 100644 src/api/qms/samplingProcess/index.ts create mode 100644 src/views/qms/samplingProcess/index.vue create mode 100644 src/views/qms/samplingProcess/samplingProcess.data.ts diff --git a/src/api/qms/samplingProcess/index.ts b/src/api/qms/samplingProcess/index.ts new file mode 100644 index 000000000..68a42f63a --- /dev/null +++ b/src/api/qms/samplingProcess/index.ts @@ -0,0 +1,53 @@ +import request from '@/config/axios' + +export interface SamplingProcessVO { + id: number + code: string + describe: string + sampleType: string + evaluationMode: string + sampleSize: number + sampleProgCode: number + available: string +} + +// 查询采样过程列表 +export const getSamplingProcessPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/qms/sampling-process/senior', data }) + } else { + return await request.get({ url: `/qms/sampling-process/page`, params }) + } +} + +// 查询采样过程详情 +export const getSamplingProcess = async (id: number) => { + return await request.get({ url: `/qms/sampling-process/get?id=` + id }) +} + +// 新增采样过程 +export const createSamplingProcess = async (data: SamplingProcessVO) => { + return await request.post({ url: `/qms/sampling-process/create`, data }) +} + +// 修改采样过程 +export const updateSamplingProcess = async (data: SamplingProcessVO) => { + return await request.put({ url: `/qms/sampling-process/update`, data }) +} + +// 删除采样过程 +export const deleteSamplingProcess = async (id: number) => { + return await request.delete({ url: `/qms/sampling-process/delete?id=` + id }) +} + +// 导出采样过程 Excel +export const exportSamplingProcess = async (params) => { + return await request.download({ url: `/qms/sampling-process/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/qms/sampling-process/get-import-template' }) +} \ No newline at end of file diff --git a/src/utils/dict.ts b/src/utils/dict.ts index e40305070..5490e63a4 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -279,4 +279,8 @@ export enum DICT_TYPE { PLAN_PRODUCTION_TYPE = "plan_production_type", // 生产计划类型 DELIVER_TYPE="deliver_type",//发货类型 BILL_TYPE="bill_type", // 发票类型 + + //========== QMS ========== + SAMPLING_TYPE = "sampling_type", // 取样类型 + EVALUATION_MODE = "evaluation_mode", // 评估模式 } diff --git a/src/views/qms/samplingProcess/index.vue b/src/views/qms/samplingProcess/index.vue new file mode 100644 index 000000000..0ac3084b8 --- /dev/null +++ b/src/views/qms/samplingProcess/index.vue @@ -0,0 +1,244 @@ + + + diff --git a/src/views/qms/samplingProcess/samplingProcess.data.ts b/src/views/qms/samplingProcess/samplingProcess.data.ts new file mode 100644 index 000000000..a805e2a01 --- /dev/null +++ b/src/views/qms/samplingProcess/samplingProcess.data.ts @@ -0,0 +1,84 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const SamplingProcessRules = reactive({ + code: [required], + sampleType: [required], + evaluationMode: [required], + available: [required], +}) + +export const SamplingProcess = useCrudSchemas(reactive([ + { + label: 'id', + field: 'id', + sort: 'custom', + isTable: false, + isForm: false, + }, + { + label: '编码', + field: 'code', + sort: 'custom', + isSearch: true, + }, + { + label: '描述', + field: 'describe', + sort: 'custom', + isSearch: true, + }, + { + label: '取样类型', + field: 'sampleType', + sort: 'custom', + dictType: DICT_TYPE.SAMPLING_TYPE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + isSearch: true, + form: { + component: 'SelectV2' + }, + }, + { + label: '评估模式', + field: 'evaluationMode', + sort: 'custom', + dictType: DICT_TYPE.EVALUATION_MODE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + form: { + component: 'SelectV2' + }, + }, + { + label: '样品量', + field: 'sampleSize', + sort: 'custom', + }, + { + label: '采样方案编码', + field: 'sampleProgCode', + sort: 'custom', + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isForm: false, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) From 2dab3bd5546b4dd714b79b2f2548237d62d026b9 Mon Sep 17 00:00:00 2001 From: zhousq Date: Mon, 1 Apr 2024 15:00:26 +0800 Subject: [PATCH 2/4] =?UTF-8?q?2024-04-01=20=E5=87=A0=E6=97=A5=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E6=8E=92=E4=BA=A7=E5=8F=8A=E5=B7=A5=E8=89=BA=E8=B7=AF?= =?UTF-8?q?=E7=BA=BF=E5=9B=BE=E5=BD=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mes/orderDay/index.ts | 102 ++++ src/utils/dict.ts | 6 + .../mes/orderDay/components/BasicFormV2.vue | 459 ++++++++++++++++++ .../mes/orderDay/components/orderDetail.vue | 237 +++++++++ .../mes/orderDay/components/schedule.vue | 332 +++++++++++++ src/views/mes/orderDay/index.vue | 331 +++++++++++++ src/views/mes/orderDay/orderDay.data.ts | 327 +++++++++++++ .../processroute/components/configDialog.vue | 102 +++- .../processroute/components/graphbase.data.ts | 8 +- 9 files changed, 1893 insertions(+), 11 deletions(-) create mode 100644 src/api/mes/orderDay/index.ts create mode 100644 src/views/mes/orderDay/components/BasicFormV2.vue create mode 100644 src/views/mes/orderDay/components/orderDetail.vue create mode 100644 src/views/mes/orderDay/components/schedule.vue create mode 100644 src/views/mes/orderDay/index.vue create mode 100644 src/views/mes/orderDay/orderDay.data.ts diff --git a/src/api/mes/orderDay/index.ts b/src/api/mes/orderDay/index.ts new file mode 100644 index 000000000..0b88e4782 --- /dev/null +++ b/src/api/mes/orderDay/index.ts @@ -0,0 +1,102 @@ +import request from '@/config/axios' + +export interface OrderDayVO { + status: string + remark: string + planNoMonth: string + planNoDay: string + productCode: string + workroomCode: string + lineCode: string + planCount: number + processrouteCode: string + tempProcessroute: string + standardBom: string + tempBom: string + workMode: string + planDate: Date + startTime: Date + endTime: Date + taskMode: string +} + +// 查询生产日计划列表 +export const getOrderDayPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/mes/orderday/senior', data }) + } else { + return await request.get({ url: `/mes/orderday/page`, params }) + } +} + +// 查询生产日计划详情 +export const getOrderDay = async (id: number) => { + return await request.get({ url: `/mes/orderday/get?id=` + id }) +} + +// 新增生产日计划 +export const createOrderDay = async (data: OrderDayVO) => { + return await request.post({ url: `/mes/orderday/create`, data }) +} + +// 修改生产日计划 +export const updateOrderDay = async (data: OrderDayVO) => { + return await request.put({ url: `/mes/orderday/update`, data }) +} + +// 删除生产日计划 +export const deleteOrderDay = async (id: number) => { + return await request.delete({ url: `/mes/orderday/delete?id=` + id }) +} + +// 导出生产日计划 Excel +export const exportOrderDay = async (params) => { + return await request.download({ url: `/mes/orderday/export-excel`, params }) +} +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/mes/orderday/get-import-template' }) +} +// 根据产品编码获取Bom +export const getBoms = async (code: String) => { + return request.get({ url: '/mes/common/geBomByProductCode?code='+code }) +} +// 根据产品编码获取工艺路线 +export const getProcessroutes = async (code: String) => { + return request.get({ url: '/mes/common/getProcessRouteByProductCode?code='+code }) +} +// 根据车间编码获取产线列表 +export const getProductlines = async (code: String) => { + return request.get({ url: '/mes/common/getLinesByWorkRoomCode?code='+code }) +} +// 获取产线信息 +export const getProductlineInfo = async (code: String) => { + return request.get({ url: '/mes/common/getLinesByWorkRoomCode?code='+code }) +} +// 根据工艺路线的工序信息 +export const getProcessroutesDetail = async (code) => { + return await request.get({ url: `/mes/orderday/getProcessInfo?code=`+ code }) +} +// 根据获取计划BOM信息 +export const getPlanBom = async (params) => { + return await request.get({ url: `/mes/orderday/getBomInfo`,params }) +} +// 根据计划的车间、产线、计划时间 查询已经配置的人员 +export const getPlanWorks = async (params) => { + return await request.get({ url: `/mes/orderday/getWorkGroup`,params }) +} +// 根据车间、产线 查询已配置的设备 +export const getPlanDevices = async (params) => { + return await request.get({ url: `/mes/orderday/getDeviceInfo`,params }) +} + +///发布计划 +export const publishPlan = async (params) => { + return await request.post({ url: `/mes/orderday/publishPlan`,params }) +} +//终止计划 +export const stopPlan = async (params) => { + return await request.post({ url: `/mes/orderday/stopPlan`,params }) +} \ No newline at end of file diff --git a/src/utils/dict.ts b/src/utils/dict.ts index e40305070..ec2cf47ac 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -279,4 +279,10 @@ export enum DICT_TYPE { PLAN_PRODUCTION_TYPE = "plan_production_type", // 生产计划类型 DELIVER_TYPE="deliver_type",//发货类型 BILL_TYPE="bill_type", // 发票类型 + // ========== 业务 - mes ========== + MESDO_STATUS= 'mes_do_status', // 工单执行状态 + MES_WORKBILL_MODEL='mes_workbill_model',// 工单模式 单工单(根据产品数量生成多个工单)、批量工单(一个产品一个工单) + MES_TASK_MODE='mes_task_mode', //生产模式 派工方式、领工方式 + MES_PLANDO_STATUS='mes_plando_status' //计划执行状 + } diff --git a/src/views/mes/orderDay/components/BasicFormV2.vue b/src/views/mes/orderDay/components/BasicFormV2.vue new file mode 100644 index 000000000..a155e9cdc --- /dev/null +++ b/src/views/mes/orderDay/components/BasicFormV2.vue @@ -0,0 +1,459 @@ + + + diff --git a/src/views/mes/orderDay/components/orderDetail.vue b/src/views/mes/orderDay/components/orderDetail.vue new file mode 100644 index 000000000..ce6d955bd --- /dev/null +++ b/src/views/mes/orderDay/components/orderDetail.vue @@ -0,0 +1,237 @@ + + + + + diff --git a/src/views/mes/orderDay/components/schedule.vue b/src/views/mes/orderDay/components/schedule.vue new file mode 100644 index 000000000..0d05bb829 --- /dev/null +++ b/src/views/mes/orderDay/components/schedule.vue @@ -0,0 +1,332 @@ + + + + + diff --git a/src/views/mes/orderDay/index.vue b/src/views/mes/orderDay/index.vue new file mode 100644 index 000000000..f7193af01 --- /dev/null +++ b/src/views/mes/orderDay/index.vue @@ -0,0 +1,331 @@ + + + diff --git a/src/views/mes/orderDay/orderDay.data.ts b/src/views/mes/orderDay/orderDay.data.ts new file mode 100644 index 000000000..1f9cd3889 --- /dev/null +++ b/src/views/mes/orderDay/orderDay.data.ts @@ -0,0 +1,327 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +import * as ItembasicApi from '@/api/wms/itembasic' +import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data' +import * as WorkshopApi from '@/api/wms/workshop' +import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data' +import { on } from '@/utils/domUtils' + +// 表单校验 +export const OrderDayRules = reactive({ + planNoDay: [ + { required: true, message: '请输入一个日计划编号', trigger: 'blur' } + ], + planNoMonth: [ + { required: true, message: '请输入一个月计划编号', trigger: 'blur' } + ], + productCode: [ + { required: true, message: '请选择一个产品', trigger: 'blur' } + ], + workroomCode: [ + { required: true, message: '请选择一个车间', trigger: 'blur' } + ], + lineCode: [ + { required: true, message: '请选择一个产线', trigger: 'blur' } + ], + workMode: [ + { required: true, message: '请选择工单生成方式', trigger: 'blur' } + ], + startTime: [ + { required: true, message: '请输入计划生产开始时间', trigger: 'blur' } + ], + endTime: [ + { required: true, message: '请输入计划生产完成时间', trigger: 'blur' } + ], + planDate: [ + { required: true, message: '请输入计划日期', trigger: 'blur' } + ], + taskMode: [ + { required: true, message: '请选择一个生产方式', trigger: 'blur' } + ], +}) + +export const OrderDay = useCrudSchemas(reactive([ + { + label: '主键', + field: 'id', + sort: 'custom', + isForm: false, + width: '60px', + }, + { + label: '日计划单号', + field: 'planNoDay', + sort: 'custom', + isSearch: true, + required: true, + }, + { + label: '月计划单号', + field: 'planNoMonth', + sort: 'custom', + isSearch: true, + required: false, + }, + { + label: '状态', + field: 'status', + sort: 'custom', + isForm: false, + isTable: true, + isDetail:true, + isSearch: false, + width: '80px', + dictType: DICT_TYPE.MES_PLANDO_STATUS, + dictClass: 'string', + form: { + component: 'Select', + }, + }, + { + label: '产品编号', + field: 'productCode', + sort: 'custom', + isSearch: true, + required: true, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '产品编码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '产品信息', // 查询弹窗标题 + searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类 + searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法 + isHideFilterButton:true, + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }, + { + key: 'type', + action: 'in', // 查询拼接条件 + isSearch: true, // 使用自定义拼接条件 + value: 'FG,SEMI',//,SEMI] + isMainValue: false + }, + + ] + } + } + }, + { + label: '车间编码', + field: 'workroomCode', + sort: 'custom', + isSearch: true, + required: true, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '车间', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '车间信息', // 查询弹窗标题 + searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类 + searchPage: WorkshopApi.getWorkshopPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + }, + + }, + { + label: '产线编码', + field: 'lineCode', + sort: 'custom', + isSearch: true, + required: true, + form:{ + component:'Select', + componentProps:{ + options:[{lablel:'1',value:'1'}] + } + } + }, + { + label: '计划数量', + field: 'planCount', + sort: 'custom', + required: true, + form: { + component: 'InputNumber', + value: 1 + }, + }, + { + label: '工艺路线编码', + field: 'processrouteCode', + sort: 'custom', + form: { + component:'Select', + componentProps: { + options: [] + } + } + }, + { + label: '临时工艺', + field: 'tempProcessroute', + sort: 'custom', + width: '80px', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: 'BOM编码', + field: 'standardBom', + sort: 'custom', + form: { + component:'Select', + componentProps: { + options: [{lablel:'bom',value:'bom'}] + } + } + }, + { + label: '替代BOM', + field: 'tempBom', + sort: 'custom', + width: '80px', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE', + } + } + }, + { + label: '工单模式', + field: 'workMode', + width: '80px', + sort: 'custom', + dictType: DICT_TYPE.MES_WORKBILL_MODEL, + dictClass: 'string', + form: { + component: 'Select', + value: 'BATCH', + }, + }, + { + label: '计划日期', + field: 'planDate', + 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: 'startTime', + sort: 'custom', + formatter: dateFormatter, + required: true, + form: { + component: 'TimePicker', + componentProps: { + type: 'time', + dateFormat: 'HH:mm', + //valueFormat: 'x', + } + }, + }, + { + label: '结束时间', + field: 'endTime', + sort: 'custom', + formatter: dateFormatter, + isReadonly:true, + form: { + component: 'TimePicker', + componentProps: { + type: 'time', + dateFormat: 'HH:mm', + } + }, + }, + { + label: '生产模式', + field: 'taskMode', + width : '80px', + sort: 'custom', + dictType: DICT_TYPE.MES_TASK_MODE, + dictClass: 'string', + form: { + component: 'Select', + value:'ASSIGN' + }, + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: true, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'datetime', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + isForm: false, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + isSearch: false, + isForm: false, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: false, + isTable:false, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 200, + fixed: 'right' + } + } +])) diff --git a/src/views/mes/processroute/components/configDialog.vue b/src/views/mes/processroute/components/configDialog.vue index 3f041b99b..71006812c 100644 --- a/src/views/mes/processroute/components/configDialog.vue +++ b/src/views/mes/processroute/components/configDialog.vue @@ -43,7 +43,28 @@ -
+
+ +
+ + + + + + + + + + @@ -53,9 +74,9 @@ 产品信息 -

产品名称:{{ productData.name }}

-

产品编码:{{ productData.code }}

-

产品描述:{{ productData.desc1 }}

+

产品名称:{{ productData.name }}

+

产品编码:{{ productData.code }}

+

产品描述:{{ productData.desc1 }}