|
|
@@ -152,7 +152,7 @@
|
|
|
<el-table-column prop="positionId" label="部门" width="100">
|
|
|
<template slot-scope="{ row }">
|
|
|
<ibps-user-selector
|
|
|
- type="position"
|
|
|
+ type="org"
|
|
|
:value="row.positionId"
|
|
|
readonly-text="text"
|
|
|
:disabled="true"
|
|
|
@@ -362,20 +362,26 @@ export default {
|
|
|
},
|
|
|
// 获取部门数据
|
|
|
async posData () {
|
|
|
- const sql = `select p.*,r.SUB_PID_ as userId FROM IBPS_PARTY_POSITION p INNER JOIN ibps_party_rel r ON p.id_ = r.MAIN_PID_ WHERE r.BIZ_ = 'mainPost' ORDER BY p.CREATE_TIME_ DESC`
|
|
|
+ // const sql = `select p.*,r.SUB_PID_ as userId FROM IBPS_PARTY_POSITION p INNER JOIN ibps_party_rel r ON p.id_ = r.MAIN_PID_ WHERE r.BIZ_ = 'mainPost' ORDER BY p.CREATE_TIME_ DESC`
|
|
|
+ const sql = `select users.id_ as userId, users.name_ as userName, users.status_ as status, users.gender_ as gender, (select ifnull(GROUP_CONCAT(DISTINCT roles.role_id_ SEPARATOR ','), '') from ibps_party_user_role as roles where roles.user_id_ = users.id_ ) as roleId, (select ifnull(GROUP_CONCAT(DISTINCT roles.name_ SEPARATOR ','), '') from ibps_party_role as roles where roles.id_ in (select role_id_ from ibps_party_user_role where user_id_ = users.id_)) as roleName, (select ifnull(GROUP_CONCAT(DISTINCT roles.role_alias_ SEPARATOR ','), '') from ibps_party_role as roles where roles.id_ in (select role_id_ from ibps_party_user_role where user_id_ = users.id_)) as roleAlias, ifnull(o.name_, '') as groupName, o.ID_ as groupID from ibps_party_employee users left join ibps_party_user_role ur on users.id_ = ur.user_id_ left join ibps_party_role r on r.id_ = ur.role_id_ left join ibps_party_org o on o.id_ = users.group_id_ where users.status_ = 'actived' and users.id_ <> '-1' group by users.id_`
|
|
|
const { variables: { data }} = await this.$common.request('sql', sql)
|
|
|
this.paperList.forEach((item) => {
|
|
|
- const mainUser = data.find(i => i.userId === item.examineeId)
|
|
|
- // 如果有主部门 只统计主部门
|
|
|
- if (mainUser) {
|
|
|
- this.$set(item, 'positionId', mainUser?.ID_ || '')
|
|
|
- this.$set(item, 'positionName', mainUser?.NAME_ || '')
|
|
|
- } else {
|
|
|
- // 没有主部门 则统计全部
|
|
|
- const user = this.userList.find((u) => u.userId === item.examineeId)
|
|
|
- this.$set(item, 'positionId', user?.positionId || '')
|
|
|
- this.$set(item, 'positionName', user?.positions || '')
|
|
|
- }
|
|
|
+ // const mainUser = data.find(i => i.userId === item.examineeId)
|
|
|
+ // // 如果有主部门 只统计主部门
|
|
|
+ // if (mainUser) {
|
|
|
+ // this.$set(item, 'positionId', mainUser?.ID_ || '')
|
|
|
+ // this.$set(item, 'positionName', mainUser?.NAME_ || '')
|
|
|
+ // } else {
|
|
|
+ // // 没有主部门 则统计全部
|
|
|
+ // const user = this.userList.find((u) => u.userId === item.examineeId)
|
|
|
+ // this.$set(item, 'positionId', user?.positionId || '')
|
|
|
+ // this.$set(item, 'positionName', user?.positions || '')
|
|
|
+ // }
|
|
|
+ console.log(this.userList)
|
|
|
+
|
|
|
+ const user = data.find((u) => u.userId === item.examineeId)
|
|
|
+ this.$set(item, 'positionId', user?.groupID || '')
|
|
|
+ this.$set(item, 'positionName', user?.groupName || '')
|
|
|
})
|
|
|
},
|
|
|
handleActionEvent ({ key }) {
|