|
|
@ -354,6 +354,10 @@ const judgeIsTheClass = (row) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const judgeIsTheFactory = (row) => { |
|
|
|
return userStore.userSelfInfo.deptId == row.factoryAreaNumber |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const judgeIsTheClassEngineer = (row) => { |
|
|
|
const rolesOk = userStore.roles.find(item => { |
|
|
@ -371,16 +375,6 @@ const judgeIsTheClassEngineer = (row) => { |
|
|
|
} |
|
|
|
|
|
|
|
const judgeIsTheClassEngineerAndApply = (row,type) => { |
|
|
|
// 先判断角色是否满足条件 |
|
|
|
const rolesOk = userStore.roles.some(item => { |
|
|
|
if (row.type == 'DEVICE') { |
|
|
|
return item === 'device_class_Engineer_role'; |
|
|
|
} else if (row.type == 'TECH') { |
|
|
|
return item === 'tech_class_Engineer_role'; |
|
|
|
} |
|
|
|
}); |
|
|
|
// 如果角色不满足条件,直接返回false |
|
|
|
if (!rolesOk) return false; |
|
|
|
// 根据不同的状态进行判断 |
|
|
|
if (row.status === 'COMPLETED' && type == 'CONFIRM') { |
|
|
|
// COMPLETED状态下,需要额外判断requestNumber和declarer |
|
|
@ -389,10 +383,28 @@ const judgeIsTheClassEngineerAndApply = (row,type) => { |
|
|
|
}else{ |
|
|
|
return false |
|
|
|
} |
|
|
|
}else if(row.status === 'COMPLETED' && type == 'VERIFY'){ |
|
|
|
if(row.requestNumber == null || row.requestNumber == ''){ |
|
|
|
// 先判断角色是否满足条件 |
|
|
|
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) return true |
|
|
|
} |
|
|
|
} else if (row.status === 'APPLYPASS' && type == 'VERIFY') { |
|
|
|
// APPLYPASS状态下,可能有其他逻辑,这里直接返回true作为示例 |
|
|
|
// 根据实际情况,这里可能需要添加额外的逻辑判断 |
|
|
|
return true; |
|
|
|
// 先判断角色是否满足条件 |
|
|
|
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) return true |
|
|
|
} |
|
|
|
|
|
|
|
// 如果不是COMPLETED或APPLYPASS状态,或者COMPLETED状态下条件不满足,则默认返回false |
|
|
@ -417,6 +429,7 @@ const judgeIsTheClassWorker = (row) => { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
|
const HeadButttondata = [ |
|
|
|
defaultButtons.defaultAddBtn({ hide: !(judgeHasAddFunc()) }), // 新增 |
|
|
@ -469,7 +482,7 @@ const butttondata = (row) => { |
|
|
|
defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && row.status != 'APPLYPASS' && isReceiver(row.maintenance) )}), // 编辑 |
|
|
|
defaultButtons.acceptOrderBtn({ |
|
|
|
hide: !( |
|
|
|
row.status == 'PENDING' && judgeIsTheClass(row) |
|
|
|
row.status == 'PENDING' && judgeIsTheClass(row) && judgeIsTheFactory(row) |
|
|
|
) |
|
|
|
}), // 接单 |
|
|
|
defaultButtons.turnOrderBtn({ |
|
|
@ -480,7 +493,7 @@ const butttondata = (row) => { |
|
|
|
}), // 维修 |
|
|
|
defaultButtons.verifyOrderBtn({ |
|
|
|
hide: !( |
|
|
|
judgeIsTheClassEngineerAndApply(row,'VERIFY') |
|
|
|
judgeIsTheClassEngineerAndApply(row,'VERIFY') && judgeIsTheFactory(row) |
|
|
|
) |
|
|
|
}), // 验证 |
|
|
|
defaultButtons.finishOrderBtn({ |
|
|
|