Browse Source

(+)业绩汇总表基础框子

master
ww664853070 2 years ago
parent
commit
15ac7f81aa
  1. 23
      api/app/lib/controllers/salePerformance/index.js
  2. 14
      api/app/lib/models/customerContactsFollup.js
  3. 55
      api/app/lib/models/sale.js
  4. 55
      api/app/lib/models/salePerformance.js
  5. 8
      api/app/lib/routes/salePerformance/index.js
  6. 6
      web/client/src/sections/business/containers/index.js
  7. 597
      web/client/src/sections/business/containers/performanceReport/performanceSummary.jsx
  8. 3
      web/client/src/sections/business/nav-item.jsx
  9. 7
      web/client/src/sections/business/routes.js
  10. 9
      web/client/src/sections/business/style.less

23
api/app/lib/controllers/salePerformance/index.js

@ -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,
}

14
api/app/lib/models/customerContactsFollup.js

@ -7,7 +7,7 @@ module.exports = dc => {
const CustomerContactsFollowup = sequelize.define("customerContactsFollowup", { const CustomerContactsFollowup = sequelize.define("customerContactsFollowup", {
id: { id: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: false, allowNull: true,
primaryKey: true, primaryKey: true,
field: "id", field: "id",
autoIncrement: true, autoIncrement: true,
@ -19,7 +19,7 @@ module.exports = dc => {
}, },
items: { items: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: false,
field: "items", field: "items",
}, },
department: { department: {
@ -29,7 +29,7 @@ module.exports = dc => {
}, },
sale: { sale: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: false,
field: "sale", field: "sale",
}, },
updatetime: { updatetime: {
@ -39,22 +39,22 @@ module.exports = dc => {
}, },
customerContacts: { customerContacts: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: false,
field: "customer_contacts", field: "customer_contacts",
}, },
phone: { phone: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: false,
field: "phone", field: "phone",
}, },
visitStyle: { visitStyle: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: false,
field: "visit_style", field: "visit_style",
}, },
itemText: { itemText: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: false,
field: "item_text", field: "item_text",
} }
}, { }, {

55
api/app/lib/models/sale.js

@ -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;
};

55
api/app/lib/models/salePerformance.js

@ -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;
};

8
api/app/lib/routes/salePerformance/index.js

@ -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);
};

6
web/client/src/sections/business/containers/index.js

@ -9,7 +9,8 @@ import InvoicingDetails from './performanceReport/invoicingDetails';
import BackMoneyDetails from './performanceReport/backMoneyDetails'; import BackMoneyDetails from './performanceReport/backMoneyDetails';
import AchievementDetails from './performanceReport/achievementDetails'; import AchievementDetails from './performanceReport/achievementDetails';
import SalesDistributionDetails from './salesReport/salesDistributionDetails'; import SalesDistributionDetails from './salesReport/salesDistributionDetails';
import CustomerContactFollowup from './customer/customerContactFollowup' import CustomerContactFollowup from './customer/customerContactFollowup';
import PerformanceSummary from './performanceReport/performanceSummary'
export { export {
ReserveItemsReporting, ReserveItemsReporting,
@ -21,5 +22,6 @@ export {
BackMoneyDetails, BackMoneyDetails,
AchievementDetails, AchievementDetails,
SalesDistributionDetails, SalesDistributionDetails,
CustomerContactFollowup CustomerContactFollowup,
PerformanceSummary
}; };

597
web/client/src/sections/business/containers/performanceReport/performanceSummary.jsx

@ -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);

3
web/client/src/sections/business/nav-item.jsx

@ -43,6 +43,9 @@ export function getNavItem(user, dispatch) {
}, { }, {
itemKey: 'achievementDetails', itemKey: 'achievementDetails',
to: '/businessManagement/performanceReport/achievementDetails', text: '业绩明细表' to: '/businessManagement/performanceReport/achievementDetails', text: '业绩明细表'
}, {
itemKey: 'summary',
to: '/businessManagement/performanceReport/summary', text: '业绩汇总表'
}] }]
}, { }, {
itemKey: 'salesReport', itemKey: 'salesReport',

7
web/client/src/sections/business/routes.js

@ -1,6 +1,6 @@
import { import {
ReserveItemsReporting, ReserveItemsPeriodicStatistics, ReserveItemsDepSummary, ReserveItemsLostStatistics, ReserveItemsReporting, ReserveItemsPeriodicStatistics, ReserveItemsDepSummary, ReserveItemsLostStatistics,
ContractDetails, InvoicingDetails, BackMoneyDetails, AchievementDetails, SalesDistributionDetails, CustomerContactFollowup ContractDetails, InvoicingDetails, BackMoneyDetails, AchievementDetails, SalesDistributionDetails, CustomerContactFollowup,PerformanceSummary
} from './containers'; } from './containers';
export default [{ export default [{
@ -60,6 +60,11 @@ export default [{
key: 'achievementDetails', key: 'achievementDetails',
breadcrumb: '业绩明细表', breadcrumb: '业绩明细表',
component: AchievementDetails component: AchievementDetails
}, {
path: '/summary',
key: 'summary',
breadcrumb: '业绩汇总表',
component: PerformanceSummary
}] }]
}, { }, {
path: '/salesReport', path: '/salesReport',

9
web/client/src/sections/business/style.less

@ -7,3 +7,12 @@
} }
} }
} }
.summaryList{
margin-top: 20px;
.semi-table .semi-table-row:first-child .semi-table-row-head{
border-right: 1px solid #ccc;
}
.semi-table-thead > .semi-table-row > .semi-table-row-head{
border-right: 1px solid #ccc;
}
}

Loading…
Cancel
Save