From 33d1c6920be1f09c18057fe1ba6796e22a9225b1 Mon Sep 17 00:00:00 2001 From: bjang03 Date: Wed, 17 Apr 2024 10:16:17 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=B7=A5=E4=BD=8D=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E5=85=B3=E8=81=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mes/workstation/index.ts | 47 ++++++-- src/views/mes/workstation/index.vue | 18 ++- src/views/mes/workstation/workstation.data.ts | 112 ++++++++++++++++-- 3 files changed, 150 insertions(+), 27 deletions(-) diff --git a/src/api/mes/workstation/index.ts b/src/api/mes/workstation/index.ts index 08794d283..2c17c0642 100644 --- a/src/api/mes/workstation/index.ts +++ b/src/api/mes/workstation/index.ts @@ -20,11 +20,6 @@ export const getWorkstationPage = async (params) => { } } -// 查询工位详情 -export const getWorkstation = async (id: number) => { - return await request.get({ url: `/mes/workstation/get?id=` + id }) -} - // 新增工位 export const createWorkstation = async (data: WorkstationVO) => { return await request.post({ url: `/mes/workstation/create`, data }) @@ -116,15 +111,14 @@ export const deleteProcessRelation = async (processCodes:string[]) => { return await request.post({ url: `/mes/workstation-process/deleteRelation`, data }) } - export const getOperstepsPage = async (params) => { params.workstationCode = goalParams.workstationCode if (params.isSearch) { delete params.isSearch const data = {...params} - return await request.post({ url: '/strategy/workstation-opersteps/senior', data }) + return await request.post({ url: '/mes/workstation-opersteps/senior', data }) } else { - return await request.get({ url: `/strategy/workstation-opersteps/pageListByWorkstationCode`, params }) + return await request.get({ url: `/mes/workstation-opersteps/pageListByWorkstationCode`, params }) } } export const checkOperstepsPageList = async (params) => { @@ -132,9 +126,9 @@ export const checkOperstepsPageList = async (params) => { if (params.isSearch) { delete params.isSearch const data = {...params} - return await request.post({ url: '/strategy/workstation-opersteps/senior', data }) + return await request.post({ url: '/mes/workstation-opersteps/senior', data }) } else { - return await request.get({ url: `/strategy/workstation-opersteps/pageCheckListByWorkstationCode`, params }) + return await request.get({ url: `/mes/workstation-opersteps/pageCheckListByWorkstationCode`, params }) } } // 添加操作步骤关联 @@ -143,7 +137,7 @@ export const createOperstepsRelation = async (codes:string[]) => { workstationCode : goalParams.workstationCode, operstepsCodes : codes } - return await request.post({ url: `/strategy/workstation-opersteps/createRelation`, data }) + return await request.post({ url: `/mes/workstation-opersteps/createRelation`, data }) } // 删除操作步骤关联 @@ -152,5 +146,34 @@ export const deleteOperstepsRelation = async (codes:string[]) => { workstationCode : goalParams.workstationCode, operstepsCodes : codes } - return await request.post({ url: `/strategy/workstation-opersteps/deleteRelation`, data }) + return await request.post({ url: `/mes/workstation-opersteps/deleteRelation`, data }) +} + + +export const getAbilityPage = async (params) => { + params.workstationCode = goalParams.workstationCode + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/mes/workstation-ability/senior', data }) + } else { + return await request.get({ url: `/mes/workstation-ability/page`, params }) + } +} +// 添加能力关联 +export const createAbility = async (codes:string[]) => { + const data = { + workstationCode : goalParams.workstationCode, + abilityCodes : codes + } + return await request.post({ url: `/mes/workstation-ability/create`, data }) +} + +// 删除能力关联 +export const deleteAbility = async (codes:string[]) => { + const data = { + workstationCode : goalParams.workstationCode, + abilityCodes : codes + } + return await request.post({ url: `/mes/workstation-ability/delete`, data }) } diff --git a/src/views/mes/workstation/index.vue b/src/views/mes/workstation/index.vue index 09ee0e8db..38d0bfa1f 100644 --- a/src/views/mes/workstation/index.vue +++ b/src/views/mes/workstation/index.vue @@ -68,6 +68,7 @@ :detailButtonIsShowEdit="false" @detailOpenForm="detailOpenForm" @searchTableSuccessDetail="searchTableSuccess" + :detailButtonIsShowFilter="false" /> import { + Ability, abilityPopList, Equipment, equipmentPopList, Opersteps, @@ -87,7 +89,6 @@ import { WorkstationRules } from './workstation.data' import * as WorkstationApi from '@/api/mes/workstation' -import {goalParams} from '@/api/mes/workstation' import * as defaultButtons from '@/utils/disposition/defaultButtons' import TableHead from '@/components/TableHead/src/TableHead.vue' import Detail from './components/Detail.vue' @@ -105,7 +106,6 @@ const tableColumns = ref(Workstation.allSchemas.tableColumns) // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef) => { nextTick(async () => { - if (formRef) { const setV = {} setV[formField] = val[0][searchField] @@ -229,7 +229,7 @@ onMounted(async () => { /** 详情操作 */ const detailRef = ref() const openDetail = (row: any, titleName: any, titleValue: any) => { - goalParams.workstationCode = row.code + WorkstationApi.goalParams.workstationCode = row.code detailRef.value.openDetail(row, titleName, titleValue, 'basicWorkstation') } // 子包装数据 @@ -252,6 +252,18 @@ const changeTabs = (data) =>{ tabsDeleteApi = WorkstationApi.deleteOperstepsRelation tabsCreateApi = WorkstationApi.createOperstepsRelation tmpPopList = stepPopList.allSchemas + }else if(data.prop == 'Ability'){ + apiPage.value = WorkstationApi.getAbilityPage + detailAllSchemas.value = Ability.allSchemas + tabsDeleteApi = WorkstationApi.deleteAbility + tabsCreateApi = WorkstationApi.createAbility + tmpPopList = abilityPopList.allSchemas + }else if(data.prop == 'Post'){ + apiPage.value = WorkstationApi.getOperstepsPage + detailAllSchemas.value = Opersteps.allSchemas + tabsDeleteApi = WorkstationApi.deleteOperstepsRelation + tabsCreateApi = WorkstationApi.createOperstepsRelation + tmpPopList = stepPopList.allSchemas } } const tmpPopListRef = ref() diff --git a/src/views/mes/workstation/workstation.data.ts b/src/views/mes/workstation/workstation.data.ts index 6d405e1a9..7770e3a73 100644 --- a/src/views/mes/workstation/workstation.data.ts +++ b/src/views/mes/workstation/workstation.data.ts @@ -7,13 +7,17 @@ import { Productionline } from "@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data"; import * as ProductionlineApi from "@/api/wms/productionline"; +import * as ProcessApi from "@/api/mes/process"; +import * as AbilityInfoApi from "@/api/mes/abilityInfo"; +import {AbilityInfo} from "@/views/mes/abilityInfo/abilityInfo.data"; // 表单校验 export const WorkstationRules = reactive({ code: [required], name: [required], workshopCode:[required], - productionLineCode: [required] + productionLineCode: [required], + processCode: [required] }) export const TabsList = [{ label: "设备", @@ -22,6 +26,14 @@ export const TabsList = [{ { label: "操作步骤", prop: 'Opersteps', + }, + { + label: "能力", + prop: 'Ability', + }, + { + label: "岗位", + prop: 'Post', } ] @@ -73,7 +85,7 @@ export const Workstation = useCrudSchemas(reactive([ // labelMessage: '信息提示说明!!!', componentProps: { isSearchList: true, // 开启查询弹窗 - searchListPlaceholder: '请选择生产线代码', // 输入框占位文本 + searchListPlaceholder: '请选择生产线', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '生产线信息', // 查询弹窗标题 searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类 @@ -81,7 +93,7 @@ export const Workstation = useCrudSchemas(reactive([ searchCondition: [{ key:'workshopCode', value:'workshopCode', - message: '请填写车间代码!', + message: '请选择车间!', isMainValue: true },{ key: 'available', @@ -91,6 +103,31 @@ export const Workstation = useCrudSchemas(reactive([ } } }, + { + label: '工序代码', + field: 'processCode', + sort: 'custom', + isSearch: true, + table: { + width: 150 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择工序', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '工序信息', // 查询弹窗标题 + searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类 + searchPage: ProcessApi.getProcessPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + } + }, { label: '生效时间', field: 'activeTime', @@ -157,7 +194,7 @@ export const Workstation = useCrudSchemas(reactive([ } } ])) -export const select = useCrudSchemas(reactive([ +export const searchPop = useCrudSchemas(reactive([ { label: '代码', field: 'code', @@ -228,7 +265,33 @@ export const Opersteps = useCrudSchemas(reactive([ isTableForm:true, } ])) - +export const Ability = 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 equipmentPopList = useCrudSchemas(reactive([ { label: '选择设备', @@ -243,7 +306,7 @@ export const equipmentPopList = useCrudSchemas(reactive([ searchListPlaceholder: '选择设备', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '选择设备', // 查询弹窗标题 - searchAllSchemas: select.allSchemas, // 查询弹窗所需类 + searchAllSchemas: searchPop.allSchemas, // 查询弹窗所需类 searchPage: WorkstationApi.checkEquipmentPageList, // 查询弹窗所需分页方法 searchCondition: [{ key: 'available', @@ -254,9 +317,9 @@ export const equipmentPopList = useCrudSchemas(reactive([ } } ])) -export const processPopList = useCrudSchemas(reactive([ +export const PostList = useCrudSchemas(reactive([ { - label: '选择工序', + label: '选择岗位', field: 'list', sort: 'custom', isSearch: false, @@ -265,10 +328,10 @@ export const processPopList = useCrudSchemas(reactive([ componentProps: { multiple:true, isSearchList: true, // 开启查询弹窗 - searchListPlaceholder: '选择工序', // 输入框占位文本 + searchListPlaceholder: '选择岗位', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 - searchTitle: '选择工序', // 查询弹窗标题 - searchAllSchemas: select.allSchemas, // 查询弹窗所需类 + searchTitle: '选择岗位', // 查询弹窗标题 + searchAllSchemas: searchPop.allSchemas, // 查询弹窗所需类 searchPage: WorkstationApi.checkProcessPageList, // 查询弹窗所需分页方法 searchCondition: [{ key: 'available', @@ -293,7 +356,7 @@ export const stepPopList = useCrudSchemas(reactive([ searchListPlaceholder: '选择操作步骤', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '选择操作步骤', // 查询弹窗标题 - searchAllSchemas: select.allSchemas, // 查询弹窗所需类 + searchAllSchemas: searchPop.allSchemas, // 查询弹窗所需类 searchPage: WorkstationApi.checkOperstepsPageList, // 查询弹窗所需分页方法 searchCondition: [{ key: 'available', @@ -304,3 +367,28 @@ export const stepPopList = useCrudSchemas(reactive([ } } ])) +export const abilityPopList = useCrudSchemas(reactive([ + { + label: '选择能力', + field: 'list', + sort: 'custom', + isSearch: false, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + multiple:true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '选择能力', // 输入框占位文本 + searchField: 'ablityCode', // 查询弹窗赋值字段 + searchTitle: '选择能力', // 查询弹窗标题 + searchAllSchemas: AbilityInfo.allSchemas, // 查询弹窗所需类 + searchPage: AbilityInfoApi.getAbilityInfoPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + } + } +]))