Browse Source

1、工位能力关联

master_hella_20240701
bjang03 1 year ago
parent
commit
1d53ed2bfe
  1. 30
      src/api/mes/workstation/index.ts
  2. 16
      src/views/mes/workstation/index.vue
  3. 7
      src/views/mes/workstation/workstation.data.ts

30
src/api/mes/workstation/index.ts

@ -42,7 +42,7 @@ export const getEquipmentPage = async (params) => {
const data = {...params} const data = {...params}
return await request.post({ url: '/mes/equipment/senior', data }) return await request.post({ url: '/mes/equipment/senior', data })
} else { } else {
return await request.get({ url: `/mes/equipment/pageListByWorkstationCode`, params }) return await request.get({ url: `/mes/equipment/getEquipmentPage`, params })
} }
} }
// 查询选择设备列表 // 查询选择设备列表
@ -53,11 +53,11 @@ export const checkEquipmentPageList = async (params) => {
const data = {...params} const data = {...params}
return await request.post({ url: '/mes/equipment/senior', data }) return await request.post({ url: '/mes/equipment/senior', data })
} else { } else {
return await request.get({ url: `/mes/equipment/pageCheckListByWorkstationCode`, params }) return await request.get({ url: `/mes/equipment/pageCheckList`, params })
} }
} }
// 添加设备关联 // 添加设备关联
export const createEquipmentRelation = async (equipmentCodes:string[]) => { export const createEquipment = async (equipmentCodes:string[]) => {
const data = { const data = {
workstationCode : goalParams.workstationCode, workstationCode : goalParams.workstationCode,
equipmentCodes : equipmentCodes equipmentCodes : equipmentCodes
@ -66,7 +66,7 @@ export const createEquipmentRelation = async (equipmentCodes:string[]) => {
} }
// 删除设备关联 // 删除设备关联
export const deleteEquipmentRelation = async (equipmentCodes:string[]) => { export const deleteEquipment = async (equipmentCodes:string[]) => {
const data = { const data = {
workstationCode : goalParams.workstationCode, workstationCode : goalParams.workstationCode,
equipmentCodes : equipmentCodes equipmentCodes : equipmentCodes
@ -118,35 +118,25 @@ export const getOperstepsPage = async (params) => {
const data = {...params} const data = {...params}
return await request.post({ url: '/mes/workstation-opersteps/senior', data }) return await request.post({ url: '/mes/workstation-opersteps/senior', data })
} else { } else {
return await request.get({ url: `/mes/workstation-opersteps/pageListByWorkstationCode`, params }) return await request.get({ url: `/mes/workstation-opersteps/getWorkstationOperstepsPage`, params })
}
}
export const checkOperstepsPageList = async (params) => {
params.workstationCode = goalParams.workstationCode
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/workstation-opersteps/senior', data })
} else {
return await request.get({ url: `/mes/workstation-opersteps/pageCheckListByWorkstationCode`, params })
} }
} }
// 添加操作步骤关联 // 添加操作步骤关联
export const createOperstepsRelation = async (codes:string[]) => { export const createOpersteps = async (codes:string[]) => {
const data = { const data = {
workstationCode : goalParams.workstationCode, workstationCode : goalParams.workstationCode,
operstepsCodes : codes operstepsCodes : codes
} }
return await request.post({ url: `/mes/workstation-opersteps/createRelation`, data }) return await request.post({ url: `/mes/workstation-opersteps/create`, data })
} }
// 删除操作步骤关联 // 删除操作步骤关联
export const deleteOperstepsRelation = async (codes:string[]) => { export const deleteOpersteps = async (codes:string[]) => {
const data = { const data = {
workstationCode : goalParams.workstationCode, workstationCode : goalParams.workstationCode,
operstepsCodes : codes operstepsCodes : codes
} }
return await request.post({ url: `/mes/workstation-opersteps/deleteRelation`, data }) return await request.post({ url: `/mes/workstation-opersteps/delete`, data })
} }
@ -157,7 +147,7 @@ export const getAbilityPage = async (params) => {
const data = {...params} const data = {...params}
return await request.post({ url: '/mes/workstation-ability/senior', data }) return await request.post({ url: '/mes/workstation-ability/senior', data })
} else { } else {
return await request.get({ url: `/mes/workstation-ability/page`, params }) return await request.get({ url: `/mes/workstation-ability/getWorkstationAbilityPage`, params })
} }
} }
// 添加能力关联 // 添加能力关联

16
src/views/mes/workstation/index.vue

