From e7c6a1e0378b3e04b2baac9c78ef87d3aeab74d3 Mon Sep 17 00:00:00 2001
From: deartibers <947466799@qq.com>
Date: Thu, 20 Oct 2022 10:34:06 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../containers/employeeInformation.jsx | 53 +++++++++++++++----
.../containers/personnelFiles.jsx | 3 +-
2 files changed, 43 insertions(+), 13 deletions(-)
diff --git a/web/client/src/sections/humanAffairs/containers/employeeInformation.jsx b/web/client/src/sections/humanAffairs/containers/employeeInformation.jsx
index 825e7fe..88734e0 100644
--- a/web/client/src/sections/humanAffairs/containers/employeeInformation.jsx
+++ b/web/client/src/sections/humanAffairs/containers/employeeInformation.jsx
@@ -21,6 +21,7 @@ const employeeInformation = (props) => {
const [setup, setSetup] = useState(false);//表格设置是否显现
const [setupp, setSetupp] = useState([]);//实际显示的表格列表
const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息
+ const [order, setOrder] = useState({ orderBy: 'hiredate', orderDirection: 'DESC' }); //页码信息
const [limits, setLimits] = useState()//每页实际条数
const [downloadUrl, setDownloadUrl] = useState('')//下载pdf
const EMPLOYEEINFORMATION = "employeeInformation";
@@ -84,7 +85,7 @@ const employeeInformation = (props) => {
}, [])
useEffect(() => {
getMemberSearchList()//查询人员列表
- }, [query])
+ }, [query, order])
function getMemberSearchList () {//查询人员列表
@@ -97,7 +98,7 @@ const employeeInformation = (props) => {
obj.hiredateStart = ''
obj.hiredateEnd = ''
}
- dispatch(humanAffairs.getMemberList({ ...obj, ...query })).then((res) => {//查询人员列表
+ dispatch(humanAffairs.getMemberList({ ...obj, ...query, ...order })).then((res) => {//查询人员列表
if (res.success) {
setArchivesList(res.payload?.data?.rows)
setLimits(res.payload?.data?.count)
@@ -121,13 +122,15 @@ const employeeInformation = (props) => {
const columns = [
{
title: (
-
+
员工编号
-
+
),
- width: 120,
+ width: 200,
dataIndex: "userCode",
key: "userCode",
+ sorter: (a, b) => { },
+ // sorter: (a, b) => a.name.length - b.name.length > 0 ? 1 : -1,
render: (_, r, index) => {
return (r.userCode ? r.userCode : '-');
},
@@ -235,6 +238,7 @@ const employeeInformation = (props) => {
width: 120,
dataIndex: "birthday",
key: "birthday",
+ sorter: (a, b) => { },
render: (_, r, index) => {
return (r.birthday ? r.birthday : '-');
},
@@ -307,6 +311,7 @@ const employeeInformation = (props) => {
width: 120,
dataIndex: "hiredate",
key: "hiredate",
+ sorter: (a, b) => { },
render: (_, r, index) => {
return (r.hiredate ? r.hiredate : '-');
},
@@ -339,6 +344,7 @@ const employeeInformation = (props) => {
width: 120,
dataIndex: "employmentLife",
key: "employmentLife",
+ sorter: (a, b) => { },
render: (_, r, index) => {
return (r.hiredate ? {moment(new Date()).diff(r.hiredate, 'years') + '年'} : '-')
},
@@ -520,12 +526,16 @@ const employeeInformation = (props) => {
-
{ setDownloadUrl(`members/export?token=${user.token}×tamp=${moment().valueOf()}`) }}
- />
- {
- downloadUrl ?
: ''
- }
+
{
+ let obj = form.current.getValues()
+ setDownloadUrl(`members/export?token=${user.token}&keywordTarget=${obj.keywordTarget ? obj.keywordTarget : ''}&keyword=${obj.keyword ? obj.keyword : ''}&marital=${obj.marital ? obj.marital : ''}&native=${obj.native ? obj.native : ''}&workPlace=${obj.workPlace ? obj.workPlace : ''}`)
+ }}>
+
+ {
+ downloadUrl ?
: ''
+ }
+
setSetup(true)}
/>
@@ -557,6 +567,27 @@ const employeeInformation = (props) => {
bordered={false}
empty="暂无数据"
pagination={false}
+ onChange={({ sorter }) => {
+ if (sorter.key == 'userCode') {
+ if (sorter.sortOrder == 'descend') {
+ setOrder({ orderBy: 'code', orderDirection: 'DESC' })
+ } else {
+ setOrder({ orderBy: 'code', orderDirection: 'ASC' })
+ }
+ } else if (sorter.key == 'birthday') {
+ if (sorter.sortOrder == 'descend') {
+ setOrder({ orderBy: 'hiredate', orderDirection: 'DESC' })
+ } else {
+ setOrder({ orderBy: 'hiredate', orderDirection: 'ASC' })
+ }
+ } else {
+ if (sorter.sortOrder == 'descend') {
+ setOrder({ orderBy: 'hiredate', orderDirection: 'DESC' })
+ } else {
+ setOrder({ orderBy: 'hiredate', orderDirection: 'ASC' })
+ }
+ }
+ }}
onRow={handleRow}
scroll={scroll}
/>
diff --git a/web/client/src/sections/humanAffairs/containers/personnelFiles.jsx b/web/client/src/sections/humanAffairs/containers/personnelFiles.jsx
index 2bc29f9..3ddcf64 100644
--- a/web/client/src/sections/humanAffairs/containers/personnelFiles.jsx
+++ b/web/client/src/sections/humanAffairs/containers/personnelFiles.jsx
@@ -136,8 +136,7 @@ const Rest = (props) => {
{
- setDownloadUrl(`members/export?token=${user.token}&state=${typeChoose}&keywordTarget=${keywordTarget}&keyword=${keyword}`)
-
+ setDownloadUrl(`members/export?token=${user.token}&state=${typeChoose}&keywordTarget=${keywordTarget}&keyword=${keyword}&keys=overtimeStatistic,vacateStatistic`)
}}>