Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-ui into master_hella

master_hella_20240701
zhaoxuebing 6 months ago
parent
commit
61dd8db85f
  1. 5
      src/api/mes/workSchedulingDetail/index.ts
  2. 8
      src/locales/zh-CN.ts
  3. 1
      src/utils/dict.ts
  4. 12
      src/views/mes/ordermonthplan/index.vue
  5. 8
      src/views/mes/ordermonthplan/mesOrderMonthSub.data.ts
  6. 27
      src/views/mes/workScheduling/components/Detail.vue
  7. 12
      src/views/mes/workScheduling/components/finish.vue
  8. 13
      src/views/mes/workScheduling/components/report.vue
  9. 29
      src/views/mes/workScheduling/index.vue
  10. 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 })

8
src/locales/zh-CN.ts

@ -618,11 +618,11 @@ export default {
}, },
ts: { ts: {
:'代码', :'代码',
: 'All', :'全部',
:'标准', :'标准',
: '委外', :'委外',
:'其它', :'其它',
:'其他', :'其他',
: '是否可用', : '是否可用',
:'类型', :'类型',
:'名称', :'名称',

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', //计划执行状

12
src/views/mes/ordermonthplan/index.vue

@ -86,7 +86,7 @@
hasPermi: '' hasPermi: ''
}]" }]"
@buttonBaseClick="detailButtonBaseClick" @buttonBaseClick="detailButtonBaseClick"
@buttondataTable="detailButtonBaseClick" @tableFormButton="detailButtonBaseClick"
/> />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/plan/mes-order-month-main/import" <ImportForm ref="importFormRef" url="/plan/mes-order-month-main/import"
@ -292,7 +292,6 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
//formRef.setValues({standardBom:'bomddd'}) //formRef.setValues({standardBom:'bomddd'})
// getProcessroutes(val[0][searchField]) // getProcessroutes(val[0][searchField])
productName = val[0].name productName = val[0].name
getBoms(val[0][searchField])
} }
if(formField=='factoryCode'){ if(formField=='factoryCode'){
factoryName = val[0].name factoryName = val[0].name
@ -304,15 +303,6 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
}) })
} }
const bomOptions=ref([])
const getBoms = async (code: String) => {
bomOptions.value = await OrderDayApi.getBoms(code)
MesOrderMonthSub.allSchemas.formSchema.forEach(item => {
if (item.field == 'bomCode') {
item.componentProps.options = bomOptions.value
}
})
}
const createMesOrderMonthSub = async (data: MesOrderMonthSubVO) => { const createMesOrderMonthSub = async (data: MesOrderMonthSubVO) => {

8
src/views/mes/ordermonthplan/mesOrderMonthSub.data.ts

@ -67,11 +67,9 @@ export const MesOrderMonthSub = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isTable: false, isTable: false,
isSearch: true, isSearch: true,
form: { table: {
component:'Select', width: 200,
componentProps: { fixed: 'left'
options: [{lablel:'bom',value:'bom'}]
}
} }
}, },
{ {

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

@ -90,14 +90,14 @@
> >
</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"
@ -105,10 +105,11 @@
:key="updateKey" :key="updateKey"
> >
<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>
</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 }
@ -604,7 +603,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
tableObjectRef.value.params = { tableObjectRef.value.params = {
schedulingCode: row.schedulingCode schedulingCode: row.schedulingCode
} }
console.log(tableObjectRef.value.params) //console.log(tableObjectRef.value.params)
await getList() await getList()
} }
isShowDrawer.value = true isShowDrawer.value = true
@ -659,6 +658,12 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
}) })
] ]
} }
if(row.status == '1'){
props.buttondataTable[0].hide = false
}else{
props.buttondataTable[0].hide = true
}
buttondata.value = [...detailButtonEdit, ...detailButtonDelete, ...props.buttondataTable] buttondata.value = [...detailButtonEdit, ...detailButtonDelete, ...props.buttondataTable]
} finally { } finally {
detailLoading.value = false detailLoading.value = false
@ -795,6 +800,7 @@ const opensearchTable = (
) )
} }
// //
// const updataTableColumns = (val) => { // const updataTableColumns = (val) => {
// detailAllSchemas.tableColumns.value = val // detailAllSchemas.tableColumns.value = val
@ -827,7 +833,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 +846,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'])

13
src/views/mes/workScheduling/components/report.vue

@ -130,11 +130,16 @@ const saveReport = async() => {
] ]
} }
saveFlag.value = true saveFlag.value = true
try {
await workschedulingApi.reportWorkByProcess(data)
}finally{
saveFlag.value = false
dialogVisible.value = false
emit('close')
}
//console.log("report-saveReport-82",data) //console.log("report-saveReport-82",data)
await workschedulingApi.reportWorkByProcess(data) //await workschedulingApi.reportWorkByProcess(data)
saveFlag.value = false
dialogVisible.value = false
emit('close')
} }
// //
const emit = defineEmits(['success', 'close']) const emit = defineEmits(['success', 'close'])

29
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,12 @@ 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,['4'] ),hasPermi:'mes:workScheduling:update'}),
defaultButtons.mainListHandleBtn({label:"质检",name:'check',hide: isShowMainButton(row,['5'] ),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()
@ -195,6 +213,8 @@ const buttonTableClick = async (val, row) => {
changeBillStatus(row,"1") changeBillStatus(row,"1")
}else if(val=='report'){ }else if(val=='report'){
reportRef.value.openDetail(row,"报工") reportRef.value.openDetail(row,"报工")
}else if(val=='check'){
//reportRef.value.openDetail(row,"")
}else if(val=='finish'){ }else if(val=='finish'){
finishReport(row) finishReport(row)
} else if(val=='callMaterial'){ } else if(val=='callMaterial'){
@ -211,6 +231,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