Browse Source

员工信息新增字段,员工档案新增字段

master
zmh 2 years ago
parent
commit
a1f9c0eeae
  1. 29
      api/app/lib/controllers/member/index.js
  2. 34
      api/app/lib/utils/constant.js
  3. 5
      api/app/lib/utils/member.js
  4. 102
      web/client/src/sections/humanAffairs/containers/employeeInformation.jsx
  5. 66
      web/client/src/sections/humanAffairs/containers/personnelFilesDetail.jsx
  6. 3
      web/client/src/utils/index.js

29
api/app/lib/controllers/member/index.js

@ -486,7 +486,7 @@ async function exportData (ctx) {
try { try {
const { models } = ctx.fs.dc; const { models } = ctx.fs.dc;
const { clickHouse, opts: { qiniu } } = ctx.app.fs const { clickHouse, opts: { qiniu } } = ctx.app.fs
const { simpleExcelDown, memberList, packageUserData } = ctx.app.fs.utils const { simpleExcelDown, memberList, packageUserData, UserAttribute } = ctx.app.fs.utils
const { const {
keywordTarget, keyword, limit, page, state, keys = '', keywordTarget, keyword, limit, page, state, keys = '',
hiredateStart, hiredateEnd, marital, native, workPlace, hiredateStart, hiredateEnd, marital, native, workPlace,
@ -511,7 +511,28 @@ async function exportData (ctx) {
}, { }, {
title: '姓名', title: '姓名',
key: 'userName', key: 'userName',
}] }, {
title: '所属部门',
key: 'departmrnt',
}, {
title: '职位',
key: 'userJob',
}, {
title: '岗位',
key: 'userPost',
}, {
title: '在职状态',
key: 'userActiveStatus',
}, {
title: '绩点',
key: 'point',
}, {
title: '归属机构',
key: 'userOrganization',
}, {
title: '技术职级等级',
key: 'technicalGrade',
}]
let header = [].concat(preHeader) let header = [].concat(preHeader)
for (let k in tableAttributes) { for (let k in tableAttributes) {
const comment = tableAttributes[k].comment const comment = tableAttributes[k].comment
@ -574,6 +595,10 @@ async function exportData (ctx) {
d.departmrnt = d.departmrnt.map(dep => dep.name).join('、') d.departmrnt = d.departmrnt.map(dep => dep.name).join('、')
d.role = d.role.map(r => r.name).join('、') d.role = d.role.map(r => r.name).join('、')
d.userJob = d.userJob? UserAttribute.jobDataSource[d.userJob - 1] : '';
d.userActiveStatus = d.userActiveStatus? UserAttribute.activeStatusDataSource[d.userActiveStatus - 1] : '';
d.userOrganization = d.userOrganization? UserAttribute.organizationDataSource[d.userOrganization - 1] : '';
d.idPhoto ? d.idPhoto = qiniu.domain + '/' + d.idPhoto : '' d.idPhoto ? d.idPhoto = qiniu.domain + '/' + d.idPhoto : ''
d.vitae ? d.vitae = qiniu.domain + '/' + d.vitae : '' d.vitae ? d.vitae = qiniu.domain + '/' + d.vitae : ''

34
api/app/lib/utils/constant.js

@ -2,19 +2,25 @@
module.exports = function (app, opts) { module.exports = function (app, opts) {
const dayType = { const dayType = {
dayoff: '普假', dayoff: '普假',
workday: '工作日', workday: '工作日',
festivals: '法定假', festivals: '法定假',
} }
const overtimeType = { const overtimeType = {
'发放加班补偿': '折算', '发放加班补偿': '折算',
'调休': '调休' '调休': '调休'
} }
const UserAttribute = {
return { jobDataSource: ['普通员工', '中层', '高层'],
dayType, activeStatusDataSource: ['在职', '离职', '特殊状态-特殊账号'],
overtimeType, organizationDataSource: ['江西飞尚科技有限公司', '江西飞尚工程质量检测有限公司',
} '江西飞尚科技有限公司江苏分公司', '江西汇派科技有限公司'],
};
return {
dayType,
overtimeType,
UserAttribute
}
} }

5
api/app/lib/utils/member.js

@ -246,7 +246,10 @@ module.exports = function (app, opts) {
role.name AS roleName, role.name AS roleName,
role.id AS roleId, role.id AS roleId,
department.name AS depName, department.name AS depName,
department.id AS depId department.id AS depId,
user.job AS userJob,
user.active_status AS userActiveStatus,
user.organization AS userOrganization
FROM ( FROM (
SELECT SELECT
${orderBy == 'overtimeTakeRestSum' ${orderBy == 'overtimeTakeRestSum'

102
web/client/src/sections/humanAffairs/containers/employeeInformation.jsx

@ -7,6 +7,7 @@ import '../style.less'
import { Setup } from "$components"; import { Setup } from "$components";
import moment from 'moment' import moment from 'moment'
import { set } from 'nprogress'; import { set } from 'nprogress';
import { UserAttribute } from '$utils'
const employeeInformation = (props) => { const employeeInformation = (props) => {
const { dispatch, actions, history, user, loading, socket, xqMembers } = props const { dispatch, actions, history, user, loading, socket, xqMembers } = props
@ -33,8 +34,12 @@ const employeeInformation = (props) => {
list: [ list: [
{ name: "姓名", value: "userName" }, { name: "姓名", value: "userName" },
{ name: "所属部门", value: "departmrnt" }, { name: "所属部门", value: "departmrnt" },
{ name: "职位", value: "roleName" }, { name: "职位", value: "userJob" },
{ name: "岗位", value: "userPost" },
{ name: "在职状态", value: "userActiveStatus" },
{ name: "绩点", value: "point" }, { name: "绩点", value: "point" },
{ name: "所属机构", value: "userOrganization" },
{ name: "技术职级等级", value: "technicalGrade" },
{ name: "证件号", value: "idNumber" }, { name: "证件号", value: "idNumber" },
{ name: "性别", value: "gender" }, { name: "性别", value: "gender" },
{ name: "籍贯", value: "nativePlace" }, { name: "籍贯", value: "nativePlace" },
@ -78,7 +83,8 @@ const employeeInformation = (props) => {
localStorage.getItem(EMPLOYEEINFORMATION) == null localStorage.getItem(EMPLOYEEINFORMATION) == null
? localStorage.setItem( ? localStorage.setItem(
EMPLOYEEINFORMATION, EMPLOYEEINFORMATION,
JSON.stringify(['userName', 'departmrnt', 'roleName', 'point', 'hiredate', 'age', 'phoneNumber', 'marital', 'politicsStatus', 'educationBackground', JSON.stringify(['userName', 'departmrnt', 'userJob', 'userPost', 'userActiveStatus', 'point', 'userOrganization', 'technicalGrade',
'hiredate', 'age', 'phoneNumber', 'marital', 'politicsStatus', 'educationBackground',
'graduatedFrom', 'employmentLife', 'occupationalHistory']) 'graduatedFrom', 'employmentLife', 'occupationalHistory'])
) )
: ""; : "";
@ -204,44 +210,60 @@ const employeeInformation = (props) => {
<img src="/assets/images/hrImg/V.png" alt="" style={{ width: 14, height: 14 }} /> 职位 <img src="/assets/images/hrImg/V.png" alt="" style={{ width: 14, height: 14 }} /> 职位
</div> </div>
), ),
width: 150, width: 100,
dataIndex: "roleName", dataIndex: "userJob",
key: "roleName", key: "userJob",
render: (_, r, index) => { render: (_, r, index) => {
return ( return r.userJob ? UserAttribute.jobDataSource[r.userJob - 1] : '-';
<div style={{ display: 'flex', alignItems: 'center' }}> },
{ }, {
r.role.map((ite, idx) => { title: (
let roleArr = [] <div>
for (let i = 0; i < r.role.length; i++) { <img src="/assets/images/hrImg/V.png" alt="" style={{ width: 14, height: 14 }} /> 岗位
roleArr.push(r.role[i].name) </div>
} ),
return ( width: 120,
<div key={idx} style={{ display: 'flex', alignItems: 'center' }}> dataIndex: "userPost",
{idx == 0 ? key: "userPost",
(ite.name) : ('') render: (_, r, index) => {
} return r.userPost || '-';
{ },
r.role.length > 1 && idx == 1 ? ( }, {
<Tooltip content={roleArr.join(',')} trigger="click" style={{ lineHeight: 2 }}> title: (
<div style={{ color: 'rgba(0,90,189,0.8)', fontSize: 12, marginRight: 4, cursor: "pointer", }}> <div>
+{r.role.length - 1} <img src="/assets/images/hrImg/V.png" alt="" style={{ width: 14, height: 14 }} /> 在职状态
</div> </div>
</Tooltip> ),
) : ('') width: 110,
} dataIndex: "userActiveStatus",
</div> key: "userActiveStatus",
) render: (_, r, index) => {
}) return r.userActiveStatus ? UserAttribute.activeStatusDataSource[r.userActiveStatus - 1] : '-';
}
</div>);
}, },
}, { }, {
title: '绩点', title: '绩点',
width: 100, width: 100,
dataIndex: "point", dataIndex: "point",
key: "point", key: "point",
render: (_, r, index) => <span></span>, render: (_, r, index) => <span>-</span>,
}, {
title: (
<div>
<img src="/assets/images/hrImg/V.png" alt="" style={{ width: 14, height: 14 }} /> 所属机构
</div>
),
width: 150,
dataIndex: "userOrganization",
key: "userOrganization",
render: (_, r, index) => {
return r.userOrganization ? UserAttribute.organizationDataSource[r.userOrganization - 1] : '-';
},
}, {
title: '技术职级等级',
width: 150,
dataIndex: "technicalGrade",
key: "technicalGrade",
render: (_, r, index) => <span>-</span>,
}, { }, {
title: '证件号', title: '证件号',
width: 180, width: 180,
@ -434,13 +456,13 @@ const employeeInformation = (props) => {
}, },
}, },
]; ];
for (let i = 0; i < arr.length; i++) { let newColumns = columns;
let colum = column.filter((item) => { for (let i = 0; i < column.length; i++) {
return item.key === arr[i]; if (arr.indexOf(column[i].key) > -1) {
}); newColumns.push(column[i]);
columns.splice(i + 2, 0, colum[0]); }
} }
setSetupp(columns); setSetupp(newColumns);
} }
function handleRow(record, index) {// function handleRow(record, index) {//
// //
@ -675,7 +697,7 @@ const employeeInformation = (props) => {
<Setup <Setup
tableType={EMPLOYEEINFORMATION} tableType={EMPLOYEEINFORMATION}
tableList={tableList} tableList={tableList}
length={25} length={30}
close={() => { close={() => {
setSetup(false); setSetup(false);
attribute(); attribute();

66
web/client/src/sections/humanAffairs/containers/personnelFilesDetail.jsx

@ -7,6 +7,7 @@ import * as echarts from 'echarts';
import DeleteModal from '../components/deleteModal'; import DeleteModal from '../components/deleteModal';
import PersonnelModal from '../components/personnelModal'; import PersonnelModal from '../components/personnelModal';
import moment from 'moment' import moment from 'moment'
import { UserAttribute } from '$utils'
import '../style.less' import '../style.less'
@ -610,7 +611,7 @@ const Rest = (props) => {
职务信息 职务信息
</div> </div>
<div style={{ marginTop: 13, display: 'flex' }}> <div style={{ marginTop: 13, display: 'flex' }}>
<div style={{ display: 'flex', width: '14.715%' }}> <div style={{ display: 'flex', width: '15.715%' }}>
<div style={{ color: 'rgba(0, 0, 0,0.6)', fontSize: 12, width: 60 }}> <div style={{ color: 'rgba(0, 0, 0,0.6)', fontSize: 12, width: 60 }}>
员工编号 员工编号
</div> </div>
@ -618,7 +619,7 @@ const Rest = (props) => {
{pepObj.userCode || '暂无'} {pepObj.userCode || '暂无'}
</div> </div>
</div> </div>
<div style={{ display: 'flex', width: '19.072%' }}> <div style={{ display: 'flex', width: '17.072%' }}>
<div style={{ color: 'rgba(0, 0, 0,0.6)', fontSize: 12, width: 60 }}> <div style={{ color: 'rgba(0, 0, 0,0.6)', fontSize: 12, width: 60 }}>
入职时间 入职时间
</div> </div>
@ -626,7 +627,7 @@ const Rest = (props) => {
{pepObj.hiredate || '暂无'} {pepObj.hiredate || '暂无'}
</div> </div>
</div> </div>
<div style={{ display: 'flex', width: '21.395%' }}> <div style={{ display: 'flex', width: '32.395%' }}>
<div style={{ color: 'rgba(0, 0, 0,0.6)', fontSize: 12, width: 84 }}> <div style={{ color: 'rgba(0, 0, 0,0.6)', fontSize: 12, width: 84 }}>
转试用期时间 转试用期时间
</div> </div>
@ -644,43 +645,38 @@ const Rest = (props) => {
</div> </div>
</div> </div>
<div style={{ marginTop: 9, display: 'flex' }}> <div style={{ marginTop: 9, display: 'flex' }}>
<div style={{ display: 'flex', width: '33.787%' }}> <div style={{ display: 'flex', width: '15.715%' }}>
<div style={{ color: 'rgba(0, 0, 0,0.6)', fontSize: 12, width: 60 }}> <div style={{ color: 'rgba(0, 0, 0,0.6)', fontSize: 12, width: 60 }}>
员工职位 员工职位
</div> </div>
<div style={{ color: '#005ABD', fontSize: 13, display: 'flex', alignItems: 'center' }}> <div style={{ color: '#005ABD', fontSize: 13 }}>
{
pepObj.userJob? UserAttribute.jobDataSource[pepObj.userJob - 1] : '暂无'
}
</div>
</div>
<div style={{ display: 'flex', width: '17.072%'}}>
<div style={{ color: 'rgba(0, 0, 0,0.6)', fontSize: 12, width: 60 }}>
员工岗位
</div>
<div style={{ color: '#4A4A4A', fontSize: 13 }}>
{ {
pepObj?.role?.map((item, index) => { pepObj.userPost || '暂无'
let roleArr = []
for (let i = 0; i < pepObj.role.length; i++) {
roleArr.push(pepObj.role[i].name)
}
return (
<div key={index} style={{ display: 'flex', alignItems: 'center' }}>
{index < 2 ?
(item.name) : ('')
}
{
pepObj.role.length > 1 && index == 0 ?
(',') : ('')
}
{
pepObj.role.length > 2 && index == 2 ? (
<Tooltip content={roleArr.join(',')} trigger="click" style={{ lineHeight: 2 }}>
<div style={{ color: 'rgba(0,90,189,0.8)', fontSize: 12, marginRight: 4, cursor: "pointer", }}>
+{pepObj.role.length - 2}
</div>
</Tooltip>
) : ('')
}
</div>
)
})
} }
</div> </div>
</div> </div>
<div style={{ display: 'flex', width: '66.213%' }}> <div style={{ display: 'flex', width: '32.395%'}}>
<div style={{ color: 'rgba(0, 0, 0,0.6)', fontSize: 12, width: 84, textAlign: 'end' }}> <div style={{ color: 'rgba(0, 0, 0,0.6)', fontSize: 12, width: 84, textAlign: 'end' }}>
所属机构
</div>
<div style={{ color: '#4A4A4A', fontSize: 13 }}>
{
pepObj.userOrganization? UserAttribute.organizationDataSource[pepObj.userOrganization - 1] : '暂无'
}
</div>
</div>
<div style={{ display: 'flex', width: '' }}>
<div style={{ color: 'rgba(0, 0, 0,0.6)', fontSize: 12, width: 60 }}>
所属部门 所属部门
</div> </div>
{ {
@ -712,7 +708,7 @@ const Rest = (props) => {
</div> </div>
</div> </div>
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<div style={{ marginTop: 9, display: 'flex', width: '14.715%' }}> <div style={{ marginTop: 9, display: 'flex', width: '15.715%' }}>
<div style={{ color: 'rgba(0, 0, 0,0.6)', fontSize: 12, width: 60 }}> <div style={{ color: 'rgba(0, 0, 0,0.6)', fontSize: 12, width: 60 }}>
工作经验 工作经验
</div> </div>
@ -720,7 +716,7 @@ const Rest = (props) => {
{pepObj.experienceYear ? pepObj.experienceYear + '年' : '暂无'} {pepObj.experienceYear ? pepObj.experienceYear + '年' : '暂无'}
</div> </div>
</div> </div>
<div style={{ marginTop: 9, display: 'flex', width: '19.072%' }}> <div style={{ marginTop: 9, display: 'flex', width: '17.072%' }}>
<div style={{ color: 'rgba(0, 0, 0,0.6)', fontSize: 12, width: 60 }}> <div style={{ color: 'rgba(0, 0, 0,0.6)', fontSize: 12, width: 60 }}>
入职年限 入职年限
</div> </div>
@ -728,7 +724,7 @@ const Rest = (props) => {
{pepObj.hiredate ? String(moment(new Date()).diff(pepObj.hiredate, 'years',true)).substring(0,3) + '年' : '暂无'} {pepObj.hiredate ? String(moment(new Date()).diff(pepObj.hiredate, 'years',true)).substring(0,3) + '年' : '暂无'}
</div> </div>
</div> </div>
<div style={{ marginTop: 9, display: 'flex', width: '39.4%' }}> <div style={{ marginTop: 9, display: 'flex', width: '32.395%' }}>
<div style={{ color: 'rgba(0, 0, 0,0.6)', fontSize: 12, width: 84, textAlign: 'end' }}> <div style={{ color: 'rgba(0, 0, 0,0.6)', fontSize: 12, width: 84, textAlign: 'end' }}>
试用期 试用期
</div> </div>

3
web/client/src/utils/index.js

@ -6,7 +6,7 @@ import {
AxyRequest, EmisRequest, AxyRequest, EmisRequest,
basicAction, RouteRequest basicAction, RouteRequest
} from './webapi' } from './webapi'
import { UserAttribute } from './userAttribute';
export { export {
isAuthorized, isAuthorized,
AuthorizationCode, AuthorizationCode,
@ -17,4 +17,5 @@ export {
EmisRequest, EmisRequest,
basicAction, basicAction,
RouteRequest, RouteRequest,
UserAttribute
} }
Loading…
Cancel
Save