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