ww664853070
2 years ago
10 changed files with 767 additions and 10 deletions
@ -0,0 +1,23 @@ |
|||
'use strict'; |
|||
|
|||
// 查询业绩汇总表-->关联sale表
|
|||
async function getSalePerformance(ctx, next) { |
|||
const { type } = ctx.params; |
|||
let rslt = null; |
|||
try { |
|||
rslt = await ctx.fs.dc.models.salePerformance.findAll({ |
|||
order: [['id', 'DESC']], |
|||
// where: { type: type }
|
|||
}) |
|||
ctx.status = 200 |
|||
ctx.body = rslt |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path:${ctx.path},error:${error}`) |
|||
ctx.status = 400; |
|||
ctx.body = { name: 'FindAllError', message: '获取失败' } |
|||
} |
|||
} |
|||
|
|||
module.exports = { |
|||
getSalePerformance, |
|||
} |
@ -0,0 +1,55 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const sale = sequelize.define("sale", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
}, |
|||
department: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
field: "department", |
|||
}, |
|||
sale: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
field: "sale", |
|||
}, |
|||
business: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
field: "business", |
|||
}, |
|||
sale: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
field: "sale", |
|||
}, |
|||
hiredate: { |
|||
type: DataTypes.DATE, |
|||
allowNull: false, |
|||
field: "hiredate", |
|||
}, |
|||
regularDate: { |
|||
type: DataTypes.DATE, |
|||
allowNull: false, |
|||
field: "regular_date", |
|||
}, |
|||
pepId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
field: "pep_id", |
|||
} |
|||
}, { |
|||
tableName: "sale", |
|||
}); |
|||
dc.models.sale = sale; |
|||
return sale; |
|||
}; |
@ -0,0 +1,55 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const salePerformance = sequelize.define("salePerformance", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
}, |
|||
amount: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
field: "amount", |
|||
}, |
|||
actualPerformance: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
field: "actual_performance", |
|||
}, |
|||
assessmentPerformance: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
field: "assessment_performance", |
|||
}, |
|||
completion : { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
field: "completion ", |
|||
}, |
|||
month: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
field: "month", |
|||
}, |
|||
year: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
field: "year", |
|||
}, |
|||
saleId: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
field: "sale_id", |
|||
} |
|||
}, { |
|||
tableName: "sale_performance", |
|||
}); |
|||
dc.models.salePerformance = salePerformance; |
|||
return salePerformance; |
|||
}; |
@ -0,0 +1,8 @@ |
|||
'use strict'; |
|||
|
|||
const report = require('../../controllers/salePerformance'); |
|||
|
|||
module.exports = function (app, router, opts) { |
|||
app.fs.api.logAttr['GET/salePerformance'] = { content: '业绩汇总表', visible: false }; |
|||
router.get('/salePerformance', report.getSalePerformance); |
|||
}; |
@ -0,0 +1,597 @@ |
|||
import React, { useRef, useEffect, useState, useMemo } from 'react'; |
|||
import { connect } from 'react-redux'; |
|||
import moment from 'moment' |
|||
import { Select, Input, Button, Toast, Radio, Tooltip, Table, Pagination, Skeleton } from '@douyinfe/semi-ui'; |
|||
import { IconSearch } from '@douyinfe/semi-icons'; |
|||
import '../../style.less'; |
|||
|
|||
const AchievementDetails = (props) => { |
|||
const { dispatch, actions, user } = props |
|||
let columns = [ |
|||
{ |
|||
title: '部门', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '销售人员', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '业务线', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '入职日期', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '转正日期', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '工龄', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '1月', |
|||
children: [ |
|||
{ |
|||
title: '合同金额', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '实际业绩', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '考核业绩', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '销售任务', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '完成率', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
} |
|||
] |
|||
}, |
|||
{ |
|||
title: '2月', |
|||
children: [ |
|||
{ |
|||
title: '合同金额', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '实际业绩', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '考核业绩', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '销售任务', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '完成率', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
} |
|||
] |
|||
}, |
|||
{ |
|||
title: '3月', |
|||
children: [ |
|||
{ |
|||
title: '合同金额', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '实际业绩', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '考核业绩', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '销售任务', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '完成率', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
} |
|||
] |
|||
}, |
|||
{ |
|||
title: '一季度', |
|||
children: [ |
|||
{ |
|||
title: '销售任务', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '完成率', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
} |
|||
] |
|||
}, |
|||
{ |
|||
title: '4月', |
|||
children: [ |
|||
{ |
|||
title: '合同金额', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '实际业绩', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '考核业绩', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '销售任务', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '完成率', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
} |
|||
] |
|||
}, |
|||
{ |
|||
title: '5月', |
|||
children: [ |
|||
{ |
|||
title: '合同金额', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '实际业绩', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '考核业绩', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '销售任务', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '完成率', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
} |
|||
] |
|||
}, |
|||
{ |
|||
title: '6月', |
|||
children: [ |
|||
{ |
|||
title: '合同金额', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '实际业绩', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '考核业绩', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '销售任务', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '完成率', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
} |
|||
] |
|||
}, |
|||
{ |
|||
title: '二季度', |
|||
children: [ |
|||
{ |
|||
title: '销售任务', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '完成率', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
} |
|||
] |
|||
}, |
|||
{ |
|||
title: '7月', |
|||
children: [ |
|||
{ |
|||
title: '合同金额', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '实际业绩', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '考核业绩', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '销售任务', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '完成率', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
} |
|||
] |
|||
}, |
|||
{ |
|||
title: '8月', |
|||
children: [ |
|||
{ |
|||
title: '合同金额', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '实际业绩', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '考核业绩', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '销售任务', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '完成率', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
} |
|||
] |
|||
}, |
|||
{ |
|||
title: '9月', |
|||
children: [ |
|||
{ |
|||
title: '合同金额', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '实际业绩', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '考核业绩', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '销售任务', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '完成率', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
} |
|||
] |
|||
}, |
|||
{ |
|||
title: '三季度', |
|||
children: [ |
|||
{ |
|||
title: '销售任务', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '完成率', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
} |
|||
] |
|||
}, |
|||
{ |
|||
title: '10月', |
|||
children: [ |
|||
{ |
|||
title: '合同金额', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '实际业绩', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '考核业绩', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '销售任务', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '完成率', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
} |
|||
] |
|||
}, |
|||
{ |
|||
title: '11月', |
|||
children: [ |
|||
{ |
|||
title: '合同金额', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '实际业绩', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '考核业绩', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '销售任务', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '完成率', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
} |
|||
] |
|||
}, |
|||
{ |
|||
title: '12月', |
|||
children: [ |
|||
{ |
|||
title: '合同金额', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '实际业绩', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '考核业绩', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '销售任务', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '完成率', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
} |
|||
] |
|||
}, |
|||
{ |
|||
title: '四季度', |
|||
children: [ |
|||
{ |
|||
title: '销售任务', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
}, |
|||
{ |
|||
title: '完成率', |
|||
dataIndex: 'index', |
|||
width: 130, |
|||
render: (text, record, index) => index + 1 |
|||
} |
|||
] |
|||
} |
|||
] |
|||
|
|||
useEffect(() => { |
|||
}, []); |
|||
|
|||
|
|||
const exportAllData = () => { |
|||
|
|||
} |
|||
|
|||
return ( |
|||
<> |
|||
<div style={{ padding: '0px 12px' }}> |
|||
<div style={{ display: 'flex' }}> |
|||
<div style={{ color: 'rgba(0,0,0,0.45)', fontSize: 14 }}>业务管理</div> |
|||
<div style={{ color: 'rgba(0,0,0,0.45)', fontSize: 14, margin: '0px 8px' }}>/</div> |
|||
<div style={{ color: 'rgba(0,0,0,0.45)', fontSize: 14 }}>业绩报表</div> |
|||
<div style={{ color: '#033C9A', fontSize: 14, margin: '0px 8px' }}>/</div> |
|||
<div style={{ color: '#033C9A', fontSize: 14 }}>业绩汇总表</div> |
|||
</div> |
|||
<div style={{ background: '#FFFFFF', boxShadow: '0px 0px 12px 2px rgba(220,222,224,0.2)', borderRadius: 2, padding: '20px ', marginTop: 9 }}> |
|||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}> |
|||
<div style={{ display: 'flex', alignItems: 'baseline' }}> |
|||
<div style={{ width: 0, height: 20, borderLeft: '3px solid #0F7EFB', borderTop: '3px solid transparent', borderBottom: '3px solid transparent' }}></div> |
|||
<div style={{ fontFamily: "YouSheBiaoTiHei", fontSize: 24, color: '#033C9A', marginLeft: 8 }}>业绩汇总表</div> |
|||
<div style={{ marginLeft: 6, fontSize: 12, color: '#969799', fontFamily: "DINExp", }}>PERFORMANCE SUMMARY</div> |
|||
</div> |
|||
</div> |
|||
<div style={{ margin: '18px 0px' }}> |
|||
<div style={{ display: 'flex', margin: '16px 0px', justifyContent: 'space-between' }}> |
|||
<div style={{ display: 'flex' }}> |
|||
<div style={{ padding: '6px 20px', background: '#0F7EFB', color: '#FFFFFF', fontSize: 14, cursor: "pointer" }} |
|||
onClick={() => { setImportModalV(true); }}> |
|||
导入 |
|||
</div> |
|||
<div style={{ padding: '6px 20px', background: '#00BA85', color: '#FFFFFF', fontSize: 14, cursor: "pointer", marginLeft: 18 }} |
|||
onClick={() => { |
|||
exportAllData() |
|||
}}> |
|||
导出全部 |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div className='summaryList'> |
|||
<Table columns={columns} /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</> |
|||
) |
|||
} |
|||
|
|||
|
|||
function mapStateToProps(state) { |
|||
const { auth, global } = state; |
|||
return { |
|||
user: auth.user, |
|||
actions: global.actions, |
|||
}; |
|||
} |
|||
|
|||
export default connect(mapStateToProps)(AchievementDetails); |
Loading…
Reference in new issue