|
|
@ -232,7 +232,53 @@ const judgeHasAddFunc = () => { |
|
|
|
const rolesOk = userStore.roles.find(item => { |
|
|
|
return item == 'device_class_worker_role' || item == 'device_class_Engineer_role' || item == 'tech_class_worker_role' || item == 'tech_class_Engineer_role' |
|
|
|
}) |
|
|
|
if (rolesOk != undefined && rolesOk != null && rolesOk.length > 0) { |
|
|
|
if (rolesOk != undefined && rolesOk != null) { |
|
|
|
return true |
|
|
|
} else { |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const judgeIsTheClass = (row) => { |
|
|
|
const rolesOk = userStore.roles.find(item => { |
|
|
|
if (row.type == 'DEVICE') { |
|
|
|
return item == 'device_class_worker_role' || item == 'device_class_Engineer_role' |
|
|
|
}else if (row.type == 'TECH') { |
|
|
|
return item == 'tech_class_worker_role' || item == 'tech_class_Engineer_role' |
|
|
|
} |
|
|
|
}) |
|
|
|
if (rolesOk != undefined && rolesOk != null) { |
|
|
|
return true |
|
|
|
} else { |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
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 judgeIsTheClassWorker = (row) => { |
|
|
|
const rolesOk = userStore.roles.find(item => { |
|
|
|
if (row.type == 'DEVICE') { |
|
|
|
return item == 'device_class_worker_role' |
|
|
|
}else if (row.type == 'TECH') { |
|
|
|
return item == 'tech_class_worker_role' |
|
|
|
} |
|
|
|
}) |
|
|
|
if (rolesOk != undefined && rolesOk != null) { |
|
|
|
return true |
|
|
|
} else { |
|
|
|
return false |
|
|
@ -288,22 +334,22 @@ const butttondata = (row) => { |
|
|
|
defaultButtons.mainListEditBtn({ hide: !(row.status != 'COMPLETED' && row.status != 'VERIFIED' && row.status != 'REJECTED' && isReceiver(row.maintenance) )}), // 编辑 |
|
|
|
defaultButtons.acceptOrderBtn({ |
|
|
|
hide: !( |
|
|
|
row.status == 'PENDING' |
|
|
|
row.status == 'PENDING' && judgeIsTheClass(row) |
|
|
|
) |
|
|
|
}), // 接单 |
|
|
|
defaultButtons.turnOrderBtn({ |
|
|
|
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) |
|
|
|
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id && !row.hasDetails) |
|
|
|
}), // 转办 |
|
|
|
defaultButtons.repairBtn({ |
|
|
|
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) |
|
|
|
}), // 维修 |
|
|
|
defaultButtons.verifyOrderBtn({ |
|
|
|
hide: !( |
|
|
|
row.status == 'COMPLETED' |
|
|
|
row.status == 'COMPLETED' && judgeIsTheClassEngineer(row) |
|
|
|
) |
|
|
|
}), // 验证 |
|
|
|
defaultButtons.finishOrderBtn({ |
|
|
|
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) |
|
|
|
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id && row.hasDetails) |
|
|
|
}), // 完成 |
|
|
|
defaultButtons.pictureBtn({ |
|
|
|
hide: !(row.filePathList != null && row.filePathList.length > 0) |
|
|
|