@ -94,8 +94,8 @@ import TableHead from '@/components/TableHead/src/TableHead.vue'
import Detail from './components/Detail.vue' import Detail from './components/Detail.vue'
defineOptions({ name: 'Workstation' }) defineOptions({ name: 'Workstation' })
let tabsDeleteApi = WorkstationApi.deleteEquipmentRelation let tabsDeleteApi = WorkstationApi.deleteEquipment
let tabsCreateApi = WorkstationApi.createEquipmentRelation let tabsCreateApi = WorkstationApi.createEquipment
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const route = useRoute() // const route = useRoute() //
@ -243,14 +243,14 @@ const changeTabs = (data) =>{
if(data.prop == 'Equipment'){ if(data.prop == 'Equipment'){
apiPage.value = WorkstationApi.getEquipmentPage apiPage.value = WorkstationApi.getEquipmentPage
detailAllSchemas.value = Equipment.allSchemas detailAllSchemas.value = Equipment.allSchemas
tabsDeleteApi = WorkstationApi.deleteEquipmentRelation tabsDeleteApi = WorkstationApi.deleteEquipment
tabsCreateApi = WorkstationApi.createEquipmentRelation tabsCreateApi = WorkstationApi.createEquipment
tmpPopList = equipmentPopList.allSchemas tmpPopList = equipmentPopList.allSchemas
}else if(data.prop == 'Opersteps'){ }else if(data.prop == 'Opersteps'){
apiPage.value = WorkstationApi.getOperstepsPage apiPage.value = WorkstationApi.getOperstepsPage
detailAllSchemas.value = Opersteps.allSchemas detailAllSchemas.value = Opersteps.allSchemas
tabsDeleteApi = WorkstationApi.deleteOperstepsRelation tabsDeleteApi = WorkstationApi.deleteOpersteps
tabsCreateApi = WorkstationApi.createOperstepsRelation tabsCreateApi = WorkstationApi.createOpersteps
tmpPopList = stepPopList.allSchemas tmpPopList = stepPopList.allSchemas
}else if(data.prop == 'Ability'){ }else if(data.prop == 'Ability'){
apiPage.value = WorkstationApi.getAbilityPage apiPage.value = WorkstationApi.getAbilityPage
@ -261,8 +261,8 @@ const changeTabs = (data) =>{
}else if(data.prop == 'Post'){ }else if(data.prop == 'Post'){
apiPage.value = WorkstationApi.getOperstepsPage apiPage.value = WorkstationApi.getOperstepsPage
detailAllSchemas.value = Opersteps.allSchemas detailAllSchemas.value = Opersteps.allSchemas
tabsDeleteApi = WorkstationApi.deleteOperstepsRelation tabsDeleteApi = WorkstationApi.deleteOpersteps
tabsCreateApi = WorkstationApi.createOperstepsRelation tabsCreateApi = WorkstationApi.createOpersteps
tmpPopList = stepPopList.allSchemas tmpPopList = stepPopList.allSchemas
} }
} }

7
src/views/mes/workstation/workstation.data.ts

@ -10,6 +10,7 @@ import * as ProductionlineApi from "@/api/wms/productionline";
import * as ProcessApi from "@/api/mes/process"; import * as ProcessApi from "@/api/mes/process";
import * as AbilityInfoApi from "@/api/mes/abilityInfo"; import * as AbilityInfoApi from "@/api/mes/abilityInfo";
import {AbilityInfo} from "@/views/mes/abilityInfo/abilityInfo.data"; import {AbilityInfo} from "@/views/mes/abilityInfo/abilityInfo.data";
import {getOperstepsPage} from "@/api/mes/opersteps";
// 表单校验 // 表单校验
export const WorkstationRules = reactive({ export const WorkstationRules = reactive({
@ -354,10 +355,10 @@ export const stepPopList = useCrudSchemas(reactive<CrudSchema[]>([
multiple:true, multiple:true,
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '选择操作步骤', // 输入框占位文本 searchListPlaceholder: '选择操作步骤', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段 searchField: 'stepsCode', // 查询弹窗赋值字段
searchTitle: '选择操作步骤', // 查询弹窗标题 searchTitle: '选择操作步骤', // 查询弹窗标题
searchAllSchemas: searchPop.allSchemas, // 查询弹窗所需类 searchAllSchemas: Opersteps.allSchemas, // 查询弹窗所需类
searchPage: WorkstationApi.checkOperstepsPageList, // 查询弹窗所需分页方法 searchPage: getOperstepsPage, // 查询弹窗所需分页方法
searchCondition: [{ searchCondition: [{
key: 'available', key: 'available',
value: 'TRUE', value: 'TRUE',

Loading…
Cancel
Save