Browse Source

2024-05-09 工单工序的处理

master_hella_20240701
zhousq 6 months ago
parent
commit
8e219ee3ab
  1. 5
      src/api/mes/workSchedulingDetail/index.ts
  2. 1
      src/utils/dict.ts
  3. 20
      src/views/mes/workScheduling/components/Detail.vue
  4. 12
      src/views/mes/workScheduling/components/finish.vue
  5. 24
      src/views/mes/workScheduling/index.vue
  6. 53
      src/views/mes/workScheduling/workScheduling.data.ts

5
src/api/mes/workSchedulingDetail/index.ts

@ -40,7 +40,10 @@ export const getWorkSchedulingDetail = async (id: number) => {
export const createWorkSchedulingDetail = async (data: WorkSchedulingDetailVO) => { export const createWorkSchedulingDetail = async (data: WorkSchedulingDetailVO) => {
return await request.post({ url: `/mes/work-scheduling-detail/create`, data }) 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) => { export const updateWorkSchedulingDetail = async (data: WorkSchedulingDetailVO) => {
return await request.put({ url: `/mes/work-scheduling-detail/update`, data }) return await request.put({ url: `/mes/work-scheduling-detail/update`, data })

1
src/utils/dict.ts

@ -284,6 +284,7 @@ export enum DICT_TYPE {
// ========== 业务 - mes ========== // ========== 业务 - mes ==========
MESDO_STATUS= 'mes_do_status', // 工单执行状态 MESDO_STATUS= 'mes_do_status', // 工单执行状态
MES_PROCESS_STATUS= 'mes_process_status', // 工单工序状态
MES_WORKBILL_MODEL='mes_workbill_model',// 工单模式 单工单(根据产品数量生成多个工单)、批量工单(一个产品一个工单) MES_WORKBILL_MODEL='mes_workbill_model',// 工单模式 单工单(根据产品数量生成多个工单)、批量工单(一个产品一个工单)
MES_TASK_MODE='mes_task_mode', //生产模式 派工方式、领工方式 MES_TASK_MODE='mes_task_mode', //生产模式 派工方式、领工方式
MES_PLANDO_STATUS='mes_plando_status', //计划执行状 MES_PLANDO_STATUS='mes_plando_status', //计划执行状

20
src/views/mes/workScheduling/components/Detail.vue

@ -90,25 +90,26 @@
> >
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase <ButtonBase v-if="row.status == '0'"
:Butttondata="buttondata" :Butttondata="buttondata"
@button-base-click="buttonTableClick($event, row)" @button-base-click="buttonTableClick($event, row)"
/> />
</template> </template>
</Table> </Table>
<DetailTable <DetailTable
v-if="!isBasic && fromeWhere == 'countPlan' && isShowDrawer" v-if="!isBasic && isShowDrawer"
:columns="detailAllSchemasRef.tableColumns" :columns="detailAllSchemasRef.tableColumns"
:data="tableObjectRef.tableList" :data="tableObjectRef.tableList"
:allList="allList" :allList="allList"
:countScopeType="countScopeType" :countScopeType="countScopeType"
:key="updateKey" :key="updateKey"
> >
<template #action="{ row }"> <template #actionDetail="{ row }">
<ButtonBase <ButtonBase
:Butttondata="buttondata" :Butttondata="buttondata"
@button-base-click="buttonTableClick($event, row)" @button-base-click="buttonTableClick($event, row)"
/> />
</template> </template>
</DetailTable> </DetailTable>
</ContentWrap> </ContentWrap>
@ -224,8 +225,7 @@ import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import DetailTable from '@/components/DetailTable/src/DetailTable.vue' import DetailTable from '@/components/DetailTable/src/DetailTable.vue'
import { SearchTable } from '@/components/SearchTable' import { SearchTable } from '@/components/SearchTable'
import { defaultFreshBtn } from '@/utils/disposition/defaultButtons' import * as WorkSchedulingDetailApi from '@/api/mes/workSchedulingDetail'
defineOptions({ name: 'Detail' }) defineOptions({ name: 'Detail' })
const message = useMessage() // const message = useMessage() //
@ -555,7 +555,6 @@ const masterParmas = ref({
const HeadButttondata = ref() const HeadButttondata = ref()
// - // -
const buttondata = ref() const buttondata = ref()
/** 表格弹窗 */ /** 表格弹窗 */
const initModel = (schema: FormSchema[], formModel: Recordable) => { const initModel = (schema: FormSchema[], formModel: Recordable) => {
const model: Recordable = { ...formModel } const model: Recordable = { ...formModel }
@ -659,6 +658,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
}) })
] ]
} }
buttondata.value = [...detailButtonEdit, ...detailButtonDelete, ...props.buttondataTable] buttondata.value = [...detailButtonEdit, ...detailButtonDelete, ...props.buttondataTable]
} finally { } finally {
detailLoading.value = false detailLoading.value = false
@ -795,6 +795,7 @@ const opensearchTable = (
) )
} }
// //
// const updataTableColumns = (val) => { // const updataTableColumns = (val) => {
// detailAllSchemas.tableColumns.value = val // detailAllSchemas.tableColumns.value = val
@ -827,7 +828,11 @@ const buttonTableClick = async (val, row) => {
} else if (val == 'delete') { } else if (val == 'delete') {
// //
handleDelete(row.id) handleDelete(row.id)
} else { } else if (val == 'pfinished') {
WorkSchedulingDetailApi.processFinished(row.id)
getList()
}else {
emit('tableFormButton', val, row) emit('tableFormButton', val, row)
} }
} }
@ -836,6 +841,7 @@ const openForm = async (type: string, row?: number) => {
formRef.value.open(type, row, masterParmas.value) formRef.value.open(type, row, masterParmas.value)
emit('detailOpenForm', type, row) emit('detailOpenForm', type, row)
} }
// form // form
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
try { try {

12
src/views/mes/workScheduling/components/finish.vue

@ -38,7 +38,7 @@
<template #footer <template #footer
><el-button @click="dialogVisible = false">关闭</el-button> ><el-button @click="dialogVisible = false">关闭</el-button>
<el-button type="primary" @click="saveReport">保存</el-button></template <el-button type="primary" :disabled="saveFlag" @click="saveReport">保存</el-button></template
> >
</Dialog> </Dialog>
</template> </template>
@ -96,12 +96,14 @@ const getCurrentWorkerList = async (row) => {
} }
personData.value = await workschedulingApi.getCurrentWorkerList(params) personData.value = await workschedulingApi.getCurrentWorkerList(params)
} }
const saveFlag=ref(false)
// //
const saveReport = () => { const saveReport = async() => {
let data = { 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, schedulingCode: rowData.value.schedulingCode,
processCode: currentProcess.value, processCode: currentProcess.value,
id:rowData.value.id,
list: [ list: [
{ {
reportCount: reportCount.value, reportCount: reportCount.value,
@ -112,7 +114,11 @@ const saveReport = () => {
} }
] ]
} }
saveFlag.value=true
workschedulingApi.completeHandle(data) workschedulingApi.completeHandle(data)
saveFlag.value=false
dialogVisible.value = false
emit('close')
} }
// //
const emit = defineEmits(['success', 'close']) const emit = defineEmits(['success', 'close'])

