You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.2 KiB
43 lines
1.2 KiB
2 years ago
|
'use strict';
|
||
|
const moment = require('moment')
|
||
|
|
||
|
/**考核列表
|
||
|
* query
|
||
|
* limit、offset
|
||
|
* type : 考核分类
|
||
|
* year : 年
|
||
|
* month :月
|
||
|
*/
|
||
|
async function getemployeeAssessmentList(ctx) {
|
||
|
try {
|
||
|
const { models } = ctx.fs.dc;
|
||
|
const { limit, page, year,month } = ctx.query;
|
||
|
const { type } = ctx.params;
|
||
|
let rlst = [];
|
||
|
const findObj = {
|
||
|
order: [["id", "desc"]]
|
||
|
};
|
||
|
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;
|
||
|
}
|
||
|
if (type) {
|
||
|
findObj.type = type;
|
||
|
}
|
||
|
rlst = await models.PerformanceAll.findAndCountAll(findObj);
|
||
|
ctx.status = 200;
|
||
|
ctx.body = rlst;
|
||
|
} catch (err) {
|
||
|
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
|
||
|
ctx.status = 400;
|
||
|
ctx.body = { message: err.message || '查询列表失败' }
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = {
|
||
|
getemployeeAssessmentList,
|
||
|
}
|