Browse Source

1、工位能力关联

master_hella_20240701
bjang03 7 months ago
parent
commit
33d1c6920b
  1. 47
      src/api/mes/workstation/index.ts
  2. 18
      src/views/mes/workstation/index.vue
  3. 112
      src/views/mes/workstation/workstation.data.ts

47
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 })
}

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

@ -68,6 +68,7 @@
:detailButtonIsShowEdit="false"
@detailOpenForm="detailOpenForm"
@searchTableSuccessDetail="searchTableSuccess"
:detailButtonIsShowFilter="false"
/>
<BasicForm
ref="tmpPopListRef"
@ -78,6 +79,7 @@
<script setup lang="ts">
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()

112
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<CrudSchema[]>([
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择生产线代码', // 输入框占位文本
searchListPlaceholder: '请选择生产线', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '生产线信息', // 查询弹窗标题
searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类
@ -81,7 +93,7 @@ export const Workstation = useCrudSchemas(reactive<CrudSchema[]>([
searchCondition: [{
key:'workshopCode',
value:'workshopCode',
message: '请填写车间代码!',
message: '请选择车间!',
isMainValue: true
},{
key: 'available',
@ -91,6 +103,31 @@ export const Workstation = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
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<CrudSchema[]>([
}
}
]))
export const select = useCrudSchemas(reactive<CrudSchema[]>([
export const searchPop = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '代码',
field: 'code',
@ -228,7 +265,33 @@ export const Opersteps = useCrudSchemas(reactive<CrudSchema[]>([
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,
}
]))
export const equipmentPopList = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '选择设备',
@ -243,7 +306,7 @@ export const equipmentPopList = useCrudSchemas(reactive<CrudSchema[]>([
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<CrudSchema[]>([
}
}
]))
export const processPopList = useCrudSchemas(reactive<CrudSchema[]>([
export const PostList = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '选择工序',
label: '选择岗位',
field: 'list',
sort: 'custom',
isSearch: false,
@ -265,10 +328,10 @@ export const processPopList = useCrudSchemas(reactive<CrudSchema[]>([
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<CrudSchema[]>([
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<CrudSchema[]>([
}
}
]))
export const abilityPopList = useCrudSchemas(reactive<CrudSchema[]>([
{
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
}]
}
}
}
]))

Loading…
Cancel
Save