소스 검색

Merge branch '17025' of http://119.23.210.103:3000/wy/lh_firm_former into 17025

wy 9 달 전
부모
커밋
062b99ac56

+ 17 - 16
src/store/getters.js

@@ -1,12 +1,13 @@
 export default {
     // ===========  用户相关
-    userId: (state) =>state.ibps.user.info && state.ibps.user.info.user? state.ibps.user.info.user.id : "", // 用户ID
-    name: (state) =>state.ibps.user.info && state.ibps.user.info.employee? state.ibps.user.info.employee.name: "", // 姓名
-    status: (state) =>state.ibps.user.info && state.ibps.user.info.employee? state.ibps.user.info.employee.status : "", // 用户状态
+    userId: (state) => state.ibps.user.info && state.ibps.user.info.user ? state.ibps.user.info.user.id : '', // 用户ID
+    name: (state) => state.ibps.user.info && state.ibps.user.info.employee ? state.ibps.user.info.employee.name : '', // 姓名
+    status: (state) => state.ibps.user.info && state.ibps.user.info.employee ? state.ibps.user.info.employee.status : '', // 用户状态
     org: (state) => (state.ibps.user.info ? state.ibps.user.info.org : {}), // 用户部门信息
-    position: (state) =>state.ibps.user.info && state.ibps.user.info.employee? state.ibps.user.info.employee.positions: "", // 用户部门信息
-    isSuper: (state) => state.ibps.user.info && state.ibps.user.info.user ? state.ibps.user.info.user.isSuper === "Y" : false, // 是否超级管理员
-    account: (state) =>state.ibps.user.info && state.ibps.user.info.user ? state.ibps.user.info.user.account : "", // 用户名
+    role: state => state.ibps.user.info ? state.ibps.user.info.role : [], // 用户角色信息
+    position: (state) => state.ibps.user.info && state.ibps.user.info.employee ? state.ibps.user.info.employee.positions : '', // 用户部门信息
+    isSuper: (state) => state.ibps.user.info && state.ibps.user.info.user ? state.ibps.user.info.user.isSuper === 'Y' : false, // 是否超级管理员
+    account: (state) => state.ibps.user.info && state.ibps.user.info.user ? state.ibps.user.info.user.account : '', // 用户名
     regOpen: (state) => state.ibps.user.regOpen, // 注册状态
 
     userInfo: (state) => state.ibps.user.info, // 用户信息
@@ -14,37 +15,37 @@ export default {
     // =========== 租户
     tenant: (state) => state.ibps.user.info && state.ibps.user.info.mainTenant ? state.ibps.user.info.mainTenant || {} : {}, // 当前租户
     tenants: (state) => state.ibps.user.info && state.ibps.user.info.tenants ? state.ibps.user.info.tenants || [] : [], // 当前拥有的租户
-    tenantid: (state) => state.ibps.user.info && state.ibps.user.info.tenantId ? state.ibps.user.info.tenantId || "": "", // 租户id
-    isTenantAdmin: (state) => state.ibps.user.info && state.ibps.user.info.isTenantAdmin? state.ibps.user.info.isTenantAdmin || false : false, // 是否租户管理员
+    tenantid: (state) => state.ibps.user.info && state.ibps.user.info.tenantId ? state.ibps.user.info.tenantId || '' : '', // 租户id
+    isTenantAdmin: (state) => state.ibps.user.info && state.ibps.user.info.isTenantAdmin ? state.ibps.user.info.isTenantAdmin || false : false, // 是否租户管理员
 
     single: (state) => state.ibps.api.single, // 单体应用
     baseApi: (state) => state.ibps.api.base, // baseAPI地址
     websocket: (state) => state.ibps.api.websocket, // websocket地址
 
-    isTenantOpen: (state) =>state.ibps.sass ? state.ibps.sass.tenantOpen : false, // 是否租户模式
+    isTenantOpen: (state) => state.ibps.sass ? state.ibps.sass.tenantOpen : false, // 是否租户模式
 
-    designTenantid: (state) =>state.ibps.user && state.ibps.user.designTenantid ? state.ibps.user.designTenantid || "" : "",
+    designTenantid: (state) => state.ibps.user && state.ibps.user.designTenantid ? state.ibps.user.designTenantid || '' : '',
     // =========== 菜单
     menus: (state) => state.ibps.menu.menus, // 菜单
     routers: (state) => state.ibps.menu.routers, // 新增的路由表
     // =========== 子系统
     system: (state) => state.ibps.system.system, // 子系统
-    systemid: (state) =>state.ibps.system.system ? state.ibps.system.system.id : "", // 子系统id
+    systemid: (state) => state.ibps.system.system ? state.ibps.system.system.id : '', // 子系统id
 
     permissions: (state) => state.ibps.menu.permissions, //  拥有的权限
-    jianCeDuiXiangId: (state) =>state.ibps.jianCeDuiXiangId ? state.ibps.jianCeDuiXiangId : "",
-    myform: (state) => (state.ibps.myform ? state.ibps.myform : ""),
-    jianCeCanShuId: (state) => state.ibps.jianCeCanShuId ? state.ibps.jianCeCanShuId : "",
+    jianCeDuiXiangId: (state) => state.ibps.jianCeDuiXiangId ? state.ibps.jianCeDuiXiangId : '',
+    myform: (state) => (state.ibps.myform ? state.ibps.myform : ''),
+    jianCeCanShuId: (state) => state.ibps.jianCeCanShuId ? state.ibps.jianCeCanShuId : '',
     // 所有检测项目名称及流程key数组
     testingList: (state) => state.ibps.param && state.ibps.param.testingList ? state.ibps.param.testingList : [],
     // 获取所有用户信息
-    userList: (state) =>state.ibps.param && state.ibps.param.userList ? state.ibps.param.userList : [],
+    userList: (state) => state.ibps.param && state.ibps.param.userList ? state.ibps.param.userList : [],
     // 获取用户最高层级
     level: (state) => state.ibps.param && state.ibps.param.level ? state.ibps.param.level : [],
     // 获取所有部门信息
     deptList: (state) => state.ibps.param && state.ibps.param.deptList ? state.ibps.param.deptList : [],
     // 获取所有岗位信息
-    positionList: (state) =>state.ibps.param && state.ibps.param.positionList ? state.ibps.param.positionList : [],
+    positionList: (state) => state.ibps.param && state.ibps.param.positionList ? state.ibps.param.positionList : [],
     // 获取认证信息
     licence: state => state.ibps.licence ? state.ibps.licence.licJson : {}
 }

+ 10 - 10
src/views/component/trainingManage/index.vue

@@ -168,19 +168,19 @@ export default {
                 // 查询条件
                 searchForm: {
                     forms: [
-                        { prop: '', label: '姓名', fieldType: 'slot', slotName: 'user' },
-                        { prop: '', label: '部门', fieldType: 'slot', slotName: 'position' },
-                        { prop: '', label: '统计时段', fieldType: 'slot', slotName: 'time' }
+                        { prop: '', label: '姓名', fieldType: 'slot', slotName: 'user', labelWidth: 40 },
+                        { prop: '', label: '部门', fieldType: 'slot', slotName: 'position', labelWidth: 40 },
+                        { prop: '', label: '统计时段', fieldType: 'slot', slotName: 'time', labelWidth: 70 }
                     ]
                 },
                 // 表格字段配置
                 columns: [
-                    { prop: 'id_', label: '姓名', width: 100, slotName: 'userIdSlot' },
-                    { prop: 'group_id_', label: '部门', width: 120, slotName: 'orgIdSlot' },
-                    { prop: 'jian_ding_zi_ge_z', label: '工号', width: 140 },
-                    { prop: 'planedjoin', label: '应参训次数', width: 120 },
-                    { prop: 'truejoin', label: '实参训次数', width: 120 },
-                    { prop: 'participationRate', label: '参训率', width: 120 },
+                    { prop: 'id_', label: '姓名', width: 200, slotName: 'userIdSlot' },
+                    { prop: 'group_id_', label: '部门', width: 220, slotName: 'orgIdSlot' },
+                    { prop: 'jian_ding_zi_ge_z', label: '工号', width: 240 },
+                    { prop: 'planedjoin', label: '应参训次数', width: 220 },
+                    { prop: 'truejoin', label: '实参训次数', width: 220 },
+                    { prop: 'participationRate', label: '参训率' },
                     { label: '操作', width: 120, slotName: 'customButton' }
                 ]
             },
@@ -215,7 +215,7 @@ export default {
         async getDatas () {
             this.loading = true
             const params = {
-                //diDian: this.level
+                // diDian: this.level
             }
             if (this.user) {
                 params.userId = this.user

+ 19 - 13
src/views/platform/examination/exam/detail.vue

@@ -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 }) {

+ 7 - 1
src/views/platform/examination/questionBank/edit.vue

@@ -76,7 +76,7 @@
                         <i class="el-icon-question question-icon">:</i>
                     </el-tooltip>
                 </template>
-                <el-radio-group v-model="form.suo_shu_fan_wei_" :disabled="readonly">
+                <el-radio-group v-model="form.suo_shu_fan_wei_" :disabled="readonly" @change="chageFanwei">
                     <el-radio label="科级">科级</el-radio>
                     <el-radio label="组级">组级</el-radio>
                 </el-radio-group>
@@ -527,6 +527,12 @@ export default {
         changeLimit (e) {
             this.form.xian_kao_ci_shu_ = e === '1' ? 1 : '不限'
         },
+        chageFanwei (e) {
+            console.log(e, 'aaaaa')
+
+            const { deptList = [] } = this.$store.getters || {}
+            this.form.bian_zhi_bu_men_ = e === '组级' ? '' : deptList.filter(i => !i.path_id.split('.')[1])[0].positionId
+        },
         getRaterOptions () {
             const { userList = [], deptList = [] } = this.$store.getters || {}
             const depts = deptList.filter(i => i.depth > 2)

+ 8 - 1
src/views/platform/examination/questionBank/test.vue

@@ -157,6 +157,10 @@ export default {
         examData: {
             type: Object,
             default: () => {}
+        },
+        pingfenRen: {
+            type: String,
+            default: ''
         }
     },
     data () {
@@ -536,6 +540,9 @@ export default {
                 const autoType = ['单选题', '多选题', '判断题'].includes(item.questionType)
                 const multipleType = ['多选题', '填空题'].includes(item.questionType)
                 const selectType = ['多选题', '单选题'].includes(item.questionType)
+                const a = item.rater ? item.rater.split(',') : []
+                const b = this.pingfenRen ? this.pingfenRen.split(',') : []
+                const ping_fen_ren_ = [...a, ...b].join(',')
                 submitData.push({
                     parent_id_: this.id,
                     ti_mu_id_: item.questionId,
@@ -547,7 +554,7 @@ export default {
                     xuan_xiang_: selectType ? JSON.stringify(item.options) : '',
                     can_kao_da_an_: item.rightKey,
                     ping_fen_fang_shi: item.rateType,
-                    ping_fen_ren_: item.rater,
+                    ping_fen_ren_: ping_fen_ren_,
                     hui_da_: multipleType && item.answer ? JSON.stringify(item.answer) : item.answer,
                     shi_fou_yi_yue_: autoType ? '是' : '否',
                     ping_yue_shi_jian: autoType ? time : '',