Ver código fonte

bug 951 体系运行记录盒人员信息错误

cfort 2 anos atrás
pai
commit
74f0cf0feb

+ 2 - 1
src/store/modules/ibps/modules/user.js

@@ -150,7 +150,8 @@ export default {
          * 获取所有系统用户账号
          */
         getUserList ({ state, dispatch }) {
-            const sql = 'select id_ as userId, name_ as userName, mobile_ as phone from ibps_party_employee'
+            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 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_ group by users.id_
+            `
             request('sql', sql).then(res => {
                 const { data = [] } = res.variables || {}
                 dispatch('ibps/param/setUserList', data, {

+ 7 - 14
src/views/platform/bpmn/bpmInstHis/list.vue

@@ -200,7 +200,7 @@ export default {
         const roleList = this.$store.getters.userInfo.role
         // 系统管理角色、实验室主任、档案管理员具有高级权限
         const hasRole = roleList.some(item => ['xtgljs', 'syszr', 'dagly', 'xxgljs'].includes(item.alias))
-        const { account = '' } = this.$store.getters
+        const { account = '', userList = [] } = this.$store.getters
         return {
             hasRole,
             width: 210,
@@ -269,7 +269,8 @@ export default {
                     effect: 'display',
                     width: '100'
                 }
-            }
+            },
+            userList
         }
     },
     created () {
@@ -307,18 +308,10 @@ export default {
             queryClassify(this.getSearcFormData()).then((response) => {
                 const data = response.data && response.data.dataResult
                 data.forEach(item => {
-                    const temp = this.getParenthesesStr(item.subject)
-                    // 如果是年度计划, 标题编辑中取年份, 去除默认给与的年份
-                    if (temp.length === 4) {
-                        // 判断截取内容是否为数字,如果不是则截取创建时间的作为年份
-                        item.tYear = isNaN(Number(temp[0])) ? item.createTime.slice(0, 4) : temp[0]
-                        item.tDept = temp[2]
-                        item.tUser = temp[3]
-                    } else if (temp.length > 1) {
-                        item.tYear = isNaN(Number(temp[0])) ? item.createTime.slice(0, 4) : temp[0]
-                        item.tDept = temp[1]
-                        item.tUser = temp[2]
-                    }
+                    const temp = this.userList.find(i => item.createBy === i.userId)
+                    item.tYear = item.createTime.slice(0, 4)
+                    item.tDept = temp.groupName
+                    item.tUser = temp.userName
                     if ((item.formKey == 'nsssjhbfj' || item.formKey == 'nsssjhx') && item.updateTime == item.endTime) {
                         item.endTime = ''
                     }