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 @@
>
-
-
+
+
@@ -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 }
@@ -659,6 +658,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
})
]
}
+
buttondata.value = [...detailButtonEdit, ...detailButtonDelete, ...props.buttondataTable]
} finally {
detailLoading.value = false
@@ -795,6 +795,7 @@ const opensearchTable = (
)
}
+
// 字段设置 更新主列表字段
// const updataTableColumns = (val) => {
// detailAllSchemas.tableColumns.value = val
@@ -827,7 +828,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 +841,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 {
diff --git a/src/views/mes/workScheduling/components/finish.vue b/src/views/mes/workScheduling/components/finish.vue
index e01d5f681..927e7094e 100644
--- a/src/views/mes/workScheduling/components/finish.vue
+++ b/src/views/mes/workScheduling/components/finish.vue
@@ -38,7 +38,7 @@
关闭
- 保存保存
@@ -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'
+ }
+ }
]))