Browse Source

人员信息

master
deartibers 2 years ago
parent
commit
e7c6a1e037
  1. 47
      web/client/src/sections/humanAffairs/containers/employeeInformation.jsx
  2. 3
      web/client/src/sections/humanAffairs/containers/personnelFiles.jsx

47
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: (
<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}&timestamp=${moment().valueOf()}`) }}
/>
<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}
/>

3
web/client/src/sections/humanAffairs/containers/personnelFiles.jsx

@ -136,8 +136,7 @@ const Rest = (props) => {
</RadioGroup>
</div>
<div style={{ display: 'flex', marginLeft: 30, alignItems: 'center', cursor: 'pointer' }} onClick={() => {
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`)
}}>
<div style={{ width: 20, height: 20 }}>
<img src="/assets/images/hrImg/export.png" alt="" style={{ width: '100%', height: '100%' }} />

Loading…
Cancel
Save