From 86d7eab3aaf5919af3a2b783bfc1f516fbde04ee Mon Sep 17 00:00:00 2001 From: bjang03 Date: Fri, 29 Mar 2024 10:12:01 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1=E3=80=81=E5=A2=9E=E5=8A=A0=E5=B7=A5?= =?UTF-8?q?=E4=BD=8D=E6=93=8D=E4=BD=9C=E6=AD=A5=E9=AA=A4=E5=85=B3=E8=81=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mes/workstation/index.ts | 76 +++++---- .../mes/workstation/components/Detail.vue | 23 ++- .../mes/workstation/components/TableHead.vue | 160 ------------------ src/views/mes/workstation/index.vue | 59 ++++--- src/views/mes/workstation/workstation.data.ts | 6 +- 5 files changed, 93 insertions(+), 231 deletions(-) delete mode 100644 src/views/mes/workstation/components/TableHead.vue diff --git a/src/api/mes/workstation/index.ts b/src/api/mes/workstation/index.ts index 37694b15d..f697cb04a 100644 --- a/src/api/mes/workstation/index.ts +++ b/src/api/mes/workstation/index.ts @@ -62,7 +62,6 @@ export const getTeamPage = async (params) => { } // 查询选择班组列表 export const checkTeamPageList = async (params) => { - console.log(goalParams.workstationCode) params.workstationCode = goalParams.workstationCode if (params.isSearch) { delete params.isSearch @@ -73,18 +72,18 @@ export const checkTeamPageList = async (params) => { } } // 添加班组关联 -export const createTeamRelation = async (workstationCode,teamCodes:string[]) => { +export const createTeamRelation = async (teamCodes:string[]) => { const data = { - workstationCode : workstationCode, + workstationCode : goalParams.workstationCode, teamCodes : teamCodes } return await request.post({ url: `/mes/team/createRelation`, data }) } // 删除班组关联 -export const deleteTeamRelation = async (workstationCode,teamCodes:string[]) => { +export const deleteTeamRelation = async (teamCodes:string[]) => { const data = { - workstationCode : workstationCode, + workstationCode : goalParams.workstationCode, teamCodes : teamCodes } return await request.post({ url: `/mes/team/deleteRelation`, data }) @@ -113,89 +112,92 @@ export const checkEquipmentPageList = async (params) => { } } // 添加设备关联 -export const createEquipmentRelation = async (workstationCode,equipmentCodes:string[]) => { +export const createEquipmentRelation = async (equipmentCodes:string[]) => { const data = { - workstationCode : workstationCode, + workstationCode : goalParams.workstationCode, equipmentCodes : equipmentCodes } - return await request.post({ url: `/mes/team/createRelation`, data }) + return await request.post({ url: `/mes/equipment/createRelation`, data }) } // 删除设备关联 -export const deleteEquipmentRelation = async (workstationCode,equipmentCodes:string[]) => { +export const deleteEquipmentRelation = async (equipmentCodes:string[]) => { + debugger const data = { - workstationCode : workstationCode, + workstationCode : goalParams.workstationCode, equipmentCodes : equipmentCodes } - return await request.post({ url: `/mes/team/deleteRelation`, data }) + return await request.post({ url: `/mes/equipment/deleteRelation`, data }) } export const getProcessPage = async (params) => { if (params.isSearch) { delete params.isSearch const data = {...params} - return await request.post({ url: '/mes/production-process/senior', data }) + return await request.post({ url: '/mes/workstation-process/senior', data }) } else { - return await request.get({ url: `/mes/production-process/pageListByWorkstationCode`, params }) + return await request.get({ url: `/mes/workstation-process/pageListByWorkstationCode`, params }) } } export const checkProcessPageList = async (params) => { if (params.isSearch) { delete params.isSearch const data = {...params} - return await request.post({ url: '/mes/production-process/senior', data }) + return await request.post({ url: '/mes/workstation-process/senior', data }) } else { - return await request.get({ url: `/mes/production-process/pageCheckListByWorkstationCode`, params }) + return await request.get({ url: `/mes/workstation-process/pageCheckListByWorkstationCode`, params }) } } // 添加工序关联 -export const createProcessRelation = async (workstationCode,processCodes:string[]) => { +export const createProcessRelation = async (processCodes:string[]) => { const data = { - workstationCode : workstationCode, + workstationCode : goalParams.workstationCode, processCodes : processCodes } - return await request.post({ url: `/mes/production-process/createRelation`, data }) + return await request.post({ url: `/mes/workstation-process/createRelation`, data }) } // 删除工序关联 -export const deleteProcessRelation = async (workstationCode,processCodes:string[]) => { +export const deleteProcessRelation = async (processCodes:string[]) => { const data = { - workstationCode : workstationCode, + workstationCode : goalParams.workstationCode, processCodes : processCodes } - return await request.post({ url: `/mes/production-process/deleteRelation`, data }) + return await request.post({ url: `/mes/workstation-process/deleteRelation`, data }) } -export const getProductionPage = async (params) => { + + +export const getOperstepsPage = async (params) => { if (params.isSearch) { delete params.isSearch const data = {...params} - return await request.post({ url: '/mes/production-process/senior', data }) + return await request.post({ url: '/mes/workstation-process/senior', data }) } else { - return await request.get({ url: `/mes/production-process/pageListByWorkstationCode`, params }) + return await request.get({ url: `/mes/workstation-process/pageListByWorkstationCode`, params }) } } -export const checkProductionPageList = async (params) => { +export const checkOperstepsPageList = async (params) => { if (params.isSearch) { delete params.isSearch const data = {...params} - return await request.post({ url: '/mes/production-process/senior', data }) + return await request.post({ url: '/mes/workstation-process/senior', data }) } else { - return await request.get({ url: `/mes/production-process/pageCheckListByWorkstationCode`, params }) + return await request.get({ url: `/mes/workstation-process/pageCheckListByWorkstationCode`, params }) } } -// 添加产品关联 -export const createProductionRelation = async (workstationCode,productionCodes:string[]) => { +// 添加工序关联 +export const createOperstepsRelation = async (processCodes:string[]) => { const data = { - workstationCode : workstationCode, - productionCodes : productionCodes + workstationCode : goalParams.workstationCode, + processCodes : processCodes } - return await request.post({ url: `/mes/production-process/createRelation`, data }) + return await request.post({ url: `/mes/workstation-process/createRelation`, data }) } -// 删除产品关联 -export const deleteProductionRelation = async (workstationCode,productionCodes:string[]) => { +// 删除工序关联 +export const deleteOperstepsRelation = async (processCodes:string[]) => { const data = { - workstationCode : workstationCode, - productionCodes : productionCodes + workstationCode : goalParams.workstationCode, + processCodes : processCodes } - return await request.post({ url: `/mes/production-process/deleteRelation`, data }) + return await request.post({ url: `/mes/workstation-process/deleteRelation`, data }) } diff --git a/src/views/mes/workstation/components/Detail.vue b/src/views/mes/workstation/components/Detail.vue index 443256baf..c8b25e83c 100644 --- a/src/views/mes/workstation/components/Detail.vue +++ b/src/views/mes/workstation/components/Detail.vue @@ -138,6 +138,7 @@ @onBlur="onBlur" @formFormDateChange="formFormDateChange" /> + @@ -150,7 +151,7 @@ import * as RemarkApi from '@/api/wms/remark' import * as FileApi from '@/api/wms/file' import * as defaultButtons from '@/utils/disposition/defaultButtons' import BasicForm from '@/components/BasicForm/src/BasicForm.vue' -import TableHead from './TableHead.vue' +import TableHead from '@/components/TableHead/src/TableHead.vue' import DetailTable from '@/components/DetailTable/src/DetailTable.vue' defineOptions({ name: 'Detail' }) @@ -163,7 +164,7 @@ const routeName = ref() routeName.value = route.name routeName.value = routeName.value.substring(0, routeName.value.length - 4) + 'Detail' const updateKey = ref(0) -const addRef = ref() + const props = defineProps({ // 标签参数 tabs: { @@ -429,6 +430,12 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: } HeadButttondata.value = [...detailButtonFilter,...detailButtonAdd] + // 针对特殊处理 当业务是任务的 只显示筛选 正常情况下应在业务页面设置 后期再作优化 + if (routeName.value.indexOf('Job') > -1) { + HeadButttondata.value = [ + defaultButtons.defaultFilterBtn(null) // 筛选 + ] + } let detailButtonEdit: any = [] let detailButtonDelete: any = [] @@ -506,6 +513,12 @@ const buttonBaseClick = (val, item) => { if (val == 'add') { // 新增 openForm('create') + } else if (val == 'import') { + // 导入 + handleImport() + } else if (val == 'export') { + // 导出 + handleExport() } else if (val == 'refresh') { // 刷新 getList() @@ -529,7 +542,7 @@ const buttonTableClick = async (val, row) => { openForm('update', row) } else if (val == 'delete') { // 删除 - handleDelete(row.id) + handleDelete(row.code) } else { emit('tableFormButton',val, row) } @@ -584,7 +597,7 @@ const handleDelete = async (id: number) => { await message.delConfirm() tableObject.loading = true // 发起删除 - await props.apiDelete(id) + await props.apiDelete([id]) tableObject.loading = false message.success(t('common.delSuccess')) // 刷新列表 @@ -638,7 +651,7 @@ const openImage=(item)=>{ /** * 监听失焦事件 * @param field 当前操作字段 - * @param e + * @param e */ const onBlur = (field, e) => { emit('onBlur', field, e) diff --git a/src/views/mes/workstation/components/TableHead.vue b/src/views/mes/workstation/components/TableHead.vue deleted file mode 100644 index 507ba8de4..000000000 --- a/src/views/mes/workstation/components/TableHead.vue +++ /dev/null @@ -1,160 +0,0 @@ - - - diff --git a/src/views/mes/workstation/index.vue b/src/views/mes/workstation/index.vue index 96b18035e..1a5451359 100644 --- a/src/views/mes/workstation/index.vue +++ b/src/views/mes/workstation/index.vue @@ -58,9 +58,12 @@ :detailAllSchemasRules="WorkstationRules" :apiPage="apiPage" :tabs="TabsList" + :apiDelete=tabsDeleteApi @changeTabs="changeTabs" - :buttondataTable="buttondataTable" @tableFormButton="tableFormButton" + :detailButtonIsShowAdd="true" + :detailButtonIsShowDelete="true" + :detailButtonIsShowEdit="false" /> { if (val == 'add') { // 新增 @@ -310,27 +313,31 @@ const changeTabs = (data) =>{ if(data.prop == 'Team'){ apiPage.value = WorkstationApi.getTeamPage detailAllSchemas.value = Team.allSchemas + tabsDeleteApi = WorkstationApi.deleteTeamRelation }else if(data.prop == 'Equipment'){ apiPage.value = WorkstationApi.getEquipmentPage detailAllSchemas.value = Equipment.allSchemas + tabsDeleteApi = WorkstationApi.deleteEquipmentRelation }else if(data.prop == 'Process'){ apiPage.value = WorkstationApi.getProcessPage detailAllSchemas.value = Process.allSchemas + tabsDeleteApi = WorkstationApi.deleteProcessRelation }else if(data.prop == 'Production'){ - apiPage.value = WorkstationApi.getProductionPage + apiPage.value = WorkstationApi.getOperstepsPage detailAllSchemas.value = Production.allSchemas + tabsDeleteApi = WorkstationApi.deleteOperstepsRelation } } -const buttondataTable = ref([{ - label: '取消关联', - name: 'viewParentPickingNumber', - hide: false, - type: 'primary', - icon: '', - color: '', - hasPermi: '', - link: true, // 文本展现按钮 -}]) +// 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 @@ -349,11 +356,11 @@ const { tableObject: selectProcessListTableData, tableMethods: processListTableM }) const { getList:selectProcessListList } = processListTableMethods -const productionListRef = ref() -const { tableObject: selectProductionListTableData, tableMethods: productionListTableMethods } = useTable({ - getListApi: WorkstationApi.checkProductionPageList +const OperstepsListRef = ref() +const { tableObject: selectOperstepsListTableData, tableMethods: OperstepsListTableMethods } = useTable({ + getListApi: WorkstationApi.checkOperstepsPageList }) -const { getList:selectProductionList } = productionListTableMethods +const { getList:selectOperstepsList } = OperstepsListTableMethods const tableFormButton = async (val , row) => { if(val == 'Team'){ @@ -375,11 +382,11 @@ const tableFormButton = async (val , row) => { await selectProcessListList() processListRef.value.open('create', row, null,'viewDetail')//查看明细数据 }else if(val == 'Production'){ - selectProductionListTableData.params = { + selectOperstepsListTableData.params = { workstationCode:row.workstationCode } - await selectProductionList() - productionListRef.value.open('create', row, null,'viewDetail')//查看明细数据 + await selectOperstepsList() + OperstepsListRef.value.open('create', row, null,'viewDetail')//查看明细数据 } } diff --git a/src/views/mes/workstation/workstation.data.ts b/src/views/mes/workstation/workstation.data.ts index fe87fb777..8087e9fac 100644 --- a/src/views/mes/workstation/workstation.data.ts +++ b/src/views/mes/workstation/workstation.data.ts @@ -18,8 +18,8 @@ export const TabsList = [{ prop: 'Process', }, { - label: "产品", - prop: 'Production', + label: "操作步骤", + prop: 'Opersteps', } ] @@ -201,7 +201,7 @@ export const Process = useCrudSchemas(reactive([ isTableForm:true, } ])) -export const Production = useCrudSchemas(reactive([ +export const Opersteps = useCrudSchemas(reactive([ { label: '代码', field: 'code', From 4cc1a81d3891fb55569e001516f0c51a98967b88 Mon Sep 17 00:00:00 2001 From: bjang03 Date: Fri, 29 Mar 2024 10:19:04 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1=E3=80=81=E5=A2=9E=E5=8A=A0=E5=B7=A5?= =?UTF-8?q?=E4=BD=8D=E6=93=8D=E4=BD=9C=E6=AD=A5=E9=AA=A4=E5=85=B3=E8=81=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mes/workstation/index.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/views/mes/workstation/index.vue b/src/views/mes/workstation/index.vue index 1a5451359..f9a70ace0 100644 --- a/src/views/mes/workstation/index.vue +++ b/src/views/mes/workstation/index.vue @@ -129,7 +129,6 @@ import { goalParams, } from "@/api/mes/workstation"; import Detail from './components/Detail.vue' -import * as PurchaseDetailApi from "@/api/wms/purchaseDetail"; defineOptions({ name: 'Workstation' }) let tabsDeleteApi = WorkstationApi.deleteTeamRelation const message = useMessage() // 消息弹窗 @@ -322,9 +321,9 @@ const changeTabs = (data) =>{ apiPage.value = WorkstationApi.getProcessPage detailAllSchemas.value = Process.allSchemas tabsDeleteApi = WorkstationApi.deleteProcessRelation - }else if(data.prop == 'Production'){ + }else if(data.prop == 'Opersteps'){ apiPage.value = WorkstationApi.getOperstepsPage - detailAllSchemas.value = Production.allSchemas + detailAllSchemas.value = Opersteps.allSchemas tabsDeleteApi = WorkstationApi.deleteOperstepsRelation } }