| | |
| | | <el-table-column v-if="checkPer(['admin','taskUser:edit','taskUser:del'])" label="操作" width="150px" align="center" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <udOperation |
| | | v-if="userRolesLevelMin == roleLevelSuper || userRolesLevelMin == roleLevelGeneral || scope.row.projectLiableUserId == $store.state.user.user.id || scope.row.userId == $store.state.user.user.id" |
| | | :data="scope.row" |
| | | :permission="permission" |
| | | /> |
| | |
| | | standardWorkloadUnit: constant.STANDARD_WORKLOAD_UNIT, |
| | | // 字典:批准状态-未承认 |
| | | approveStatusUnrecognized: constant.APPROVE_STATUS_UNRECOGNIZED, |
| | | // 角色级别:超级管理员 |
| | | roleLevelSuper: constant.ROLE_LEVEL_SUPER, |
| | | // 角色级别:总经理 |
| | | roleLevelGeneral: constant.ROLE_LEVEL_GENERAL, |
| | | // 角色级别:普通用户 |
| | | roleLevelOrdinary: constant.ROLE_LEVEL_ORDINARY, |
| | | // CRUD状态 |
| | |
| | | this.form.divideUserIds = res |
| | | }) |
| | | } |
| | | }, |
| | | // 钩子:提交 - 之前 |
| | | [CRUD.HOOK.beforeSubmit]() { |
| | | // 判断用户角色 |
| | | if (this.userRolesLevelMin === this.roleLevelSuper || this.userRolesLevelMin === this.roleLevelGeneral) { |
| | | return true |
| | | } else { |
| | | // 检索选中项目信息 |
| | | const chooseProject = this.projects.filter((item) => { |
| | | return item.id === this.form.projectId |
| | | }) |
| | | // 判断是否是项目责任人 |
| | | if (chooseProject.projectLiableUserId === this.$store.state.user.user.id || this.form.userId === this.$store.state.user.user.id) { |
| | | return true |
| | | } else { |
| | | // 消息提示 |
| | | this.crud.notify('您不是当前项目责任人,无法添加/修改任务分配', CRUD.NOTIFICATION_TYPE.WARNING) |
| | | return false |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |