Browse Source

人员信息

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

53
web/client/src/sections/humanAffairs/containers/employeeInformation.jsx

@ -21,6 +21,7 @@ const employeeInformation = (props) => {
const [setup, setSetup] = useState(false);// const [setup, setSetup] = useState(false);//
const [setupp, setSetupp] = useState([]);// const [setupp, setSetupp] = useState([]);//
const [query, setQuery] = useState({ limit: 10, page: 0 }); // const [query, setQuery] = useState({ limit: 10, page: 0 }); //
const [order, setOrder] = useState({ orderBy: 'hiredate', orderDirection: 'DESC' }); //
const [limits, setLimits] = useState()// const [limits, setLimits] = useState()//
const [downloadUrl, setDownloadUrl] = useState('')//pdf const [downloadUrl, setDownloadUrl] = useState('')//pdf
const EMPLOYEEINFORMATION = "employeeInformation"; const EMPLOYEEINFORMATION = "employeeInformation";
@ -84,7 +85,7 @@ const employeeInformation = (props) => {
}, []) }, [])
useEffect(() => { useEffect(() => {
getMemberSearchList()// getMemberSearchList()//
}, [query]) }, [query, order])
function getMemberSearchList () {// function getMemberSearchList () {//
@ -97,7 +98,7 @@ const employeeInformation = (props) => {
obj.hiredateStart = '' obj.hiredateStart = ''
obj.hiredateEnd = '' obj.hiredateEnd = ''
} }
dispatch(humanAffairs.getMemberList({ ...obj, ...query })).then((res) => {// dispatch(humanAffairs.getMemberList({ ...obj, ...query, ...order })).then((res) => {//
if (res.success) { if (res.success) {
setArchivesList(res.payload?.data?.rows) setArchivesList(res.payload?.data?.rows)
setLimits(res.payload?.data?.count) setLimits(res.payload?.data?.count)
@ -121,13 +122,15 @@ const employeeInformation = (props) => {
const columns = [ const columns = [
{ {
title: ( title: (
<div> <span>
<img src="/assets/images/hrImg/V.png" alt="" style={{ width: 14, height: 14 }} /> 员工编号 <img src="/assets/images/hrImg/V.png" alt="" style={{ width: 14, height: 14 }} /> 员工编号
</div> </span>
), ),
width: 120, width: 200,
dataIndex: "userCode", dataIndex: "userCode",
key: "userCode", key: "userCode",
sorter: (a, b) => { },
// sorter: (a, b) => a.name.length - b.name.length > 0 ? 1 : -1,
render: (_, r, index) => { render: (_, r, index) => {
return (r.userCode ? r.userCode : '-'); return (r.userCode ? r.userCode : '-');
}, },
@ -235,6 +238,7 @@ const employeeInformation = (props) => {
width: 120, width: 120,
dataIndex: "birthday", dataIndex: "birthday",
key: "birthday", key: "birthday",
sorter: (a, b) => { },
render: (_, r, index) => { render: (_, r, index) => {
return (r.birthday ? r.birthday : '-'); return (r.birthday ? r.birthday : '-');
}, },
@ -307,6 +311,7 @@ const employeeInformation = (props) => {
width: 120, width: 120,
dataIndex: "hiredate", dataIndex: "hiredate",
key: "hiredate", key: "hiredate",
sorter: (a, b) => { },
render: (_, r, index) => { render: (_, r, index) => {
return (r.hiredate ? r.hiredate : '-'); return (r.hiredate ? r.hiredate : '-');
}, },
@ -339,6 +344,7 @@ const employeeInformation = (props) => {
width: 120, width: 120,
dataIndex: "employmentLife", dataIndex: "employmentLife",
key: "employmentLife", key: "employmentLife",
sorter: (a, b) => { },
render: (_, r, index) => { render: (_, r, index) => {
return (r.hiredate ? <span style={{ color: '#1890FF' }}>{moment(new Date()).diff(r.hiredate, 'years') + '年'}</span> : '-') return (r.hiredate ? <span style={{ color: '#1890FF' }}>{moment(new Date()).diff(r.hiredate, 'years') + '年'}</span> : '-')
}, },
@ -520,12 +526,16 @@ const employeeInformation = (props) => {
</Form.Select> </Form.Select>
</div> </div>
<div style={{ display: 'flex', alignItems: 'center' }}> <div style={{ display: 'flex', alignItems: 'center' }}>
<img src="/assets/images/hrImg/export.png" alt="" style={{ width: 20, height: 20, cursor: "pointer", marginRight: 15 }} <div style={{ width: 20, height: 20, cursor: "pointer", marginRight: 15 }}
onClick={() => { setDownloadUrl(`members/export?token=${user.token}&timestamp=${moment().valueOf()}`) }} 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 : ''}`)
downloadUrl ? <iframe src={`/_api/${downloadUrl}`} style={{ display: 'none' }} /> : '' }}>
} <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 }} <img src="/assets/images/hrImg/setup.png" alt="" style={{ width: 20, height: 20, cursor: "pointer", marginRight: 15 }}
onClick={() => setSetup(true)} onClick={() => setSetup(true)}
/> />
@ -557,6 +567,27 @@ const employeeInformation = (props) => {
bordered={false} bordered={false}
empty="暂无数据" empty="暂无数据"
pagination={false} 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} onRow={handleRow}
scroll={scroll} scroll={scroll}
/> />

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

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

Loading…
Cancel
Save