|
|
@ -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: ( |
|
|
|
<div> |
|
|
|
<span> |
|
|
|
<img src="/assets/images/hrImg/V.png" alt="" style={{ width: 14, height: 14 }} /> 员工编号 |
|
|
|
</div> |
|
|
|
</span> |
|
|
|
), |
|
|
|
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 ? <span style={{ color: '#1890FF' }}>{moment(new Date()).diff(r.hiredate, 'years') + '年'}</span> : '-') |
|
|
|
}, |
|
|
@ -520,12 +526,16 @@ const employeeInformation = (props) => { |
|
|
|
</Form.Select> |
|
|
|
</div> |
|
|
|
<div style={{ display: 'flex', alignItems: 'center' }}> |
|
|
|
<img src="/assets/images/hrImg/export.png" alt="" style={{ width: 20, height: 20, cursor: "pointer", marginRight: 15 }} |
|
|
|
onClick={() => { setDownloadUrl(`members/export?token=${user.token}×tamp=${moment().valueOf()}`) }} |
|
|
|
/> |
|
|
|
{ |
|
|
|
downloadUrl ? <iframe src={`/_api/${downloadUrl}`} style={{ display: 'none' }} /> : '' |
|
|
|
} |
|
|
|
<div style={{ width: 20, height: 20, cursor: "pointer", marginRight: 15 }} |
|
|
|
onClick={() => { |
|
|
|
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 : ''}`) |
|
|
|
}}> |
|
|
|
<img src="/assets/images/hrImg/export.png" alt="" style={{ width: '100%', height: '100%' }} /> |
|
|
|
{ |
|
|
|
downloadUrl ? <iframe src={`/_api/${downloadUrl}`} style={{ display: 'none' }} /> : '' |
|
|
|
} |
|
|
|
</div> |
|
|
|
<img src="/assets/images/hrImg/setup.png" alt="" style={{ width: 20, height: 20, cursor: "pointer", marginRight: 15 }} |
|
|
|
onClick={() => 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} |
|
|
|
/> |
|
|
|