Browse Source

1、工位能力关联

master_hella_20240701
bjang03 7 months ago
parent
commit
c99842953d
  1. 65
      src/api/mes/workstation/index.ts
  2. 17
      src/views/mes/workstation/index.vue
  3. 93
      src/views/mes/workstation/workstation.data.ts

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

@ -73,43 +73,7 @@ export const deleteEquipment = async (equipmentCodes:string[]) => {
}
return await request.post({ url: `/mes/equipment/deleteRelation`, data })
}
export const getProcessPage = async (params) => {
params.workstationCode = goalParams.workstationCode
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/workstation-process/senior', data })
} else {
return await request.get({ url: `/mes/workstation-process/pageListByWorkstationCode`, params })
}
}
export const checkProcessPageList = async (params) => {
params.workstationCode = goalParams.workstationCode
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/workstation-process/senior', data })
} else {
return await request.get({ url: `/mes/workstation-process/pageCheckListByWorkstationCode`, params })
}
}
// 添加工序关联
export const createProcessRelation = async (processCodes:string[]) => {
const data = {
workstationCode : goalParams.workstationCode,
processCodes : processCodes
}
return await request.post({ url: `/mes/workstation-process/createRelation`, data })
}
// 删除工序关联
export const deleteProcessRelation = async (processCodes:string[]) => {
const data = {
workstationCode : goalParams.workstationCode,
processCodes : processCodes
}
return await request.post({ url: `/mes/workstation-process/deleteRelation`, data })
}
export const getOperstepsPage = async (params) => {
params.workstationCode = goalParams.workstationCode
@ -139,7 +103,6 @@ export const deleteOpersteps = async (codes:string[]) => {
return await request.post({ url: `/mes/workstation-opersteps/delete`, data })
}
export const getAbilityPage = async (params) => {
params.workstationCode = goalParams.workstationCode
if (params.isSearch) {
@ -167,3 +130,31 @@ export const deleteAbility = async (codes:string[]) => {
}
return await request.post({ url: `/mes/workstation-ability/delete`, data })
}
// 查询工位岗位关联
export const getPostPage = async (params) => {
params.workstationCode = goalParams.workstationCode
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/workstation-post/senior', data })
} else {
return await request.get({ url: `/mes/workstation-post/getWorkstationPostPage`, params })
}
}
// 添加能力关联
export const createAPost = async (codes:string[]) => {
const data = {
workstationCode : goalParams.workstationCode,
postCodes : codes
}
return await request.post({ url: `/mes/workstation-post/create`, data })
}
// 删除能力关联
export const deletePost = async (codes:string[]) => {
const data = {
workstationCode : goalParams.workstationCode,
postCodes : codes
}
return await request.post({ url: `/mes/workstation-post/delete`, data })
}

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

@ -79,10 +79,9 @@
<script setup lang="ts">
import {
Ability, abilityPopList,
abilityPopList,
Equipment,
equipmentPopList,
Opersteps,
equipmentPopList, postPopList,
stepPopList,
TabsList,
Workstation,
@ -242,28 +241,24 @@ const changeTabs = (data) =>{
tableKey.value = data.prop
if(data.prop == 'Equipment'){
apiPage.value = WorkstationApi.getEquipmentPage
detailAllSchemas.value = Equipment.allSchemas
tabsDeleteApi = WorkstationApi.deleteEquipment
tabsCreateApi = WorkstationApi.createEquipment
tmpPopList = equipmentPopList.allSchemas
}else if(data.prop == 'Opersteps'){
apiPage.value = WorkstationApi.getOperstepsPage
detailAllSchemas.value = Opersteps.allSchemas
tabsDeleteApi = WorkstationApi.deleteOpersteps
tabsCreateApi = WorkstationApi.createOpersteps
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.deleteOpersteps
tabsCreateApi = WorkstationApi.createOpersteps
tmpPopList = stepPopList.allSchemas
apiPage.value = WorkstationApi.getPostPage
tabsDeleteApi = WorkstationApi.deletePost
tabsCreateApi = WorkstationApi.createAPost
tmpPopList = postPopList.allSchemas
}
}
const tmpPopListRef = ref()

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

@ -11,6 +11,8 @@ 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";
import {Opersteps} from "@/views/mes/opersteps/opersteps.data";
import {getPostPage} from "@/api/system/post";
// 表单校验
export const WorkstationRules = reactive({
@ -195,22 +197,6 @@ export const Workstation = useCrudSchemas(reactive<CrudSchema[]>([
}
}
]))
export const searchPop = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '代码',
field: 'code',
sort: 'custom',
isSearch: true,
isForm: false
},
{
label: '名称',
field: 'name',
sort: 'custom',
isSearch: true,
isForm: false
}
]))
export const Equipment = useCrudSchemas(reactive<CrudSchema[]>([
{
@ -239,7 +225,7 @@ export const Equipment = useCrudSchemas(reactive<CrudSchema[]>([
isTableForm:true
}
]))
export const Opersteps = useCrudSchemas(reactive<CrudSchema[]>([
export const Post = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '代码',
field: 'code',
@ -263,34 +249,7 @@ export const Opersteps = useCrudSchemas(reactive<CrudSchema[]>([
width: 150,
fixed: 'right'
},
isTableForm:true,
}
]))
export const Ability = useCrudSchemas(reactive<CrudSchema[]>([
{
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,
isTableForm:true
}
]))
export const equipmentPopList = useCrudSchemas(reactive<CrudSchema[]>([
@ -307,7 +266,7 @@ export const equipmentPopList = useCrudSchemas(reactive<CrudSchema[]>([
searchListPlaceholder: '选择设备', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '选择设备', // 查询弹窗标题
searchAllSchemas: searchPop.allSchemas, // 查询弹窗所需类
searchAllSchemas: Equipment.allSchemas, // 查询弹窗所需类
searchPage: WorkstationApi.checkEquipmentPageList, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
@ -318,9 +277,9 @@ export const equipmentPopList = useCrudSchemas(reactive<CrudSchema[]>([
}
}
]))
export const PostList = useCrudSchemas(reactive<CrudSchema[]>([
export const stepPopList = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '选择岗位',
label: '选择操作步骤',
field: 'list',
sort: 'custom',
isSearch: false,
@ -329,11 +288,11 @@ export const PostList = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: {
multiple:true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '选择岗位', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '选择岗位', // 查询弹窗标题
searchAllSchemas: searchPop.allSchemas, // 查询弹窗所需类
searchPage: WorkstationApi.checkProcessPageList, // 查询弹窗所需分页方法
searchListPlaceholder: '选择操作步骤', // 输入框占位文本
searchField: 'stepsCode', // 查询弹窗赋值字段
searchTitle: '选择操作步骤', // 查询弹窗标题
searchAllSchemas: Opersteps.allSchemas, // 查询弹窗所需类
searchPage: getOperstepsPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
@ -343,9 +302,9 @@ export const PostList = useCrudSchemas(reactive<CrudSchema[]>([
}
}
]))
export const stepPopList = useCrudSchemas(reactive<CrudSchema[]>([
export const abilityPopList = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '选择操作步骤',
label: '选择能力',
field: 'list',
sort: 'custom',
isSearch: false,
@ -354,11 +313,11 @@ export const stepPopList = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: {
multiple:true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '选择操作步骤', // 输入框占位文本
searchField: 'stepsCode', // 查询弹窗赋值字段
searchTitle: '选择操作步骤', // 查询弹窗标题
searchAllSchemas: Opersteps.allSchemas, // 查询弹窗所需类
searchPage: getOperstepsPage, // 查询弹窗所需分页方法
searchListPlaceholder: '选择能力', // 输入框占位文本
searchField: 'ablityCode', // 查询弹窗赋值字段
searchTitle: '选择能力', // 查询弹窗标题
searchAllSchemas: AbilityInfo.allSchemas, // 查询弹窗所需类
searchPage: AbilityInfoApi.getAbilityInfoPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
@ -368,9 +327,9 @@ export const stepPopList = useCrudSchemas(reactive<CrudSchema[]>([
}
}
]))
export const abilityPopList = useCrudSchemas(reactive<CrudSchema[]>([
export const postPopList = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '选择能力',
label: '选择岗位',
field: 'list',
sort: 'custom',
isSearch: false,
@ -379,11 +338,11 @@ export const abilityPopList = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: {
multiple:true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '选择能力', // 输入框占位文本
searchField: 'ablityCode', // 查询弹窗赋值字段
searchTitle: '选择能力', // 查询弹窗标题
searchAllSchemas: AbilityInfo.allSchemas, // 查询弹窗所需类
searchPage: AbilityInfoApi.getAbilityInfoPage, // 查询弹窗所需分页方法
searchListPlaceholder: '选择岗位', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '选择岗位', // 查询弹窗标题
searchAllSchemas: Post.allSchemas, // 查询弹窗所需类
searchPage: getPostPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',

Loading…
Cancel
Save