From 3b555ae9067f073f99db45e805ad8bfbc4bb2047 Mon Sep 17 00:00:00 2001 From: wuqun Date: Tue, 18 Oct 2022 16:06:13 +0800 Subject: [PATCH 1/5] =?UTF-8?q?5930=20=E4=BA=BA=E5=91=98=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF=E5=AF=BC=E5=85=A5=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E4=B8=8B=E8=BD=BD=E5=BA=94=E8=AF=A5=E4=B8=BAcsv?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E6=A8=A1=E6=9D=BF=205932=20=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E6=A1=A3=E6=A1=88=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=A0=BC=E5=BC=8F=E6=9C=AA=E5=81=9A=E9=99=90?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../containers/import-members-modal.js | 50 ++++++++++++------- .../containers/personnelFiles.jsx | 1 + 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/web/client/src/sections/humanAffairs/containers/import-members-modal.js b/web/client/src/sections/humanAffairs/containers/import-members-modal.js index cf9a00c..0cb6d48 100644 --- a/web/client/src/sections/humanAffairs/containers/import-members-modal.js +++ b/web/client/src/sections/humanAffairs/containers/import-members-modal.js @@ -31,8 +31,24 @@ const ImportMembersModal = props => { } } + const dldCsvMb = () => { + //表头 + let head = "人员编号,姓名,证件号,性别(男/女),出生年月日(例2022/02/01),籍贯,婚育状态(已婚/未婚/已婚已育),政治面貌,联系方式,工作地点,毕业院校,学历,专业,毕业时间,入职时间,转试用期时间,转正时间,离职日期,工作经验(年),历史工作经历与职务\n" + //数据 + //let data = 1 + ',' + 2 + ',' + 3 + ',' + 4 + ',' + 5 + let templateCsv = "data:text/csv;charset=utf-8,\ufeff" + head; + //创建一个a标签 + let link = document.createElement("a"); + //为a标签设置属性 + link.setAttribute("href", templateCsv); + link.setAttribute("download", "人资系统人员信息导入模板.csv"); + //点击a标签 + link.click(); + } + const download = () => { - dldTemplate(); + //dldTemplate(); + dldCsvMb(); let str = ""; rule.forEach((v, i) => { str += `${v}\r\n` @@ -40,21 +56,21 @@ const ImportMembersModal = props => { dldText("填写说明.txt", str); } - const dldTemplate = () => { - let dataTable = []; - let option = {}; - option.fileName = '人资系统人员信息导入模板'; - option.datas = [ - { - sheetData: dataTable, - sheetName: '人资系统人员信息导入模板', - sheetFilter: ['人员编号', '姓名', '证件号', '性别(男/女)', '出生年月日(例2022/02/01)', '籍贯', '婚育状态(已婚/未婚/已婚已育)', '政治面貌', '联系方式', '工作地点', '毕业院校', '学历', '专业', '毕业时间', '入职时间', '转试用期时间', '转正时间', '离职日期', '工作经验(年)', '历史工作经历与职务'], //excel文件中需显示的列数据 - sheetHeader: ['人员编号', '姓名', '证件号', '性别(男/女)', '出生年月日(例2022/02/01)', '籍贯', '婚育状态(已婚/未婚/已婚已育)', '政治面貌', '联系方式', '工作地点', '毕业院校', '学历', '专业', '毕业时间', '入职时间', '转试用期时间', '转正时间', '离职日期', '工作经验(年)', '历史工作经历与职务'], //excel文件中每列的表头名称 - } - ] - let toExcel = new ExportJsonExcel(option); //生成excel文件 - toExcel.saveExcel(); //下载excel文件 - } + // const dldTemplate = () => { + // let dataTable = []; + // let option = {}; + // option.fileName = '人资系统人员信息导入模板'; + // option.datas = [ + // { + // sheetData: dataTable, + // sheetName: '人资系统人员信息导入模板', + // sheetFilter: ['人员编号', '姓名', '证件号', '性别(男/女)', '出生年月日(例2022/02/01)', '籍贯', '婚育状态(已婚/未婚/已婚已育)', '政治面貌', '联系方式', '工作地点', '毕业院校', '学历', '专业', '毕业时间', '入职时间', '转试用期时间', '转正时间', '离职日期', '工作经验(年)', '历史工作经历与职务'], //excel文件中需显示的列数据 + // sheetHeader: ['人员编号', '姓名', '证件号', '性别(男/女)', '出生年月日(例2022/02/01)', '籍贯', '婚育状态(已婚/未婚/已婚已育)', '政治面貌', '联系方式', '工作地点', '毕业院校', '学历', '专业', '毕业时间', '入职时间', '转试用期时间', '转正时间', '离职日期', '工作经验(年)', '历史工作经历与职务'], //excel文件中每列的表头名称 + // } + // ] + // let toExcel = new ExportJsonExcel(option); //生成excel文件 + // toExcel.saveExcel(); //下载excel文件 + // } const dldText = (filename, text) => { var element = document.createElement('a'); @@ -68,7 +84,7 @@ const ImportMembersModal = props => { document.body.removeChild(element); } //const action = '/file/qiniu/upload?type=excel&token=' + user.token; - const fileLimit = '.xls,.xlsx,.csv'; + const fileLimit = '.csv'; const getFileBlob = (url) => { return new Promise((resolve, reject) => { diff --git a/web/client/src/sections/humanAffairs/containers/personnelFiles.jsx b/web/client/src/sections/humanAffairs/containers/personnelFiles.jsx index d87ea29..f45095e 100644 --- a/web/client/src/sections/humanAffairs/containers/personnelFiles.jsx +++ b/web/client/src/sections/humanAffairs/containers/personnelFiles.jsx @@ -32,6 +32,7 @@ const Rest = (props) => { }, [typeChoose]) function getMemberSearchList () {//搜索项企用户 + dispatch(humanAffairs.getMemberSearch()) dispatch(humanAffairs.getMemberList({ keywordTarget, keyword, state: typeChoose })).then((res) => {//搜索项企用户 if (res.success) { setArchivesList(res.payload?.data?.rows) From 64dc6b85e59ed431f52d5f6c1f45b22e1bf5798e Mon Sep 17 00:00:00 2001 From: wuqun Date: Tue, 18 Oct 2022 16:19:03 +0800 Subject: [PATCH 2/5] =?UTF-8?q?5936=20=E4=BA=BA=E5=91=98=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF=E5=AF=BC=E5=85=A5=E5=BF=85?= =?UTF-8?q?=E5=A1=AB=E4=B8=94=E6=AD=A3=E7=A1=AE=E7=9A=84=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E7=BC=96=E5=8F=B7=E5=90=8E=E6=8F=90=E7=A4=BA=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/sections/humanAffairs/containers/import-members-modal.js | 1 + 1 file changed, 1 insertion(+) diff --git a/web/client/src/sections/humanAffairs/containers/import-members-modal.js b/web/client/src/sections/humanAffairs/containers/import-members-modal.js index 0cb6d48..54332f9 100644 --- a/web/client/src/sections/humanAffairs/containers/import-members-modal.js +++ b/web/client/src/sections/humanAffairs/containers/import-members-modal.js @@ -104,6 +104,7 @@ const ImportMembersModal = props => { const workbook = XLSX.read(result, { type: "binary", cellDates: true,//设为true,将天数的时间戳转为时间格式 + codepage: 936 }); let data = []; // 存储获取到的数据 // 遍历每张工作表进行读取(这里默认只读取第一张表) From fc8e1d518ed7ae2c3a98b7313edd798d4a7dbf9d Mon Sep 17 00:00:00 2001 From: deartibers <947466799@qq.com> Date: Tue, 18 Oct 2022 16:34:36 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=8A=98=E7=BA=BF=E5=9B=BE=E5=92=8C?= =?UTF-8?q?=E5=91=98=E5=B7=A5=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/client/assets/images/hrImg/!.png | Bin 0 -> 554 bytes web/client/assets/images/hrImg/V.png | Bin 0 -> 838 bytes web/client/assets/images/hrImg/setUp.png | Bin 0 -> 2069 bytes web/client/index.ejs | 2 +- web/client/index.html | 28 +- web/client/src/components/setup.jsx | 9 +- .../containers/employeeInformation.jsx | 344 ++++++++++++++++ .../sections/humanAffairs/containers/index.js | 3 +- .../containers/personnelFiles.jsx | 2 +- .../containers/personnelFilesDetail.jsx | 372 +++++++++++------- .../src/sections/humanAffairs/nav-item.jsx | 10 +- .../src/sections/humanAffairs/routes.js | 16 +- 12 files changed, 608 insertions(+), 178 deletions(-) create mode 100644 web/client/assets/images/hrImg/!.png create mode 100644 web/client/assets/images/hrImg/V.png create mode 100644 web/client/assets/images/hrImg/setUp.png create mode 100644 web/client/src/sections/humanAffairs/containers/employeeInformation.jsx diff --git a/web/client/assets/images/hrImg/!.png b/web/client/assets/images/hrImg/!.png new file mode 100644 index 0000000000000000000000000000000000000000..f9c334f16f5871b8bd4275e120ca94fe6428cc67 GIT binary patch literal 554 zcmV+_0@eMAP)Px$_TV%fa-oBbbw{YN?h zYo9^5>CyTwC(o7L|FCYcsw$1edLJrrzL#4Va=DNngR?Pm|LfxQ6~&j*{R zS<*x|rlGq)7shftY(E(V^1gE^JppuJ9st}z99^7*_cw4*e(9V5qgaWrRCW&7WaINzp%d^`o|(lOXjcW@^3kEkJ5~19z_k40oBD?a0;3{}PqQj& zS^LrJFXuU7r8VX}lR>#6Aq@f~GA5~gE9iO zKydp%gtT+gU^CC+vrVV@EZ|Is>saet7PWJ}uHU-p3v()0799(}3t-Px&07*naR7gv`mVIbVaTv!x&%N6)Gs_=F80EFijB)QxiA2fE9}9m>ByWFEh(sEB zD>8{cC@B(Zd5gag@={86j$!64%6ncSlFiI^@1t{%?e5sl*||0Q{r5c2_xJt&p65L0 z_xyw;mzpd>DMhJ9STA8tCPN{~fYoF;N(D+~nbAA)c}B24eN4BZ6d9cpkN7!f~Br$LYr zaaJx?2j9*(eOW~i?CSK@RKTyNjlRngVM>b()nG5ms-~TROvtZ|?dO-qGIT*A7M!rn=YM;WxLeN@wLHHzU@ERq@3q_Ya$h!l9&Nl3A z31}2@N^Lt<50A&f&k9c(gf~`6XQ7;qSJ`W2uZI46Y(&jH>&rveLfd|~5#De27K123 zX4_3;vYZ(E+BzOXuR!-nPS}rI@MJs|pT}xIm@8pUHD#scYymcVil+93{3=MvvSHC` zcvt{+FWk3TGZTs>%vlTMoE8RmQU11|3rCMRFsRH9zE}cZ4!2dxcDULGmO&sLo)@(x zX2s7-gc*%MXNG<+?_d^4Dl~lVAVEJe35;ik*MN!1@wI^#j!KvXZY8yTrjm9Ov^rE6 zCn1d11uN;vFSa4{afsTNf;D1NTn=Ns*e=B>((uN%pD#2eS?8zM2(h QHUIzs07*qoM6N<$f}$~RYybcN literal 0 HcmV?d00001 diff --git a/web/client/assets/images/hrImg/setUp.png b/web/client/assets/images/hrImg/setUp.png new file mode 100644 index 0000000000000000000000000000000000000000..ea7321717292dd8db5ebe16c46887f82009c5d57 GIT binary patch literal 2069 zcmV+w2Px+&q+ilp+$K2E0 zduNwfW_D($*}i|yocB4;``q)Mk5~9#R#ozL&=F8_hO)Bv*fg#+C(Jetu_HMeSBFzl za)K?De=63U6t!XY-l4Rl)}lJ2W1q-T3}(?_z1<0`Hu-s4-EAme$gtf_sMnKhx%XIi z{dSMw6UTdV;nX5{*#?4?3P3loea zrh}{oy)6UmIAXjAI`JAccL0j2M=)5zPE>x4Fdx;i8ET$Fbt&<1Lq3xE305WM;qv1Q zXO}>pqvED@EFay1st|S715f63BJwg*&BvG_Dg1bBoQLWPRIl%_H;iu(GhgY7WY+}i z4wrN3;z?8o1WL%yK^9?~r?SAJ$p=AKb|@tBJ{ZfeC;c+ZcJ{s-X=z)7G8S4xn|u}I0%EMdHa7$x&s){WnWWs;Iyv%HU@^A2G3$mcc&jgGuj~i? zQn1Irfgd1v4MQJPCj{};zT{18b9xqzS6#L{OF*6lE$QUnFdiaiZVw1X9M9Q32rfuH za1X(6L`j-z7s`rj0)%HQ~rPzQSUXT|c;yeesG_aS)u&t}jM6QjI#75xpz}~3F zHe&_w*MUCe+w_vrLL_+~xPM5?`V?`?>rT2}QRiR~W1{paE$65Ae3sw7@lG`LPFjF^ z?C|UYU+8IEecrbT$^Al=GYwbYNT0A4+x%I6hlx`tgAqA_ZB^v8_5Q3)_Mt^TONUSb z+qy5mg2}Ig8?;|yOc(rylx_YG26KpoHy2Rw45~MSd`R3HS&-oJ_e(i;)>F9@A&DKf z3Mg2EtL-Aq5TcEf(bTT=rl*OA*A|G8pgwyyzF+wOHjVpF0Y&ZrHyDYo9>3sQPOWDTgHEyb5FHDa=x3!Zla{$ur6)e0iwgAVq4$O ziC3GvnKmB8b-n&@VY;gL9aKQD%E=7O0K*?8S%4k>Nfu~r@_JfaFLkuv;ub{qqv=v7 zOhCCSP}#>yGS&KuKRjK#B2FEm>$ApLq0aN2*(|I^bx~GL6k`pxnU0|hbnn!y?hceY z^M(X$r+;}g=Vgi{)&Pq;?HBQ0DK-!@7kjn4^U&lq0q2`Xk#g?`z6bR7V(UnGZVZ>i?pC;~=ahX1&=(e2ydK9tujPTtQfY%kLKY$H zQ@=?kW)4lrF5=c#yTUC*FsQr8$Hc8$dxTs&NW}RF zbQo}&czAH}1ZO2~qm>isoU@s@HK#`jMx9qt4KPbfhErd8JQse~3RXE|arMtZ9+QpO z*0=H!^xh7e+a@8#WkO}iZd8mPp*lanG`>jO418U)@;x4v(e&@rKsiBfT2JrNm0A6t z->v*}HNq1?N%K$Cgu(MnF;`_J=d8ygE-o0GgYBgK}?fb!88O`b_biclG>+%q4DZDn16U2J-??FKOS90df$722|!|Jh^$Z z?J_W~L-jiy!;-Kc;Wb>o35>}&Y!5tOwxiX&J&;t>N}w)10ChgF@DJ!U8GB+d+jw)1 zoBBPfLvkq7!%x7O9wNy*KsWj$YWostq_kv4R^{+2OWWnw!D|}QOXUCbh<>dM)y{Za z8A_<+uX$hWy(i-8B00000NkvXXu0mjfkC^Je literal 0 HcmV?d00001 diff --git a/web/client/index.ejs b/web/client/index.ejs index 54e5c56..49ff0b5 100644 --- a/web/client/index.ejs +++ b/web/client/index.ejs @@ -9,7 +9,7 @@ - + diff --git a/web/client/index.html b/web/client/index.html index b4cac35..cba0f37 100644 --- a/web/client/index.html +++ b/web/client/index.html @@ -2,23 +2,23 @@ - - + + - + - - + + -
+
- - + + - - + - + - + \ No newline at end of file diff --git a/web/client/src/components/setup.jsx b/web/client/src/components/setup.jsx index c4cd070..a02fd3e 100644 --- a/web/client/src/components/setup.jsx +++ b/web/client/src/components/setup.jsx @@ -9,7 +9,8 @@ function Setup(props) { const { close, tableType, - tableList + tableList, + length } = props; console.log(tableType, @@ -25,7 +26,7 @@ function Setup(props) { ischeck(); }, []); function ischeck(value) { - if (check.length >= 8) { + if (check.length >= length) { if (check.includes(value)) { return false; } else { @@ -49,12 +50,12 @@ function Setup(props) { textAlign: "center", marginLeft: 6, background: - check.length == 8 + check.length == length ? "rgba(40, 123, 255, 1)" : "rgba(176, 176, 176, 1)", }} > - {check.length}/8 + {check.length}/length } diff --git a/web/client/src/sections/humanAffairs/containers/employeeInformation.jsx b/web/client/src/sections/humanAffairs/containers/employeeInformation.jsx new file mode 100644 index 0000000..768ad91 --- /dev/null +++ b/web/client/src/sections/humanAffairs/containers/employeeInformation.jsx @@ -0,0 +1,344 @@ +import React, { useEffect, useState, useRef } from 'react'; +import { connect } from 'react-redux'; +import { Select, SkeletonScreen, Button, Pagination, Skeleton, Form } from '@douyinfe/semi-ui'; +import { IconSearch } from '@douyinfe/semi-icons'; +import '../style.less' +import { Setup } from "$components"; +import moment from 'moment' +import { set } from 'nprogress'; + +const employeeInformation = (props) => { + const { dispatch, actions, history, user, loading, socket, xqMembers } = props + + const { humanAffairs } = actions; + + const form = useRef();//表单 + let [archivesList, setArchivesList] = useState([]); + const [personnelModal, setPersonnelModal] = useState(false);//档案弹框 + const [exportModalVs, setExportModalVs] = useState(false); + const [keyword, setKeyword] = useState('');//搜索内容 + const [keywordTarget, setKeywordTarget] = useState('');//搜索类型 + const [downloadUrl, setDownloadUrl] = useState('') + let [typeChoose, setTypeChoose] = useState(''); + + const [setup, setSetup] = useState(false);//表格设置是否显现 + const [setupp, setSetupp] = useState([]);//实际显示的表格列表 + const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息 + const [limits, setLimits] = useState()//每页实际条数 + + const EMPLOYEEINFORMATION = "employeeInformation"; + const tableList = [//表格属性 + { + title: '推送信息', + list: [ + { name: "策略类型", value: "pushWay" }, + { name: "推送机制", value: "noticeWay" }, + { name: "监听设备数量", value: "monitorCount" }, + { name: "累计推送次数", value: "logCount" }, + ] + } + ]; + useEffect(() => { + getMemberSearchList() + + + // attribute(); + // localStorage.getItem(EMPLOYEEINFORMATION) == null + // ? localStorage.setItem( + // EMPLOYEEINFORMATION, + // JSON.stringify(['pushWay','noticeWay','logCount','monitorCount']) + // ) + // : ""; + }, [typeChoose]) + + function getMemberSearchList () {//搜索项企用户 + dispatch(humanAffairs.getMemberList({ keywordTarget, keyword, state: typeChoose })).then((res) => {//搜索项企用户 + if (res.success) { + setArchivesList(res.payload?.data?.rows) + } + }) + } + + function typeOnChange (e) {//角色选择 + setTypeChoose(e.target.value); + } + function seachValueChange (value) { + setKeyword(value) + } + //获取表格属性设置 + function attribute () { + const arr = localStorage.getItem(EMPLOYEEINFORMATION) + ? JSON.parse(localStorage.getItem(EMPLOYEEINFORMATION)) + : []; + + const column = [ + { + title: "关联项目", + dataIndex: "noticeWay", + key: "noticeWay", + render: (_, r, index) => { + return r.noticeWay; + }, + }, + { + title: "创建时间", + dataIndex: "logCount", + key: "logCount", + render: (_, r, index) => { + return (r.logCount + '次') + }, + }, + { + title: "接收人", + dataIndex: "monitorCount", + key: "monitorCount", + render: (_, r, index) => { + return r.monitorCount + }, + }, + { + title: "监听问题", + dataIndex: "pushWay", + key: "pushWay", + render: (_, r, index) => { + return r.pushWay == 'email' ? '邮件通知' : '短信通知'; + }, + }, + { + title: "通知时效", + dataIndex: "text1", + key: "text1", + render: (_, r, index) => { + return r.text1 + }, + }, + { + title: "启用状态", + dataIndex: "text2", + key: "text2", + render: (_, r, index) => { + return r.text2 + }, + }, + { + title: "推送次数", + dataIndex: "time", + key: "time", + render: (_, r, index) => { + return r.time + }, + }, + ]; + 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]); + } + setSetupp(columns); + } + return ( + <> +
+
+
人事管理
+
/
+
档案中心
+
/
+
人员档案
+
+
+
+
+
+
员工信息
+
EMPLOYEE INFORMATION
+
+
+
+
{ + console.log('values', values); + }} + getFormApi={(formApi) => (form.current = formApi)} + > +
+
+ + 职位 + 部门 + 编号 + 姓名 + + } + pure + showClear + placeholder='请输入或选择关键词' + value={keyword} + style={{ width: 346, marginLeft: 12, marginRight: 12 }} + onChange={seachValueChange}> + + +
+
+
+ + {/* {.map((item) => { + return ( + + {item.name} + + ); + })} */} + + + {/* {.map((item) => { + return ( + + {item.name} + + ); + })} */} + + + {/* {.map((item) => { + return ( + + {item.name} + + ); + })} */} + +
+
+ setSetup(true)} + /> + setSetup(true)} + /> + +
+
+
+
+
+ + 表格中带有认证标识" + + "信息的为系统基础数据,来源于项企PEP、钉钉等系统,其他数据均为导入或自定义数据 +
+ {/*
+ + s)} + dataSource={tableData} + bordered={false} + empty="暂无数据" + pagination={false} + onRow={handleRow} + rowSelection={rowSelection} + /> + +
+
+
+
+ + 共{limits}条信息 + + { + setQuery({ limit: pageSize, page: currentPage - 1 }); + page.current = currentPage - 1 + }} + /> +
+
+ */} + + + + {setup ? ( + { + setSetup(false); + attribute(); + // setcameraSetup(false); + }} + /> + ) : ( + "" + )} + + ) +} + +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)(employeeInformation); diff --git a/web/client/src/sections/humanAffairs/containers/index.js b/web/client/src/sections/humanAffairs/containers/index.js index 59a3f85..eff5a17 100644 --- a/web/client/src/sections/humanAffairs/containers/index.js +++ b/web/client/src/sections/humanAffairs/containers/index.js @@ -2,5 +2,6 @@ import PersonnelFiles from './personnelFiles'; import PersonnelFilesDetail from './personnelFilesDetail'; +import EmployeeInformation from './employeeInformation'; -export { PersonnelFiles, PersonnelFilesDetail }; \ No newline at end of file +export { PersonnelFiles, PersonnelFilesDetail, EmployeeInformation }; \ No newline at end of file diff --git a/web/client/src/sections/humanAffairs/containers/personnelFiles.jsx b/web/client/src/sections/humanAffairs/containers/personnelFiles.jsx index d87ea29..4a2e67a 100644 --- a/web/client/src/sections/humanAffairs/containers/personnelFiles.jsx +++ b/web/client/src/sections/humanAffairs/containers/personnelFiles.jsx @@ -161,7 +161,7 @@ const Rest = (props) => {
- {item.pepUserId} + {item.userCode}
{ item.departmrnt.map((ite, idx) => { diff --git a/web/client/src/sections/humanAffairs/containers/personnelFilesDetail.jsx b/web/client/src/sections/humanAffairs/containers/personnelFilesDetail.jsx index 4bd6cee..2bc385d 100644 --- a/web/client/src/sections/humanAffairs/containers/personnelFilesDetail.jsx +++ b/web/client/src/sections/humanAffairs/containers/personnelFilesDetail.jsx @@ -151,99 +151,134 @@ const Rest = (props) => { } }) } - function getWorkOption () {//请假折线图 + function getWorkOption () {//加班折线图 + let date = []; + let showdate = [] + let showdate1 = [] dispatch(humanAffairs.getMemberOvertime({ pepUserId: history?.location?.search.slice(1), startDate: startDate, endDate: endDate })).then((res) => {//搜索项企用户 if (res.success) { setTableData(res.payload?.data?.data) setTableStatistic(res.payload?.data) - } - }) - var date = []; - date.push([2017, 6, 1].join("/")); - date.push([2017, 6, 2].join("/")); - date.push([2017, 6, 3].join("/")); - date.push([2017, 6, 4].join("/")); - date.push([2017, 6, 5].join("/")); - date.push([2017, 6, 6].join("/")); - date.push([2017, 6, 7].join("/")); - date.push([2017, 6, 8].join("/")); - date.push([2017, 6, 9].join("/")); - let data = { - legend: { - data: ["调休", "折算"], - left: 'right', - icon: 'roundRect', - itemHeight: 3, // 粗细 - }, - color: ['#0F7EFB', '#FE9812'], //两条折线的颜色 - xAxis: [ - { - boundaryGap: false, - data: date, - }, - ], - yAxis: [ - { - type: "value", - name: '小时' - }, - ], - dataZoom: [ - { - id: "dataZoomX", - type: "slider", - start: 0, - end: 100, - handleIcon: - "M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z", - handleSize: "80%", - }, - ], - tooltip: { - trigger: 'axis', - axisPointer: { - type: 'cross', - label: { - backgroundColor: '#6a7985' + let textdate = []; + for (let i = 0; i < res.payload?.data?.dayStatisticData?.length; i++) { + if (textdate.findIndex((ev) => { + return ev.time == moment(res.payload.data.dayStatisticData[i].day).format('YYYY/MM') + }) !== -1) { + textdate[textdate.findIndex((ev) => { + return ev.time == moment(res.payload.data.dayStatisticData[i].day).format('YYYY/MM') + })].num + = + textdate[textdate.findIndex((ev) => { + return ev.time == moment(res.payload.data.dayStatisticData[i].day).format('YYYY/MM') + })].num + res.payload.data.dayStatisticData[i].duration / 3600 + } + else { + textdate.push({ + time: moment(res.payload.data.dayStatisticData[i].day).format('YYYY/MM'), + num: res.payload.data.dayStatisticData[i].duration / 3600, + compensate: res.payload.data.dayStatisticData[i].compensate + }) + } + + } + console.log('textdate',textdate); + for (let l = 0; l < textdate.length; l++) { + if (textdate[l].compensate == '调休') { + showdate.push([textdate[l].time, textdate[l].num]) + } + else { + showdate1.push([textdate[l].time, textdate[l].num]) } + } - }, - series: [ - { - name: "调休", - type: "line", - areaStyle: { - color: 'rgba(14,156,255,0.5)', - opacity: 0.1 + + if (!startDate && !endDate) { + for (let i = 0; i < 12; i++) { + date.unshift(moment(new Date()).subtract(i, 'months').format('YYYY/MM')); + } + } + else { + let nowdate = moment(startDate).format('YYYY/MM') + date.push(nowdate) + for (let o = 0; o < 10000; o++) { + if (nowdate !== moment(endDate).format('YYYY/MM')) { + nowdate = moment(nowdate).add(1, 'months').format('YYYY/MM') + date.push(nowdate) + } + else { + break + } + } + } + let data = { + legend: { + data: ["调休", "折算"], + left: 'right', + icon: 'roundRect', + itemHeight: 3, // 粗细 }, - smooth: true, - data: [ - ["2017/6/1", 1], - ["2017/6/3", 3], - ["2017/6/5", 5], - ["2017/6/7", 4], - ["2017/6/9", 4], + color: ['#0F7EFB', '#FE9812'], //两条折线的颜色 + xAxis: [ + { + boundaryGap: false, + data: date, + }, + ], + yAxis: [ + { + type: "value", + name: '小时' + }, ], - }, - { - name: "折算", - type: "line", - areaStyle: { - color: 'rgba(254,152,18,0.2)', + dataZoom: [ + { + id: "dataZoomX", + type: "slider", + start: 0, + end: 100, + handleIcon: + "M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z", + handleSize: "80%", + }, + ], + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'cross', + label: { + backgroundColor: '#6a7985' + } + } }, - smooth: true, - data: [ - ["2017/6/2", 3], - ["2017/6/4", 1], - ["2017/6/6", 6], - ["2017/6/8", 3], + series: [ + { + name: "调休", + type: "line", + areaStyle: { + color: 'rgba(14,156,255,0.5)', + opacity: 0.1 + }, + smooth: true, + data: showdate, + }, + { + name: "折算", + type: "line", + areaStyle: { + color: 'rgba(254,152,18,0.2)', + }, + smooth: true, + data: showdate1, + }, ], - }, - ], - } - setOption(data) + } + setOption(data) + } + }) } function getLeaveOption () {//请假折线图 + let date = []; + let showdate = [] dispatch(humanAffairs.getMemberVacate({ pepUserId: history?.location?.search.slice(1), startDate: startDate, endDate: endDate })).then((res) => {//搜索项企用户 if (res.success) { setLeaveData(res.payload?.data?.data) @@ -270,78 +305,109 @@ const Rest = (props) => { setLeaveStatistic({ compassionate, sick, year, other, all }) - } - }) - var date = []; - date.push([2017, 6, 1].join("/")); - date.push([2017, 6, 2].join("/")); - date.push([2017, 6, 3].join("/")); - date.push([2017, 6, 4].join("/")); - date.push([2017, 6, 5].join("/")); - date.push([2017, 6, 6].join("/")); - date.push([2017, 6, 7].join("/")); - date.push([2017, 6, 8].join("/")); - date.push([2017, 6, 9].join("/")); - let data = { - color: ['#0F7EFB', '#FE9812'], //两条折线的颜色 - xAxis: [ - { - boundaryGap: false, - data: date, - }, - ], - yAxis: [ - { - type: "value", - name: '小时' - }, - ], - dataZoom: [ - { - id: "dataZoomX", - type: "slider", - start: 0, - end: 100, - handleIcon: - "M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z", - handleSize: "80%", - }, - ], - tooltip: { - trigger: 'axis', - axisPointer: { - type: 'cross', - label: { - backgroundColor: '#6a7985' + let textdate = []; + for (let i = 0; i < res.payload?.data?.dayStatisticData?.length; i++) { + if (textdate.findIndex((ev) => { + return ev.time == moment(res.payload.data.dayStatisticData[i].day).format('YYYY/MM') + }) !== -1) { + textdate[textdate.findIndex((ev) => { + return ev.time == moment(res.payload.data.dayStatisticData[i].day).format('YYYY/MM') + })].num + = + textdate[textdate.findIndex((ev) => { + return ev.time == moment(res.payload.data.dayStatisticData[i].day).format('YYYY/MM') + })].num + res.payload.data.dayStatisticData[i].duration / 3600 + } + else { + textdate.push({ + time: moment(res.payload.data.dayStatisticData[i].day).format('YYYY/MM'), + num: res.payload.data.dayStatisticData[i].duration / 3600 + }) } + } - }, - series: [ - { - name: "调休", - type: "line", - areaStyle: { - color: 'rgba(14,156,255,0.5)', - opacity: 0.1 + for (let l = 0; l < textdate.length; l++) { + showdate.push([textdate[l].time, textdate[l].num]) + } + + if (!startDate && !endDate) { + for (let i = 0; i < 12; i++) { + date.unshift(moment(new Date()).subtract(i, 'months').format('YYYY/MM')); + } + } + else { + let nowdate = moment(startDate).format('YYYY/MM') + date.push(nowdate) + for (let o = 0; o < 10000; o++) { + if (nowdate !== moment(endDate).format('YYYY/MM')) { + nowdate = moment(nowdate).add(1, 'months').format('YYYY/MM') + date.push(nowdate) + } + else { + break + } + } + } + let data = { + color: ['#0F7EFB', '#FE9812'], //两条折线的颜色 + xAxis: [ + { + boundaryGap: false, + data: date, + }, + ], + yAxis: [ + { + type: "value", + name: '小时' + }, + ], + dataZoom: [ + { + id: "dataZoomX", + type: "slider", + start: 0, + end: 100, + handleIcon: + "M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z", + handleSize: "80%", + }, + ], + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'cross', + label: { + backgroundColor: '#6a7985' + } + } }, - smooth: true, - data: [ - ["2017/6/1", 1], - ["2017/6/3", 3], - ["2017/6/5", 5], - ["2017/6/7", 4], - ["2017/6/9", 4], + series: [ + { + name: "调休", + type: "line", + areaStyle: { + color: 'rgba(14,156,255,0.5)', + opacity: 0.1 + }, + smooth: true, + data: showdate, + }, ], - }, - ], - } - setLeaveOption(data) + } + setLeaveOption(data) + } + }) } function handleChange (date) { - console.log('datedatedatedate', date); - setStartDate(moment(date[0]).format('YYYY-MM-DD')) - setEndDate(moment(date[1]).format('YYYY-MM-DD')) - + if (date.length > 1) { + setStartDate(moment(date[0]).format('YYYY-MM-DD')) + setEndDate(moment(date[1]).format('YYYY-MM-DD')) + } + else { + setStartDate('') + setEndDate('') + } } return ( <> @@ -646,8 +712,8 @@ const Rest = (props) => {
-
- 基础动作 +
+ 基本动作
时间筛选: @@ -685,7 +751,7 @@ const Rest = (props) => { 工作日:
- {tableStatistic.sumPayWorkday / 60 / 60 + tableStatistic.sumTakeRestWorkday / 60 / 60||0}小时 + {tableStatistic.sumPayWorkday / 60 / 60 + tableStatistic.sumTakeRestWorkday / 60 / 60 || 0}小时
@@ -693,7 +759,7 @@ const Rest = (props) => { 普通假日:
- {tableStatistic.sumTakeRestDayoff / 60 / 60 + tableStatistic.sumTakeRestDayoff / 60 / 60||0}小时 + {tableStatistic.sumTakeRestDayoff / 60 / 60 + tableStatistic.sumTakeRestDayoff / 60 / 60 || 0}小时
@@ -701,7 +767,7 @@ const Rest = (props) => { 法定假日:
- {tableStatistic.sumPayFestivals / 60 / 60 + tableStatistic.sumTakeRestFestivals / 60 / 60||0}小时 + {tableStatistic.sumPayFestivals / 60 / 60 + tableStatistic.sumTakeRestFestivals / 60 / 60 || 0}小时
@@ -709,7 +775,7 @@ const Rest = (props) => { 累计加班时长:
- {tableStatistic.sumPayWorkday / 60 / 60 + tableStatistic.sumTakeRestWorkday / 60 / 60 + tableStatistic.sumTakeRestDayoff / 60 / 60 + tableStatistic.sumTakeRestDayoff / 60 / 60 + tableStatistic.sumPayFestivals / 60 / 60 + tableStatistic.sumTakeRestFestivals / 60 / 60||0}小时 + {tableStatistic.sumPayWorkday / 60 / 60 + tableStatistic.sumTakeRestWorkday / 60 / 60 + tableStatistic.sumTakeRestDayoff / 60 / 60 + tableStatistic.sumTakeRestDayoff / 60 / 60 + tableStatistic.sumPayFestivals / 60 / 60 + tableStatistic.sumTakeRestFestivals / 60 / 60 || 0}小时
diff --git a/web/client/src/sections/humanAffairs/nav-item.jsx b/web/client/src/sections/humanAffairs/nav-item.jsx index e2f2869..a80967a 100644 --- a/web/client/src/sections/humanAffairs/nav-item.jsx +++ b/web/client/src/sections/humanAffairs/nav-item.jsx @@ -12,11 +12,19 @@ export function getNavItem (user, dispatch) { { itemKey: 'archivesCenter', text: '档案中心', - icon: , + icon: , to: '/humanAffairs/archivesCenter/personnelFiles', items: [{ itemKey: 'personnelFiles', to: '/humanAffairs/archivesCenter/personnelFiles', text: '人员档案' }] + },{ + itemKey: 'employeeRelations', + text: '员工关系', + icon: , + to: '/humanAffairs/employeeRelations/employeeInformation', + items: [{ + itemKey: 'employeeInformation', to: '/humanAffairs/employeeRelations/employeeInformation', text: '员工信息' + }] }, ] }, diff --git a/web/client/src/sections/humanAffairs/routes.js b/web/client/src/sections/humanAffairs/routes.js index 9fb9882..3e000e7 100644 --- a/web/client/src/sections/humanAffairs/routes.js +++ b/web/client/src/sections/humanAffairs/routes.js @@ -1,4 +1,4 @@ -import { PersonnelFiles,PersonnelFilesDetail } from './containers'; +import { PersonnelFiles, PersonnelFilesDetail, EmployeeInformation } from './containers'; export default [{ type: 'inner', @@ -17,9 +17,19 @@ export default [{ component: PersonnelFiles, breadcrumb: '人员档案', }] - },] + }, { + path: '/employeeRelations', + key: 'employeeRelations', + breadcrumb: '员工关系', + childRoutes: [{ + path: '/employeeInformation', + key: 'employeeInformation', + component: EmployeeInformation, + breadcrumb: '员工信息', + }] + }] } -},{ +}, { type: 'inner', route: { path: "/personnelFilesDetail", From 560a2a2984797a44cc21a9601d05891c867f7009 Mon Sep 17 00:00:00 2001 From: deartibers <947466799@qq.com> Date: Tue, 18 Oct 2022 16:59:47 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/sections/humanAffairs/components/personnelModal.jsx | 4 ++-- .../humanAffairs/containers/personnelFilesDetail.jsx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/web/client/src/sections/humanAffairs/components/personnelModal.jsx b/web/client/src/sections/humanAffairs/components/personnelModal.jsx index b8760bc..485e7b7 100644 --- a/web/client/src/sections/humanAffairs/components/personnelModal.jsx +++ b/web/client/src/sections/humanAffairs/components/personnelModal.jsx @@ -328,7 +328,7 @@ function pushModal (props) { label='籍贯:' showClear style={{ width: 184 }} - initValue={editObj?.nativePlace.split('-') || ""} + initValue={editObj?.nativePlace?.split('-') || ""} > @@ -371,7 +371,7 @@ function pushModal (props) { field='workPlace' label='工作地点:' showClear - initValue={editObj?.workPlace.split('-') || ""} + initValue={editObj?.workPlace?.split('-') || ""} style={{ width: 184 }} > diff --git a/web/client/src/sections/humanAffairs/containers/personnelFilesDetail.jsx b/web/client/src/sections/humanAffairs/containers/personnelFilesDetail.jsx index 2bc385d..ce73865 100644 --- a/web/client/src/sections/humanAffairs/containers/personnelFilesDetail.jsx +++ b/web/client/src/sections/humanAffairs/containers/personnelFilesDetail.jsx @@ -181,7 +181,7 @@ const Rest = (props) => { } } - console.log('textdate',textdate); + console.log('textdate', textdate); for (let l = 0; l < textdate.length; l++) { if (textdate[l].compensate == '调休') { showdate.push([textdate[l].time, textdate[l].num]) @@ -682,7 +682,7 @@ const Rest = (props) => { 试用期:
- {pepObj.regularDate ? moment(pepObj.regularDate).diff(pepObj.hiredate, 'months', true) + '个月' : '暂无'} + {pepObj.regularDate ? moment(pepObj.regularDate).diff(pepObj.hiredate, 'months', true).toFixed(1) + '个月' : '暂无'}
{ @@ -701,7 +701,7 @@ const Rest = (props) => {
-
+
他/她的历史工作经历与职务
From 23a0cf69d7aeb351ad3eeff6590e1bbf5c215fe8 Mon Sep 17 00:00:00 2001 From: deartibers <947466799@qq.com> Date: Tue, 18 Oct 2022 17:22:47 +0800 Subject: [PATCH 5/5] change --- .../src/sections/humanAffairs/components/personnelModal.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/client/src/sections/humanAffairs/components/personnelModal.jsx b/web/client/src/sections/humanAffairs/components/personnelModal.jsx index 485e7b7..59d311f 100644 --- a/web/client/src/sections/humanAffairs/components/personnelModal.jsx +++ b/web/client/src/sections/humanAffairs/components/personnelModal.jsx @@ -187,7 +187,9 @@ function pushModal (props) { rules={[{ required: true, message: "请输入人员编号" }]} />
{ let formList = form.current.getValues() - memberSeach(formList.userCode) + if(formList.userCode){ + memberSeach(formList.userCode) + } }}> 搜索