cyy 10 месяцев назад
Родитель
Сommit
c1b468f687
1 измененных файлов с 94 добавлено и 25 удалено
  1. 94 25
      src/views/peopleManages/taskStatistics/index.vue

+ 94 - 25
src/views/peopleManages/taskStatistics/index.vue

@@ -177,6 +177,7 @@ export default {
         return {
             level: level.second || level.first,
             userList,
+            dept3:'',
             monthValues: [],
             startDate: '',
             endDate: '',
@@ -387,6 +388,10 @@ export default {
             degreePieData: {
                 // 学位学历
                 data: [
+                    {
+                        name: '高中',
+                        value: 0
+                    },
                     {
                         name: ' 大专',
                         value: 0
@@ -419,6 +424,10 @@ export default {
                         name: '中级',
                         value: 0
                     },
+                    {
+                        name: '副高',
+                        value: 0
+                    },
                     {
                         name: '高级',
                         value: 0
@@ -481,6 +490,29 @@ export default {
                 ],
                 // " 大专", "本科", "硕士", "博士", "初级职称", "中级职称", "高级职称"
                 series: [
+                {
+                        name: ' 高中',
+                        type: 'bar',
+                        emphasis: {
+                            focus: 'series'
+                        },
+                        stack: 'Search Engine',
+                        data: [],
+                        label: {
+                            // 柱体上显示数值
+                            show: true, // 开启显示
+                            textStyle: {
+                                // 数值样式
+                                fontSize: '12px',
+                                color: '#fff'
+                            },
+                            formatter: function (name) {
+                                return name.value === 0
+                                    ? ''
+                                    : '高:' + name.value
+                            }
+                        }
+                    },
                     {
                         name: ' 大专',
                         type: 'bar',
@@ -680,6 +712,29 @@ export default {
                             }
                         }
                     },
+                    {
+                        name: '副高级职称',
+                        type: 'bar',
+                        stack: 'Search Engine',
+                        emphasis: {
+                            focus: 'series'
+                        },
+                        data: [],
+                        label: {
+                            // 柱体上显示数值
+                            show: true, // 开启显示
+                            textStyle: {
+                                // 数值样式
+                                fontSize: '12px',
+                                color: 'rgba(251, 251, 251, 1)'
+                            },
+                            formatter: function (name) {
+                                return name.value === 0
+                                    ? ''
+                                    : '副高:' + name.value
+                            }
+                        }
+                    },
                     {
                         name: '高级职称',
                         type: 'bar',
@@ -844,7 +899,8 @@ export default {
             // const sql = `select a.id_, a.parent_id_, a.zui_gao_xue_li_x_, a.zhi_cheng_deng_ji, a.ren_zhi_shi_jian_, a.ru_zhi_shi_jian_, ee.name_, ee.jian_ding_zi_ge_z from t_ryjbqk as a join ibps_party_employee as ee on a.parent_id_= ee.id_`
             // const { variables: { data = [] }} = await this.$common.request('query', { key: 'empManageBoard1', params: [null] }) || {}
             const deptUserList = this.userList.filter(item => item.positionId.includes(this.selection))
-            this.employeeNum = this.userList.length
+            const deptUserList1 = this.userList.filter(item => !item.userName.includes('系统')&&!item.userName.includes('金通')&&!item.userName.includes('管理')&&!item.userId.includes('702117247933480960'))
+            this.employeeNum = deptUserList1.length
             this.personIds = deptUserList.map(i => i.userId).join(',')
             this.optionPerson.yAxis.data = deptUserList.map(i => i.userName)
             // this.getTtaskMattersData()
@@ -855,9 +911,11 @@ export default {
             this.degreePieData.data[1].value = 0
             this.degreePieData.data[2].value = 0
             this.degreePieData.data[3].value = 0
+            this.degreePieData.data[4].value = 0
             this.ranksPieData.data[0].value = 0
             this.ranksPieData.data[1].value = 0
             this.ranksPieData.data[2].value = 0
+            this.ranksPieData.data[3].value = 0
             // const sql = `select sum(a.zui_gao_xue_li_x_ like '%博士%') as boShi, sum(a.zui_gao_xue_li_x_ like '%硕士%') as shuoShi, sum(a.zui_gao_xue_li_x_ = '本科') as benKe, sum(a.zui_gao_xue_li_x_ = '大专') as daZhuan, sum(a.zhi_cheng_deng_ji = '初级') as chuJi, sum(a.zhi_cheng_deng_ji = '中级') as zhongJi, sum(a.zhi_cheng_deng_ji = '高级') as gaoJi, sum(a.zhi_cheng_deng_ji = '' || a.zhi_cheng_deng_ji is null) as other from t_ryjbqk as a join ibps_party_employee as ee on a.parent_id_= ee.id_`
             const { variables: { data = [] }} = await this.$common.request('query', {
                 key: 'empManageBoard3',
@@ -866,22 +924,24 @@ export default {
             if (!data.length) {
                 return
             }
-            this.degreePieData.data[0].value = data[0]?.daZhuan || 0
-            this.degreePieData.data[1].value = data[0]?.benKe || 0
-            this.degreePieData.data[2].value = data[0]?.shuoShi || 0
-            this.degreePieData.data[3].value = data[0]?.boShi || 0
+            this.degreePieData.data[0].value = data[0]?.gaozhong || 0
+            this.degreePieData.data[1].value = data[0]?.daZhuan || 0
+            this.degreePieData.data[2].value = data[0]?.benKe || 0
+            this.degreePieData.data[3].value = data[0]?.shuoShi || 0
+            this.degreePieData.data[4].value = data[0]?.boShi || 0
 
             this.ranksPieData.data[0].value = data[0]?.chuJi || 0
             this.ranksPieData.data[1].value = data[0]?.zhongJi || 0
-            this.ranksPieData.data[2].value = data[0]?.gaoJi || 0
+            this.ranksPieData.data[2].value = data[0]?.fugao || 0
+            this.ranksPieData.data[3].value = data[0]?.gaoJi || 0
         },
         // 部门信息统计
         positionsInfoData () {
             // const sql = `select jh.* from (select en.id_, en.name_ AS enName, sum(gy.zui_gao_xue_li_x_ like '%博士%') as boShi, sum(gy.zui_gao_xue_li_x_ like '%硕士%') as shuoShi, sum(gy.zui_gao_xue_li_x_ = '本科') as benKe, sum(gy.zui_gao_xue_li_x_ = '大专') as daZhuan, sum(gy.zhi_cheng_deng_ji = '初级') AS chuJi, sum(gy.zhi_cheng_deng_ji = '中级') AS zhongJi, sum(gy.zhi_cheng_deng_ji = '高级') AS gaoJi FROM (SELECT ee.id_ AS eeID, ee.name_ AS eeName, ee.positions_, ry.zui_gao_xue_li_x_, ry.zhi_cheng_deng_ji FROM t_ryjbqk AS ry JOIN ibps_party_employee AS ee ON ry.parent_id_= ee.id_) gy LEFT JOIN ibps_party_entity en ON FIND_IN_SET(en.id_, gy.positions_) GROUP BY enName) jh where enName is not null`
             const filterDeptIds = this.filterDept.map(i => i.positionId).join(',')
             this.$common.request('query', {
-                key: 'empManageBoard2',
-                params: [filterDeptIds]
+                key: 'empManageBoard4',
+                params: [this.dept3,this.dept3,this.dept3]
             }).then(res => {
                 const { data = [] } = res.variables || {}
                 // 组装数据集,以学历职称为列,以部门为行:{" 大专":['1','2','3']}
@@ -896,7 +956,7 @@ export default {
                     return
                 }
                 // 跟《部门信息统计配置表》排列顺序一致
-                const shuZuList = ['daZhuan', 'benKe', 'shuoShi', 'boShi', 'chuJi', 'zhongJi', 'gaoJi']
+                const shuZuList = ['gaozhong','daZhuan', 'benKe', 'shuoShi', 'boShi', 'chuJi', 'zhongJi','fuGao', 'gaoJi']
                 data.forEach(item => {
                     PositionsDegreeOption.xAxis[0].data.push(item.enName)
                     PositionsRanksOption.xAxis[0].data.push(item.enName)
@@ -908,7 +968,7 @@ export default {
 
                     // 设置职级系列数据
                     ranksSeries.forEach((series, i) => {
-                        series.data.push(item[shuZuList[i + 4]])
+                        series.data.push(item[shuZuList[i + 5]])
                     })
                 })
                 console.log(PositionsDegreeOption)
@@ -977,36 +1037,43 @@ export default {
             }
             const deptUserList = this.getPositionPeopleIds(this.selection)
             const deptUserIdList = deptUserList.map(user => user.userId)
-            // const sql = `select * from t_examination where zhuang_tai_ = '已完成' and find_in_set(kao_shi_ren_, '${deptUserIdList.join(',')}')`
-            let { variables: { data }} = await this.$common.request('query', {
-                key: 'empManageBoard0',
+            const parm = deptUserIdList.join(',') !== '' ? {
+                key: 'empManageBoard5',
                 params: [deptUserIdList.join(',')]
-            })
+            } : {
+                key: 'empManageBoard0',
+                params: [null]
+            }
+            
+            // const sql = `select * from t_examination where zhuang_tai_ = '已完成' and find_in_set(kao_shi_ren_, '${deptUserIdList.join(',')}')`
+            let { variables: { data }} = await this.$common.request('query', parm)
             if (this.startDate && this.endDate) {
                 data = data.filter(item => {
-                    // return new Date(item.jie_shu_shi_jian_).getTime() >= new Date(this.startDate).getTime() && new Date(item.jie_shu_shi_jian_).getTime() <= new Date(this.endDate).getTime()
-                    const itemTime = new Date(item.jie_shu_shi_jian_).getTime()
-                    return itemTime >= +new Date(this.startDate) && itemTime <= +new Date(this.endDate)
+                    return new Date(item.startDate).getTime() >= new Date(this.startDate).getTime() && new Date(item.startDate).getTime() <= new Date(this.endDate).getTime()
                 })
             }
             const resultData = deptUserList.map(user => {
-                const userExams = data.filter(item => item.kao_shi_ren_ === user.userId)
-                const count = userExams.length
-                const passCount = userExams.filter(item =>
-                    +item.de_fen_ * 100 >= +item.ti_ku_zong_fen_ * +item.da_biao_zhan_bi_
-                ).length
-
+                let count = 0
+                let passCount = 0
+                data.forEach(item => {
+                    if (item.examinee === user.userId) {
+                        count++
+                        if (+(item.scoringType === '平均分' ? item.averageScore : item.scoringType === '最高分' ? item.maxScore : item.recentScore) * 100 >= +item.totalScore * +item.qualifiedRadio) {
+                            passCount++
+                        }
+                    }
+                })
                 return {
                     ...user,
                     count,
                     passCount,
-                    passRate: count ? `${(passCount / count * 100).toFixed(2)}%` : '0%'
+                    passRate: (count === 0 ? 0 : (passCount / count * 100).toFixed(2)) + '%'
                 }
             })
+            console.log(deptUserList,resultData,'resultDataresultDataresultDataresultData')
             resultData.sort((a, b) => {
                 return a.userId - b.userId
             })
-            // console.log('考试', resultData)
             // 格式化统计图需要的数据
             this.optionExamStatisticsConfig.xAxis.data = resultData.map(item => item.userName)
             this.optionExamStatisticsConfig.series[0].data = resultData.map(item => item.count)
@@ -1038,6 +1105,8 @@ export default {
             this.selection = selection
             this.selectionDept = selectionDept
             this.filterDept = filterDept
+            console.log(selection, selectionDept, filterDept,'2132321321321')
+            this.dept3 = filterDept.filter(i=>i.depth===3)[0].positionId
             this.handleAllGetFunc()
             // clearInterval(this.interval)
             this.getTrainingStatisticsData()