Browse Source

EAM ——> 保养工单领取 执行

master_hella_20240701
gaojs 6 months ago
parent
commit
bad7830acb
  1. 5
      src/api/eam/equipmentMaintenanceMain/index.ts
  2. 13
      src/utils/disposition/defaultButtons.ts
  3. 54
      src/views/eam/equipmentMaintenanceMain/index.vue

5
src/api/eam/equipmentMaintenanceMain/index.ts

@ -78,3 +78,8 @@ export const importTemplate = () => {
export const updateEnableCode = async (data: EquipmentMainPartVO) => { export const updateEnableCode = async (data: EquipmentMainPartVO) => {
return await request.post({ url: `/eam/equipment-maintenance-main/ables` , data }) return await request.post({ url: `/eam/equipment-maintenance-main/ables` , data })
} }
// 执行保养工单
export const executeMaintenanceOrder = async (data: EquipmentMainPartVO) => {
return await request.post({ url: `/eam/equipment-maintenance-main/execute`, data })
}

13
src/utils/disposition/defaultButtons.ts

@ -325,6 +325,19 @@ export function mainListReceiveBtn(option:any) {
}) })
} }
// 主列表-执行按钮
export function mainListExecuteBtn(option:any) {
return __defaultBtnOption(option,{
label: t(`ts.执行`).replace('ts.', ''),
name: 'execute',
hide: false,
type: 'primary',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 主列表-完成按钮 // 主列表-完成按钮
export function mainListFinishBtn(option:any) { export function mainListFinishBtn(option:any) {
return __defaultBtnOption(option,{ return __defaultBtnOption(option,{

54
src/views/eam/equipmentMaintenanceMain/index.vue

@ -79,6 +79,8 @@ import {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts
import * as EquipmentItemApi from "@/api/eam/equipmentAccounts"; import * as EquipmentItemApi from "@/api/eam/equipmentAccounts";
import {ToolAccounts} from "@/views/eam/toolAccounts/toolAccounts.data"; import {ToolAccounts} from "@/views/eam/toolAccounts/toolAccounts.data";
import * as ToolItemApi from "@/api/eam/toolAccounts"; import * as ToolItemApi from "@/api/eam/toolAccounts";
import * as ReworkBatchApi from "@/api/mes/reworkBatch";
import {mainListExecuteBtn} from "@/utils/disposition/defaultButtons";
defineOptions({ name: 'EquipmentMaintenanceMain' }) 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) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListEditBtn({hasPermi:'eam:equipmentMaintenanceMain:update'}), // defaultButtons.mainListEditBtn({hasPermi:'eam:equipmentMaintenanceMain:update'}), //
//defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipmentMaintenanceMain:delete'}), // //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.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'eam:maintenance:update'}),
defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),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) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
handleDelete(row.id) 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 {} } 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) => { const handleEnable = async (id: number) => {
try { try {

Loading…
Cancel
Save