diff --git a/src/api/mes/process/index.ts b/src/api/mes/process/index.ts new file mode 100644 index 000000000..0adec9ed9 --- /dev/null +++ b/src/api/mes/process/index.ts @@ -0,0 +1,158 @@ +import request from '@/config/axios' + +export interface ProcessVO { + code: string + name: string + description: string + type: string + workshopCode: string + productionLineCode: string + available: number + activeTime: Date + expireTime: Date + remark: string +} + +export const goalParams = { + processCode:null +} +// 查询工序列表 +export const getProcessPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return request.post({ url: '/mes/process/senior', data }) + } else { + return await request.get({ url: `/mes/process/page`, params }) + } +} + +// 查询工序详情 +export const getProcess = async (id: number) => { + return await request.get({ url: `/mes/process/get?id=` + id }) +} + +// 新增工序 +export const createProcess: (data: ProcessVO) => Promise = async (data: ProcessVO) => { + return await request.post({ url: `/mes/process/create`, data }) +} + +// 修改工序 +export const updateProcess = async (data: ProcessVO) => { + return await request.put({ url: `/mes/process/update`, data }) +} + +// 删除工序 +export const deleteProcess: (id: number) => Promise = async (id: number) => { + return await request.delete({ url: `/mes/process/delete?id=` + id }) +} + +// 导出工序 Excel +export const exportProcess = async (params) => { + if (params.isSearch) { + const data = {...params} + return await request.downloadPost({ url: `/mes/process/export-excel-senior`, data }) + } else { + return await request.download({ url: `/mes/process/export-excel`, params }) + } +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/mes/process/get-import-template' }) +} + + +// 查询模具基本信息列表 +export const getPatternPage = async (params) => { + params.processCode = goalParams.processCode + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return request.post({ url: '/mes/mes-process-pattern/senior', data }) + } else { + return await request.get({ url: `/mes/mes-process-pattern/pagePatternByProcessCode`, params }) + } +} + +//创建工序模具关联 +export const createPatternRelation = async (Codes:string[]) => { + const data = { + processCode : goalParams.processCode, + listPatternCode : Codes + } + return await request.post({ url: `/mes/mes-process-pattern/createRelation`, data }) +} + +//删除工序模具关联 +export const deletePatternRelation = async (Codes:string[]) => { + const data = { + processCode : goalParams.processCode, + listPatternCode : Codes + } + return await request.post({ url: `/mes/mes-process-pattern/deleteRelation`, data }) +} + + + +// 查询产线列表 +export const getProductionlinePage = async (params) => { + params.processCode = goalParams.processCode + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return request.post({ url: '/mes/mes-process-productionline/senior', data }) + } else { + return await request.get({ url: `/mes/mes-process-productionline/pageByProcessCode`, params }) + } +} + +//创建工序产线关联 +export const createProductionlineRelation = async (Codes:string[]) => { + const data = { + processCode : goalParams.processCode, + listProductionlineCode : Codes + } + return await request.post({ url: `/mes/mes-process-productionline/createRelation`, data }) +} + +//删除工序产线关联 +export const deleteProductionlineRelation = async (Codes:string[]) => { + const data = { + processCode : goalParams.processCode, + listProductionlineCode : Codes + } + return await request.post({ url: `/mes/mes-process-productionline/deleteRelation`, data }) +} + + + +// 查询物料列表 +export const getItembasicPage = async (params) => { + params.processCode = goalParams.processCode + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return request.post({ url: '/mes/mes-process-itembasic/senior', data }) + } else { + return await request.get({ url: `/mes/mes-process-itembasic/pageByProcessCode`, params }) + } +} + +//创建工序物料关联 +export const createItembasicRelation = async (Codes:string[]) => { + const data = { + processCode : goalParams.processCode, + listItembasicCode : Codes + } + return await request.post({ url: `/mes/mes-process-itembasic/createRelation`, data }) +} + +//删除工序物料关联 +export const deleteItembasicRelation = async (Codes:string[]) => { + const data = { + processCode : goalParams.processCode, + listItembasicCode : Codes + } + return await request.post({ url: `/mes/mes-process-itembasic/deleteRelation`, data }) +} diff --git a/src/api/mes/processroute/index.ts b/src/api/mes/processroute/index.ts index f80f4aab1..04e7c6abd 100644 --- a/src/api/mes/processroute/index.ts +++ b/src/api/mes/processroute/index.ts @@ -61,38 +61,27 @@ export const importTemplate = () => { } // 获取工序工序列表- export const getProcessList =async (params) => { - return await request.get({ url: `/wms/process/page`, params }) + return await request.get({ url: `/mes/process/page`, params }) } // 获取工序工序信息- export const getProcesInfo = async(code:String) => { - return await request.get({ url: `/wms/process/getByCode?code=`,code }) + return await request.get({ url: `/mes/process/getByCode?code=`+code }) } // 获取产品信息列表- export const getProductInfo =async (code:String) => { return await request.get({ url: `/wms/itembasic/getProduct?code=`+code}) } -// 获取设备列表-参数为工序编码 -export const getDeviceList =async (code:String) => { - //return request.get({ url: `/wms/itembasic/getProduct?code=`+code}) - return request.get({ url: `/wms/itembasic/getProduct?code=`+code}) - return {code:0,data:[{name:"冲压设备1",code:"CY0001"},{name:"冲压设备2",code:"CY0002"}]} +// 查询模具基本信息列表 +export const getPatternPage = async (code:String) => { + return await request.get({ url: `/mes/mes-process-pattern/pagePatternByProcessCode?pageSize=25&processCode=`+code }) } -// 获取工作人员信息--参数为工序编码 -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 getItembasicPage = async (code:String) => { + return await request.get({ url: `/mes/mes-process-itembasic/pageByProcessCode?pageSize=25&processCode=`+code}) } -// 获取工位信息 -export const getWorkStation =async (code:String) => { - //return request.get({ url: `/wms/itembasic/getProduct?code=`+code}) - return {code:0,data:{name:"冲压工位",code:"CYW0001"}} + +export const getWorkstationPage = async (code:String) => { + return await request.get({ url: `/mes/workstation/page?pageSize=25&processCode=`+code}) } -// 获取车间信息列表- -// 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/api/mes/productBackline/index.ts b/src/api/mes/productBackline/index.ts new file mode 100644 index 000000000..c1403fca4 --- /dev/null +++ b/src/api/mes/productBackline/index.ts @@ -0,0 +1,59 @@ +import request from '@/config/axios' + +export interface ProductBacklineVO { + offlineCode: string + productCode: string + workBillno: string + processCode: string + operCode: string + backlineBillno: string + planCode: string + deleteTime: Date + id: number + status: string + remark: string + deleter: string + siteId: number + workstationCode: string +} + +// 查询产品返线登记列表 +export const getProductBacklinePage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/mes/product-backline/senior', data }) + } else { + return await request.get({ url: `/mes/product-backline/page`, params }) + } +} + +// 查询产品返线登记详情 +export const getProductBackline = async (id: number) => { + return await request.get({ url: `/mes/product-backline/get?id=` + id }) +} + +// 新增产品返线登记 +export const createProductBackline = async (data: ProductBacklineVO) => { + return await request.post({ url: `/mes/product-backline/create`, data }) +} + +// 修改产品返线登记 +export const updateProductBackline = async (data: ProductBacklineVO) => { + return await request.put({ url: `/mes/product-backline/update`, data }) +} + +// 删除产品返线登记 +export const deleteProductBackline = async (id: number) => { + return await request.delete({ url: `/mes/product-backline/delete?id=` + id }) +} + +// 导出产品返线登记 Excel +export const exportProductBackline = async (params) => { + return await request.download({ url: `/mes/product-backline/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/mes/product-backline/get-import-template' }) +} diff --git a/src/api/mes/productOffline/index.ts b/src/api/mes/productOffline/index.ts new file mode 100644 index 000000000..c5434f931 --- /dev/null +++ b/src/api/mes/productOffline/index.ts @@ -0,0 +1,71 @@ +import request from '@/config/axios' + +export interface ProductOfflineVO { + offlineCode: string + workBillno: string + planCode: string + productCode: string + offlineReson: string + productDestination: string + deleteTime: Date + id: number + status: string + concurrencyStamp: number + remark: string + deleter: string + siteId: number + processCode: string + stationCode: string + checkPersonCode: string +} + +// 查询产品离线登记记录列表 +export const getProductOfflinePage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/mes/product-offline/senior', data }) + } else { + return await request.get({ url: `/mes/product-offline/page`, params }) + } +} + +// 查询产品离线登记记录详情 +export const getProductOffline = async (id: number) => { + return await request.get({ url: `/mes/product-offline/get?id=` + id }) +} + +// 新增产品离线登记记录 +export const createProductOffline = async (data: ProductOfflineVO) => { + return await request.post({ url: `/mes/product-offline/create`, data }) +} + +// 修改产品离线登记记录 +export const updateProductOffline = async (data: ProductOfflineVO) => { + return await request.put({ url: `/mes/product-offline/update`, data }) +} + +// 删除产品离线登记记录 +export const deleteProductOffline = async (id: number) => { + return await request.delete({ url: `/mes/product-offline/delete?id=` + id }) +} + +// 导出产品离线登记记录 Excel +export const exportProductOffline = async (params) => { + return await request.download({ url: `/mes/product-offline/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/mes/product-offline/get-import-template' }) +} + +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 }) + } +} diff --git a/src/api/system/user/index.ts b/src/api/system/user/index.ts index 6224f0e85..7011ade4c 100644 --- a/src/api/system/user/index.ts +++ b/src/api/system/user/index.ts @@ -15,13 +15,25 @@ export interface UserVO { remark: string loginDate: Date createTime: Date + userType :string } -// 查询用户管理列表 -export const getUserPage = (params: PageParam) => { - return request.get({ url: '/system/user/page', params }) +export const getUserPage = async (params) => { + console.log(params) + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/system/user/senior', data }) + } else { + return await request.get({ url: '/system/user/page', params }) + } } +// 查询用户管理列表 +// export const getUserPage = (params: PageParam) => { +// return request.get({ url: '/system/user/page', params }) +// } + // 查询用户详情 export const getUser = (id: number) => { return request.get({ url: '/system/user/get?id=' + id }) diff --git a/src/api/wms/team/index.ts b/src/api/wms/team/index.ts index 6c978a410..ace3d69c0 100644 --- a/src/api/wms/team/index.ts +++ b/src/api/wms/team/index.ts @@ -9,6 +9,9 @@ export interface TeamVO { expireTime: Date remark: string available: string + teamGroup: string + workshopCode: string + productionLineCode: string } // 查询班组列表 @@ -55,4 +58,4 @@ export const exportTeam = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/team/get-import-template' }) -} \ No newline at end of file +} diff --git a/src/utils/dict.ts b/src/utils/dict.ts index ca6b004c2..d1afb1ad1 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -322,4 +322,6 @@ export enum DICT_TYPE { SUPPLIERINVOICE_REQUEST_STATUS = 'supplierinvoice_request_status', //发票申请状态 SUPPLIERINVOICE_STATUS = 'supplierinvoice_status', //待开票审核状态 + BASIC_TEAM_TYPE='basic_team_type',//班组类型 + } diff --git a/src/views/mes/process/components/Detail.vue b/src/views/mes/process/components/Detail.vue new file mode 100644 index 000000000..a888b982b --- /dev/null +++ b/src/views/mes/process/components/Detail.vue @@ -0,0 +1,820 @@ + + + + + diff --git a/src/views/mes/process/index.vue b/src/views/mes/process/index.vue new file mode 100644 index 000000000..352a1b523 --- /dev/null +++ b/src/views/mes/process/index.vue @@ -0,0 +1,368 @@ + + + diff --git a/src/views/mes/process/process.data.ts b/src/views/mes/process/process.data.ts new file mode 100644 index 000000000..0f6dce604 --- /dev/null +++ b/src/views/mes/process/process.data.ts @@ -0,0 +1,513 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +import * as WorkshopApi from '@/api/wms/workshop' +import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data' + +import * as ProductionlineApi from '@/api/wms/productionline' +import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data' + +import { validateYS } from '@/utils/validator' + +import * as PatternApi from "@/api/mes/pattern"; +import * as ItembasicApi from "@/api/wms/itembasic"; +import {Itembasic} from "@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data"; + +const { t } = useI18n() // 国际化 + +/** + * @returns {Array} 工序 + */ +export const Process = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150, + fixed: 'left' + }, + isSearch: true, + }, + { + label: '名称', + field: 'name', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + }, + { + label: '类型', + field: 'type', + dictType: DICT_TYPE.PROCESS_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '工序节拍', + field: 'actionClock', + sort: 'custom', + form: { + component: 'InputNumber', + componentProps: { + min: 1 + } + }, + table: { + width: 120 + } + }, + { + label: '车间代码', + field: 'workshopCode', + sort: 'custom', + table: { + width: 150 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择车间代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '车间信息', // 查询弹窗标题 + searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类 + searchPage: WorkshopApi.getWorkshopPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + } + }, + { + label: '生产线代码', + field: 'productionLineCode', + sort: 'custom', + table: { + width: 150 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择生产线代码', // 输入框占位文本 + multiple:true, + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '生产线信息', // 查询弹窗标题 + searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类 + searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法 + searchCondition: [{ + key:'workshopCode', + value:'workshopCode', + message: '请填写车间代码!', + isMainValue: true + },{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + } + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '是否报工', + field: 'isReport', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '是否质检', + field: 'isCheck', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '是否关键', + field: 'isSerious', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: {width:'100%'}, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: {width:'100%'}, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: {width:'100%'}, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + isTable: false, + isForm: false + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + isTable: false, + isForm: false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150, + fixed: 'right' + } + } +])) + +//表单检验 +export const ProcessRules = reactive({ + code: [ + { required: true, message: '请输入代码', trigger: 'blur' }, + { max: 50, message: '不得超过50个字符', trigger: 'blur' }, + { validator:validateYS, message: '请输入正确的代码', trigger: 'blur'} + ], + name: [ + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + workshopCode: [ + { required: true, message: '请输入车间代码', trigger: 'change' } + ], + productionLineCode: [ + { required: true, message: '请输入生产线代码', trigger: 'change' } + ], + remark: [ + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], + isReport: [ + { required: true, message: '请选择是否报工', trigger: 'change' } + ], + isCheck: [ + { required: true, message: '请选择是否质检', trigger: 'change' } + ], + isSerious: [ + { required: true, message: '请选择是否关键', trigger: 'change' } + ], +}) + +export const ProductionlineTab = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + isSearch: true, + isForm: false + }, + { + label: '名称', + field: 'name', + sort: 'custom', + isSearch: true, + isForm: false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150, + fixed: 'right' + }, + isTableForm:true, + } +])) + +export const PatternTab = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + isSearch: true, + isForm: false + }, + { + label: '名称', + field: 'name', + sort: 'custom', + isSearch: true, + isForm: false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150, + fixed: 'right' + }, + isTableForm:true + } +])) + +export const ItembasicTab = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + isSearch: true, + isForm: false + }, + { + label: '名称', + field: 'name', + sort: 'custom', + isSearch: true, + isForm: false + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150, + fixed: 'right' + }, + isTableForm:true + } +])) + + + +export const TabsList = [ + { + label: "产线", + prop: 'ProductionlineTab', + }, + { + label: "模具", + prop: 'PatternTab', + }, + { + label: "物料", + prop: 'ItembasicTab', + } + +] + +export const ProductionlinePopList = useCrudSchemas(reactive([ + { + label: '选择产线', + field: 'list', + sort: 'custom', + isSearch: false, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + multiple:true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '选择产线', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '选择产线', // 查询弹窗标题 + searchAllSchemas: ProductionlineTab.allSchemas, // 查询弹窗所需类 + searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + },{ + key:'workshopCode', + value:'workshopCode', + message: '请填写车间代码!', + isMainValue: true + }] + } + } + } +])) +export const PatternPopList = useCrudSchemas(reactive([ + { + label: '选择模具', + field: 'list', + sort: 'custom', + isSearch: false, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + multiple:true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '选择模具', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '选择模具', // 查询弹窗标题 + searchAllSchemas: PatternTab.allSchemas, // 查询弹窗所需类 + searchPage: PatternApi.getPatternPage, // 查询弹窗所需分页方法 + // searchCondition: [{ + // key: 'available', + // value: 'TRUE', + // isMainValue: false + // }] + } + } + } +])) + +export const ItembasicPopList = useCrudSchemas(reactive([ + { + label: '选择物料', + field: 'list', + sort: 'custom', + isSearch: false, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + multiple:true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '选择物料', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '选择物料', // 查询弹窗标题 + searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类 + searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + } + } +])) diff --git a/src/views/mes/processroute/components/configDialog.vue b/src/views/mes/processroute/components/configDialog.vue index 0b89f8423..d68b94120 100644 --- a/src/views/mes/processroute/components/configDialog.vue +++ b/src/views/mes/processroute/components/configDialog.vue @@ -42,7 +42,7 @@ @@ -51,7 +51,7 @@
- +
@@ -95,11 +95,11 @@ 物料信息 - - + + = - - + + @@ -110,8 +110,8 @@ 模具信息 - - + + 工位信息 - + @@ -162,12 +162,10 @@ const titleValueRef = ref() const processRouteId = ref() const processData = ref([]) //工序数据 const tableProcess = ref() -// const workshopCodeOptions = ref([{ code: '', name: '车间1' }]) -// const productionLineCodeOptions = ref([{ code: '', name: '产线' }]) const productData = ref({ name: '', code: '', desc1: '--' }) //产品数据 const materialData=ref() const mouldData = ref() -const workstationData = ref() //工位数据 +const workStationList = ref() //工位数据 // 附件默认数据 const annexData = reactive({ annexList: [] @@ -182,7 +180,6 @@ const routeVersion=ref() const searchTableRef = ref() const opensearchTable = ( ) => { - //console.log("opensearchTable") const _searchCondition = {} const _searchTableTitle = "工序查询" const _searchTableAllSchemas = ProcessSearch.allSchemas @@ -216,8 +213,9 @@ const deleteNode=(row)=>{ } //初始化图形组件 const graph = ref() -const openDetail = (rowData: any) => { - rowData.value = rowData +const rowData = ref() +const openDetail = (row: any) => { + rowData.value = row console.log('rowData',rowData.value) titleNameRef.value = rowData.value.processrouteCode titleValueRef.value = rowData.value.processName @@ -230,54 +228,52 @@ const openDetail = (rowData: any) => { if(rowData){ let graphJson = JSON.parse(rowData.value.graphJson) isShowDrawer.value = true - nextTick(() => { + nextTick?.(() => { graph.value = createGraph(graphContainer.value as HTMLElement,true,640,480) + //首次打开弹窗,将物料,模具,工位对应的表单清空 + materialData.value = [] + mouldData.value = [] + workStationList.value = [] graph.value.on('node:click', ({ e, x, y, node, view }) => { nodeClick(e, x, y, node, view) }) graph.value.fromJSON(graphJson.cells) }) - getItembasicInfo(rowData.value.productCode) - getRemarkList() - getFileList() - getChangeRecordList()} + getItembasicInfo(rowData.value.productCode) + getRemarkList() + getFileList() + getChangeRecordList() + } } //关闭后销毁图形组件 const handleDrawerClose = () => { //console.log('close') if (graph && graph.value != undefined) { //console.log(graph.value.toJSON()) + rowData.value=null } } //**获取 工序信息 */ -const getProcessInfo = async (id: number) => { - const res = await ProcessrouteApi.getProcesInfo(id) - return res +const getProcessInfo = async (id: any) => { + return await ProcessrouteApi.getProcesInfo(id) } /** 获取产品信息 */ const getItembasicInfo = async (code: String) => { const res = await ProcessrouteApi.getProductInfo(code) productData.value = res - //console.log(productData.value) } -/** 获取设备列表 */ -const getDeviceList = async (code: String) => { - const res = await ProcessrouteApi.getDeviceList(code) - deviceList.value = res.data - //console.log(productData.value) +/** 获取物料列表 */ +const getItembasicPage = async (code) => { + return await ProcessrouteApi.getItembasicPage(code); } -/** 获取工位信息 */ -const getWorkStation = async (code: String) => { - const res = await ProcessrouteApi.getWorkStation(code) - workStationData.value = res.data - //console.log(productData.value) +/** 查询模具基本信息列表 */ +const getPatternPage = async (code) => { + return await ProcessrouteApi.getPatternPage(code); } -/** 获取人员信息列表 */ -const getWorkerList = async (code: String) => { - const res = await ProcessrouteApi.getWorkerList(code) - workerList.value = res.data - //console.log(productData.value) +/** 查询模具基本信息列表 */ +const getWorkstationPage = async (code) => { + return await ProcessrouteApi.getWorkstationPage(code); } const processListParmas = ref({ name: '', @@ -288,20 +284,33 @@ const processListParmas = ref({ }) /**获取工序列表 */ const getProcessList = async () => { - //console.log(processListParmas.value) const res = await ProcessrouteApi.getProcessList(processListParmas.value) - processData.value = res.list - //return res } +// 并行执行所有异步操作 const nodeClick = (e, x, y, node, view) => { - //console.log('nodeClick', e, x, y, node, view) - let data = getProcessInfo(node.id) - getDeviceList(node.id) - getWorkerList(node.id) - getWorkStation(node.id) - message.info(data.toString()) + Promise.all([ + getProcessInfo(node.id), + getItembasicPage(node.id), + getPatternPage(node.id), + getWorkstationPage(node.id) + ]).then(([processIndoList,itembasicPage, patternPage,workstationInfoList]) => { + // 在这里处理所有异步操作的结果 + message.info(JSON.stringify(processIndoList)) + console.log(processIndoList) + //获取绑定的物料信息 + materialData.value = itembasicPage.list + //获取绑定的模具信息 + mouldData.value = patternPage.list + //获取绑定的工位信息 + workStationList.value = workstationInfoList.list + }).catch(error => { + console.error("Error:", error); + materialData.value = [] + mouldData.value = [] + workStationList.value = [] + }); } //添加节点 @@ -341,7 +350,7 @@ const userAddNode = (row) => { } //------- defineExpose({ openDetail, createGraph }) // 提供 open 方法,用于打开弹窗 -onMounted(() => { +onMounted?.(() => { //registerNodes() getProcessList() @@ -418,7 +427,7 @@ const deleteAnnexSuccess = async () => { getChangeRecordList() } // 验证图形 -onUnmounted(() => {}) +onUnmounted?.(() => {}) const emit = defineEmits(['close']) diff --git a/src/views/mes/processroute/index.vue b/src/views/mes/processroute/index.vue index 5e48c1d11..2e174e39d 100644 --- a/src/views/mes/processroute/index.vue +++ b/src/views/mes/processroute/index.vue @@ -51,7 +51,7 @@ /> - + @@ -140,7 +140,7 @@ const butttondata = [ defaultButtons.mainListHandleBtn({label: '配置', name: 'config', hide: false, - type: 'warning', + type: 'primary', icon: '', color: '', hasPermi: ''}), // 路由设置 @@ -148,18 +148,22 @@ const butttondata = [ // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { - + if (val == 'edit') { // 编辑 openForm('update', row) } else if (val == 'delete') { // 删除 handleDelete(row.id) - } else if (val == 'config') { // + } else if (val == 'config') { // openDetail(row) } } const dailogClose=() => { console.log('close'); - + nextTick?.(()=>{ + debugger + getList() + }) + } /** 添加/修改操作 */ const basicFormRef = ref() @@ -194,7 +198,8 @@ const formsSuccess = async (formType,data) => { /** 详情操作 */ const configDialogRef = ref() const openDetail =(row) => { - + + // configDialogRef.value.openDetail(row) } @@ -257,5 +262,10 @@ onMounted(async () => { getList() importTemplateData.templateUrl = await ProcessrouteApi.importTemplate() }) +// +// watch( +// () => tableObject.tableList, +// console.log(tableObject.tableList) +// ) diff --git a/src/views/mes/productBackline/index.vue b/src/views/mes/productBackline/index.vue new file mode 100644 index 000000000..1dc6d58fb --- /dev/null +++ b/src/views/mes/productBackline/index.vue @@ -0,0 +1,249 @@ + + + diff --git a/src/views/mes/productBackline/productBackline.data.ts b/src/views/mes/productBackline/productBackline.data.ts new file mode 100644 index 000000000..32a949e54 --- /dev/null +++ b/src/views/mes/productBackline/productBackline.data.ts @@ -0,0 +1,170 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +import {workscheduling} from "@/views/mes/productionPlan/productionPlan.data"; +import * as ProductOfflineApi from "@/api/mes/productOffline"; +import {ProductOffline} from "@/views/mes/productOffline/productOffline.data"; + +// 表单校验 +export const ProductBacklineRules = reactive({ + productCode: [ + { required: true, message: '请选择产品编码', trigger: 'change' }, + ], +}) + +export const ProductBackline = useCrudSchemas(reactive([ + { + label: '返线工单号', + field: 'backlineBillno', + sort: 'custom', + isSearch: true, + isForm: false, + table: { + width: 200 + }, + }, + { + label: '离线编码', + field: 'offlineCode', + sort: 'custom', + isSearch: true, + isForm: true, + table: { + width: 200 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择离线编码', // 输入框占位文本 + searchField: 'offlineCode', // 查询弹窗赋值字段 + searchTitle: '产品离线登记信息', // 查询弹窗标题 + searchAllSchemas: ProductOffline.allSchemas, // 查询弹窗所需类 + searchPage: ProductOfflineApi.getProductOfflinePage, // 查询弹窗所需分页方法 + // searchCondition: [{ + // key: 'flagDo', + // value: '3', + // action: '==', + // isSearch: true, + // isMainValue: false + // }] + } + } + }, + { + label: '产品编码', + field: 'productCode', + sort: 'custom', + isSearch: true, + table: { + width: 120 + }, + form: { + componentProps: { + disabled:true, + } + } + }, + { + label: '计划编码', + field: 'planCode', + sort: 'custom', + isSearch: true, + table: { + width: 120 + }, + form: { + componentProps: { + disabled:true, + } + } + }, + { + label: '工单编码', + field: 'workBillno', + sort: 'custom', + isSearch: true, + table: { + width: 140 + }, + form: { + componentProps: { + disabled:true, + } + } + }, + { + label: '返线工序', + field: 'processCode', + sort: 'custom', + isSearch: true, + table: { + width: 120 + }, + form: { + componentProps: { + disabled:true, + } + } + }, + { + label: '返线工位', + field: 'workstationCode', + sort: 'custom', + isSearch: true, + table: { + width: 120 + }, + form: { + componentProps: { + disabled:true, + } + } + }, + { + label: '加工人员', + field: 'operCode', + sort: 'custom', + isSearch: false, + table: { + width: 120 + }, + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + isTable: true, + formatter: dateFormatter, + isForm: false, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: {width:'100%'}, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + } + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: false, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) diff --git a/src/views/mes/productOffline/index.vue b/src/views/mes/productOffline/index.vue new file mode 100644 index 000000000..6f96689ef --- /dev/null +++ b/src/views/mes/productOffline/index.vue @@ -0,0 +1,250 @@ + + + diff --git a/src/views/mes/productOffline/productOffline.data.ts b/src/views/mes/productOffline/productOffline.data.ts new file mode 100644 index 000000000..07249e267 --- /dev/null +++ b/src/views/mes/productOffline/productOffline.data.ts @@ -0,0 +1,185 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +import {workscheduling} from "@/views/mes/productionPlan/productionPlan.data"; +import * as ProductOfflineApi from "@/api/mes/productOffline"; + +// 表单校验 +export const ProductOfflineRules = reactive({ + checkPersonCode: [ + { required: true, message: '请输入质检人员', trigger: 'blur' }, + { max: 50, message: '不得超过50个字符', trigger: 'blur' }, + ], + remark: [ + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + offlineReson: [ + { required: true, message: '请输入离线原因', trigger: 'blur' }, + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + productCode: [ + { required: true, message: '请选择产品编码', trigger: 'change' }, + ], +}) + +export const ProductOffline = useCrudSchemas(reactive([ + { + label: '离线编码', + field: 'offlineCode', + sort: 'custom', + isForm: false, + }, + { + label: '产品编码', + field: 'productCode', + sort: 'custom', + isSearch: true, + table: { + width: 120, + fixed: 'left' + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择产品编码', // 输入框占位文本 + searchField: 'productCode', // 查询弹窗赋值字段 + searchTitle: '生产任务信息表', // 查询弹窗标题 + searchAllSchemas: workscheduling.allSchemas, // 查询弹窗所需类 + searchPage: ProductOfflineApi.getworkSchedulingPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'flagDo', + value: '3', + action: '==', + isSearch: true, + isMainValue: false + }] + } + } + }, + { + label: '工单编码', + field: 'workBillno', + sort: 'custom', + isSearch: true, + disabled:true, + table: { + width: 120 + }, + form: { + componentProps: { + disabled:true, + } + } + }, + { + label: '计划编码', + field: 'planCode', + sort: 'custom', + isSearch: true, + table: { + width: 120 + }, + form: { + componentProps: { + disabled:true, + } + } + }, + { + label: '工序编码', + field: 'processCode', + sort: 'custom', + isSearch: true, + table: { + width: 120 + }, + form: { + componentProps: { + disabled:true, + } + } + }, + { + label: '工位编码', + field: 'stationCode', + sort: 'custom', + isSearch: true, + table: { + width: 120 + }, + form: { + componentProps: { + disabled:true, + } + } + }, + { + label: '产品去向', + field: 'productDestination', + sort: 'custom', + isSearch: false, + table: { + width: 120 + } + }, + { + label: '离线原因', + field: 'offlineReson', + sort: 'custom', + // dictType: DICT_TYPE.BASIC_TEAM_TYPE, + // dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 120 + } + }, + { + label: '质检人员', + field: 'checkPersonCode', + sort: 'custom', + isSearch: false, + isSearch: true, + table: { + width: 120 + } + }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + isTable: true, + formatter: dateFormatter, + isForm: false, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: {width:'100%'}, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + } + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: false, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) diff --git a/src/views/mes/productionPlan/productionPlan.data.ts b/src/views/mes/productionPlan/productionPlan.data.ts index f6f8f68ec..5e6a4bbd1 100644 --- a/src/views/mes/productionPlan/productionPlan.data.ts +++ b/src/views/mes/productionPlan/productionPlan.data.ts @@ -180,3 +180,103 @@ export const ProductionPlan = useCrudSchemas(reactive([ } } ])) + + +export const workscheduling = useCrudSchemas(reactive([ + { + label: '产品编号', + field: 'productCode', + sort: 'custom', + isSearch: true, + table: { + width: 120 + }, + form: { + componentProps: { + disabled:true, + } + } + }, + { + label: '产品名称', + field: 'productName', + sort: 'custom', + isSearch: true, + table: { + width: 120 + }, + form: { + componentProps: { + disabled:true, + } + } + }, + { + label: '计划编号', + field: 'planMaserCode', + sort: 'custom', + isSearch: true, + table: { + width: 120, + fixed: 'left' + }, + }, + { + label: '当前工序', + field: 'workingNode', + sort: 'custom', + isSearch: false, + table: { + width: 120 + } + }, + { + label: '当前工位', + field: 'currentWorkstation', + sort: 'custom', + isSearch: false, + table: { + width: 120 + } + }, + { + label: '工单编码', + field: 'schedulingCode', + sort: 'custom', + isSearch: false, + disabled:true, + table: { + width: 120 + }, + }, + { + label: '车间编号', + field: 'workroomCode', + sort: 'custom', + isSearch: true, + table: { + width: 120 + }, + form: { + componentProps: { + disabled:true, + } + } + }, + { + label: '产线编号', + field: 'lineCode', + sort: 'custom', + isSearch: true, + isTable: true, + table: { + width: 120 + } + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: false, + } +])) diff --git a/src/views/wms/basicDataManage/orderManage/team/index.vue b/src/views/wms/basicDataManage/orderManage/team/index.vue index 6543ab854..99f3bf129 100644 --- a/src/views/wms/basicDataManage/orderManage/team/index.vue +++ b/src/views/wms/basicDataManage/orderManage/team/index.vue @@ -6,9 +6,9 @@ - + + + + + + + + + + @@ -60,11 +61,13 @@ import download from '@/utils/download' import * as TeamApi from '@/api/wms/team' import BasicForm from '@/components/BasicForm/src/BasicForm.vue' -import { Team, TeamRules } from './team.data' +import {searchUser, Team, TeamRules} from './team.data' import * as defaultButtons from '@/utils/disposition/defaultButtons' -import TableHead from '@/components/TableHead/src/TableHead.vue' +import TableHead from '@/components/TableHead/src/TableHead.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import Detail from '@/components/Detail/src/Detail.vue' +import TeamForm from "@/views/wms/basicDataManage/orderManage/team/teamForm.vue"; +import {sync} from "rimraf"; defineOptions({ name: 'Team' }) @@ -106,7 +109,7 @@ const HeadButttondata = [ // }, ] -// 头部按钮事件 +// 头部按钮事件 const buttonBaseClick = (val, item) => { if (val == 'add') { // 新增 openForm('create') @@ -123,7 +126,7 @@ const buttonBaseClick = (val, item) => { getList() } } else if (val == 'filtrate') { // 筛选 - } else { // 其他按钮 + } else { // 其他按钮 console.log('其他按钮', item) } } @@ -134,11 +137,12 @@ const butttondata = [ defaultButtons.mainListDeleteBtn({hasPermi:'wms:team:delete'}), // 删除 ] -// 列表-操作按钮事件 +// 列表-操作按钮事件 const buttonTableClick = async (val, row) => { if (val == 'edit') { // 编辑 // const res = await TeamApi.getItempackaging(row.id) - openForm('update', row) + // openForm('update', row) + basicFormRef.value.open('update', row) } else if (val == 'delete') { // 删除 handleDelete(row.id) } @@ -152,13 +156,13 @@ const openForm = (type: string, row?: any) => { if (item.field == 'code') { item.componentProps.disabled = true } - }) + }) }else { Team.allSchemas.formSchema.forEach((item) => { if (item.field == 'code') { item.componentProps.disabled = false } - }) + }) } basicFormRef.value.open(type, row) } @@ -186,6 +190,9 @@ const formsSuccess = async (formType,data) => { basicFormRef.value.dialogVisible = false getList() } +const getData = async() => { + getList(); +} /** 详情操作 */ const detailRef = ref() @@ -253,4 +260,4 @@ onMounted(async() => { getList() importTemplateData.templateUrl = await TeamApi.importTemplate() }) - \ No newline at end of file + diff --git a/src/views/wms/basicDataManage/orderManage/team/team.data.ts b/src/views/wms/basicDataManage/orderManage/team/team.data.ts index 0bc377788..81a9335f7 100644 --- a/src/views/wms/basicDataManage/orderManage/team/team.data.ts +++ b/src/views/wms/basicDataManage/orderManage/team/team.data.ts @@ -24,10 +24,43 @@ export const Team = useCrudSchemas(reactive([ isSearch: true, }, { - label: '成员', + label: '车间代码', + field: 'workshopCode', + sort: 'custom', + isSearch: true, + table: { + width: 120 + } + }, + { + label: '产线代码', + field: 'productionLineCode', + sort: 'custom', + isSearch: true, + table: { + width: 120 + } + }, + { + label: '班组类型', + field: 'teamGroup', + sort: 'custom', + dictType: DICT_TYPE.BASIC_TEAM_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 120 + } + }, + { + label: '班组成员', field: 'members', sort: 'custom', isSearch: true, + table: { + width: 200 + } }, { label: '是否可用', @@ -131,7 +164,8 @@ export const Team = useCrudSchemas(reactive([ isDetail: false, isForm: false , table: { - fixed: 'right' + fixed: 'right', + width: 110 } } ])) @@ -155,4 +189,27 @@ export const TeamRules = reactive({ available: [ { required: true, message: '请选择是否可用', trigger: 'change' } ], -}) \ No newline at end of file + treamGroup: [ + { required: true, message: '请选择班组类型', trigger: 'change' }, + ], +}) + +export const searchUser = useCrudSchemas(reactive([ + { + label: '用户名', + field: 'username', + sort: 'custom', + isSearch: true, + }, + { + label: '用户昵称', + field: 'nickname', + sort: 'custom', + isSearch: true, + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + } + ])) diff --git a/src/views/wms/basicDataManage/orderManage/team/teamForm.vue b/src/views/wms/basicDataManage/orderManage/team/teamForm.vue new file mode 100644 index 000000000..5abcc0c42 --- /dev/null +++ b/src/views/wms/basicDataManage/orderManage/team/teamForm.vue @@ -0,0 +1,441 @@ + + + +