RoleSetting.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. <template>
  2. <div class="all">
  3. <div class="alert-box bounce animated">
  4. <div class="alert-content flex-box-ce">
  5. <i class="el-icon-warning"></i>
  6. 如需设置绩效主管理员,绩效子管理员,部门管理员,普通员工及其权限,请前往旧系统设置!
  7. </div>
  8. <div class="alert-btn" @click="goSetting()">
  9. <el-link type="primary">立即设置</el-link>
  10. </div>
  11. </div>
  12. <div class="flex-box-ce">
  13. <div style="height: 40px; display: flex; align-items: center;">
  14. <div class="title">绩效主管理员</div>
  15. <div class="text fontColorC">拥有全部权限,支持更换主管理员</div>
  16. </div>
  17. </div>
  18. <div style="margin: 10px 0;">
  19. <div class="flex-box-ce" style="margin-bottom: 10px; width: 360px;" v-for="(item, index) in userMain"
  20. :key="index">
  21. <userImage :user_name="item.name" :img_url="item.img_url" :id="item.id" fontSize="14"></userImage>
  22. <span class="name flex-1">{{ item.name }}</span>
  23. </div>
  24. </div>
  25. <div class="flex-box-ce">
  26. <div style="height: 40px; display: flex; align-items: center;">
  27. <div class="title">绩效子管理员</div>
  28. <div class="text fontColorB">负责绩效考核日常的管理工作,由主管理员分配权限</div>
  29. </div>
  30. </div>
  31. <div class="table-box">
  32. <el-table :data="AdministratorList" style="width: 100%;" v-loading="loading" size="mini"
  33. :header-cell-style="{ background: '#f5f7fa' }">
  34. <el-table-column prop="date" label="姓名">
  35. <template slot-scope="scope">
  36. <div class="flex-box-ce">
  37. <userImage :user_name="scope.row.name" fontSize="14" :img_url="scope.row.img_url">
  38. </userImage>
  39. <span class="name">{{ scope.row.name }}</span>
  40. </div>
  41. </template>
  42. </el-table-column>
  43. <el-table-column prop="range" label="管理范围">
  44. <template slot-scope="scope">
  45. <span>{{ scope.row.range == '全公司' ? '全公司' : '其管辖部门及子部门的人员' }}</span>
  46. </template>
  47. </el-table-column>
  48. <el-table-column prop="menu" label="权限菜单">
  49. <template slot-scope="scope">
  50. <span>{{ filtrationStr(scope.row.menu) }}</span>
  51. </template>
  52. </el-table-column>
  53. <el-table-column prop="group" label="管理考核表">
  54. <template slot-scope="scope">
  55. <span>{{ filtrationStr(scope.row.group) }}</span>
  56. </template>
  57. </el-table-column>
  58. <!-- <el-table-column label="操作">
  59. <template slot-scope="scope">
  60. <el-button @click="compile(scope.row)" type="text">编辑</el-button>
  61. <el-button @click="deleteUser(scope.row.id)" type="text" class="red">删除</el-button>
  62. </template>
  63. </el-table-column> -->
  64. </el-table>
  65. <Pagination :page="page" :page_size="page_size" :page_sizes="[5]" :total="total"
  66. @handleSizeChange="handleSizeChange" @handleCurrentChange="handleCurrentChange"></Pagination>
  67. </div>
  68. <div>
  69. <div class="title-f flex-box-ce" style="height: 40px; display: flex; align-items: center;">
  70. <div class="title">部门管理员</div>
  71. <div class="text fontColorB">部门管理员在【组织架构】设置,可以对管理范围下的员工进行沟通反馈,评分,查看考核结果</div>
  72. </div>
  73. <div class="title-f flex-box-ce" style="height: 40px; display: flex; align-items: center;">
  74. <div class="title">普通员工</div>
  75. <div class="text fontColorB">员工只能看到自己的绩效,编写执行计划并进行沟通反馈</div>
  76. </div>
  77. </div>
  78. </div>
  79. </template>
  80. <script>
  81. import EmployeeSelector from '@/components/EmployeeSelector';
  82. import BrawerBox from '@/performance/components/public/BrawerBox';
  83. export default {
  84. components: { EmployeeSelector, BrawerBox },
  85. name: 'JurisdictionSet',
  86. data() {
  87. return {
  88. total: 0,
  89. page: 1,
  90. page_size: 5,
  91. loading: false,
  92. isAdministrator: false,
  93. isChecks: false,
  94. setAdministrator: false,
  95. // 编辑添加管理员
  96. checkboxs: [
  97. { label: '全部权限', id: 'all', check: true },
  98. {
  99. label: '绩效管理',
  100. id: 'kh',
  101. check: true,
  102. child: [
  103. { label: '发起考核', id: '7', check: true },
  104. { label: '开始评分', id: '8', check: true },
  105. { label: '调整结果', id: '9', check: true },
  106. { label: '等级配置', id: '10', check: true },
  107. { label: '导出报表', id: '11', check: true }
  108. ]
  109. },
  110. // { label: '考核指标库', id: '12', check: true },
  111. { label: '绩效等级配置', id: '15', check: true },
  112. { label: '绩效报表', id: '16', check: true },
  113. { label: '考核表', id: 'kp', check: true }
  114. ],
  115. selected: { employee: [], dept: [] },
  116. // 考核模板
  117. searchWords: '',
  118. groupList: [],
  119. userMain: [], //主管理员
  120. AdministratorList: [], //子管理员列表
  121. setCreator: false, //更换主管理员
  122. employee_not_select: [],//过滤的管理员
  123. // 添加编辑子管理员
  124. userData: {},
  125. scope: 3, //管理范围
  126. isKjJg: true, //是否可见考核结果
  127. review: 14, //考核模板
  128. isReviewShow: true, //控制考核模板是否能显示
  129. isReviewShow2: false, //控制考核模板是否能显示
  130. parameter: {
  131. id: '',
  132. permission: '',
  133. group: ''
  134. },
  135. selectGroup: [], //选择的考核模板
  136. isDisabled: false,
  137. id: ''
  138. };
  139. },
  140. watch: {
  141. review(val) {
  142. this.isReviewShow2 = val == 14 ? false : true;
  143. },
  144. },
  145. created() {
  146. this.getList();
  147. this.getList2();
  148. // this.getGroups();
  149. },
  150. mounted() {
  151. this.$nextTick(() => { });
  152. },
  153. methods: {
  154. // 过滤
  155. filtrationStr(str, is) {
  156. if (is) {
  157. var text = [...str].toString();
  158. return str.length > 0 ? text : '--';
  159. } else {
  160. return str ? str : '--';
  161. }
  162. },
  163. qkSelect() {
  164. // 初始化数据
  165. this.selectGroup = [];
  166. for (let i in this.groupList) {
  167. this.$set(this.groupList[i], 'check', false);
  168. }
  169. for (let i in this.checkboxs) {
  170. this.$set(this.checkboxs[i], 'check', true);
  171. if (this.checkboxs[i].child) {
  172. for (let j in this.checkboxs[i].child) {
  173. this.$set(this.checkboxs[i].child[j], 'check', true);
  174. }
  175. }
  176. }
  177. },
  178. // 获取主管理员
  179. getList2() {
  180. this.$axiosUser('get', '/api/pro/per/user/manager_info', { range: 1 }).then(res => {
  181. this.userMain = res.data.data.list || [];
  182. });
  183. },
  184. // 获取子管理员
  185. getList() {
  186. this.loading = true;
  187. this.$axiosUser('get', '/api/pro/per/user/manager_info', { page: this.page, page_size: this.page_size, range: 0 })
  188. .then(res => {
  189. let data = res.data.data.list || [];
  190. this.total = res.data.data.total;
  191. this.AdministratorList = data.filter(item => {
  192. this.employee_not_select.push(item.id);
  193. return item.main == 0;
  194. });
  195. })
  196. .finally(() => {
  197. this.loading = false;
  198. });
  199. },
  200. goSetting() {
  201. this.$router.push("/jurisdictionSet")
  202. },
  203. // 页面变更
  204. handleCurrentChange(val) {
  205. this.page = val;
  206. this.getList();
  207. },
  208. // 页面跳转
  209. handleSizeChange(val) {
  210. this.page_size = val;
  211. this.getList();
  212. }
  213. }
  214. };
  215. </script>
  216. <style scoped="scoped" lang="scss">
  217. .all {
  218. min-height: calc(100vh - 210px);
  219. overflow: auto;
  220. padding: 20px;
  221. background-color: #fff;
  222. }
  223. .title {
  224. font-size: 18px;
  225. font-weight: 500;
  226. margin-right: 10px;
  227. }
  228. .name {
  229. padding-left: 10px;
  230. }
  231. .title-f {
  232. margin-bottom: 20px;
  233. }
  234. .inputDc {
  235. position: absolute;
  236. top: 0;
  237. right: 0;
  238. left: 0;
  239. bottom: 0;
  240. z-index: 9;
  241. }
  242. .checkChild {
  243. background-color: #fbfdff;
  244. margin-left: 20px;
  245. }
  246. .li {
  247. border-bottom: 1px solid #f1f1f1;
  248. }
  249. .li:hover {
  250. background-color: #f5f7fa;
  251. }
  252. .ul {
  253. margin: 20px 0;
  254. margin-top: 10px;
  255. }
  256. .alert-box {
  257. width: 100%;
  258. height: 40px;
  259. background-color: #fdf6ec;
  260. color: #E6A23C;
  261. border-radius: 4px;
  262. display: flex;
  263. align-items: center;
  264. justify-content: space-between;
  265. padding: 8px 16px;
  266. box-sizing: border-box;
  267. .el-icon-warning {
  268. font-size: 16px;
  269. width: 16px;
  270. margin-right: 3px;
  271. }
  272. }
  273. </style>