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. 29
      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) => {
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 })

8
src/locales/zh-CN.ts

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

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

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

@ -86,7 +86,7 @@
hasPermi: ''
}]"
@buttonBaseClick="detailButtonBaseClick"
@buttondataTable="detailButtonBaseClick"
@tableFormButton="detailButtonBaseClick"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/plan/mes-order-month-main/import"
@ -292,7 +292,6 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
//formRef.setValues({standardBom:'bomddd'})
// getProcessroutes(val[0][searchField])
productName = val[0].name
getBoms(val[0][searchField])
}
if(formField=='factoryCode'){
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) => {

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

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

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

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

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

@ -38,7 +38,7 @@
<template #footer
><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>
</template>
@ -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'])

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

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

29
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,12 @@ 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:'report',hide: isShowMainButton(row,['1'] ),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,['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:'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()
@ -195,6 +213,8 @@ const buttonTableClick = async (val, row) => {
changeBillStatus(row,"1")
}else if(val=='report'){
reportRef.value.openDetail(row,"报工")
}else if(val=='check'){
//reportRef.value.openDetail(row,"")
}else if(val=='finish'){
finishReport(row)
} else if(val=='callMaterial'){
@ -211,6 +231,7 @@ const openForm = (type: string, row?: any) => {
//
const finishReport=async(row)=>{
let params={
id:row.id,
planDayCode:row.planMasterCode,
processCode:row.workingNode
}

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

@ -192,9 +192,14 @@ export const WorkSchedulingDetail = useCrudSchemas(reactive<CrudSchema[]>([
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<CrudSchema[]>([
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<CrudSchema[]>([
// 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'
}
}
]))

Loading…
Cancel
Save