24
src/views/mes/workScheduling/index.vue

@ -61,6 +61,7 @@
:apiUpdate="WorkSchedulingDetailApi.updateWorkSchedulingDetail" :apiUpdate="WorkSchedulingDetailApi.updateWorkSchedulingDetail"
:apiDelete="WorkSchedulingDetailApi.deleteWorkSchedulingDetail" :apiDelete="WorkSchedulingDetailApi.deleteWorkSchedulingDetail"
:detailButtonIsShowAdd="false" :detailButtonIsShowAdd="false"
:buttondataTable="buttondataTable"
:detailButtonIsShowEdit="false" :detailButtonIsShowEdit="false"
:detailButtonIsShowDelete="false" :detailButtonIsShowDelete="false"
@handleMainFefresh="handleMainFefresh" @handleMainFefresh="handleMainFefresh"
@ -85,6 +86,7 @@ import Detail from './components/Detail.vue'
import Report from './components/report.vue' import Report from './components/report.vue'
import Finish from './components/finish.vue' import Finish from './components/finish.vue'
defineOptions({ name: 'MesWorkScheduling' }) defineOptions({ name: 'MesWorkScheduling' })
const message = useMessage() // const message = useMessage() //
@ -94,7 +96,21 @@ const route = useRoute() // 路由信息
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(WorkScheduling.allSchemas.tableColumns) 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) => { const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => { 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:'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:'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:'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:'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:'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 reportRef=ref()
const reportFinishRef=ref() const reportFinishRef=ref()
@ -211,6 +228,7 @@ const openForm = (type: string, row?: any) => {
// //
const finishReport=async(row)=>{ const finishReport=async(row)=>{
let params={ let params={
id:row.id,
planDayCode:row.planMasterCode, planDayCode:row.planMasterCode,
processCode:row.workingNode processCode:row.workingNode
} }

53
src/views/mes/workScheduling/workScheduling.data.ts

@ -192,9 +192,14 @@ export const WorkSchedulingDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'status', field: 'status',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isTable: false, isTable: true,
isForm:false, isForm:false,
isDetail:false, isDetail:false,
dictType: DICT_TYPE.MES_PROCESS_STATUS,
dictClass: 'string',
form: {
component: 'Select',
},
}, },
{ {
@ -307,12 +312,12 @@ export const WorkSchedulingDetail = useCrudSchemas(reactive<CrudSchema[]>([
value: 0 value: 0
}, },
}, },
{ // {
label: '报工人', // label: '报工人',
field: 'reportPerson', // field: 'reportPerson',
sort: 'custom', // sort: 'custom',
isSearch: true, // isSearch: true,
}, // },
{ {
label: '报工数量', label: '报工数量',
field: 'reportCount', field: 'reportCount',
@ -373,22 +378,22 @@ export const WorkSchedulingDetail = useCrudSchemas(reactive<CrudSchema[]>([
// field: 'materialValidate', // field: 'materialValidate',
// sort: 'custom', // sort: 'custom',
// }, // },
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
},
// { // {
// label: '操作', // label: '备注',
// field: 'action', // field: 'remark',
// isForm: false, // sort: 'custom',
// table: { // isSearch: false,
// width: 150, // isTable: false,
// fixed: 'right' // isForm:false,
// } // isDetail:false,
// } // },
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
])) ]))

Loading…
Cancel
Save