diff --git a/api/app/lib/controllers/member/index.js b/api/app/lib/controllers/member/index.js index 1593234..2e2ad47 100644 --- a/api/app/lib/controllers/member/index.js +++ b/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 : '' diff --git a/api/app/lib/utils/constant.js b/api/app/lib/utils/constant.js index 8012eca..67f58e8 100644 --- a/api/app/lib/utils/constant.js +++ b/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 + } } \ No newline at end of file diff --git a/api/app/lib/utils/member.js b/api/app/lib/utils/member.js index 3f4c7a2..1a5c404 100644 --- a/api/app/lib/utils/member.js +++ b/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' diff --git a/web/client/src/sections/humanAffairs/containers/employeeInformation.jsx b/web/client/src/sections/humanAffairs/containers/employeeInformation.jsx index 553c264..1fcdeff 100644 --- a/web/client/src/sections/humanAffairs/containers/employeeInformation.jsx +++ b/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) => { 职位 ), - width: 150, - dataIndex: "roleName", - key: "roleName", + width: 100, + dataIndex: "userJob", + key: "userJob", render: (_, r, index) => { - return ( -
- { - r.role.map((ite, idx) => { - let roleArr = [] - for (let i = 0; i < r.role.length; i++) { - roleArr.push(r.role[i].name) - } - return ( -
- {idx == 0 ? - (ite.name) : ('') - } - { - r.role.length > 1 && idx == 1 ? ( - -
- +{r.role.length - 1} -
-
- ) : ('') - } -
- ) - }) - } -
); + return r.userJob ? UserAttribute.jobDataSource[r.userJob - 1] : '-'; + }, + }, { + title: ( +
+ 岗位 +
+ ), + width: 120, + dataIndex: "userPost", + key: "userPost", + render: (_, r, index) => { + return r.userPost || '-'; + }, + }, { + title: ( +
+ 在职状态 +
+ ), + 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) => , + render: (_, r, index) => -, + }, { + title: ( +
+ 所属机构 +
+ ), + 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) => -, }, { 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) => { { setSetup(false); attribute(); diff --git a/web/client/src/sections/humanAffairs/containers/personnelFilesDetail.jsx b/web/client/src/sections/humanAffairs/containers/personnelFilesDetail.jsx index 46a4e8e..c2b889b 100644 --- a/web/client/src/sections/humanAffairs/containers/personnelFilesDetail.jsx +++ b/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) => { 职务信息
-
+
员工编号:
@@ -618,7 +619,7 @@ const Rest = (props) => { {pepObj.userCode || '暂无'}
-
+
入职时间:
@@ -626,7 +627,7 @@ const Rest = (props) => { {pepObj.hiredate || '暂无'}
-
+
转试用期时间:
@@ -644,43 +645,38 @@ const Rest = (props) => {
-
+
员工职位:
-
+
+ { + pepObj.userJob? UserAttribute.jobDataSource[pepObj.userJob - 1] : '暂无' + } +
+
+
+
+ 员工岗位: +
+
{ - pepObj?.role?.map((item, index) => { - let roleArr = [] - for (let i = 0; i < pepObj.role.length; i++) { - roleArr.push(pepObj.role[i].name) - } - return ( -
- {index < 2 ? - (item.name) : ('') - } - { - pepObj.role.length > 1 && index == 0 ? - (',') : ('') - } - { - pepObj.role.length > 2 && index == 2 ? ( - -
- +{pepObj.role.length - 2} -
-
- ) : ('') - } -
- ) - }) + pepObj.userPost || '暂无' }
-
+
+ 所属机构: +
+
+ { + pepObj.userOrganization? UserAttribute.organizationDataSource[pepObj.userOrganization - 1] : '暂无' + } +
+
+
+
所属部门:
{ @@ -712,7 +708,7 @@ const Rest = (props) => {
-
+
工作经验:
@@ -720,7 +716,7 @@ const Rest = (props) => { {pepObj.experienceYear ? pepObj.experienceYear + '年' : '暂无'}
-
+
入职年限:
@@ -728,7 +724,7 @@ const Rest = (props) => { {pepObj.hiredate ? String(moment(new Date()).diff(pepObj.hiredate, 'years',true)).substring(0,3) + '年' : '暂无'}
-
+
试用期:
diff --git a/web/client/src/utils/index.js b/web/client/src/utils/index.js index 0084428..860a315 100644 --- a/web/client/src/utils/index.js +++ b/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 } \ No newline at end of file