From a190db262813c5d034578d6f68d5e3a9a6df7a35 Mon Sep 17 00:00:00 2001 From: zhousq Date: Tue, 7 May 2024 17:30:12 +0800 Subject: [PATCH] =?UTF-8?q?2024-05-07=20=E4=BF=AE=E6=94=B9=E6=8E=92?= =?UTF-8?q?=E4=BA=A7bug=EF=BC=8C=E5=90=8E=E7=AB=AF=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=8A=A5=E5=B7=A5=E3=80=81=E5=AE=8C=E5=B7=A5=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mes/workScheduling/index.ts | 24 ++- .../mes/orderDay/components/schedule.vue | 2 +- src/views/mes/orderDay/index.vue | 4 +- src/views/mes/orderDay/orderDay.data.ts | 8 +- .../mes/workScheduling/components/finish.vue | 121 ++++++++++++++++ .../mes/workScheduling/components/report.vue | 137 ++++++++++++++++++ src/views/mes/workScheduling/index.vue | 37 ++++- .../mes/workScheduling/workScheduling.data.ts | 2 +- 8 files changed, 321 insertions(+), 14 deletions(-) create mode 100644 src/views/mes/workScheduling/components/finish.vue create mode 100644 src/views/mes/workScheduling/components/report.vue diff --git a/src/api/mes/workScheduling/index.ts b/src/api/mes/workScheduling/index.ts index d17a72c52..7df13e502 100644 --- a/src/api/mes/workScheduling/index.ts +++ b/src/api/mes/workScheduling/index.ts @@ -47,4 +47,26 @@ export const exportWorkScheduling = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/mes/workScheduling/get-import-template' }) -} \ No newline at end of file +} +// 完工 +export const completeHandle = async (data) => { + return await request.post({ url: `/mes/workScheduling/completeHandle`, data }) +} +//报工 +export const reportWorkByProcess = async (data) => { + return await request.post({ url: `/mes/work-scheduling-detail/reportWorkByProcess`, data }) +} +//检查当前节点是否可以完工 +export const getNodePosition = async (params) => { + return await request.get({ url: `/mes/workScheduling/getNodePosition`, params }) +} +//获取当前工序的员工列表 +export const getCurrentWorkerList = async (params) => { + return await request.get({ url: `/mes/workScheduling/getCurrentWorkerList`, params }) +} +//获取当前工单的工序列表 +export const getProcessList = async (params) => { + return await request.get({ url: `/mes/workScheduling/getProcessList`, params }) +} + + diff --git a/src/views/mes/orderDay/components/schedule.vue b/src/views/mes/orderDay/components/schedule.vue index 89b4d112c..1373e120d 100644 --- a/src/views/mes/orderDay/components/schedule.vue +++ b/src/views/mes/orderDay/components/schedule.vue @@ -202,7 +202,7 @@ diff --git a/src/views/mes/orderDay/index.vue b/src/views/mes/orderDay/index.vue index fc421c5e3..134854079 100644 --- a/src/views/mes/orderDay/index.vue +++ b/src/views/mes/orderDay/index.vue @@ -197,7 +197,7 @@ const buttonBaseClick = (val, item) => { } const publishClosed=()=>{ //console.log('publishClosed') - getList() + getList() } // 根据状态返回该按钮是否显示 const isShowMainButton = (row,val) => { @@ -282,7 +282,7 @@ const formsSuccess = async (formType,data) => { } basicFormRef.value.dialogVisible = false - getList() + await getList() } /** 详情操作 */ diff --git a/src/views/mes/orderDay/orderDay.data.ts b/src/views/mes/orderDay/orderDay.data.ts index 3c97730b6..8397adc6b 100644 --- a/src/views/mes/orderDay/orderDay.data.ts +++ b/src/views/mes/orderDay/orderDay.data.ts @@ -11,9 +11,9 @@ export const OrderDayRules = reactive({ // batchCode: [ // { required: false, message: '请输入一个日计划编号', trigger: 'blur' } // ], - planNoMonth: [ - { required: true, message: '请输入一个月计划编号', trigger: 'blur' } - ], + // planNoMonth: [ + // { required: true, message: '请输入一个月计划编号', trigger: 'blur' } + // ], productCode: [ { required: true, message: '请选择一个产品', trigger: 'blur' } ], @@ -214,7 +214,7 @@ export const OrderDay = useCrudSchemas(reactive([ dictClass: 'string', form: { component: 'Switch', - value: 'TRUE', + value: 'FALSE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE' diff --git a/src/views/mes/workScheduling/components/finish.vue b/src/views/mes/workScheduling/components/finish.vue new file mode 100644 index 000000000..e01d5f681 --- /dev/null +++ b/src/views/mes/workScheduling/components/finish.vue @@ -0,0 +1,121 @@ + + diff --git a/src/views/mes/workScheduling/components/report.vue b/src/views/mes/workScheduling/components/report.vue new file mode 100644 index 000000000..9b387097c --- /dev/null +++ b/src/views/mes/workScheduling/components/report.vue @@ -0,0 +1,137 @@ + + diff --git a/src/views/mes/workScheduling/index.vue b/src/views/mes/workScheduling/index.vue index 19577fe7a..3982490fe 100644 --- a/src/views/mes/workScheduling/index.vue +++ b/src/views/mes/workScheduling/index.vue @@ -67,7 +67,8 @@ @searchTableSuccessDetail="searchTableSuccessDetail" :key="count" /> - + + @@ -81,7 +82,8 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' import TableHead from '@/components/TableHead/src/TableHead.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import Detail from './components/Detail.vue' -import { async } from '@antv/x6/lib/registry/marker/async' +import Report from './components/report.vue' +import Finish from './components/finish.vue' defineOptions({ name: 'MesWorkScheduling' }) @@ -172,9 +174,13 @@ 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:'change', hasPermi:'mes:workScheduling:update'}), // + defaultButtons.mainListHandleBtn({label:"开工",name:'start',hide: isShowMainButton(row,['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'}), ]} - +const reportRef=ref() +const reportFinishRef=ref() // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { if (val == 'edit') { // 编辑 @@ -185,6 +191,14 @@ const buttonTableClick = async (val, row) => { changeBillStatus(row,"3") }else if (val == 'resume') { // 恢复 changeBillStatus(row,"1") + }else if(val=='start'){ + changeBillStatus(row,"1") + }else if(val=='report'){ + reportRef.value.openDetail(row,"报工") + }else if(val=='finish'){ + finishReport(row) + } else if(val=='callMaterial'){ + } } @@ -193,7 +207,20 @@ const basicFormRef = ref() const openForm = (type: string, row?: any) => { basicFormRef.value.open(type, row) } - +//完工报工 +const finishReport=async(row)=>{ + let params={ + planDayCode:row.planMasterCode, + processCode:row.workingNode + } + //console.log("workscheduling-finishReport-213",row) + let res=await WorkSchedulingApi.getNodePosition(params) + if(res==='end'){ + reportFinishRef.value.openDetail(row,"完工") + }else{ + message.alert("当前工序不是完工工序,不能进行完工操作!") + } +} // form表单提交 const formsSuccess = async (formType,data) => { var isHave =WorkScheduling.allSchemas.formSchema.some(function (item) { diff --git a/src/views/mes/workScheduling/workScheduling.data.ts b/src/views/mes/workScheduling/workScheduling.data.ts index 29dde4d40..8edb043b5 100644 --- a/src/views/mes/workScheduling/workScheduling.data.ts +++ b/src/views/mes/workScheduling/workScheduling.data.ts @@ -164,7 +164,7 @@ export const WorkScheduling = useCrudSchemas(reactive([ field: 'action', isForm: false, table: { - width: 150, + width: 'wrapContent', fixed: 'right' } }