From 8e219ee3abecb848d38f521c99de6bd92edf75d2 Mon Sep 17 00:00:00 2001 From: zhousq Date: Thu, 9 May 2024 17:07:25 +0800 Subject: [PATCH] =?UTF-8?q?2024-05-09=20=E5=B7=A5=E5=8D=95=E5=B7=A5?= =?UTF-8?q?=E5=BA=8F=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mes/workSchedulingDetail/index.ts | 5 +- src/utils/dict.ts | 1 + .../mes/workScheduling/components/Detail.vue | 20 ++++--- .../mes/workScheduling/components/finish.vue | 12 +++-- src/views/mes/workScheduling/index.vue | 24 +++++++-- .../mes/workScheduling/workScheduling.data.ts | 53 ++++++++++--------- 6 files changed, 77 insertions(+), 38 deletions(-) diff --git a/src/api/mes/workSchedulingDetail/index.ts b/src/api/mes/workSchedulingDetail/index.ts index 0bd6244ea..f39e63513 100644 --- a/src/api/mes/workSchedulingDetail/index.ts +++ b/src/api/mes/workSchedulingDetail/index.ts @@ -40,7 +40,10 @@ export const getWorkSchedulingDetail = async (id: number) => { export const createWorkSchedulingDetail = async (data: WorkSchedulingDetailVO) => { return await request.post({ url: `/mes/work-scheduling-detail/create`, data }) } - +// 更新工序的状态 +export const processFinished = async (id:number) => { + return await request.get({ url: `/mes/work-scheduling-detail/processFinished?id=`+id }) +} // 修改工单任务明细 export const updateWorkSchedulingDetail = async (data: WorkSchedulingDetailVO) => { return await request.put({ url: `/mes/work-scheduling-detail/update`, data }) diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 691897e7e..74ae2cd68 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -284,6 +284,7 @@ export enum DICT_TYPE { // ========== 业务 - mes ========== MESDO_STATUS= 'mes_do_status', // 工单执行状态 + MES_PROCESS_STATUS= 'mes_process_status', // 工单工序状态 MES_WORKBILL_MODEL='mes_workbill_model',// 工单模式 单工单(根据产品数量生成多个工单)、批量工单(一个产品一个工单) MES_TASK_MODE='mes_task_mode', //生产模式 派工方式、领工方式 MES_PLANDO_STATUS='mes_plando_status', //计划执行状 diff --git a/src/views/mes/workScheduling/components/Detail.vue b/src/views/mes/workScheduling/components/Detail.vue index b42ae5cd2..63620192e 100644 --- a/src/views/mes/workScheduling/components/Detail.vue +++ b/src/views/mes/workScheduling/components/Detail.vue @@ -90,25 +90,26 @@ > - @@ -96,12 +96,14 @@ const getCurrentWorkerList = async (row) => { } personData.value = await workschedulingApi.getCurrentWorkerList(params) } +const saveFlag=ref(false) //提交报工 -const saveReport = () => { +const saveReport = async() => { let data = { - reportDate: dayjs(new Date()).format('YYYY-MM-DD HH:mm:sss'), + reportDate: dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'), schedulingCode: rowData.value.schedulingCode, processCode: currentProcess.value, + id:rowData.value.id, list: [ { reportCount: reportCount.value, @@ -112,7 +114,11 @@ const saveReport = () => { } ] } + saveFlag.value=true workschedulingApi.completeHandle(data) + saveFlag.value=false + dialogVisible.value = false + emit('close') } // 传递给父类 const emit = defineEmits(['success', 'close']) diff --git a/src/views/mes/workScheduling/index.vue b/src/views/mes/workScheduling/index.vue index c12d7bd90..1ce8ac437 100644 --- a/src/views/mes/workScheduling/index.vue +++ b/src/views/mes/workScheduling/index.vue @@ -61,6 +61,7 @@ :apiUpdate="WorkSchedulingDetailApi.updateWorkSchedulingDetail" :apiDelete="WorkSchedulingDetailApi.deleteWorkSchedulingDetail" :detailButtonIsShowAdd="false" + :buttondataTable="buttondataTable" :detailButtonIsShowEdit="false" :detailButtonIsShowDelete="false" @handleMainFefresh="handleMainFefresh" @@ -85,6 +86,7 @@ import Detail from './components/Detail.vue' import Report from './components/report.vue' import Finish from './components/finish.vue' + defineOptions({ name: 'MesWorkScheduling' }) const message = useMessage() // 消息弹窗 @@ -94,7 +96,21 @@ const route = useRoute() // 路由信息 const routeName = ref() routeName.value = route.name const tableColumns = ref(WorkScheduling.allSchemas.tableColumns) - +// 详情 table 操作扩展 按钮 +const buttondataTable = ref([{ + label: '完工', + name: 'pfinished', + hide: false, + type: 'primary', + icon: '', + color: '', + hasPermi: '', + link: true, // 文本展现按钮 + }]) +// 查看 Bom 按钮回调事件 +const tableFormButton = async (val , row) => { + getList() +} // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef) => { nextTick(() => { @@ -174,10 +190,11 @@ const butttondata=(row) =>{ return [ defaultButtons.mainListHandleBtn({label:"终止",name:'terminate',hide: isShowMainButton(row,['-1','0']),hasPermi:'mes:workScheduling:update'}), // defaultButtons.mainListHandleBtn({label:"暂停",name:'pause',hide: isShowMainButton(row,['1']),hasPermi:'mes:workScheduling:update'}), defaultButtons.mainListHandleBtn({label:"恢复",name:'resume',hide: isShowMainButton(row,['3']),hasPermi:'mes:workScheduling:update'}), - defaultButtons.mainListHandleBtn({label:"开工",name:'start',hide: isShowMainButton(row,['0']),hasPermi:'mes:workScheduling:update'}), + defaultButtons.mainListHandleBtn({label:"开工",name:'start',hide: isShowMainButton(row,['-1','0']),hasPermi:'mes:workScheduling:update'}), defaultButtons.mainListHandleBtn({label:"报工",name:'report',hide: isShowMainButton(row,['1'] ),hasPermi:'mes:workScheduling:update'}), defaultButtons.mainListHandleBtn({label:"完工",name:'finish',hide: isShowMainButton(row,['1']),hasPermi:'mes:workScheduling:update'}), - defaultButtons.mainListHandleBtn({label:"叫料",name:'callMaterial',hide: isShowMainButton(row,['1']),hasPermi:'mes:workScheduling:update'}), + //defaultButtons.mainListHandleBtn({label:"叫料",name:'callMaterial',hide: isShowMainButton(row,['1']),hasPermi:'mes:workScheduling:update'}), + ]} const reportRef=ref() const reportFinishRef=ref() @@ -211,6 +228,7 @@ const openForm = (type: string, row?: any) => { //完工报工 const finishReport=async(row)=>{ let params={ + id:row.id, planDayCode:row.planMasterCode, processCode:row.workingNode } diff --git a/src/views/mes/workScheduling/workScheduling.data.ts b/src/views/mes/workScheduling/workScheduling.data.ts index 890ceff4b..658876f4b 100644 --- a/src/views/mes/workScheduling/workScheduling.data.ts +++ b/src/views/mes/workScheduling/workScheduling.data.ts @@ -192,9 +192,14 @@ export const WorkSchedulingDetail = useCrudSchemas(reactive([ field: 'status', sort: 'custom', isSearch: false, - isTable: false, + isTable: true, isForm:false, isDetail:false, + dictType: DICT_TYPE.MES_PROCESS_STATUS, + dictClass: 'string', + form: { + component: 'Select', + }, }, { @@ -307,12 +312,12 @@ export const WorkSchedulingDetail = useCrudSchemas(reactive([ value: 0 }, }, - { - label: '报工人', - field: 'reportPerson', - sort: 'custom', - isSearch: true, - }, + // { + // label: '报工人', + // field: 'reportPerson', + // sort: 'custom', + // isSearch: true, + // }, { label: '报工数量', field: 'reportCount', @@ -373,22 +378,22 @@ export const WorkSchedulingDetail = useCrudSchemas(reactive([ // field: 'materialValidate', // sort: 'custom', // }, - { - label: '备注', - field: 'remark', - sort: 'custom', - isSearch: false, - isTable: false, - isForm:false, - isDetail:false, - }, // { - // label: '操作', - // field: 'action', - // isForm: false, - // table: { - // width: 150, - // fixed: 'right' - // } - // } + // label: '备注', + // field: 'remark', + // sort: 'custom', + // isSearch: false, + // isTable: false, + // isForm:false, + // isDetail:false, + // }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } ]))