diff --git a/src/api/mes/processroute/index.ts b/src/api/mes/processroute/index.ts new file mode 100644 index 000000000..f9409206c --- /dev/null +++ b/src/api/mes/processroute/index.ts @@ -0,0 +1,97 @@ +import request from '@/config/axios' + +export interface ProcessrouteVO { + deleteTime: Date + id: number + status: string + concurrencyStamp: number + remark: string + deleter: string + processrouteCode: string + processName: string + productCode: string + routeVersion: number + +} + + +// 查询工艺路线定义列表 +export const getProcessroutePage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/mes/processroute/senior', data }) + } else { + return await request.get({ url: `/mes/processroute/page`, params }) + } +} + +// 查询工艺路线定义详情 +export const getProcessroute = async (id: number) => { + return await request.get({ url: `/mes/processroute/get?id=` + id }) +} + +// 新增工艺路线定义 +export const createProcessroute = async (data: ProcessrouteVO) => { + return await request.post({ url: `/mes/processroute/create`, data }) +} +//提交图形数据 +// 新增工艺路线定义 +export const saveGraphData = async (data: any) => { + return await request.post({ url: `/mes/processroute/updategraph`, data }) +} +// 修改工艺路线定义 +export const updateProcessroute = async (data: ProcessrouteVO) => { + return await request.put({ url: `/mes/processroute/update`, data }) +} + +// 删除工艺路线定义 +export const deleteProcessroute = async (id: number) => { + return await request.delete({ url: `/mes/processroute/delete?id=` + id }) +} + +// 导出工艺路线定义 Excel +export const exportProcessroute = async (params) => { + return await request.download({ url: `/mes/processroute/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/mes/processroute/get-import-template' }) +} +// 获取工序工序列表- +export const getProcessList =async (params) => { + return request.get({ url: `/wms/process/page`,params }) +} +// 获取工序工序信息- +export const getProcesInfo = async(code:String) => { + return request.get({ url: `/wms/process/getByCode?code=`,code }) +} +// 获取产品信息列表- +export const getProductInfo =async (code:String) => { + return request.get({ url: `/wms/itembasic/getProduct?code=`+code}) +} + +// 获取设备列表-参数为工序编码 +export const getDeviceList =async (code:String) => { + //return request.get({ url: `/wms/itembasic/getProduct?code=`+code}) + return {code:0,data:[{name:"冲压设备1",code:"CY0001"},{name:"冲压设备2",code:"CY0002"}]} +} +// 获取工作人员信息--参数为工序编码 +export const getWorkerList =async (code:String) => { + // return request.get({ url: `/wms/itembasic/getProduct?code=`+code}) + return {code:0,data:[{name:"张三",code:"冲压1班"},{name:"李四",code:"冲压1班"}]} +} +// 获取工位信息 +export const getWorkStation =async (code:String) => { + //return request.get({ url: `/wms/itembasic/getProduct?code=`+code}) + return {code:0,data:{name:"冲压工位",code:"CYW0001"}} +} +// 获取车间信息列表- +// export const getWorkInfoList = () => { +// return request.get({ url: '/wms/workshop?code=',code }) +// } +// 获取产品信息列表- +// export const getProductInfo = (code:String) => { +// return request.get({ url: '/wms/itembasic/getProduct?code=',code }) +// } \ No newline at end of file diff --git a/src/views/mes/processroute/components/configDialog.vue b/src/views/mes/processroute/components/configDialog.vue new file mode 100644 index 000000000..4f9957a31 --- /dev/null +++ b/src/views/mes/processroute/components/configDialog.vue @@ -0,0 +1,326 @@ + + + + + + + + {{ titleValueRef }} + [{{ titleNameRef }}] + + + + 保存修改 + + + + + + + + + + + + + {{ scope.row.name }}[{{ scope.row.code }}] + + + + + + + + + + + + + 产品信息 + + + 产品名称:{{ productData.name }} + 产品编码:{{ productData.code }} + 产品描述:{{ productData.desc1 }} + + + + + + 设备信息 + + + {{ item.name }} + + + + + 人员信息 + + + {{ item.name }} + + + + + 工位信息 + + + 工位编码:{{ workStationData.name }} + 工位名称:{{ workStationData.code }} + + + + + + + + diff --git a/src/views/mes/processroute/components/graphbase.data.ts b/src/views/mes/processroute/components/graphbase.data.ts new file mode 100644 index 000000000..c5dc0893a --- /dev/null +++ b/src/views/mes/processroute/components/graphbase.data.ts @@ -0,0 +1,290 @@ +import { Graph, Node, Path, Cell } from '@antv/x6' +//工艺节点的定义 +export const process_node = ref({ + width: 120, + height: 40, + attrs: { + body: { + stroke: '#5F95FF', + strokeWidth: 1, + fill: 'rgba(255,255,255,0.8)', + refWidth: 1, + refHeight: 1 + }, + // image: { + // 'xlink:href': + // 'https://gw.alipayobjects.com/zos/antfincdn/FLrTNDvlna/antv.png', + // width: 16, + // height: 16, + // x: 12, + // y: 12, + // }, + title: { + text: 'Node', + refX: 5, + refY: 5, + fill: 'rgba(0,0,0,0.85)', + fontSize: 12, + 'text-anchor': 'start' + }, + text: { + text: 'this is content text', + refX: 5, + refY: 25, + fontSize: 12, + fill: 'rgba(0,0,0,0.6)', + 'text-anchor': 'start' + } + }, + ports: { + groups: { + in: { + position: 'left', + attrs: { + circle: { + magnet: true, + stroke: '#8f8f8f', + r: 5 + } + } + }, + out: { + position: 'right', + attrs: { + circle: { + magnet: true, + stroke: '#8f8f8f', + r: 5 + } + } + } + } + }, + tools: [ + { + name: 'button-remove', + args: { + x: '100%', + y: 0, + offset: { x: -10, y: 10 } + } + } + ], + markup: [ + { + tagName: 'rect', + selector: 'body' + }, + // { + // tagName: 'image', + // selector: 'image', + // }, + { + tagName: 'text', + selector: 'title' + }, + { + tagName: 'text', + selector: 'text' + } + ] +}) +//--------开始结束节点的定义--------------------- + +export const base_node = ref({ + width: 66, + height: 36, + inherit: 'rect', // 继承于 rect 节点 + attrs: { + body: { + stroke: '#5F95FF', + strokeWidth: 1, + fill: '#EFF4FF', + refWidth: 2, + refHeight: 2 + }, + text: { + fontSize: 12, + fill: '#262626' + } + }, + ports: { + groups: { + in: { + position: 'left', + attrs: { + circle: { + magnet: true, + stroke: '#8f8f8f', + r: 5 + } + } + }, + out: { + position: 'right', + attrs: { + circle: { + magnet: true, + stroke: '#8f8f8f', + r: 5 + } + } + } + } + } +}) + +export const start_node = ref({ + id: 'startNode', + label: '开始', + x: 50, + y: 200, + attrs: { + body: { + rx: 20, + ry: 26 + } + }, + shape: 'base-node', + ports: [{ id: 'out', group: 'out' }] +}) +//结束节点的定义 +export const end_node = ref({ + id: 'endNode', + x: 200, + y: 200, + label: '结束', + attrs: { + body: { + rx: 20, + ry: 26 + } + }, + shape: 'base-node', + ports: [{ id: 'in', group: 'in' }] +}) +export const createGraph = (graphContainer: any) => { + const ret = ref() + ret.value= new Graph({ + container: graphContainer, + autoResize: true, + background: { color: '#F2F7FA' }, // 创建画布时初始化背景相关配置对象 + grid: { size: 10, visible: true, type: 'mesh' }, //创建画布时,通过配置对象来设置背景网格 + mousewheel: { + enabled: true, + modifiers: 'ctrl', + factor: 1.1, + maxScale: 1.5, + minScale: 0.5 + }, + connecting: { + snap: true, + allowBlank: false, + allowLoop: false, + allowNode: false, + highlight: true, + + createEdge() { + return this.createEdge({ + attrs: { + line: { + stroke: '#8f8f8f', + strokeWidth: 1 + } + } + }) + }, + validateMagnet({ magnet }) { + return magnet.getAttribute('port-group') !== 'in' + }, + validateConnection({ sourceMagnet, targetMagnet }) { + // 只能从输出链接桩创建连接 + if (!sourceMagnet || sourceMagnet.getAttribute('port-group') === 'in') { + return false + } + // 只能连接到输入链接桩 + if (!targetMagnet || targetMagnet.getAttribute('port-group') !== 'in') { + return false + } + return true + } + }, + panning: { + enabled: true + }, + highlighting: { + // 连接桩可以被连接时在连接桩外围围渲染一个包围框 + magnetAvailable: { + name: 'stroke', + args: { + attrs: { + fill: '#fff', + stroke: '#A4DEB1', + strokeWidth: 4 + } + } + } + } + //selecting:{enabled: true, multiple: true,rubberEdge: true,rubberNode: true,modifiers: 'shift',rubberband: true} + }) + // ret.value.on('node:click', ({ e, x, y, node, view }) => { + // //nodeClick(e, x, y, node, view) + // nodeClick(e, x, y, node, view) + // }) + // ret.value.on('node:removed', ({ node, index, options }) => { + // nodeRemoved(node, index, options) + // }) + ret.value.on('edge:mouseenter', ({ cell }) => { + cell.addTools([ + { + name: 'vertices', + args: { + d: 'M 10 -8 -10 0 10 8 Z', + fill: '#333', + stroke: '#fff', + 'stroke-width': 2, + cursor: 'move' + } + }, + { + name: 'button-remove', + args: { distance: 20 } + } + ]) + }) + ret.value.on('edge:mouseleave', ({ cell }) => { + cell.removeTools() + }) + return ret.value +} +//注册节点 +export const registerNodes = () => { + //-----图形定制化节点------------------- + Graph.registerNode('process-node', process_node.value, true) + Graph.registerNode('base-node', base_node.value, true) +} +//获取新的节点 +export const getNewNode = (id: string, title: string, contentText: string) => { + return { + id: id, + width: 120, + height: 40, + x: 100, + y: 100, + attrs: { + title: { + text: title + }, + text: { + text: contentText + } + }, + shape: 'process-node', + ports: [ + { id: 'in', group: 'in' }, + { id: 'out', group: 'out' } + ] + } +} + + diff --git a/src/views/mes/processroute/index.vue b/src/views/mes/processroute/index.vue new file mode 100644 index 000000000..234a7c32b --- /dev/null +++ b/src/views/mes/processroute/index.vue @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + {{ row.processroute_code }} + + + + + + + + + + + + + + + + + + + diff --git a/src/views/mes/processroute/processroute.data.ts b/src/views/mes/processroute/processroute.data.ts new file mode 100644 index 000000000..fb82886cf --- /dev/null +++ b/src/views/mes/processroute/processroute.data.ts @@ -0,0 +1,148 @@ +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' +// 表单校验 +export const ProcessrouteRules = reactive({ +}) + +export const Processroute = useCrudSchemas(reactive([ + { + label: '删除时间', + field: 'deleteTime', + sort: 'custom', + isTable: false, + isForm: false, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + }, + { + label: '主键', + field: 'id', + sort: 'custom', + isForm: false, + }, + + { + label: '并发乐观锁', + field: 'concurrencyStamp', + sort: 'custom', + isTable: false, + isForm: false, + form: { + component: 'InputNumber', + value: 0 + }, + }, + + + { + label: '删除用户名', + field: 'deleter', + sort: 'custom', + isTable: false, + isForm: false, + }, + { + label: '工艺路线编码', + field: 'processrouteCode', + sort: 'custom', + isSearch: true, + // form: { + // component: 'Input', + + // componentProps: { + // slots:{ + // default:} + // disabled: true + // } + // } + }, + + { + label: '工艺路线名称', + field: 'processName', + sort: 'custom', + isSearch: true, + }, + { + label: '产品编码', + field: 'productCode', + sort: 'custom', + isSearch: true, + width: 150, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择物料代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '产品信息', // 查询弹窗标题 + searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类 + searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + } + }, + { + label: '版本号', + field: 'routeVersion', + sort: 'custom', + isSearch: true, + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isForm: false, + isTable: false, + }, + { + label: '状态', + field: 'status', + sort: 'custom', + isSearch: false, + dictType: DICT_TYPE.ITEM_STATUS, + dictClass: 'string', + form: { + component: 'Switch', + value: 'ENABLE', + componentProps: { + inactiveValue: 'DISABLE', + activeValue: 'ENABLE' + } + }, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + }, + { + label: '图形数据', + field: 'graphJson', + sort: 'custom', + isForm: false, + isTable: false, + isSearch:false + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) diff --git a/src/views/wms/basicDataManage/factoryModeling/workstation/index.vue b/src/views/wms/basicDataManage/factoryModeling/workstation/index.vue index 232885f92..7002ebef5 100644 --- a/src/views/wms/basicDataManage/factoryModeling/workstation/index.vue +++ b/src/views/wms/basicDataManage/factoryModeling/workstation/index.vue @@ -210,10 +210,10 @@ const formsSuccess = async (formType,data) => { Workstation.allSchemas.tableFormColumns.map(item => { if(item.field == 'rawLocationCode') { item.form.componentProps.searchCondition = [ - // { - // key: 'areaType', - // value: 'RAW', - // }, + { + key: 'areaType', + value: 'RAW', + }, { key: 'available', value: 'TRUE', @@ -222,10 +222,10 @@ Workstation.allSchemas.tableFormColumns.map(item => { } if(item.field == 'fgLocationCode') { item.form.componentProps.searchCondition = [ - // { - // key: 'areaType', - // value: 'FG', - // }, + { + key: 'areaType', + value: 'FG', + }, { key: 'available', value: 'TRUE', diff --git a/src/views/wms/basicDataManage/itemManage/itemarea/index.vue b/src/views/wms/basicDataManage/itemManage/itemarea/index.vue index c55ae9007..e78f9d9cb 100644 --- a/src/views/wms/basicDataManage/itemManage/itemarea/index.vue +++ b/src/views/wms/basicDataManage/itemManage/itemarea/index.vue @@ -174,6 +174,23 @@ const HeadButttondata = [ // }, ] +// /** +// * 监听改变事件 +// * @param field 当前操作字段 +// * @param cur 改变后值 +// */ +// const onChangeArea = (field, cur) => { +// console.log(field,cur); +// if(field == "maxQty" && cur == "0"){ +// Itemarea.allSchemas.formSchema.forEach((item) => { +// if (item.field == 'allowIssueRequest') { +// cur.value = "FALSE" +// item.componentProps.disabled = true +// }}) +// } +// } + + // 头部按钮事件 const buttonBaseClick = (val, item) => { if (val == 'add') { // 新增
产品名称:{{ productData.name }}
产品编码:{{ productData.code }}
产品描述:{{ productData.desc1 }}
{{ item.name }}
工位编码:{{ workStationData.name }}
工位名称:{{ workStationData.code }}