|
@ -361,38 +361,18 @@ const judgeIsTheClass = (row) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const judgeIsTheFactory = (row) => { |
|
|
|
|
|
return userStore.userSelfInfo.deptId == row.factoryAreaNumber |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const judgeIsTheClassEngineer = (row) => { |
|
|
|
|
|
const rolesOk = userStore.roles.find(item => { |
|
|
|
|
|
if (row.type == 'DEVICE') { |
|
|
|
|
|
return item == 'device_class_Engineer_role' |
|
|
|
|
|
}else if (row.type == 'TECH') { |
|
|
|
|
|
return item == 'tech_class_Engineer_role' |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
if (rolesOk != undefined && rolesOk != null) { |
|
|
|
|
|
return true |
|
|
|
|
|
} else { |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const judgeIsTheClassEngineerAndApply = (row,type) => { |
|
|
const judgeIsTheClassEngineerAndApply = (row,type) => { |
|
|
// 根据不同的状态进行判断 |
|
|
// 根据不同的状态进行判断 |
|
|
// if (row.status === 'COMPLETED' && type == 'CONFIRM') { |
|
|
if (row.status === 'COMPLETED' && type == 'CONFIRM') { |
|
|
if (row.status === 'COMPLETED') { |
|
|
|
|
|
// COMPLETED状态下,需要额外判断requestNumber和declarer |
|
|
// COMPLETED状态下,需要额外判断requestNumber和declarer |
|
|
if(row.requestNumber != null && row.requestNumber !== '' && row.declarer === userStore.getUser.id){ |
|
|
if(row.requestNumber != null && row.requestNumber !== '' && row.declarer === userStore.getUser.id){ |
|
|
return true |
|
|
return true |
|
|
}else{ |
|
|
}else{ |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
|
|
|
|
}else if(row.status === 'APPLYPASS' && type == 'VERIFY'){ |
|
|
|
|
|
return true |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 如果不是COMPLETED或APPLYPASS状态,或者COMPLETED状态下条件不满足,则默认返回false |
|
|
// 如果不是COMPLETED或APPLYPASS状态,或者COMPLETED状态下条件不满足,则默认返回false |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
@ -452,7 +432,7 @@ const butttondata = (row) => { |
|
|
defaultButtons.acceptOrderBtn({ |
|
|
defaultButtons.acceptOrderBtn({ |
|
|
hasPermi:'eam:device-maintenance-job-main:orderClick', |
|
|
hasPermi:'eam:device-maintenance-job-main:orderClick', |
|
|
hide: !( |
|
|
hide: !( |
|
|
row.status == 'PENDING' && judgeIsTheFactory(row) |
|
|
row.status == 'PENDING' |
|
|
) |
|
|
) |
|
|
}), // 接单 |
|
|
}), // 接单 |
|
|
defaultButtons.turnOrderBtn({ |
|
|
defaultButtons.turnOrderBtn({ |
|
@ -466,7 +446,7 @@ const butttondata = (row) => { |
|
|
defaultButtons.verifyOrderBtn({ |
|
|
defaultButtons.verifyOrderBtn({ |
|
|
hasPermi:'eam:device-maintenance-job-main:orderClickVerify', |
|
|
hasPermi:'eam:device-maintenance-job-main:orderClickVerify', |
|
|
hide: !( |
|
|
hide: !( |
|
|
judgeIsTheClassEngineerAndApply(row,'VERIFY') && judgeIsTheFactory(row) |
|
|
judgeIsTheClassEngineerAndApply(row,'VERIFY') |
|
|
) |
|
|
) |
|
|
}), // 验证 |
|
|
}), // 验证 |
|
|
defaultButtons.finishOrderBtn({ |
|
|
defaultButtons.finishOrderBtn({ |
|
@ -491,11 +471,11 @@ const onChange = (field, cur, item) => { |
|
|
// console.log(item) |
|
|
// console.log(item) |
|
|
// console.log(item.componentProps.options) |
|
|
// console.log(item.componentProps.options) |
|
|
formRef.value.formRef.formModel.maintenance = Number(userStore?.getUser?.id) |
|
|
formRef.value.formRef.formModel.maintenance = Number(userStore?.getUser?.id) |
|
|
if (judgeIfDeviceRole()) { |
|
|
// if (judgeIfDeviceRole()) { |
|
|
formRef.value.formRef.formModel.type = 'DEVICE' |
|
|
// formRef.value.formRef.formModel.type = 'DEVICE' |
|
|
} else { |
|
|
// } else { |
|
|
formRef.value.formRef.formModel.type = 'TECH' |
|
|
// formRef.value.formRef.formModel.type = 'TECH' |
|
|
} |
|
|
// } |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -1186,16 +1166,16 @@ const getActorClass = () => { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const judgeIfDeviceRole = () => { |
|
|
// const judgeIfDeviceRole = () => { |
|
|
const rolesOk = userStore.roles.find(item => { |
|
|
// const rolesOk = userStore.roles.find(item => { |
|
|
return item == 'device_class_worker_role' || item == 'device_class_Engineer_role' |
|
|
// return item == 'device_class_worker_role' || item == 'device_class_Engineer_role' |
|
|
}) |
|
|
// }) |
|
|
if (rolesOk != undefined && rolesOk != null) { |
|
|
// if (rolesOk != undefined && rolesOk != null) { |
|
|
return true |
|
|
// return true |
|
|
} else { |
|
|
// } else { |
|
|
return false |
|
|
// return false |
|
|
} |
|
|
// } |
|
|
} |
|
|
// } |
|
|
|
|
|
|
|
|
const validateRow = (row) => { |
|
|
const validateRow = (row) => { |
|
|
let flag = true; |
|
|
let flag = true; |
|
|