Browse Source

1、工位删除关联班组代码

master_hella_20240701
bjang03 5 months ago
parent
commit
ebaa587a4e
  1. 37
      src/api/mes/workstation/index.ts
  2. 18
      src/views/mes/workstation/index.vue
  3. 29
      src/views/mes/workstation/workstation.data.ts

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

@ -48,45 +48,8 @@ export const exportWorkstation = async (params) => {
// 下载用户导入模板 // 下载用户导入模板
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/mes/workstation/get-import-template' }) return request.download({ url: '/mes/workstation/get-import-template' })
}// 查询班组列表
export const getTeamPage = async (params) => {
params.workstationCode = goalParams.workstationCode
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/team/senior', data })
} else {
return await request.get({ url: `/mes/team/pageListByWorkstationCode`, params })
}
}
// 查询选择班组列表
export const checkTeamPageList = async (params) => {
params.workstationCode = goalParams.workstationCode
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/team/senior', data })
} else {
return await request.get({ url: `/mes/team/pageCheckListByWorkstationCode`, params })
}
}
// 添加班组关联
export const createTeamRelation = async (teamCodes:string[]) => {
const data = {
workstationCode : goalParams.workstationCode,
teamCodes : teamCodes
}
return await request.post({ url: `/mes/team/createRelation`, data })
} }
// 删除班组关联
export const deleteTeamRelation = async (teamCodes:string[]) => {
const data = {
workstationCode : goalParams.workstationCode,
teamCodes : teamCodes
}
return await request.post({ url: `/mes/team/deleteRelation`, data })
}
export const getEquipmentPage = async (params) => { export const getEquipmentPage = async (params) => {
params.workstationCode = goalParams.workstationCode params.workstationCode = goalParams.workstationCode
if (params.isSearch) { if (params.isSearch) {

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

@ -86,7 +86,7 @@ import {
TabsList, TabsList,
Team, Team,
Workstation, Workstation,
WorkstationRules, teamPopList,equipmentPopList,processPopList,stepPopList WorkstationRules,equipmentPopList,processPopList,stepPopList
} from './workstation.data' } from './workstation.data'
import * as WorkstationApi from '@/api/mes/workstation' import * as WorkstationApi from '@/api/mes/workstation'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
@ -97,8 +97,8 @@ import {
} from "@/api/mes/workstation"; } from "@/api/mes/workstation";
import Detail from './components/Detail.vue' import Detail from './components/Detail.vue'
defineOptions({ name: 'Workstation' }) defineOptions({ name: 'Workstation' })
let tabsDeleteApi = WorkstationApi.deleteTeamRelation let tabsDeleteApi = WorkstationApi.deleteEquipmentRelation
let tabsCreateApi = WorkstationApi.createTeamRelation let tabsCreateApi = WorkstationApi.createEquipmentRelation
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const route = useRoute() // const route = useRoute() //
@ -271,19 +271,13 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
} }
// //
const detailAllSchemas = ref(Team.allSchemas) const detailAllSchemas = ref(Team.allSchemas)
const apiPage = ref(WorkstationApi.getTeamPage) const apiPage = ref(WorkstationApi.getEquipmentPage)
const tableKey = ref("Team"); const tableKey = ref("Team");
let tmpPopList = teamPopList.allSchemas let tmpPopList = equipmentPopList.allSchemas
// tabs // tabs
const changeTabs = (data) =>{ const changeTabs = (data) =>{
tableKey.value = data.prop tableKey.value = data.prop
if(data.prop == 'Team'){ if(data.prop == 'Equipment'){
apiPage.value = WorkstationApi.getTeamPage
detailAllSchemas.value = Team.allSchemas
tabsDeleteApi = WorkstationApi.deleteTeamRelation
tabsCreateApi = WorkstationApi.createTeamRelation
tmpPopList = teamPopList.allSchemas
}else 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.deleteEquipmentRelation

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

@ -16,10 +16,6 @@ export const WorkstationRules = reactive({
productionLineCode: [required] productionLineCode: [required]
}) })
export const TabsList = [{ export const TabsList = [{
label: "班组",
prop: 'Team',
},
{
label: "设备", label: "设备",
prop: 'Equipment', prop: 'Equipment',
}, },
@ -280,30 +276,7 @@ export const Opersteps = useCrudSchemas(reactive<CrudSchema[]>([
isTableForm:true, isTableForm:true,
} }
])) ]))
export const teamPopList = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '选择班组',
field: 'list',
sort: 'custom',
isSearch: false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择选择班组', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '选择班组', // 查询弹窗标题
searchAllSchemas: Team.allSchemas, // 查询弹窗所需类
searchPage: WorkstationApi.checkTeamPageList, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
}
]))
export const equipmentPopList = useCrudSchemas(reactive<CrudSchema[]>([ export const equipmentPopList = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '选择设备', label: '选择设备',

Loading…
Cancel
Save