Browse Source

1、工位能力关联

master_hella_20240701
bjang03 7 months 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}
return await request.post({ url: '/mes/equipment/senior', data })
} 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}
return await request.post({ url: '/mes/equipment/senior', data })
} 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 = {
workstationCode : goalParams.workstationCode,
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 = {
workstationCode : goalParams.workstationCode,
equipmentCodes : equipmentCodes
@ -118,35 +118,25 @@ export const getOperstepsPage = async (params) => {
const data = {...params}
return await request.post({ url: '/mes/workstation-opersteps/senior', data })
} else {
return await request.get({ url: `/mes/workstation-opersteps/pageListByWorkstationCode`, 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 })
return await request.get({ url: `/mes/workstation-opersteps/getWorkstationOperstepsPage`, params })
}
}
// 添加操作步骤关联
export const createOperstepsRelation = async (codes:string[]) => {
export const createOpersteps = async (codes:string[]) => {
const data = {
workstationCode : goalParams.workstationCode,
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 = {
workstationCode : goalParams.workstationCode,
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}
return await request.post({ url: '/mes/workstation-ability/senior', data })
} 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'
defineOptions({ name: 'Workstation' })
let tabsDeleteApi = WorkstationApi.deleteEquipmentRelation
let tabsCreateApi = WorkstationApi.createEquipmentRelation
let tabsDeleteApi = WorkstationApi.deleteEquipment
let tabsCreateApi = WorkstationApi.createEquipment
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
@ -243,14 +243,14 @@ const changeTabs = (data) =>{
if(data.prop == 'Equipment'){
apiPage.value = WorkstationApi.getEquipmentPage
detailAllSchemas.value = Equipment.allSchemas
tabsDeleteApi = WorkstationApi.deleteEquipmentRelation
tabsCreateApi = WorkstationApi.createEquipmentRelation
tabsDeleteApi = WorkstationApi.deleteEquipment
tabsCreateApi = WorkstationApi.createEquipment
tmpPopList = equipmentPopList.allSchemas
}else if(data.prop == 'Opersteps'){
apiPage.value = WorkstationApi.getOperstepsPage
detailAllSchemas.value = Opersteps.allSchemas
tabsDeleteApi = WorkstationApi.deleteOperstepsRelation
tabsCreateApi = WorkstationApi.createOperstepsRelation
tabsDeleteApi = WorkstationApi.deleteOpersteps
tabsCreateApi = WorkstationApi.createOpersteps
tmpPopList = stepPopList.allSchemas
}else if(data.prop == 'Ability'){
apiPage.value = WorkstationApi.getAbilityPage
@ -261,8 +261,8 @@ const changeTabs = (data) =>{
}else if(data.prop == 'Post'){
apiPage.value = WorkstationApi.getOperstepsPage
detailAllSchemas.value = Opersteps.allSchemas
tabsDeleteApi = WorkstationApi.deleteOperstepsRelation
tabsCreateApi = WorkstationApi.createOperstepsRelation
tabsDeleteApi = WorkstationApi.deleteOpersteps
tabsCreateApi = WorkstationApi.createOpersteps
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 AbilityInfoApi from "@/api/mes/abilityInfo";
import {AbilityInfo} from "@/views/mes/abilityInfo/abilityInfo.data";
import {getOperstepsPage} from "@/api/mes/opersteps";
// 表单校验
export const WorkstationRules = reactive({
@ -354,10 +355,10 @@ export const stepPopList = useCrudSchemas(reactive<CrudSchema[]>([
multiple:true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '选择操作步骤', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchField: 'stepsCode', // 查询弹窗赋值字段
searchTitle: '选择操作步骤', // 查询弹窗标题
searchAllSchemas: searchPop.allSchemas, // 查询弹窗所需类
searchPage: WorkstationApi.checkOperstepsPageList, // 查询弹窗所需分页方法
searchAllSchemas: Opersteps.allSchemas, // 查询弹窗所需类
searchPage: getOperstepsPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',

Loading…
Cancel
Save