diff --git a/api/app/lib/controllers/employeeAssessment/index.js b/api/app/lib/controllers/employeeAssessment/index.js
index 1c259f6..6bc420a 100644
--- a/api/app/lib/controllers/employeeAssessment/index.js
+++ b/api/app/lib/controllers/employeeAssessment/index.js
@@ -15,18 +15,19 @@ async function getemployeeAssessmentList(ctx) {
const { type } = ctx.params;
let rlst = [];
const findObj = {
- order: [["id", "desc"]]
+ order: [["year", "desc"],["month", "desc"]],
+ where:{}
};
if (Number(limit) > 0 && Number(page) >= 0) {
findObj.limit = Number(limit);
findObj.offset = Number(page) * Number(limit);
}
if (year && month) {
- findObj.year = year;
- findObj.month = month;
+ findObj.where.year = year;
+ findObj.where.month = month;
}
- if (type) {
- findObj.type = type;
+ if (type) {
+ findObj.where.type = type;
}
rlst = await models.PerformanceAll.findAndCountAll(findObj);
ctx.status = 200;
diff --git a/web/client/src/sections/humanAffairs/containers/highMonthly.jsx b/web/client/src/sections/humanAffairs/containers/highMonthly.jsx
index a5055ff..f98992b 100644
--- a/web/client/src/sections/humanAffairs/containers/highMonthly.jsx
+++ b/web/client/src/sections/humanAffairs/containers/highMonthly.jsx
@@ -1,16 +1,28 @@
import React, { useEffect, useState, useMemo } from 'react';
import { connect } from 'react-redux';
-import { Table, Pagination, Skeleton, DatePicker } from '@douyinfe/semi-ui';
+import { Table, Pagination, Skeleton, DatePicker,Button } from '@douyinfe/semi-ui';
import { SkeletonScreen } from "$components";
import '../style.less'
+import moment from 'moment'
const HighMonthly = (props) => {
- const { dispatch, actions } = props
- const [limits, setLimits] = useState()//每页实际条数
+ const [year, setYear] = useState(null)
+ const [month, setMonth] = useState(null)
+ const { dispatch, actions, employeeAssessmentList } = props
const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息
- const [tableData, setTableData] = useState([{ id: 1, year: '1月', statement: '高管月度测试12.xlsx' }, { id: 2, year: '2月', statement: '测试12.xlsx' }, { id: 3, year: '3月', statement: '测试12.xlsx' }, { id: 4, year: '4月', statement: '测试12.xlsx' }, { id: 5, year: '5月', statement: '测试12.xlsx' }, { id: 6, year: '6月', statement: '测试12.xlsx' }, { id: 7, year: '7月', statement: '测试12.xlsx' }, { id: 8, year: '8月', statement: '测试12.xlsx' }, { id: 9, year: '9月', statement: '测试12.xlsx' }, { id: 10, year: '10月', statement: '测试12.xlsx' }, { id: 11, year: '11月', statement: '测试12.xlsx' }, { id: 12, year: '12月', statement: '测试12.xlsx' }]);
-
-
+ const { getemployeeAssessmentList } = actions.humanAffairs;
+ const [downloadUrl, setDownloadUrl] = useState(null);
+ const [downloadKey, setDownloadKey] = useState(null);
+ useEffect(() => {
+ getList()
+ }, [query])
+ function getList() {
+ dispatch(getemployeeAssessmentList(query, 4))
+ }
+ function exportReport(url){
+ setDownloadUrl(`/_file-server${url}`);
+ setDownloadKey(Math.random());
+ }
function handleRow(record, index) {// 给偶数行设置斑马纹
if (index % 2 === 0) {
return {
@@ -31,14 +43,15 @@ const HighMonthly = (props) => {
render: (text, record, index) => index + 1
}, {
title: '月份',
- dataIndex: 'year',
- key: 'year',
- width: 80
+ dataIndex: 'yearMonth',
+ key: 'yearMonth',
+ width: 80,
+ render: (text, record, index) => `${record.year}-${record.month}`
},
{
title: '报表',
- dataIndex: 'statement',
- key: 'statement',
+ dataIndex: 'name',
+ key: 'name',
width: 200,
// render: (text, r, index) => {
@@ -49,33 +62,46 @@ const HighMonthly = (props) => {
width: 120,
render: (text, record) => {
return
- 下载
+ exportReport(record.path)} style={{ color: '#1890FF', cursor: 'pointer' }}>下载
}
}];
+ function getTime(date, dateString) {
+ if (date) {
+ setYear(moment(date).format('YYYY'))
+ setMonth(moment(date).format('MM'))
+ } else {
+ setYear(null)
+ setMonth(null)
+ }
+ }
+ function search() {
+ let query = { limit: 10, page: 0, year: year, month: month }
+ setQuery(query)
+ }
const scroll = useMemo(() => ({}), []);
-
return (
<>
绩效考核
/
-
高管考核
+
员工考核
/
-
月度过程考核
+
正式员工考核
-
月度过程考核
-
MONTHLY PROCESS ASSESSMENT
+
正式员工考核
+
FORMAL EMPLOYEE ASSESSMENT
- 查询时间:
+ 查询时间:
+
{
>
{
- 共{limits}条信息
+ 共{employeeAssessmentList.count}条信息
{
- setQuery({ limit: pageSize, page: currentPage - 1 });
+ setQuery({ limit: pageSize, page: currentPage - 1, year: year, month: month });
page.current = currentPage - 1
}}
/>
@@ -118,16 +144,20 @@ const HighMonthly = (props) => {
+ {
+ downloadUrl ? : ''
+ }
>
)
}
function mapStateToProps(state) {
- const { auth, global } = state;
+ const { auth, global, employeeAssessmentList } = state;
return {
user: auth.user,
actions: global.actions,
+ employeeAssessmentList: employeeAssessmentList.data || {}
};
}
diff --git a/web/client/src/sections/humanAffairs/containers/highQuarter.jsx b/web/client/src/sections/humanAffairs/containers/highQuarter.jsx
index af9a5fe..560cbd1 100644
--- a/web/client/src/sections/humanAffairs/containers/highQuarter.jsx
+++ b/web/client/src/sections/humanAffairs/containers/highQuarter.jsx
@@ -1,16 +1,28 @@
import React, { useEffect, useState, useMemo } from 'react';
import { connect } from 'react-redux';
-import { Table, Pagination, Skeleton, DatePicker } from '@douyinfe/semi-ui';
+import { Table, Pagination, Skeleton, DatePicker,Button } from '@douyinfe/semi-ui';
import { SkeletonScreen } from "$components";
import '../style.less'
+import moment from 'moment'
const HighQuarter = (props) => {
- const { dispatch, actions } = props
- const [limits, setLimits] = useState()//每页实际条数
+ const [year, setYear] = useState(null)
+ const [month, setMonth] = useState(null)
+ const { dispatch, actions, employeeAssessmentList } = props
const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息
- const [tableData, setTableData] = useState([{ id: 1, year: '1月', statement: '高管季度测试12.xlsx' }, { id: 2, year: '2月', statement: '测试12.xlsx' }, { id: 3, year: '3月', statement: '测试12.xlsx' }, { id: 4, year: '4月', statement: '测试12.xlsx' }, { id: 5, year: '5月', statement: '测试12.xlsx' }, { id: 6, year: '6月', statement: '测试12.xlsx' }, { id: 7, year: '7月', statement: '测试12.xlsx' }, { id: 8, year: '8月', statement: '测试12.xlsx' }, { id: 9, year: '9月', statement: '测试12.xlsx' }, { id: 10, year: '10月', statement: '测试12.xlsx' }, { id: 11, year: '11月', statement: '测试12.xlsx' }, { id: 12, year: '12月', statement: '测试12.xlsx' }]);
-
-
+ const { getemployeeAssessmentList } = actions.humanAffairs;
+ const [downloadUrl, setDownloadUrl] = useState(null);
+ const [downloadKey, setDownloadKey] = useState(null);
+ useEffect(() => {
+ getList()
+ }, [query])
+ function getList() {
+ dispatch(getemployeeAssessmentList(query, 5))
+ }
+ function exportReport(url){
+ setDownloadUrl(`/_file-server${url}`);
+ setDownloadKey(Math.random());
+ }
function handleRow(record, index) {// 给偶数行设置斑马纹
if (index % 2 === 0) {
return {
@@ -31,14 +43,15 @@ const HighQuarter = (props) => {
render: (text, record, index) => index + 1
}, {
title: '月份',
- dataIndex: 'year',
- key: 'year',
- width: 80
+ dataIndex: 'yearMonth',
+ key: 'yearMonth',
+ width: 80,
+ render: (text, record, index) => `${record.year}-${record.month}`
},
{
title: '报表',
- dataIndex: 'statement',
- key: 'statement',
+ dataIndex: 'name',
+ key: 'name',
width: 200,
// render: (text, r, index) => {
@@ -49,33 +62,46 @@ const HighQuarter = (props) => {
width: 120,
render: (text, record) => {
return
- 下载
+ exportReport(record.path)} style={{ color: '#1890FF', cursor: 'pointer' }}>下载
}
}];
+ function getTime(date, dateString) {
+ if (date) {
+ setYear(moment(date).format('YYYY'))
+ setMonth(moment(date).format('MM'))
+ } else {
+ setYear(null)
+ setMonth(null)
+ }
+ }
+ function search() {
+ let query = { limit: 10, page: 0, year: year, month: month }
+ setQuery(query)
+ }
const scroll = useMemo(() => ({}), []);
-
return (
<>
绩效考核
/
-
高管考核
+
员工考核
/
-
季度考核
+
正式员工考核
-
季度考核
-
QUARTERLY ASSESSMENT
+
正式员工考核
+
FORMAL EMPLOYEE ASSESSMENT
- 查询时间:
+ 查询时间:
+
{
>
{
- 共{limits}条信息
+ 共{employeeAssessmentList.count}条信息
{
- setQuery({ limit: pageSize, page: currentPage - 1 });
+ setQuery({ limit: pageSize, page: currentPage - 1, year: year, month: month });
page.current = currentPage - 1
}}
/>
@@ -118,16 +144,20 @@ const HighQuarter = (props) => {
+ {
+ downloadUrl ? : ''
+ }
>
)
}
function mapStateToProps(state) {
- const { auth, global } = state;
+ const { auth, global, employeeAssessmentList } = state;
return {
user: auth.user,
actions: global.actions,
+ employeeAssessmentList: employeeAssessmentList.data || {}
};
}
diff --git a/web/client/src/sections/humanAffairs/containers/monthlyProcess.jsx b/web/client/src/sections/humanAffairs/containers/monthlyProcess.jsx
index 0c36c7e..332f1ba 100644
--- a/web/client/src/sections/humanAffairs/containers/monthlyProcess.jsx
+++ b/web/client/src/sections/humanAffairs/containers/monthlyProcess.jsx
@@ -1,16 +1,28 @@
import React, { useEffect, useState, useMemo } from 'react';
import { connect } from 'react-redux';
-import { Table, Pagination, Skeleton, DatePicker } from '@douyinfe/semi-ui';
+import { Table, Pagination, Skeleton, DatePicker,Button } from '@douyinfe/semi-ui';
import { SkeletonScreen } from "$components";
import '../style.less'
+import moment from 'moment'
const MonthlyProcess = (props) => {
- const { dispatch, actions } = props
- const [limits, setLimits] = useState()//每页实际条数
+ const [year, setYear] = useState(null)
+ const [month, setMonth] = useState(null)
+ const { dispatch, actions, employeeAssessmentList } = props
const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息
- const [tableData, setTableData] = useState([{ id: 1, year: '1月', statement: '中层月度测试12.xlsx' }, { id: 2, year: '2月', statement: '测试12.xlsx' }, { id: 3, year: '3月', statement: '测试12.xlsx' }, { id: 4, year: '4月', statement: '测试12.xlsx' }, { id: 5, year: '5月', statement: '测试12.xlsx' }, { id: 6, year: '6月', statement: '测试12.xlsx' }, { id: 7, year: '7月', statement: '测试12.xlsx' }, { id: 8, year: '8月', statement: '测试12.xlsx' }, { id: 9, year: '9月', statement: '测试12.xlsx' }, { id: 10, year: '10月', statement: '测试12.xlsx' }, { id: 11, year: '11月', statement: '测试12.xlsx' }, { id: 12, year: '12月', statement: '测试12.xlsx' }]);
-
-
+ const { getemployeeAssessmentList } = actions.humanAffairs;
+ const [downloadUrl, setDownloadUrl] = useState(null);
+ const [downloadKey, setDownloadKey] = useState(null);
+ useEffect(() => {
+ getList()
+ }, [query])
+ function getList() {
+ dispatch(getemployeeAssessmentList(query, 2))
+ }
+ function exportReport(url){
+ setDownloadUrl(`/_file-server${url}`);
+ setDownloadKey(Math.random());
+ }
function handleRow(record, index) {// 给偶数行设置斑马纹
if (index % 2 === 0) {
return {
@@ -31,14 +43,15 @@ const MonthlyProcess = (props) => {
render: (text, record, index) => index + 1
}, {
title: '月份',
- dataIndex: 'year',
- key: 'year',
- width: 80
+ dataIndex: 'yearMonth',
+ key: 'yearMonth',
+ width: 80,
+ render: (text, record, index) => `${record.year}-${record.month}`
},
{
title: '报表',
- dataIndex: 'statement',
- key: 'statement',
+ dataIndex: 'name',
+ key: 'name',
width: 200,
// render: (text, r, index) => {
@@ -49,11 +62,24 @@ const MonthlyProcess = (props) => {
width: 120,
render: (text, record) => {
return
- 下载
+ exportReport(record.path)} style={{ color: '#1890FF', cursor: 'pointer' }}>下载
}
}];
+ function getTime(date, dateString) {
+ if (date) {
+ setYear(moment(date).format('YYYY'))
+ setMonth(moment(date).format('MM'))
+ } else {
+ setYear(null)
+ setMonth(null)
+ }
+ }
+ function search() {
+ let query = { limit: 10, page: 0, year: year, month: month }
+ setQuery(query)
+ }
const scroll = useMemo(() => ({}), []);
return (
<>
@@ -61,20 +87,21 @@ const MonthlyProcess = (props) => {
绩效考核
/
-
中层考核
+
员工考核
/
-
月度过程考核
+
正式员工考核
-
月度过程考核
-
Monthly process assessment
+
正式员工考核
+
FORMAL EMPLOYEE ASSESSMENT
- 查询时间:
+ 查询时间:
+
{
>
{
- 共{limits}条信息
+ 共{employeeAssessmentList.count}条信息
{
- setQuery({ limit: pageSize, page: currentPage - 1 });
+ setQuery({ limit: pageSize, page: currentPage - 1, year: year, month: month });
page.current = currentPage - 1
}}
/>
@@ -117,16 +144,20 @@ const MonthlyProcess = (props) => {
+ {
+ downloadUrl ? : ''
+ }
>
)
}
function mapStateToProps(state) {
- const { auth, global } = state;
+ const { auth, global, employeeAssessmentList } = state;
return {
user: auth.user,
actions: global.actions,
+ employeeAssessmentList: employeeAssessmentList.data || {}
};
}
diff --git a/web/client/src/sections/humanAffairs/containers/quarter.jsx b/web/client/src/sections/humanAffairs/containers/quarter.jsx
index de0b10e..d4489fa 100644
--- a/web/client/src/sections/humanAffairs/containers/quarter.jsx
+++ b/web/client/src/sections/humanAffairs/containers/quarter.jsx
@@ -1,16 +1,28 @@
import React, { useEffect, useState, useMemo } from 'react';
import { connect } from 'react-redux';
-import { Table, Pagination, Skeleton, DatePicker } from '@douyinfe/semi-ui';
+import { Table, Pagination, Skeleton, DatePicker,Button } from '@douyinfe/semi-ui';
import { SkeletonScreen } from "$components";
import '../style.less'
+import moment from 'moment'
const Quarter = (props) => {
- const { dispatch, actions } = props
- const [limits, setLimits] = useState()//每页实际条数
+ const [year, setYear] = useState(null)
+ const [month, setMonth] = useState(null)
+ const { dispatch, actions, employeeAssessmentList } = props
const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息
- const [tableData, setTableData] = useState([{ id: 1, year: '1月', statement: '中层季度测试12.xlsx' }, { id: 2, year: '2月', statement: '测试12.xlsx' }, { id: 3, year: '3月', statement: '测试12.xlsx' }, { id: 4, year: '4月', statement: '测试12.xlsx' }, { id: 5, year: '5月', statement: '测试12.xlsx' }, { id: 6, year: '6月', statement: '测试12.xlsx' }, { id: 7, year: '7月', statement: '测试12.xlsx' }, { id: 8, year: '8月', statement: '测试12.xlsx' }, { id: 9, year: '9月', statement: '测试12.xlsx' }, { id: 10, year: '10月', statement: '测试12.xlsx' }, { id: 11, year: '11月', statement: '测试12.xlsx' }, { id: 12, year: '12月', statement: '测试12.xlsx' }]);
-
-
+ const { getemployeeAssessmentList } = actions.humanAffairs;
+ const [downloadUrl, setDownloadUrl] = useState(null);
+ const [downloadKey, setDownloadKey] = useState(null);
+ useEffect(() => {
+ getList()
+ }, [query])
+ function getList() {
+ dispatch(getemployeeAssessmentList(query, 3))
+ }
+ function exportReport(url){
+ setDownloadUrl(`/_file-server${url}`);
+ setDownloadKey(Math.random());
+ }
function handleRow(record, index) {// 给偶数行设置斑马纹
if (index % 2 === 0) {
return {
@@ -31,14 +43,15 @@ const Quarter = (props) => {
render: (text, record, index) => index + 1
}, {
title: '月份',
- dataIndex: 'year',
- key: 'year',
- width: 80
+ dataIndex: 'yearMonth',
+ key: 'yearMonth',
+ width: 80,
+ render: (text, record, index) => `${record.year}-${record.month}`
},
{
title: '报表',
- dataIndex: 'statement',
- key: 'statement',
+ dataIndex: 'name',
+ key: 'name',
width: 200,
// render: (text, r, index) => {
@@ -49,11 +62,24 @@ const Quarter = (props) => {
width: 120,
render: (text, record) => {
return
- 下载
+ exportReport(record.path)} style={{ color: '#1890FF', cursor: 'pointer' }}>下载
}
}];
+ function getTime(date, dateString) {
+ if (date) {
+ setYear(moment(date).format('YYYY'))
+ setMonth(moment(date).format('MM'))
+ } else {
+ setYear(null)
+ setMonth(null)
+ }
+ }
+ function search() {
+ let query = { limit: 10, page: 0, year: year, month: month }
+ setQuery(query)
+ }
const scroll = useMemo(() => ({}), []);
return (
<>
@@ -61,20 +87,21 @@ const Quarter = (props) => {
绩效考核
/
-
中层考核
+
员工考核
/
-
季度考核
+
正式员工考核
-
季度考核
-
QUARTERLY ASSESSMENT
+
正式员工考核
+
FORMAL EMPLOYEE ASSESSMENT
- 查询时间:
+ 查询时间:
+
{
>
{
- 共{limits}条信息
+ 共{employeeAssessmentList.count}条信息
{
- setQuery({ limit: pageSize, page: currentPage - 1 });
+ setQuery({ limit: pageSize, page: currentPage - 1, year: year, month: month });
page.current = currentPage - 1
}}
/>
@@ -117,17 +144,22 @@ const Quarter = (props) => {
+ {
+ downloadUrl ? : ''
+ }
>
)
}
function mapStateToProps(state) {
- const { auth, global } = state;
+ const { auth, global, employeeAssessmentList } = state;
return {
user: auth.user,
actions: global.actions,
+ employeeAssessmentList: employeeAssessmentList.data || {}
};
}
+
export default connect(mapStateToProps)(Quarter);
diff --git a/web/client/src/sections/humanAffairs/containers/regularKPI.jsx b/web/client/src/sections/humanAffairs/containers/regularKPI.jsx
index b491c6e..41d6be9 100644
--- a/web/client/src/sections/humanAffairs/containers/regularKPI.jsx
+++ b/web/client/src/sections/humanAffairs/containers/regularKPI.jsx
@@ -1,23 +1,28 @@
import React, { useEffect, useState, useMemo } from 'react';
import { connect } from 'react-redux';
-import { Table, Pagination, Skeleton, DatePicker } from '@douyinfe/semi-ui';
+import { Table, Pagination, Skeleton, DatePicker, Button } from '@douyinfe/semi-ui';
import { SkeletonScreen } from "$components";
+import moment from 'moment'
import '../style.less'
const RegularKPI = (props) => {
- const { dispatch, actions,employeeAssessmentList } = props
- const [limits, setLimits] = useState()//每页实际条数
+ const [year, setYear] = useState(null)
+ const [month, setMonth] = useState(null)
+ const { dispatch, actions, employeeAssessmentList } = props
const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息
const { getemployeeAssessmentList } = actions.humanAffairs;
+ const [downloadUrl, setDownloadUrl] = useState(null);
+ const [downloadKey, setDownloadKey] = useState(null);
useEffect(() => {
getList()
}, [query])
function getList() {
dispatch(getemployeeAssessmentList(query, 1))
}
- const [tableData, setTableData] = useState([{ id: 1, year: '1月', statement: '正式员工测试12.xlsx' }, { id: 2, year: '2月', statement: '测试12.xlsx' }, { id: 3, year: '3月', statement: '测试12.xlsx' }, { id: 4, year: '4月', statement: '测试12.xlsx' }, { id: 5, year: '5月', statement: '测试12.xlsx' }, { id: 6, year: '6月', statement: '测试12.xlsx' }, { id: 7, year: '7月', statement: '测试12.xlsx' }, { id: 8, year: '8月', statement: '测试12.xlsx' }, { id: 9, year: '9月', statement: '测试12.xlsx' }, { id: 10, year: '10月', statement: '测试12.xlsx' }, { id: 11, year: '11月', statement: '测试12.xlsx' }, { id: 12, year: '12月', statement: '测试12.xlsx' }]);
-
-
+ function exportReport(url){
+ setDownloadUrl(`/_file-server${url}`);
+ setDownloadKey(Math.random());
+ }
function handleRow(record, index) {// 给偶数行设置斑马纹
if (index % 2 === 0) {
return {
@@ -38,14 +43,15 @@ const RegularKPI = (props) => {
render: (text, record, index) => index + 1
}, {
title: '月份',
- dataIndex: 'year',
- key: 'year',
- width: 80
+ dataIndex: 'yearMonth',
+ key: 'yearMonth',
+ width: 80,
+ render: (text, record, index) => `${record.year}-${record.month}`
},
{
title: '报表',
- dataIndex: 'statement',
- key: 'statement',
+ dataIndex: 'name',
+ key: 'name',
width: 200,
// render: (text, r, index) => {
@@ -56,13 +62,25 @@ const RegularKPI = (props) => {
width: 120,
render: (text, record) => {
return
- 下载
+ exportReport(record.path)} style={{ color: '#1890FF', cursor: 'pointer' }}>下载
}
}];
+ function getTime(date, dateString) {
+ if (date) {
+ setYear(moment(date).format('YYYY'))
+ setMonth(moment(date).format('MM'))
+ } else {
+ setYear(null)
+ setMonth(null)
+ }
+ }
+ function search() {
+ let query = { limit: 10, page: 0, year: year, month: month }
+ setQuery(query)
+ }
const scroll = useMemo(() => ({}), []);
- console.log(employeeAssessmentList, '---------------');
return (
<>
@@ -82,7 +100,8 @@ const RegularKPI = (props) => {
- 查询时间:
+ 查询时间:
+
{
>
{
- 共{limits}条信息
+ 共{employeeAssessmentList.count}条信息
{
- setQuery({ limit: pageSize, page: currentPage - 1 });
+ setQuery({ limit: pageSize, page: currentPage - 1, year: year, month: month });
page.current = currentPage - 1
}}
/>
@@ -125,6 +144,9 @@ const RegularKPI = (props) => {
+ {
+ downloadUrl ? : ''
+ }
>
)
@@ -135,7 +157,7 @@ function mapStateToProps(state) {
return {
user: auth.user,
actions: global.actions,
- employeeAssessmentList: employeeAssessmentList
+ employeeAssessmentList: employeeAssessmentList.data || {}
};
}