Эх сурвалжийг харах

修复考试,考完试后评分人无法评阅bug

shenqilong 10 сар өмнө
parent
commit
1778d21819

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

+ 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 : '',