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 {
const { models } = ctx.fs.dc;
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 {
keywordTarget, keyword, limit, page, state, keys = '',
hiredateStart, hiredateEnd, marital, native, workPlace,
@ -511,7 +511,28 @@ async function exportData (ctx) {
}, {
title: '姓名',
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)
for (let k in tableAttributes) {
const comment = tableAttributes[k].comment
@ -573,6 +594,10 @@ async function exportData (ctx) {
exportD.forEach(d => {
d.departmrnt = d.departmrnt.map(dep => dep.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.vitae ? d.vitae = qiniu.domain + '/' + d.vitae : ''

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

@ -2,19 +2,25 @@
module.exports = function (app, opts) {
const dayType = {
dayoff: '普假',
workday: '工作日',
festivals: '法定假',
}
const dayType = {
dayoff: '普假',
workday: '工作日',
festivals: '法定假',
}
const overtimeType = {
'发放加班补偿': '折算',
'调休': '调休'
}
return {
dayType,
overtimeType,
}
const overtimeType = {
'发放加班补偿': '折算',
'调休': '调休'
}
const UserAttribute = {
jobDataSource: ['普通员工', '中层', '高层'],
activeStatusDataSource: ['在职', '离职', '特殊状态-特殊账号'],
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.id AS roleId,
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 (
SELECT
${orderBy == 'overtimeTakeRestSum'

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

@ -7,6 +7,7 @@ import '../style.less'
import { Setup } from "$components";
import moment from 'moment'
import { set } from 'nprogress';
import { UserAttribute } from '$utils'
const employeeInformation = (props) => {
const { dispatch, actions, history, user, loading, socket, xqMembers } = props
@ -33,8 +34,12 @@ const employeeInformation = (props) => {
list: [
{ name: "姓名", value: "userName" },
{ name: "所属部门", value: "departmrnt" },
{ name: "职位", value: "roleName" },
{ name: "职位", value: "userJob" },
{ name: "岗位", value: "userPost" },
{ name: "在职状态", value: "userActiveStatus" },
{ name: "绩点", value: "point" },
{ name: "所属机构", value: "userOrganization" },
{ name: "技术职级等级", value: "technicalGrade" },
{ name: "证件号", value: "idNumber" },
{ name: "性别", value: "gender" },
{ name: "籍贯", value: "nativePlace" },
@ -78,7 +83,8 @@ const employeeInformation = (props) => {
localStorage.getItem(EMPLOYEEINFORMATION) == null
? localStorage.setItem(
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'])
)
: "";
@ -204,44 +210,60 @@ const employeeInformation = (props) => {
<img src="/assets/images/hrImg/V.png" alt="" style={{ width: 14, height: 14 }} /> 职位
</div>
),
width: 150,
dataIndex: "roleName",
key: "roleName",
width: 100,
dataIndex: "userJob",
key: "userJob",
render: (_, r, index) => {
return (
<div style={{ display: 'flex', alignItems: 'center' }}>
{
r.role.map((ite, idx) => {
let roleArr = []
for (let i = 0; i < r.role.length; i++) {
roleArr.push(r.role[i].name)
}
return (
<div key={idx} style={{ display: 'flex', alignItems: 'center' }}>
{idx == 0 ?
(ite.name) : ('')
}
{
r.role.length > 1 && idx == 1 ? (
<Tooltip content={roleArr.join(',')} trigger="click" style={{ lineHeight: 2 }}>
<div style={{ color: 'rgba(0,90,189,0.8)', fontSize: 12, marginRight: 4, cursor: "pointer", }}>
+{r.role.length - 1}
</div>
</Tooltip>
) : ('')
}
</div>
)
})
}
</div>);
return r.userJob ? UserAttribute.jobDataSource[r.userJob - 1] : '-';
},
}, {
title: (
<div>
<img src="/assets/images/hrImg/V.png" alt="" style={{ width: 14, height: 14 }} /> 岗位
</div>
),
width: 120,
dataIndex: "userPost",
key: "userPost",
render: (_, r, index) => {
return r.userPost || '-';
},
}, {
title: (
<div>
<img src="/assets/images/hrImg/V.png" alt="" style={{ width: 14, height: 14 }} /> 在职状态
</div>
),
width: 110,
dataIndex: "userActiveStatus",
key: "userActiveStatus",
render: (_, r, index) => {
return r.userActiveStatus ? UserAttribute.activeStatusDataSource[r.userActiveStatus - 1] : '-';
},
}, {
title: '绩点',
width: 100,
dataIndex: "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: '证件号',
width: 180,
@ -434,13 +456,13 @@ const employeeInformation = (props) => {
},
},
];
for (let i = 0; i < arr.length; i++) {
let colum = column.filter((item) => {
return item.key === arr[i];
});
columns.splice(i + 2, 0, colum[0]);
let newColumns = columns;
for (let i = 0; i < column.length; i++) {
if (arr.indexOf(column[i].key) > -1) {
newColumns.push(column[i]);
}
}
setSetupp(columns);
setSetupp(newColumns);
}
function handleRow(record, index) {//
//
@ -675,7 +697,7 @@ const employeeInformation = (props) => {
<Setup
tableType={EMPLOYEEINFORMATION}
tableList={tableList}
length={25}
length={30}
close={() => {
setSetup(false);
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 PersonnelModal from '../components/personnelModal';
import moment from 'moment'
import { UserAttribute } from '$utils'
import '../style.less'
@ -610,7 +611,7 @@ const Rest = (props) => {
职务信息
</div>
<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>
@ -618,7 +619,7 @@ const Rest = (props) => {
{pepObj.userCode || '暂无'}
</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>
@ -626,7 +627,7 @@ const Rest = (props) => {
{pepObj.hiredate || '暂无'}
</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>
@ -644,43 +645,38 @@ const Rest = (props) => {
</div>
</div>
<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>
<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) => {
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>
)
})
pepObj.userPost || '暂无'
}
</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>
<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>
{
@ -712,7 +708,7 @@ const Rest = (props) => {
</div>
</div>
<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>
@ -720,7 +716,7 @@ const Rest = (props) => {
{pepObj.experienceYear ? pepObj.experienceYear + '年' : '暂无'}
</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>
@ -728,7 +724,7 @@ const Rest = (props) => {
{pepObj.hiredate ? String(moment(new Date()).diff(pepObj.hiredate, 'years',true)).substring(0,3) + '年' : '暂无'}
</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>

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

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