|
|
@ -79,6 +79,8 @@ import {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts |
|
|
|
import * as EquipmentItemApi from "@/api/eam/equipmentAccounts"; |
|
|
|
import {ToolAccounts} from "@/views/eam/toolAccounts/toolAccounts.data"; |
|
|
|
import * as ToolItemApi from "@/api/eam/toolAccounts"; |
|
|
|
import * as ReworkBatchApi from "@/api/mes/reworkBatch"; |
|
|
|
import {mainListExecuteBtn} from "@/utils/disposition/defaultButtons"; |
|
|
|
|
|
|
|
defineOptions({ name: 'EquipmentMaintenanceMain' }) |
|
|
|
|
|
|
@ -153,11 +155,21 @@ const isShowMainButton = (row,val) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const isShowStatusButton = (row,val) => { |
|
|
|
if (val.indexOf(row.status) > -1) { |
|
|
|
return false |
|
|
|
} else { |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = (row) => { |
|
|
|
return [ |
|
|
|
defaultButtons.mainListEditBtn({hasPermi:'eam:equipmentMaintenanceMain:update'}), // 编辑 |
|
|
|
//defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipmentMaintenanceMain:delete'}), // 删除 |
|
|
|
defaultButtons.mainListReceiveBtn({hide: isShowStatusButton(row,['3']),hasPermi:'eam:maintenance:update'}), // 领取 |
|
|
|
defaultButtons.mainListExecuteBtn({hide: isShowStatusButton(row,['4']),hasPermi:'eam:maintenance:update'}), // 执行 |
|
|
|
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'eam:maintenance:update'}), |
|
|
|
defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'eam:maintenance:update'}), |
|
|
|
] |
|
|
@ -169,6 +181,10 @@ const buttonTableClick = async (val, row) => { |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
|
handleDelete(row.id) |
|
|
|
} else if (val == 'receive') { // 领取 |
|
|
|
handleReceive(row.id) |
|
|
|
} else if (val == 'execute') { // 执行 |
|
|
|
handleExecute(row.id) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -235,6 +251,44 @@ const handleDelete = async (id: number) => { |
|
|
|
} catch {} |
|
|
|
} |
|
|
|
|
|
|
|
/** 领取按钮操作 */ |
|
|
|
const handleReceive = async (id: number) => { |
|
|
|
try { |
|
|
|
// 中止的二次确认 |
|
|
|
await message.delConfirm('是否领取所选中任务?'); |
|
|
|
const params = ref({ |
|
|
|
id: '', |
|
|
|
status:'', |
|
|
|
}) |
|
|
|
params.value.id = id |
|
|
|
params.value.status = '4' |
|
|
|
// 发起删除 |
|
|
|
await EquipmentMaintenanceMainApi.executeMaintenanceOrder(params.value) |
|
|
|
message.success(t('领取成功')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch {} |
|
|
|
} |
|
|
|
|
|
|
|
/** 执行按钮操作 */ |
|
|
|
const handleExecute = async (id: number) => { |
|
|
|
try { |
|
|
|
// 中止的二次确认 |
|
|
|
await message.delConfirm('是否执行所选中任务?'); |
|
|
|
const params = ref({ |
|
|
|
id: '', |
|
|
|
status:'', |
|
|
|
}) |
|
|
|
params.value.id = id |
|
|
|
params.value.status = '5' |
|
|
|
// 发起删除 |
|
|
|
await EquipmentMaintenanceMainApi.executeMaintenanceOrder(params.value) |
|
|
|
message.success(t('执行成功')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch {} |
|
|
|
} |
|
|
|
|
|
|
|
/** 启用 */ |
|
|
|
const handleEnable = async (id: number) => { |
|
|
|
try { |
|
|
|