Browse Source

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

master_hella_20240701
bjang03 8 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 = () => {
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) => {
params.workstationCode = goalParams.workstationCode
if (params.isSearch) {

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

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

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

@ -16,10 +16,6 @@ export const WorkstationRules = reactive({
productionLineCode: [required]
})
export const TabsList = [{
label: "班组",
prop: 'Team',
},
{
label: "设备",
prop: 'Equipment',
},
@ -280,30 +276,7 @@ export const Opersteps = useCrudSchemas(reactive<CrudSchema[]>([
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[]>([
{
label: '选择设备',

Loading…
Cancel
Save