diff --git a/src/views/mes/workstation/components/Detail.vue b/src/views/mes/workstation/components/Detail.vue index e73351b0a..d950d28da 100644 --- a/src/views/mes/workstation/components/Detail.vue +++ b/src/views/mes/workstation/components/Detail.vue @@ -655,13 +655,12 @@ const openForm = async (type: string, row?: number) => { } // form 提交 const submitForm = async (formType, data) => { - console.log('submitForm',data) try { // 子表新增编辑校验 如果业务需要子表提交校验 需在主页详情组件添加 detailValidate 参数及方法 const rs = (await props.detailValidate) ? await props.detailValidate(data) : true if (!rs) return if (formType === 'create') { - await props.apiCreate(data) + await props.apiCreate(data.list.split(",")) message.success(t('common.createSuccess')) } else { await props.apiUpdate(data) diff --git a/src/views/mes/workstation/index.vue b/src/views/mes/workstation/index.vue index 7357c3f9a..327d30923 100644 --- a/src/views/mes/workstation/index.vue +++ b/src/views/mes/workstation/index.vue @@ -58,7 +58,7 @@ :apiDelete="tabsDeleteApi" :allSchemas="Workstation.allSchemas" :detailAllSchemas="detailAllSchemas" - :searchTableSchema="popList.allSchemas" + :searchTableSchema="tmpPopList" :detailAllSchemasRules="WorkstationRules" :apiPage="apiPage" :tabs="TabsList" @@ -70,7 +70,7 @@ /> @@ -86,7 +86,7 @@ import { TabsList, Team, Workstation, - WorkstationRules, popList + WorkstationRules, teamPopList,equipmentPopList,processPopList,stepPopList } from './workstation.data' import * as WorkstationApi from '@/api/mes/workstation' import * as defaultButtons from '@/utils/disposition/defaultButtons' @@ -273,6 +273,7 @@ const openDetail = (row: any, titleName: any, titleValue: any) => { const detailAllSchemas = ref(Team.allSchemas) const apiPage = ref(WorkstationApi.getTeamPage) const tableKey = ref("Team"); +let tmpPopList = teamPopList.allSchemas // tabs 切换事件 const changeTabs = (data) =>{ tableKey.value = data.prop @@ -281,23 +282,25 @@ const changeTabs = (data) =>{ detailAllSchemas.value = Team.allSchemas tabsDeleteApi = WorkstationApi.deleteTeamRelation tabsCreateApi = WorkstationApi.createTeamRelation + tmpPopList = teamPopList.allSchemas }else if(data.prop == 'Equipment'){ apiPage.value = WorkstationApi.getEquipmentPage detailAllSchemas.value = Equipment.allSchemas tabsDeleteApi = WorkstationApi.deleteEquipmentRelation tabsCreateApi = WorkstationApi.createEquipmentRelation - + tmpPopList = equipmentPopList.allSchemas }else if(data.prop == 'Process'){ apiPage.value = WorkstationApi.getProcessPage detailAllSchemas.value = Process.allSchemas tabsDeleteApi = WorkstationApi.deleteProcessRelation tabsCreateApi = WorkstationApi.createProcessRelation - + tmpPopList = processPopList.allSchemas }else if(data.prop == 'Opersteps'){ apiPage.value = WorkstationApi.getOperstepsPage detailAllSchemas.value = Opersteps.allSchemas tabsDeleteApi = WorkstationApi.deleteOperstepsRelation tabsCreateApi = WorkstationApi.createOperstepsRelation + tmpPopList = stepPopList.allSchemas } } const teamListRef = ref() diff --git a/src/views/mes/workstation/workstation.data.ts b/src/views/mes/workstation/workstation.data.ts index 013f12c8d..c1dd718ab 100644 --- a/src/views/mes/workstation/workstation.data.ts +++ b/src/views/mes/workstation/workstation.data.ts @@ -214,19 +214,19 @@ export const Opersteps = useCrudSchemas(reactive([ isTableForm:true, } ])) -export const popList = useCrudSchemas(reactive([ +export const teamPopList = useCrudSchemas(reactive([ { - label: '多选列表', - field: 'popCheckList', + label: '选择班组', + field: 'list', sort: 'custom', isSearch: false, form: { // labelMessage: '信息提示说明!!!', componentProps: { isSearchList: true, // 开启查询弹窗 - searchListPlaceholder: '请选择仓库代码', // 输入框占位文本 + searchListPlaceholder: '请选择选择班组', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 - searchTitle: '仓库信息', // 查询弹窗标题 + searchTitle: '选择班组', // 查询弹窗标题 searchAllSchemas: Team.allSchemas, // 查询弹窗所需类 searchPage: WorkstationApi.checkTeamPageList, // 查询弹窗所需分页方法 searchCondition: [{ @@ -238,3 +238,78 @@ export const popList = useCrudSchemas(reactive([ } } ])) +export const equipmentPopList = useCrudSchemas(reactive([ + { + label: '选择设备', + field: 'list', + sort: 'custom', + isSearch: false, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + multiple:true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '选择设备', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '选择设备', // 查询弹窗标题 + searchAllSchemas: Team.allSchemas, // 查询弹窗所需类 + searchPage: WorkstationApi.checkEquipmentPageList, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + } + } +])) +export const processPopList = useCrudSchemas(reactive([ + { + label: '选择工序', + field: 'list', + sort: 'custom', + isSearch: false, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + multiple:true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '选择工序', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '选择工序', // 查询弹窗标题 + searchAllSchemas: Team.allSchemas, // 查询弹窗所需类 + searchPage: WorkstationApi.checkProcessPageList, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + } + } +])) +export const stepPopList = useCrudSchemas(reactive([ + { + label: '选择操作步骤', + field: 'list', + sort: 'custom', + isSearch: false, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + multiple:true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '选择操作步骤', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '选择操作步骤', // 查询弹窗标题 + searchAllSchemas: Team.allSchemas, // 查询弹窗所需类 + searchPage: WorkstationApi.checkOperstepsPageList, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + } + } +]))