diff --git a/src/views/mes/workstation/components/Detail.vue b/src/views/mes/workstation/components/Detail.vue index c8b25e83c..81dc468ec 100644 --- a/src/views/mes/workstation/components/Detail.vue +++ b/src/views/mes/workstation/components/Detail.vue @@ -33,7 +33,7 @@ { //主表所需的参数 const masterParmas = ref({ - masterId: '', //主表id + code: '', //主表id number: '', //主表单据号 - status: '' //主表状态 用于控制子表新增编辑按钮显示情况 + status: '', //主表状态 用于控制子表新增编辑按钮显示情况 }) // 列表头部按钮 @@ -395,11 +395,11 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: // 加载明细列表 if (!props.isBasic) { // 设置主表id - masterParmas.value.masterId = row.id + masterParmas.value.code = row.id masterParmas.value.number = row.number masterParmas.value.status = row.status tableObjectRef.value.params = { - masterId: row.id + code: row.code } await getList() } @@ -549,8 +549,8 @@ const buttonTableClick = async (val, row) => { } /** 添加/修改操作 */ const openForm = async (type: string, row?: number) => { - formRef.value.open(type, row, masterParmas.value) - emit('detailOpenForm', type, row) + // formRef.value.open(type, row, masterParmas.value) + emit('detailOpenForm', type, masterParmas.value) } // form 提交 const submitForm = async (formType, data) => { @@ -614,7 +614,7 @@ const searchFormClick = async (searchData) => { isSearch: true, filters: searchData.filters ? searchData.filters - : [{ column: 'masterId', action: '==', value: masterParmas.value.masterId }] + : [{ column: 'code', action: '==', value: masterParmas.value.code }] } detailAllSchemasRef.value = props.detailAllSchemas tableObjectRef.value = tableObject @@ -668,7 +668,7 @@ watch( const { tableObject, tableMethods } = useTable({ getListApi: props.apiPage // 分页接口 }) - tableObject.params.masterId = masterParmas.value.masterId + tableObject.params.code = masterParmas.value.code detailAllSchemasRef.value = props.detailAllSchemas if (props.tableObjectExtend) { props.tableObjectExtend.forEach(item => { diff --git a/src/views/mes/workstation/index.vue b/src/views/mes/workstation/index.vue index 0ee83a64d..8514b3808 100644 --- a/src/views/mes/workstation/index.vue +++ b/src/views/mes/workstation/index.vue @@ -60,18 +60,19 @@ :tabs="TabsList" :apiDelete=tabsDeleteApi @changeTabs="changeTabs" - @tableFormButton="tableFormButton" :detailButtonIsShowAdd="true" :detailButtonIsShowDelete="true" :detailButtonIsShowEdit="false" + @detailOpenForm="detailOpenForm" /> { // 子包装数据 const detailAllSchemas = ref(Team.allSchemas) const apiPage = ref(WorkstationApi.getTeamPage) -const tableKey = ref("workstationDetail"); +const tableKey = ref("Team"); // tabs 切换事件 const changeTabs = (data) =>{ tableKey.value = data.prop @@ -327,16 +328,6 @@ const changeTabs = (data) =>{ tabsDeleteApi = WorkstationApi.deleteOperstepsRelation } } -// const buttondataTable = ref([{ -// label: '取消关联', -// name: 'viewParentPickingNumber', -// hide: false, -// type: 'primary', -// icon: '', -// color: '', -// hasPermi: '', -// link: true, // 文本展现按钮 -// }]) const teamListRef = ref() const { tableObject: selectTeamListTableData, tableMethods: selectTeamListTableMethods } = useTable({ getListApi: WorkstationApi.checkTeamPageList @@ -360,32 +351,31 @@ const { tableObject: selectOperstepsListTableData, tableMethods: OperstepsListTa getListApi: WorkstationApi.checkOperstepsPageList }) const { getList:selectOperstepsList } = OperstepsListTableMethods - -const tableFormButton = async (val , row) => { - if(val == 'Team'){ +const detailOpenForm = async (type, params) => { + if (tableKey.value == 'Team') { selectTeamListTableData.params = { - workstationCode:row.workstationCode + workstationCode: params.code } await selectTeamList() - teamListRef.value.open('create', row, null,'viewDetail')//查看明细数据 - }else if(val == 'Equipment'){ + teamListRef.value.open('viewDetail', params, null, 'viewDetail')//查看明细数据 + } else if (tableKey.value == 'Equipment') { selectEquipmentListTableData.params = { - workstationCode:row.workstationCode + workstationCode: params.code } await selectEquipmentList() - equipmentListRef.value.open('create', row, null,'viewDetail')//查看明细数据 - }else if(val == 'Process'){ + equipmentListRef.value.open('viewDetail', params.code, null, 'viewDetail')//查看明细数据 + } else if (tableKey.value == 'Process') { selectProcessListTableData.params = { - workstationCode:row.workstationCode + workstationCode: params.code } await selectProcessListList() - processListRef.value.open('create', row, null,'viewDetail')//查看明细数据 - }else if(val == 'Production'){ + processListRef.value.open('viewDetail', params.code, null, 'viewDetail')//查看明细数据 + } else if (tableKey.value == 'Production') { selectOperstepsListTableData.params = { - workstationCode:row.workstationCode + workstationCode: params.code } await selectOperstepsList() - operstepsListRef.value.open('create', row, null,'viewDetail')//查看明细数据 + operstepsListRef.value.open('viewDetail', params.code, null, 'viewDetail')//查看明细数据 } } diff --git a/src/views/mes/workstation/workstation.data.ts b/src/views/mes/workstation/workstation.data.ts index 8087e9fac..9813e222b 100644 --- a/src/views/mes/workstation/workstation.data.ts +++ b/src/views/mes/workstation/workstation.data.ts @@ -131,22 +131,7 @@ export const Team = useCrudSchemas(reactive([ isTableForm:true, } ])) -export const TeamSelect = useCrudSchemas(reactive([ - { - label: '代码', - field: 'code', - sort: 'custom', - isSearch: true, - isForm: false - }, - { - label: '名称', - field: 'name', - sort: 'custom', - isSearch: true, - isForm: false - } -])) + export const Equipment = useCrudSchemas(reactive([ { label: '代码',