|
|
@@ -55,7 +55,7 @@
|
|
|
"
|
|
|
>
|
|
|
<!-- 部门选择 -->
|
|
|
- <SelectPositions :filterGroup="true" @handleFunc="handleFunc" />
|
|
|
+ <select-positions :filter-group="true" @handleSelectionChange="initData" />
|
|
|
<div
|
|
|
style="
|
|
|
width: 30%;
|
|
|
@@ -170,28 +170,27 @@ export default {
|
|
|
ExamStatistics: () => import('../personComcont/ExamStatistics')
|
|
|
},
|
|
|
data () {
|
|
|
- const { level } = this.$store.getters
|
|
|
+ const { level, userList = [] } = this.$store.getters
|
|
|
+ userList.filter(i => i.userName === 'admin').map(i => i.id)
|
|
|
const colorGroup1 = ['#d20962', '#f47721', '#00bce4', '#7552cc']
|
|
|
const colorGroup2 = ['#00a78e', '#7d3f98', '#f85a40']
|
|
|
return {
|
|
|
level: level.second || level.first,
|
|
|
+ userList,
|
|
|
monthValues: [],
|
|
|
startDate: '',
|
|
|
endDate: '',
|
|
|
employeeNum: 0,
|
|
|
- // employeeInfo: [],
|
|
|
- otherPositions: [], // 用于其他图sql条件查询
|
|
|
- positions: [], // 用于部门统计信息sql条件查询
|
|
|
- // 查询出来的部门选择数据
|
|
|
- sqlPositionsDatasIni: [],
|
|
|
- // 轮询部门信息用
|
|
|
- positionIni: [],
|
|
|
+ // 部门Data
|
|
|
+ selectionDept: {},
|
|
|
+ // 部门ID
|
|
|
+ selection: '',
|
|
|
+ // 过滤后的所有部门
|
|
|
+ filterDept: [],
|
|
|
// 判断是否初步加载,1:已初步加载
|
|
|
initOnLoad: 0,
|
|
|
// 人员id
|
|
|
personIds: '',
|
|
|
- // 部门数组
|
|
|
- positionsIdArr: [],
|
|
|
// 日期选择配置
|
|
|
pickerOptions: {
|
|
|
shortcuts: [{
|
|
|
@@ -820,35 +819,10 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
|
- const initendDate = new Date()
|
|
|
- // this.endDate =
|
|
|
- // initendDate.getFullYear() +
|
|
|
- // '-' +
|
|
|
- // (initendDate.getMonth() + 1 > 9
|
|
|
- // ? initendDate.getMonth() + 1
|
|
|
- // : '0' + (initendDate.getMonth() + 1)) +
|
|
|
- // '-' +
|
|
|
- // (initendDate.getDate() > 9
|
|
|
- // ? initendDate.getDate()
|
|
|
- // : '0' + initendDate.getDate()) +
|
|
|
- // ' 23:59:59'
|
|
|
- // this.startDate = this.preDate(this.endDate, 60) + ' 00:00:00'
|
|
|
-
|
|
|
- // this.monthValues = [
|
|
|
- // new Date(this.startDate),
|
|
|
- // new Date(
|
|
|
- // initendDate.getFullYear() +
|
|
|
- // '-' +
|
|
|
- // (initendDate.getMonth() + 1) +
|
|
|
- // '-' +
|
|
|
- // initendDate.getDate()
|
|
|
- // )
|
|
|
- // ]
|
|
|
if (screenfull.isEnabled && !screenfull.isFullscreen) {
|
|
|
this.allView()
|
|
|
}
|
|
|
},
|
|
|
- mounted () {},
|
|
|
beforeDestroy () {
|
|
|
if (this.interval) {
|
|
|
clearInterval(this.interval)
|
|
|
@@ -859,69 +833,21 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
changeDate (value) {
|
|
|
- // const year = value[1].getFullYear()
|
|
|
- // const month = value[1].getMonth() + 1
|
|
|
- // // 这里传入的是整数时间,返回的是下个月的第一天,因为月份是0-11
|
|
|
- // const nextMonthFirthDay = new Date(year, month, 1) // 下个月的第一天
|
|
|
- // const oneDay = 1000 * 60 * 60 * 24 // 一天的时间毫秒数
|
|
|
- // const endDay = new Date(nextMonthFirthDay - oneDay)
|
|
|
- // const day = endDay.getDate() // 本月最后一天
|
|
|
- // this.endDate =
|
|
|
- // value[1].getFullYear() +
|
|
|
- // '-' +
|
|
|
- // (value[1].getMonth() + 1 > 9
|
|
|
- // ? value[1].getMonth() + 1
|
|
|
- // : '0' + (value[1].getMonth() + 1)) +
|
|
|
- // '-' +
|
|
|
- // (day > 9 ? day : '0' + day) +
|
|
|
- // ' 23:59:59'
|
|
|
- // this.startDate =
|
|
|
- // value[0].getFullYear() +
|
|
|
- // '-' +
|
|
|
- // (value[0].getMonth() + 1 > 9
|
|
|
- // ? value[0].getMonth() + 1
|
|
|
- // : '0' + (value[0].getMonth() + 1)) +
|
|
|
- // '-' +
|
|
|
- // (value[0].getDate() > 9
|
|
|
- // ? value[0].getDate()
|
|
|
- // : '0' + value[0].getDate()) +
|
|
|
- // ' 00:00:00'
|
|
|
- // this.getTtaskMattersData()
|
|
|
- if (value && value.length) {
|
|
|
- this.startDate = value[0]
|
|
|
- this.endDate = value[1]
|
|
|
- } else {
|
|
|
- this.startDate = ''
|
|
|
- this.endDate = ''
|
|
|
- }
|
|
|
+ this.startDate = value?.[0] || ''
|
|
|
+ this.endDate = value?.[1] || ''
|
|
|
// console.log(this.startDate, this.endDate)
|
|
|
this.getTrainingStatisticsData()
|
|
|
this.getExamStatisticsData()
|
|
|
},
|
|
|
// 人员基本信息 轮播表数据
|
|
|
async employeeInfoData () {
|
|
|
- let data = []
|
|
|
- this.optionPerson.yAxis.data = []
|
|
|
- const positionsWhere =
|
|
|
- this.otherPositions.length !== 0
|
|
|
- ? `(${this.otherPositions.join(' or ')} )`
|
|
|
- : `ee.positions_ = '没有选择部门'`
|
|
|
- const sql = `select a.id_,a.parent_id_,ee.name_,a.zui_gao_xue_li_x_,a.zhi_cheng_deng_ji,ee.jian_ding_zi_ge_z,a.ren_zhi_shi_jian_,
|
|
|
- a.ru_zhi_shi_jian_ from t_ryjbqk as a join ibps_party_employee as ee on a.parent_id_= ee.id_ where a.id_ !='861622496187645952' and ${positionsWhere}`
|
|
|
- await curdPost('sql', sql).then((res) => {
|
|
|
- data = res.variables.data
|
|
|
- })
|
|
|
- if (this.initOnLoad === 0) {
|
|
|
- this.employeeNum = data.length
|
|
|
- this.initOnLoad = 1
|
|
|
- }
|
|
|
- const personIdsArr = []
|
|
|
- for (const it of data) {
|
|
|
- personIdsArr.push(it.parent_id_)
|
|
|
- this.optionPerson.yAxis.data.push(it.name_)
|
|
|
- }
|
|
|
- this.personIds = personIdsArr.join(',')
|
|
|
- this.getTtaskMattersData()
|
|
|
+ // 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
|
|
|
+ this.personIds = deptUserList.map(i => i.userId).join(',')
|
|
|
+ this.optionPerson.yAxis.data = deptUserList.map(i => i.userName)
|
|
|
+ // this.getTtaskMattersData()
|
|
|
},
|
|
|
// 饼图 环形图数据
|
|
|
async degreeGradeInfoData () {
|
|
|
@@ -932,265 +858,160 @@ export default {
|
|
|
this.ranksPieData.data[0].value = 0
|
|
|
this.ranksPieData.data[1].value = 0
|
|
|
this.ranksPieData.data[2].value = 0
|
|
|
- let data = []
|
|
|
- const positionsWhere =
|
|
|
- this.otherPositions.length !== 0
|
|
|
- ? `(${this.otherPositions.join(' or ')} )`
|
|
|
- : `ee.positions_ = '没有选择部门'`
|
|
|
- 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_ where ${positionsWhere}`
|
|
|
- await curdPost('sql', sql).then((res) => {
|
|
|
- data = res.variables.data
|
|
|
+ // 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',
|
|
|
+ params: [null]
|
|
|
})
|
|
|
- if (data.length === 0 || data[0] == null) {
|
|
|
+ if (!data.length) {
|
|
|
return
|
|
|
}
|
|
|
- this.degreePieData.data[0].value = data[0].daZhuan
|
|
|
- ? data[0].daZhuan
|
|
|
- : 0
|
|
|
- this.degreePieData.data[1].value = data[0].benKe
|
|
|
- ? data[0].benKe
|
|
|
- : 0
|
|
|
- this.degreePieData.data[2].value = data[0].shuoShi
|
|
|
- ? data[0].shuoShi
|
|
|
- : 0
|
|
|
- this.degreePieData.data[3].value = data[0].boShi
|
|
|
- ? data[0].boShi
|
|
|
- : 0
|
|
|
+ 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.ranksPieData.data[0].value = data[0].chuJi ? data[0].chuJi : 0
|
|
|
- this.ranksPieData.data[1].value = data[0].zhongJi
|
|
|
- ? data[0].zhongJi
|
|
|
- : 0
|
|
|
- this.ranksPieData.data[2].value = data[0].gaoJi ? data[0].gaoJi : 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
|
|
|
},
|
|
|
// 部门信息统计
|
|
|
positionsInfoData () {
|
|
|
- const positionsWhere =
|
|
|
- this.positions.length !== 0
|
|
|
- ? `(${this.positions.join(' or ')} )`
|
|
|
- : `en.path_ = '没有选择部门'`
|
|
|
- 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_) where ${positionsWhere} and en.id_!='1166373874003083264' and en.name_ not like '%综合%' GROUP BY enName) jh`
|
|
|
- curdPost('sql', sql).then((res) => {
|
|
|
- const data = res.variables.data
|
|
|
+ // 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]
|
|
|
+ }).then(res => {
|
|
|
+ const { data = [] } = res.variables || {}
|
|
|
// 组装数据集,以学历职称为列,以部门为行:{" 大专":['1','2','3']}
|
|
|
- const degreeSeriesDatas = this.PositionsDegreeOption.series
|
|
|
- const ranksSeriesDatas = this.PositionsRanksOption.series
|
|
|
- this.PositionsDegreeOption.xAxis[0].data = []
|
|
|
- this.PositionsRanksOption.xAxis[0].data = []
|
|
|
- this.PositionsDegreeOption.series[0].data = []
|
|
|
- this.PositionsDegreeOption.series[1].data = []
|
|
|
- this.PositionsDegreeOption.series[2].data = []
|
|
|
- this.PositionsDegreeOption.series[3].data = []
|
|
|
- this.PositionsRanksOption.series[0].data = []
|
|
|
- this.PositionsRanksOption.series[1].data = []
|
|
|
- this.PositionsRanksOption.series[2].data = []
|
|
|
- if (data.length !== 0) {
|
|
|
- // 跟《部门信息统计配置表》排列顺序一致
|
|
|
- const shuZuList = [
|
|
|
- 'daZhuan',
|
|
|
- 'benKe',
|
|
|
- 'shuoShi',
|
|
|
- 'boShi',
|
|
|
- 'chuJi',
|
|
|
- 'zhongJi',
|
|
|
- 'gaoJi'
|
|
|
- ]
|
|
|
- console.log(data)
|
|
|
- for (let t = 0; t < data.length; t++) {
|
|
|
- this.PositionsDegreeOption.xAxis[0].data.push(
|
|
|
- data[t].enName
|
|
|
- )
|
|
|
- this.PositionsRanksOption.xAxis[0].data.push(
|
|
|
- data[t].enName
|
|
|
- )
|
|
|
- for (let i = 0; i < degreeSeriesDatas.length; i++) {
|
|
|
- degreeSeriesDatas[i].data[t] =
|
|
|
- data[t][shuZuList[i]]
|
|
|
- }
|
|
|
- for (let i = 0; i < ranksSeriesDatas.length; i++) {
|
|
|
- ranksSeriesDatas[i].data[t] =
|
|
|
- data[t][shuZuList[i + 4]]
|
|
|
- }
|
|
|
- }
|
|
|
- this.PositionsDegreeOption.series = degreeSeriesDatas
|
|
|
- this.PositionsRanksOption.series = ranksSeriesDatas
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 个人任务统计
|
|
|
- async getTtaskMattersData () {
|
|
|
- const this_ = this
|
|
|
- this_.optionPerson.series[0].data = []
|
|
|
- this_.optionPerson.series[1].data = []
|
|
|
- let data = [] // 待办数据
|
|
|
- let yibanData = []
|
|
|
- if (!this.personIds) {
|
|
|
- return
|
|
|
- }
|
|
|
- // 待办数据
|
|
|
- const sql = `select executor_,count(executor_) as num ,ee.name_ FROM IBPS_BPM_TASKS as a join IBPS_BPM_TASK_ASSIGN as b
|
|
|
- on a.task_id_ = b.task_id_ join ibps_party_employee as ee on b.executor_ = ee.id_ and
|
|
|
- ee.STATUS_= 'actived' and ee.ID_ != '1' and ee.ID_ != '-1' and b.executor_ in(${this.personIds})
|
|
|
- and a.CREATE_TIME_ between '${this.startDate}' and '${this.endDate}'
|
|
|
- GROUP BY executor_ order by FIELD(b.executor_,${this.personIds}) `
|
|
|
- await curdPost('sql', sql).then((res) => {
|
|
|
- data = res.variables.data
|
|
|
- })
|
|
|
- const yibansql = `select task.AUDITOR_,ee.name_,COUNT(ee.name_) AS num FROM
|
|
|
- (SELECT DISTINCT inst.* FROM
|
|
|
- ( SELECT ap.AUDITOR_,rinst.* FROM
|
|
|
- ibps_bpm_inst rinst
|
|
|
- RIGHT JOIN ibps_bpm_approval ap ON ap.PROC_INST_ID_ = rinst.ID_
|
|
|
- WHERE
|
|
|
- ap.AUDITOR_ in(${this.personIds}) and
|
|
|
- ap.CREATE_TIME_ between '${this.startDate}' and '${this.endDate}'
|
|
|
- UNION ALL
|
|
|
- SELECT aphis.AUDITOR_,insthis.* FROM
|
|
|
- ibps_bpm_inst_his insthis
|
|
|
- RIGHT JOIN ibps_bpm_approval_his aphis ON aphis.PROC_INST_ID_ = insthis.ID_
|
|
|
- WHERE
|
|
|
- aphis.AUDITOR_ in(${this.personIds}) AND insthis.id_ IS NOT NULL
|
|
|
- ) inst ) AS task
|
|
|
- LEFT JOIN ibps_party_employee ee ON task.AUDITOR_ = ee.id_
|
|
|
- where task.CREATE_TIME_ between '${this.startDate}' and '${this.endDate}'
|
|
|
- GROUP BY task.AUDITOR_ order by FIELD(task.AUDITOR_,${this.personIds})`
|
|
|
- await curdPost('sql', yibansql).then((res) => {
|
|
|
- yibanData = res.variables.data
|
|
|
- })
|
|
|
- for (const i of this.personIds.split(',')) {
|
|
|
- // 判断已读中是否存在该人员的待办
|
|
|
- const daiBan = data.filter((fil) => {
|
|
|
- return fil.executor_ === i
|
|
|
+ const { PositionsDegreeOption, PositionsRanksOption } = this
|
|
|
+ const degreeSeries = PositionsDegreeOption.series
|
|
|
+ const ranksSeries = PositionsRanksOption.series;
|
|
|
+ [PositionsDegreeOption, PositionsRanksOption].forEach(option => {
|
|
|
+ option.xAxis[0].data = []
|
|
|
+ option.series.forEach(s => { s.data = [] })
|
|
|
})
|
|
|
- if (daiBan.length === 0) {
|
|
|
- this_.optionPerson.series[0].data.push(0)
|
|
|
- } else {
|
|
|
- this_.optionPerson.series[0].data.push(daiBan[0].num)
|
|
|
+ if (!data.length) {
|
|
|
+ return
|
|
|
}
|
|
|
- // 判断已读中是否存在该人员的已办
|
|
|
- const yiBan = yibanData.filter((fil) => {
|
|
|
- return fil.AUDITOR_ === i
|
|
|
+ // 跟《部门信息统计配置表》排列顺序一致
|
|
|
+ const shuZuList = ['daZhuan', 'benKe', 'shuoShi', 'boShi', 'chuJi', 'zhongJi', 'gaoJi']
|
|
|
+ data.forEach(item => {
|
|
|
+ PositionsDegreeOption.xAxis[0].data.push(item.enName)
|
|
|
+ PositionsRanksOption.xAxis[0].data.push(item.enName)
|
|
|
+
|
|
|
+ // 设置学历系列数据
|
|
|
+ degreeSeries.forEach((series, i) => {
|
|
|
+ series.data.push(item[shuZuList[i]])
|
|
|
+ })
|
|
|
+
|
|
|
+ // 设置职级系列数据
|
|
|
+ ranksSeries.forEach((series, i) => {
|
|
|
+ series.data.push(item[shuZuList[i + 4]])
|
|
|
+ })
|
|
|
})
|
|
|
- if (yiBan.length === 0) {
|
|
|
- this_.optionPerson.series[1].data.push(0)
|
|
|
- } else {
|
|
|
- this_.optionPerson.series[1].data.push(yiBan[0].num)
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- preDate (dateParameter, num) {
|
|
|
- // 往前推算日期
|
|
|
- var translateDate = ''
|
|
|
- var dateString = ''
|
|
|
- var monthString = ''
|
|
|
- var dayString = ''
|
|
|
- translateDate = dateParameter.replace('-', '/').replace('-', '/')
|
|
|
- var newDate = new Date(translateDate)
|
|
|
- newDate = newDate.valueOf()
|
|
|
- newDate = newDate - num * 24 * 60 * 60 * 1000 // 备注 如果是往前计算日期则为减号 否则为加号
|
|
|
- newDate = new Date(newDate) // 如果月份长度少于2,则前加 0 补位
|
|
|
- if ((newDate.getMonth() + 1).toString().length === 1) {
|
|
|
- monthString = 0 + '' + (newDate.getMonth() + 1).toString()
|
|
|
- } else {
|
|
|
- monthString = (newDate.getMonth() + 1).toString()
|
|
|
- }
|
|
|
- if (newDate.getDate().toString().length === 1) {
|
|
|
- // 如果天数长度少于2,则前加 0 补位
|
|
|
- dayString = 0 + '' + newDate.getDate().toString()
|
|
|
- 0
|
|
|
- } else {
|
|
|
- dayString = newDate.getDate().toString()
|
|
|
- }
|
|
|
- dateString =
|
|
|
- newDate.getFullYear() + '-' + monthString + '-' + dayString
|
|
|
- return dateString
|
|
|
- },
|
|
|
- // 简化部门信息
|
|
|
- simplifyPosition (v) {
|
|
|
- this.positions = [] // 用于sql条件查询
|
|
|
- this.otherPositions = []
|
|
|
- for (let i = 0; i < v.length; i++) {
|
|
|
- this.positions.push(
|
|
|
- `en.path_ like '%${v[i][v[i].length - 1]}%'`
|
|
|
- )
|
|
|
- this.otherPositions.push(
|
|
|
- `ee.positions_ like '%${v[i][v[i].length - 1]}%'`
|
|
|
- )
|
|
|
- }
|
|
|
+ console.log(PositionsDegreeOption)
|
|
|
+ PositionsDegreeOption.series = degreeSeries
|
|
|
+ PositionsRanksOption.series = ranksSeries
|
|
|
+ })
|
|
|
},
|
|
|
+ // 个人任务统计
|
|
|
+ // async getTtaskMattersData () {
|
|
|
+ // this.optionPerson.series[0].data = []
|
|
|
+ // this.optionPerson.series[1].data = []
|
|
|
+ // let data = [] // 待办数据
|
|
|
+ // let yibanData = []
|
|
|
+ // if (!this.personIds) {
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // // 待办数据
|
|
|
+ // const sql = `select executor_,count(executor_) as num ,ee.name_ FROM IBPS_BPM_TASKS as a join IBPS_BPM_TASK_ASSIGN as b on a.task_id_ = b.task_id_ join ibps_party_employee as ee on b.executor_ = ee.id_ and ee.STATUS_= 'actived' and ee.ID_ != '1' and ee.ID_ != '-1' and b.executor_ in(${this.personIds}) and a.CREATE_TIME_ between '${this.startDate}' and '${this.endDate}' GROUP BY executor_ order by FIELD(b.executor_,${this.personIds}) `
|
|
|
+ // await curdPost('sql', sql).then((res) => {
|
|
|
+ // data = res.variables.data
|
|
|
+ // })
|
|
|
+ // const yibansql = `select task.AUDITOR_,ee.name_,COUNT(ee.name_) AS num FROM (SELECT DISTINCT inst.* FROM ( SELECT ap.AUDITOR_,rinst.* FROM ibps_bpm_inst rinst
|
|
|
+ // RIGHT JOIN ibps_bpm_approval ap ON ap.PROC_INST_ID_ = rinst.ID_ WHERE ap.AUDITOR_ in(${this.personIds}) and ap.CREATE_TIME_ between '${this.startDate}' and '${this.endDate}'
|
|
|
+ // UNION ALL SELECT aphis.AUDITOR_,insthis.* FROM ibps_bpm_inst_his insthis RIGHT JOIN ibps_bpm_approval_his aphis ON aphis.PROC_INST_ID_ = insthis.ID_ WHERE aphis.AUDITOR_ in(${this.personIds}) AND insthis.id_ IS NOT NULL) inst ) AS task
|
|
|
+ // LEFT JOIN ibps_party_employee ee ON task.AUDITOR_ = ee.id_ where task.CREATE_TIME_ between '${this.startDate}' and '${this.endDate}' GROUP BY task.AUDITOR_ order by FIELD(task.AUDITOR_,${this.personIds})`
|
|
|
+ // await curdPost('sql', yibansql).then((res) => {
|
|
|
+ // yibanData = res.variables.data
|
|
|
+ // })
|
|
|
+ // for (const i of this.personIds.split(',')) {
|
|
|
+ // // 判断已读中是否存在该人员的待办
|
|
|
+ // const daiBan = data.filter((fil) => {
|
|
|
+ // return fil.executor_ === i
|
|
|
+ // })
|
|
|
+ // if (daiBan.length === 0) {
|
|
|
+ // this.optionPerson.series[0].data.push(0)
|
|
|
+ // } else {
|
|
|
+ // this.optionPerson.series[0].data.push(daiBan[0].num)
|
|
|
+ // }
|
|
|
+ // // 判断已读中是否存在该人员的已办
|
|
|
+ // const yiBan = yibanData.filter((fil) => {
|
|
|
+ // return fil.AUDITOR_ === i
|
|
|
+ // })
|
|
|
+ // if (yiBan.length === 0) {
|
|
|
+ // this.optionPerson.series[1].data.push(0)
|
|
|
+ // } else {
|
|
|
+ // this.optionPerson.series[1].data.push(yiBan[0].num)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // },
|
|
|
handleAllGetFunc () {
|
|
|
this.employeeInfoData()
|
|
|
if (this.initOnLoad === 0) {
|
|
|
this.positionsInfoData()
|
|
|
this.degreeGradeInfoData()
|
|
|
+ this.initOnLoad = 1
|
|
|
}
|
|
|
},
|
|
|
// 通过部门 id 获取部门人员
|
|
|
getPositionPeopleIds (positionId) {
|
|
|
- const { userList } = this.$store.getters
|
|
|
- return userList.filter(user => user.positionId.indexOf(positionId) > -1)
|
|
|
+ return this.userList.filter(user => user.positionId.includes(positionId))
|
|
|
},
|
|
|
// 根据部门和时间获取考试统计数据
|
|
|
async getExamStatisticsData () {
|
|
|
- if (this.positionsIdArr.length) {
|
|
|
- const users = this.getPositionPeopleIds(this.positionsIdArr[0])
|
|
|
- const userIds = users.map(user => user.userId)
|
|
|
- const renyuan =userIds.map(i => `'${i}'`).join(',')!=='' ? `and kao_shi_ren_ in (${userIds.map(i => `'${i}'`).join(',')})`:''
|
|
|
- const sql = `select * from t_examination where zhuang_tai_ = '已完成' ${renyuan} `
|
|
|
- let { variables: { data }} = await this.$common.request('sql', sql)
|
|
|
- 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()
|
|
|
- })
|
|
|
- }
|
|
|
- // console.log('考试1', data)
|
|
|
- const resultData = users.map(user => {
|
|
|
- let count = 0
|
|
|
- let passCount = 0
|
|
|
- data.forEach(item => {
|
|
|
- if (item.kao_shi_ren_ === user.userId) {
|
|
|
- count++
|
|
|
- if (+item.de_fen_ * 100 >= +item.ti_ku_zong_fen_ * +item.da_biao_zhan_bi_) {
|
|
|
- passCount++
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- return {
|
|
|
- ...user,
|
|
|
- count,
|
|
|
- passCount,
|
|
|
- passRate: (count === 0 ? 0 : (passCount / count * 100).toFixed(2)) + '%'
|
|
|
- }
|
|
|
- })
|
|
|
- resultData.sort((a, b) => {
|
|
|
- return a.userId - b.userId
|
|
|
+ if (!this.selection) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 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',
|
|
|
+ params: [deptUserIdList.join(',')]
|
|
|
+ })
|
|
|
+ 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)
|
|
|
})
|
|
|
- // console.log('考试', resultData)
|
|
|
- // 格式化统计图需要的数据
|
|
|
- this.optionExamStatisticsConfig.xAxis.data = resultData.map(item => item.userName)
|
|
|
- this.optionExamStatisticsConfig.series[0].data = resultData.map(item => item.count)
|
|
|
- this.optionExamStatisticsConfig.series[1].data = resultData.map(item => item.passCount)
|
|
|
- this.optionExamStatisticsConfig.series[2].data = resultData.map(item => item.passRate)
|
|
|
}
|
|
|
+ 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
|
|
|
+
|
|
|
+ return {
|
|
|
+ ...user,
|
|
|
+ count,
|
|
|
+ passCount,
|
|
|
+ passRate: count ? `${(passCount / count * 100).toFixed(2)}%` : '0%'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ 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)
|
|
|
+ this.optionExamStatisticsConfig.series[1].data = resultData.map(item => item.passCount)
|
|
|
+ this.optionExamStatisticsConfig.series[2].data = resultData.map(item => item.passRate)
|
|
|
},
|
|
|
// 根据部门和时间获取培训统计数据
|
|
|
async getTrainingStatisticsData () {
|
|
|
@@ -1199,8 +1020,8 @@ export default {
|
|
|
params.startTime = this.startDate
|
|
|
params.endTime = this.endDate
|
|
|
}
|
|
|
- if (this.positionsIdArr.length) {
|
|
|
- params.deptId = this.positionsIdArr[0]
|
|
|
+ if (this.selection) {
|
|
|
+ params.deptId = this.selection
|
|
|
}
|
|
|
const { data } = await getUserStatisticList(params)
|
|
|
data.sort((a, b) => {
|
|
|
@@ -1213,48 +1034,15 @@ export default {
|
|
|
this.optionTrainingStatisticsConfig.series[1].data = data.map(item => item.truejoin)
|
|
|
this.optionTrainingStatisticsConfig.series[2].data = data.map(item => item.participationRate)
|
|
|
},
|
|
|
- handleFunc (e) {
|
|
|
- this.sqlPositionsDatasIni = e.i
|
|
|
- this.positionIni = e.v
|
|
|
- this.simplifyPosition(e.v)
|
|
|
+ initData ({ selection, selectionDept, filterDept }) {
|
|
|
+ this.selection = selection
|
|
|
+ this.selectionDept = selectionDept
|
|
|
+ this.filterDept = filterDept
|
|
|
this.handleAllGetFunc()
|
|
|
// clearInterval(this.interval)
|
|
|
- // this.intervalHandle()
|
|
|
- if (e.v.length >= 2) {
|
|
|
- this.positionsIdArr = [e.v[1]]
|
|
|
- }
|
|
|
this.getTrainingStatisticsData()
|
|
|
this.getExamStatisticsData()
|
|
|
},
|
|
|
- handleInt (e) {
|
|
|
- // 找到对应id的部门信息
|
|
|
- const obj = this.sqlPositionsDatasIni.find(
|
|
|
- (item) => item.ID_ === e[0][e[0].length - 1]
|
|
|
- )
|
|
|
- if (obj === undefined) {
|
|
|
- this.optionPersonConfig.title = `部门(/)员工任务统计`
|
|
|
- } else {
|
|
|
- this.optionPersonConfig.title = `部门(${obj.NAME_})员工任务统计`
|
|
|
- }
|
|
|
- this.simplifyPosition(e)
|
|
|
- this.employeeInfoData()
|
|
|
- },
|
|
|
- // 定时任务调用接口,一分钟一次
|
|
|
- intervalHandle () {
|
|
|
- let cishu = 0 // 记录所选择的部门个数,即需要轮询多少次
|
|
|
- this.interval = setInterval(() => {
|
|
|
- if (this.positionIni.length === 0) {
|
|
|
- return
|
|
|
- }
|
|
|
- if (cishu > this.positionIni.length - 1) {
|
|
|
- cishu = 0
|
|
|
- this.handleInt([this.positionIni[0]])
|
|
|
- } else {
|
|
|
- this.handleInt([this.positionIni[cishu]])
|
|
|
- cishu++
|
|
|
- }
|
|
|
- }, 10000)
|
|
|
- },
|
|
|
allView () {
|
|
|
// 默认显示全屏
|
|
|
screenfull.request()
|