Browse Source

(*)业绩汇总表,列表完成率计算

master
ww664853070 2 years ago
parent
commit
fb525fd360
  1. 24
      web/client/src/sections/business/containers/performanceReport/performanceSummary.jsx

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

@ -12,7 +12,7 @@ const AchievementDetails = (props) => {
useEffect(() => { useEffect(() => {
dispatch(actions.businessManagement.getPerformanceSummary()); dispatch(actions.businessManagement.getPerformanceSummary());
}, []); }, []);
let colums = [{ num: '1月', name: 'one' }, { num: '2月', name: 'two' }, { num: '3月', name: 'three' }, { num: '4月', name: 'four' }, { num: '5月', name: 'five' }, { num: '6月', name: 'sex' }, { num: '7月', name: 'seven' }, { num: '8月', name: 'eight' }, { num: '9月', name: 'nine' }, { num: '10月', name: 'ten' }, { num: '11月', name: 'evelen' }, { num: '12月', name: 'twelve' }] let colums = [{ num: '1月', name: 'one' }, { num: '2月', name: 'two' }, { num: '3月', name: 'three' }, { num: '4月', name: 'four' }, { num: '5月', name: 'five' }, { num: '6月', name: 'six' }, { num: '7月', name: 'seven' }, { num: '8月', name: 'eight' }, { num: '9月', name: 'nine' }, { num: '10月', name: 'ten' }, { num: '11月', name: 'eleven' }, { num: '12月', name: 'twelve' }]
const columnsList = () => { const columnsList = () => {
colums.forEach(e => { colums.forEach(e => {
columns.push({ columns.push({
@ -22,31 +22,35 @@ const AchievementDetails = (props) => {
title: '合同金额', title: '合同金额',
dataIndex: e.name + '[amount]', dataIndex: e.name + '[amount]',
width: 130, width: 130,
// render: (text, record, index) => index + 1 render: (text, record, index) => text
}, },
{ {
title: '实际业绩', title: '实际业绩',
dataIndex: e.name + '[actualPerformance]', dataIndex: e.name + '[actualPerformance]',
width: 130, width: 130,
// render: (text, record, index) => index + 1 render: (text, record, index) => text
}, },
{ {
title: '考核业绩', title: '考核业绩',
dataIndex: e.name + '[assessmentPerformance]', dataIndex: e.name + '[assessmentPerformance]',
width: 130, width: 130,
// render: (text, record, index) => index + 1 render: (text, record, index) => text
}, },
{ {
title: '销售任务', title: '销售任务',
dataIndex: e.name + '[task]', dataIndex: e.name + '[task]',
width: 130, width: 130,
// render: (text, record, index) => index + 1 render: (text, record, index) => text
}, },
{ {
title: '完成率%', title: '完成率%',
dataIndex: e.name + '[completion]', dataIndex: e.name + '[completion]',
width: 130, width: 130,
// render: (text, record, index) => index + 1 render: (text, record, index) => {
let assessmentPerformance = record[e.name] ? record[e.name].assessmentPerformance : 0
let task = record[e.name] ? record[e.name].task : 0
return assessmentPerformance == 0 || task == 0 ? 0 : assessmentPerformance / task
}
} }
] ]
} }
@ -114,7 +118,7 @@ const AchievementDetails = (props) => {
e.five = i e.five = i
} }
if (i.month == 6) { if (i.month == 6) {
e.sex = i e.six = i
} }
if (i.month == 7) { if (i.month == 7) {
e.seven = i e.seven = i
@ -129,7 +133,7 @@ const AchievementDetails = (props) => {
e.ten = i e.ten = i
} }
if (i.month == 11) { if (i.month == 11) {
e.evelen = i e.eleven = i
} }
if (i.month == 12) { if (i.month == 12) {
e.twelve = i e.twelve = i
@ -138,7 +142,6 @@ const AchievementDetails = (props) => {
return e return e
}) })
const exportDetail = () => { const exportDetail = () => {
console.log(arr, 'arrarrarr');
let tableStyle = "text-align: center;font-size:21px" let tableStyle = "text-align: center;font-size:21px"
let exportTable = ` let exportTable = `
<tr> <tr>
@ -287,7 +290,6 @@ const AchievementDetails = (props) => {
let days = moment().diff(moment(item.hiredate).format('YYYY-MM-DD'), 'days') let days = moment().diff(moment(item.hiredate).format('YYYY-MM-DD'), 'days')
let day = days / 365 let day = days / 365
const workingYears = day.toFixed(1) const workingYears = day.toFixed(1)
console.log(Number(fourTask ? fourTask : 0) + Number(fiveTask ? fiveTask : 0) + Number(sixTask ? sixTask : 0));
return Object.assign({}, item, { return Object.assign({}, item, {
oneCompletion: oneCompletion, oneCompletion: oneCompletion,
twoCompletion: twoCompletion, twoCompletion: twoCompletion,
@ -310,7 +312,7 @@ const AchievementDetails = (props) => {
fourQuarterTaskNnu: Number(tenTask ? tenTask : 0) + Number(elevenTask ? elevenTask : 0) + Number(twelveTask ? twelveTask : 0), fourQuarterTaskNnu: Number(tenTask ? tenTask : 0) + Number(elevenTask ? elevenTask : 0) + Number(twelveTask ? twelveTask : 0),
fourQuarterTask: (tenAssessmentPerformance || elevenAssessmentPerformance || twelveAssessmentPerformance) && (tenTask || elevenTask || twelveTask) && (tenAssessmentPerformance || 0 + elevenAssessmentPerformance || 0 + twelveAssessmentPerformance || 0) / (tenTask || 0 + elevenTask || 0 + twelveTask || 0), fourQuarterTask: (tenAssessmentPerformance || elevenAssessmentPerformance || twelveAssessmentPerformance) && (tenTask || elevenTask || twelveTask) && (tenAssessmentPerformance || 0 + elevenAssessmentPerformance || 0 + twelveAssessmentPerformance || 0) / (tenTask || 0 + elevenTask || 0 + twelveTask || 0),
workingYears: workingYears, workingYears: workingYears,
allAmount: Number(item.one ? item.one.amount : 0) + Number(item.two ? item.two.amount : 0) + Number(item.three ? item.three.amount : 0) + Number(item.four ? item.four.amount : 0) + Number(item.five ? item.five.amount : 0) + Number(item.six ? item.six.amount : 0) + Number(item.seven ? item.seven.amount : 0) + Number(item.eight ? item.eight.amount : 0) + Number(item.nine ? item.nine.amount : 0) + Number(item.ten ? item.ten.amount : 0) + Number(item.eleven ? item.eleven.amount : 0) + Number(item.twelve ? item.twelve.amount : 0), allAmount: Number(item.one ? item.one.amount : 0) + Number(item.two ? item.two.amount : 0) + Number(item.three ? item.three.amount : 0) + Number(item.four ? item.four.amount : 0) + Number(item.five ? item.five.amount : 0) + Number(item.six ? item.six.amount : 0) + Number(item.seven ? item.seven.amount : 0) + Number(item.eight ? item.eight.amount : 0) + Number(item.nine ? item.nine.amount : 0) + Number(item.ten ? item.ten.amount : 0) + Number(item.eleven ? item.eleven.amount : 0) + Number(item.twelve ? item.twelve.amount : 0),
allactualPerformance: Number(item.one ? item.one.actualPerformance : 0) + Number(item.two ? item.two.actualPerformance : 0) + Number(item.three ? item.three.actualPerformance : 0) + Number(item.four ? item.four.actualPerformance : 0) + Number(item.five ? item.five.actualPerformance : 0) + Number(item.six ? item.six.actualPerformance : 0) + Number(item.seven ? item.seven.actualPerformance : 0) + Number(item.eight ? item.eight.actualPerformance : 0) + Number(item.nine ? item.nine.actualPerformance : 0) + Number(item.ten ? item.ten.actualPerformance : 0) + Number(item.eleven ? item.eleven.actualPerformance : 0) + Number(item.twelve ? item.twelve.actualPerformance : 0), allactualPerformance: Number(item.one ? item.one.actualPerformance : 0) + Number(item.two ? item.two.actualPerformance : 0) + Number(item.three ? item.three.actualPerformance : 0) + Number(item.four ? item.four.actualPerformance : 0) + Number(item.five ? item.five.actualPerformance : 0) + Number(item.six ? item.six.actualPerformance : 0) + Number(item.seven ? item.seven.actualPerformance : 0) + Number(item.eight ? item.eight.actualPerformance : 0) + Number(item.nine ? item.nine.actualPerformance : 0) + Number(item.ten ? item.ten.actualPerformance : 0) + Number(item.eleven ? item.eleven.actualPerformance : 0) + Number(item.twelve ? item.twelve.actualPerformance : 0),

Loading…
Cancel
Save