From 47b91176ab2e32e49c825f55b33f25c081877ae1 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Mon, 26 Dec 2022 14:30:07 +0800 Subject: [PATCH] =?UTF-8?q?(*)=E5=B2=97=E4=BD=8D=E8=AF=84=E7=BA=A7?= =?UTF-8?q?=E6=A1=86=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/launch.json | 4 +- api/app/lib/models/member.js | 9 + api/app/lib/models/position_rating.js | 94 ++++++ .../sections/humanAffairs/containers/index.js | 3 +- .../containers/positionRating.jsx | 280 ++++++++++++++++++ .../src/sections/humanAffairs/nav-item.jsx | 2 + .../src/sections/humanAffairs/routes.js | 23 +- web/routes/attachment/index.js | 1 - 8 files changed, 411 insertions(+), 5 deletions(-) create mode 100644 api/app/lib/models/position_rating.js create mode 100644 web/client/src/sections/humanAffairs/containers/positionRating.jsx diff --git a/.vscode/launch.json b/.vscode/launch.json index 5e8a655..72c9310 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -16,14 +16,14 @@ "-p 4700", "-f http://localhost:4700", // 研发 - // "-g postgres://postgres:123@10.8.30.166:5432/hr-dev", + "-g postgres://postgres:123@10.8.30.166:5432/hr-dev", "--redisHost localhost", "--redisPort 6379", "--apiEmisUrl http://localhost:14000", // 测试 // "--apiEmisUrl http://10.8.30.161:1111", // "--redisHost 10.8.30.112", - "-g postgres://postgres:123@10.8.30.166:5432/HRM", + // "-g postgres://postgres:123@10.8.30.166:5432/HRM", "--qnak 5XrM4wEB9YU6RQwT64sPzzE6cYFKZgssdP5Kj3uu", "--qnsk w6j2ixR_i-aelc6I7S3HotKIX-ukMzcKmDfH6-M5", "--qnbkt pep-resource", diff --git a/api/app/lib/models/member.js b/api/app/lib/models/member.js index 910bad5..d4b7d79 100644 --- a/api/app/lib/models/member.js +++ b/api/app/lib/models/member.js @@ -203,6 +203,15 @@ module.exports = dc => { primaryKey: false, field: "del", autoIncrement: false + }, + technicalGrade: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "技术职级等级", + primaryKey: false, + field: "technical_grade", + autoIncrement: false } }, { tableName: "member", diff --git a/api/app/lib/models/position_rating.js b/api/app/lib/models/position_rating.js new file mode 100644 index 0000000..b833f48 --- /dev/null +++ b/api/app/lib/models/position_rating.js @@ -0,0 +1,94 @@ +/* eslint-disable*/ + +'use strict'; + +module.exports = dc => { + const DataTypes = dc.ORM; + const sequelize = dc.orm; + const PositionRating = sequelize.define("positionRating", { + id: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: true, + field: "id", + autoIncrement: true, + unique: "position_rating_id_uindex" + }, + pepUserId: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: null, + comment: null, + primaryKey: false, + field: "pep_user_id", + autoIncrement: false, + references: { + key: "pep_user_id", + model: "member" + } + }, + ratingTime: { + type: DataTypes.DATE, + allowNull: false, + defaultValue: null, + comment: "评级时间", + primaryKey: false, + field: "rating_time", + autoIncrement: false + }, + theoryBasicScore: { + type: DataTypes.DOUBLE, + allowNull: false, + defaultValue: null, + comment: "理论基础测评成绩", + primaryKey: false, + field: "theory_basic_score", + autoIncrement: false + }, + theoryPassed: { + type: DataTypes.BOOLEAN, + allowNull: false, + defaultValue: null, + comment: "理论基础测评是否通过(≥60", + primaryKey: false, + field: "theory_passed", + autoIncrement: false + }, + totalScore: { + type: DataTypes.DOUBLE, + allowNull: false, + defaultValue: null, + comment: "评级总成绩", + primaryKey: false, + field: "total_score", + autoIncrement: false + }, + totalRatingPassed: { + type: DataTypes.BOOLEAN, + allowNull: false, + defaultValue: null, + comment: "评级总成绩是否通过(K≥60)", + primaryKey: false, + field: "total_rating_passed", + autoIncrement: false + }, + technicalGrade: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: null, + comment: "技术职级等级", + primaryKey: false, + field: "technical_grade", + autoIncrement: false + } + }, { + tableName: "position_rating", + comment: "", + indexes: [] + }); + + dc.models.PositionRating = PositionRating; + return PositionRating; +}; \ No newline at end of file diff --git a/web/client/src/sections/humanAffairs/containers/index.js b/web/client/src/sections/humanAffairs/containers/index.js index a9e9ae4..0d0dec5 100644 --- a/web/client/src/sections/humanAffairs/containers/index.js +++ b/web/client/src/sections/humanAffairs/containers/index.js @@ -3,6 +3,7 @@ import PersonnelFiles from './personnelFiles'; import EmployeeInformation from './employeeInformation'; import DeptArchives from './deptArchives'; +import PositionRating from './positionRating'; //员工关系 import AttendanceStatistics from './attendanceStatistics'; import LeaveStatistics from './leaveStatistics'; @@ -34,7 +35,7 @@ import PersonnelFilesDetail from './personnelFilesDetail'; export { - PersonnelFiles, EmployeeInformation, DeptArchives, + PersonnelFiles, EmployeeInformation, DeptArchives,PositionRating, AttendanceStatistics, LeaveStatistics, OvertimeStatistics, AppointmentRecords, PersonnelDistribution, ResourceRepository, DepartmentTrainRecord, diff --git a/web/client/src/sections/humanAffairs/containers/positionRating.jsx b/web/client/src/sections/humanAffairs/containers/positionRating.jsx new file mode 100644 index 0000000..74f01ad --- /dev/null +++ b/web/client/src/sections/humanAffairs/containers/positionRating.jsx @@ -0,0 +1,280 @@ +import React, { useEffect, useState, useRef, useMemo } from 'react'; +import { connect } from 'react-redux'; +import moment from 'moment' +import { Table, Button, Pagination, Skeleton, Form, Tooltip } from '@douyinfe/semi-ui'; +import { IconSearch } from '@douyinfe/semi-icons'; +import { SkeletonScreen, Setup } from "$components"; +import { UserAttribute } from '$utils'; +import '../style.less'; + +const PositionRating = (props) => { + const { dispatch, actions, history, user, loading, socket, xqMembers } = props + + const { humanAffairs } = actions; + + const form = useRef();//表单 + let [archivesList, setArchivesList] = useState([]);//人员列表 + + const [setup, setSetup] = useState(false);//表格设置是否显现 + const [setupp, setSetupp] = useState([]);//实际显示的表格列表 + const [lookup, setLookup] = useState({});//搜索 + const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息 + const [order, setOrder] = useState({ orderBy: 'hiredate', orderDirection: 'DESC' }); //页码信息 + const [limits, setLimits] = useState()//每页实际条数 + const page = useRef(query.page);//哪一页 + + useEffect(() => { + getMemberSearchList()//查询人员列表 + }, [query, order]) + + function getMemberSearchList() {//查询人员列表 + let obj = lookup + if (lookup.entryTime?.length > 1) { + obj.hiredateStart = moment(lookup.entryTime[0]).format('YYYY-MM-DD') + obj.hiredateEnd = moment(lookup.entryTime[1]).format('YYYY-MM-DD') + } + else { + obj.hiredateStart = '' + obj.hiredateEnd = '' + } + dispatch(humanAffairs.getMemberList({ ...obj, ...query, ...order })).then((res) => {//查询人员列表 + if (res.success) { + setArchivesList(res.payload?.data?.rows) + setLimits(res.payload?.data?.count) + } + }) + } + //获取表格属性设置 + const columns = [{ + title: '序号', + width: 70, + dataIndex: "number", + key: "number", + render: (_, r, index) => {index + 1}, + }, { + title: ( +
+ 部门名称 +
+ ), + width: 160, + dataIndex: "departmrnt", + key: "departmrnt", + render: (_, r, index) => { + return ( +
+ { + r.departmrnt.map((ite, idx) => { + let departmentsArr = [] + for (let i = 0; i < r.departmrnt.length; i++) { + departmentsArr.push(r.departmrnt[i].name) + } + return ( +
+ {idx == 0 ? + (
+ {ite.name} +
) : ('') + + } + { + r.departmrnt.length > 1 && idx == 1 ? ( + +
+ +{r.departmrnt.length - 1} +
+
+ ) : ('') + } +
+ ) + }) + } +
+ ) + }, + }, { + title: ( +
+ 姓名 +
+ ), + width: 100, + dataIndex: "userName", + key: "userName", + render: (_, r, index) => { + return (r.userName ? r.userName : '-'); + }, + }, { + title: ( +
+ 现在职岗位 +
+ ), + width: 120, + dataIndex: "userPost", + key: "userPost", + render: (_, r, index) => { + return r.userPost || '-'; + }, + }, { + title: '评级时间', + width: 100, + dataIndex: "time", + key: "time", + render: (_, r, index) => -, + }, { + title: '理论基础测评成绩', + width: 150, + dataIndex: "technicalGrade", + key: "technicalGrade", + render: (_, r, index) => -, + }, { + title: '理论基础测评是否通过(≥60)', + width: 150, + dataIndex: "technicalGrade", + key: "technicalGrade", + render: (_, r, index) => -, + }, { + title: '评级总成绩', + width: 150, + dataIndex: "technicalGrade", + key: "technicalGrade", + render: (_, r, index) => -, + }, { + title: '评级总成绩是否通过(K≥60)', + width: 150, + dataIndex: "technicalGrade", + key: "technicalGrade", + render: (_, r, index) => -, + }, { + title: '技术职级等级', + width: 150, + dataIndex: "technicalGrade", + key: "technicalGrade", + render: (_, r, index) => -, + }]; + + + function handleRow(record, index) {//斑马条纹 + // 给偶数行设置斑马纹 + if (index % 2 === 0) { + return { + style: { + background: '#FAFCFF', + } + }; + } else { + return {}; + } + } + const scroll = useMemo(() => ({}), []); + return ( + <> +
+
+
档案中心
+
/
+
人员档案
+
/
+
岗位评级
+
+
+
+
+
+
岗位评级
+
POSITION RATING
+
+
+
+
+ + 表格中带有认证标识" + + "信息的为系统基础数据,来源于项企PEP、钉钉等系统,其他数据均为导入或自定义数据 +
+
+ + { + // if (sorter.key == 'userCode') { + // if (sorter.sortOrder == 'descend') { + // setOrder({ orderBy: 'code', orderDirection: 'DESC' }) + // } else { + // setOrder({ orderBy: 'code', orderDirection: 'ASC' }) + // } + // } else if (sorter.key == 'age') { + // if (sorter.sortOrder == 'descend') { + // setOrder({ orderBy: 'age', orderDirection: 'DESC' }) + // } else { + // setOrder({ orderBy: 'age', orderDirection: 'ASC' }) + // } + // } else { + // if (sorter.sortOrder == 'descend') { + // setOrder({ orderBy: 'hiredate', orderDirection: 'DESC' }) + // } else { + // setOrder({ orderBy: 'hiredate', orderDirection: 'ASC' }) + // } + // } + // }} + onRow={handleRow} + scroll={scroll} + /> + +
+
+
+
+ + 共{limits}条信息 + + { + setQuery({ limit: pageSize, page: currentPage - 1 }); + page.current = currentPage - 1 + }} + /> +
+
+ + + + + + ) +} + +function mapStateToProps(state) { + const { auth, global, MemberSearch, webSocket } = state; + return { + // loading: members.isRequesting, + user: auth.user, + actions: global.actions, + xqMembers: MemberSearch.data, + // socket: webSocket.socket + }; +} + +export default connect(mapStateToProps)(PositionRating); diff --git a/web/client/src/sections/humanAffairs/nav-item.jsx b/web/client/src/sections/humanAffairs/nav-item.jsx index 931da09..45a1363 100644 --- a/web/client/src/sections/humanAffairs/nav-item.jsx +++ b/web/client/src/sections/humanAffairs/nav-item.jsx @@ -17,6 +17,8 @@ export function getNavItem(user, dispatch) { itemKey: 'personnelFiles', to: '/humanAffairs/archivesCenter/personnelArchives/personnelFiles', text: '人员档案' }, { itemKey: 'employeeInformation', to: '/humanAffairs/archivesCenter/personnelArchives/employeeInformation', text: '员工信息' + }, { + itemKey: 'positionRating', to: '/humanAffairs/archivesCenter/personnelArchives/positionRating', text: '岗位评级' }] }, { itemKey: 'deptArchives', diff --git a/web/client/src/sections/humanAffairs/routes.js b/web/client/src/sections/humanAffairs/routes.js index 8887c81..6962444 100644 --- a/web/client/src/sections/humanAffairs/routes.js +++ b/web/client/src/sections/humanAffairs/routes.js @@ -1,5 +1,5 @@ import { - PersonnelFiles, EmployeeInformation, //人员档案 + PersonnelFiles, EmployeeInformation, PositionRating, //人员档案 DeptArchives, //部门档案 AttendanceStatistics, LeaveStatistics, OvertimeStatistics, AppointmentRecords, PersonnelDistribution, @@ -41,6 +41,11 @@ export default [{ key: 'employeeInformation', component: EmployeeInformation, breadcrumb: '员工信息', + }, { + path: '/positionRating', + key: 'positionRating', + component: PositionRating, + breadcrumb: '岗位评级' }] }, { path: '/deptArchives', @@ -77,6 +82,21 @@ export default [{ component: OvertimeStatistics, breadcrumb: '加班统计', }] +<<<<<<< HEAD + }, + // { + // path: '/communication', + // key: 'communication', + // breadcrumb: '员工沟通', + // childRoutes: [{ + // path: '/employeeCommunication', + // key: 'employeeCommunication', + // component: EmployeeCommunication, + // breadcrumb: '员工沟通统计', + // }] + // } + ] +======= }, { path: '/communication', key: 'communication', @@ -88,6 +108,7 @@ export default [{ breadcrumb: '员工沟通统计', }] }] +>>>>>>> dfde26653d43d65f3734d7b787e34d37d51c55de }, { path: '/recruit', key: 'recruit', diff --git a/web/routes/attachment/index.js b/web/routes/attachment/index.js index efd79d0..fe26ace 100644 --- a/web/routes/attachment/index.js +++ b/web/routes/attachment/index.js @@ -52,7 +52,6 @@ module.exports = { let upload = async function (ctx, next) { try { - console.log('-------------'); const { token } = ctx.request.query console.log(token); if (token) {