split (kpi/evaluation/edit) to criteria
This commit is contained in:
parent
e7d35773a9
commit
b95cda9512
1 changed files with 35 additions and 1 deletions
|
|
@ -78,7 +78,41 @@ export class kpiEvaluationController extends Controller {
|
|||
) {
|
||||
let _data = await new permission().PermissionList(request, "SYS_EVA_COMPETENCY");
|
||||
let whereClause: any = {};
|
||||
console.log("CODE8");
|
||||
if (keyword !== undefined && keyword !== "") {
|
||||
whereClause = {
|
||||
where: [{ description: Like(`%${keyword}%`) }],
|
||||
};
|
||||
whereClause.where.push({ level: Like(`%${keyword}%`) });
|
||||
}
|
||||
|
||||
const [kpiEvaluation, total] = await this.kpiEvaluationRepository.findAndCount({
|
||||
...whereClause,
|
||||
...(keyword ? {} : { skip: (page - 1) * pageSize, take: pageSize }),
|
||||
order: {
|
||||
level: "DESC",
|
||||
},
|
||||
});
|
||||
|
||||
const formatted = kpiEvaluation.map((item) => ({
|
||||
id: item.id,
|
||||
level: item.level,
|
||||
description: item.description,
|
||||
}));
|
||||
return new HttpSuccess({ data: formatted, total });
|
||||
}
|
||||
|
||||
/**
|
||||
* API เกณฑ์การประเมินในเมนูรายการการประเมิน
|
||||
*/
|
||||
@Get("criteria")
|
||||
async listKpiEvaluationEditInKpiList(
|
||||
@Request() request: RequestWithUser,
|
||||
@Query("page") page: number = 1,
|
||||
@Query("pageSize") pageSize: number = 10,
|
||||
@Query("keyword") keyword?: string,
|
||||
) {
|
||||
await new permission().PermissionGet(request, "SYS_KPI_LIST");
|
||||
let whereClause: any = {};
|
||||
if (keyword !== undefined && keyword !== "") {
|
||||
whereClause = {
|
||||
where: [{ description: Like(`%${keyword}%`) }],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue