|
@ -1,18 +1,20 @@ |
|
|
import React, { useRef, useEffect, useState, useMemo } from 'react'; |
|
|
import React, { useRef, useEffect, useState, useMemo } from 'react'; |
|
|
import { connect } from 'react-redux'; |
|
|
import { connect } from 'react-redux'; |
|
|
import { Select, Input, Button, Popconfirm, Radio, Tooltip, Table, Pagination, Skeleton } from '@douyinfe/semi-ui'; |
|
|
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 { IconSearch } from '@douyinfe/semi-icons'; |
|
|
import { SkeletonScreen } from "$components"; |
|
|
import { SkeletonScreen } from "$components"; |
|
|
import '../../style.less'; |
|
|
import '../../style.less'; |
|
|
|
|
|
|
|
|
const AchievementDetails = (props) => { |
|
|
const AchievementDetails = (props) => { |
|
|
const { dispatch, actions } = props |
|
|
const { dispatch, actions, user } = props |
|
|
const { businessManagement } = actions |
|
|
const { businessManagement } = actions |
|
|
const [keywordTarget, setKeywordTarget] = useState('saler'); |
|
|
const [keywordTarget, setKeywordTarget] = useState('saler'); |
|
|
const [keyword, setKeyword] = useState('');//搜索内容 |
|
|
const [keyword, setKeyword] = useState('');//搜索内容 |
|
|
const [limits, setLimits] = useState()//每页实际条数 |
|
|
const [limits, setLimits] = useState()//每页实际条数 |
|
|
const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息 |
|
|
const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息 |
|
|
const [tableData, setTableData] = useState([]); |
|
|
const [tableData, setTableData] = useState([]); |
|
|
|
|
|
const [exportUrl, setExportUrl] = useState('') |
|
|
const page = useRef(query.page); |
|
|
const page = useRef(query.page); |
|
|
function seachValueChange(value) { |
|
|
function seachValueChange(value) { |
|
|
setKeyword(value) |
|
|
setKeyword(value) |
|
@ -22,6 +24,10 @@ const AchievementDetails = (props) => { |
|
|
getAchievementDetails() |
|
|
getAchievementDetails() |
|
|
}, []); |
|
|
}, []); |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|
getAchievementDetails() |
|
|
|
|
|
}, [query]) |
|
|
|
|
|
|
|
|
function getAchievementDetails() { |
|
|
function getAchievementDetails() { |
|
|
dispatch(businessManagement.getAchievementDetail({ keywordTarget, keyword, ...query })).then(r => { |
|
|
dispatch(businessManagement.getAchievementDetail({ keywordTarget, keyword, ...query })).then(r => { |
|
|
if (r.success) { |
|
|
if (r.success) { |
|
@ -36,121 +42,145 @@ const AchievementDetails = (props) => { |
|
|
dataIndex: 'recConDate', |
|
|
dataIndex: 'recConDate', |
|
|
key: 'recConDate', |
|
|
key: 'recConDate', |
|
|
width: 120, |
|
|
width: 120, |
|
|
|
|
|
render: (text, record) => <span>{text || '-'}</span> |
|
|
}, { |
|
|
}, { |
|
|
title: '月份', |
|
|
title: '月份', |
|
|
dataIndex: 'month', |
|
|
dataIndex: 'month', |
|
|
key: 'month', |
|
|
key: 'month', |
|
|
width: 120, |
|
|
width: 120, |
|
|
|
|
|
render: (text, record) => <span>{text || '-'}</span> |
|
|
}, { |
|
|
}, { |
|
|
title: '部门', |
|
|
title: '部门', |
|
|
dataIndex: 'department', |
|
|
dataIndex: 'department', |
|
|
key: 'department', |
|
|
key: 'department', |
|
|
width: 140, |
|
|
width: 140, |
|
|
|
|
|
render: (text, record) => <span>{text || '-'}</span> |
|
|
}, { |
|
|
}, { |
|
|
title: '销售人员', |
|
|
title: '销售人员', |
|
|
dataIndex: 'sale', |
|
|
dataIndex: 'sale', |
|
|
key: 'sale', |
|
|
key: 'sale', |
|
|
width: 140, |
|
|
width: 140, |
|
|
|
|
|
render: (text, record) => <span>{text || '-'}</span> |
|
|
}, { |
|
|
}, { |
|
|
title: '客户名称', |
|
|
title: '客户名称', |
|
|
dataIndex: 'customer', |
|
|
dataIndex: 'customer', |
|
|
key: 'customer', |
|
|
key: 'customer', |
|
|
width: 140, |
|
|
width: 140, |
|
|
|
|
|
render: (text, record) => <span>{text || '-'}</span> |
|
|
}, { |
|
|
}, { |
|
|
title: '项目名称', |
|
|
title: '项目名称', |
|
|
dataIndex: 'item', |
|
|
dataIndex: 'item', |
|
|
key: 'item', |
|
|
key: 'item', |
|
|
width: 140, |
|
|
width: 140, |
|
|
|
|
|
render: (text, record) => <span>{text || '-'}</span> |
|
|
}, { |
|
|
}, { |
|
|
title: '合同金额', |
|
|
title: '合同金额', |
|
|
dataIndex: 'amount', |
|
|
dataIndex: 'amount', |
|
|
key: 'amount', |
|
|
key: 'amount', |
|
|
width: 140, |
|
|
width: 140, |
|
|
|
|
|
render: (text, record) => <span>{text || '-'}</span> |
|
|
}, { |
|
|
}, { |
|
|
title: '实际业绩', |
|
|
title: '实际业绩', |
|
|
dataIndex: 'realPerformance', |
|
|
dataIndex: 'realPerformance', |
|
|
key: 'realPerformance', |
|
|
key: 'realPerformance', |
|
|
width: 140, |
|
|
width: 140, |
|
|
|
|
|
render: (text, record) => <span>{text || '-'}</span> |
|
|
}, { |
|
|
}, { |
|
|
title: '考核业绩', |
|
|
title: '考核业绩', |
|
|
dataIndex: 'assessmentPerformance', |
|
|
dataIndex: 'assessmentPerformance', |
|
|
key: 'assessmentPerformance', |
|
|
key: 'assessmentPerformance', |
|
|
width: 120, |
|
|
width: 120, |
|
|
|
|
|
render: (text, record) => <span>{text || '-'}</span> |
|
|
}, { |
|
|
}, { |
|
|
title: '价格是否特批', |
|
|
title: '价格是否特批', |
|
|
dataIndex: 'isApproval', |
|
|
dataIndex: 'isApproval', |
|
|
key: 'isApproval', |
|
|
key: 'isApproval', |
|
|
width: 120, |
|
|
width: 120, |
|
|
|
|
|
render: (text, record) => <span>{text ? '是' : '否'}</span> |
|
|
}, { |
|
|
}, { |
|
|
title: '特批折算比例', |
|
|
title: '特批折算比例', |
|
|
dataIndex: 'approvalProp', |
|
|
dataIndex: 'approvalProp', |
|
|
key: 'approvalProp', |
|
|
key: 'approvalProp', |
|
|
width: 120, |
|
|
width: 120, |
|
|
|
|
|
render: (text, record) => <span>{text || '-'}</span> |
|
|
}, { |
|
|
}, { |
|
|
title: '预支提成及委外费用', |
|
|
title: '预支提成及委外费用', |
|
|
dataIndex: 'cost', |
|
|
dataIndex: 'cost', |
|
|
key: 'cost', |
|
|
key: 'cost', |
|
|
width: 140, |
|
|
width: 140, |
|
|
|
|
|
render: (text, record) => <span>{text || '-'}</span> |
|
|
}, { |
|
|
}, { |
|
|
title: '业务线', |
|
|
title: '业务线', |
|
|
dataIndex: 'serviceLine', |
|
|
dataIndex: 'serviceLine', |
|
|
key: 'serviceLine', |
|
|
key: 'serviceLine', |
|
|
width: 120, |
|
|
width: 120, |
|
|
|
|
|
render: (text, record) => <span>{text || '-'}</span> |
|
|
}, { |
|
|
}, { |
|
|
title: '客户类型', |
|
|
title: '客户类型', |
|
|
dataIndex: 'cusType', |
|
|
dataIndex: 'cusType', |
|
|
key: 'cusType', |
|
|
key: 'cusType', |
|
|
width: 140, |
|
|
width: 140, |
|
|
|
|
|
render: (text, record) => <span>{text || '-'}</span> |
|
|
}, { |
|
|
}, { |
|
|
title: '行业', |
|
|
title: '行业', |
|
|
dataIndex: 'industry', |
|
|
dataIndex: 'industry', |
|
|
key: 'industry', |
|
|
key: 'industry', |
|
|
width: 140, |
|
|
width: 140, |
|
|
|
|
|
render: (text, record) => <span>{text || '-'}</span> |
|
|
}, { |
|
|
}, { |
|
|
title: '信息来源', |
|
|
title: '信息来源', |
|
|
dataIndex: 'source', |
|
|
dataIndex: 'source', |
|
|
key: 'source', |
|
|
key: 'source', |
|
|
width: 120, |
|
|
width: 120, |
|
|
|
|
|
render: (text, record) => <span>{text || '-'}</span> |
|
|
}, { |
|
|
}, { |
|
|
title: '项目类型', |
|
|
title: '项目类型', |
|
|
dataIndex: 'itemType', |
|
|
dataIndex: 'itemType', |
|
|
key: 'itemType', |
|
|
key: 'itemType', |
|
|
width: 120, |
|
|
width: 120, |
|
|
|
|
|
render: (text, record) => <span>{text || '-'}</span> |
|
|
}, { |
|
|
}, { |
|
|
title: '客户省份', |
|
|
title: '客户省份', |
|
|
dataIndex: 'cusProvince', |
|
|
dataIndex: 'cusProvince', |
|
|
key: 'cusProvince', |
|
|
key: 'cusProvince', |
|
|
width: 140, |
|
|
width: 140, |
|
|
|
|
|
render: (text, record) => <span>{text || '-'}</span> |
|
|
}, { |
|
|
}, { |
|
|
title: '客户属性', |
|
|
title: '客户属性', |
|
|
dataIndex: 'cusAttribute', |
|
|
dataIndex: 'cusAttribute', |
|
|
key: 'cusAttribute', |
|
|
key: 'cusAttribute', |
|
|
width: 140, |
|
|
width: 140, |
|
|
|
|
|
render: (text, record) => <span>{text || '-'}</span> |
|
|
}, { |
|
|
}, { |
|
|
title: '复购次数', |
|
|
title: '复购次数', |
|
|
dataIndex: 'repurchaseCount', |
|
|
dataIndex: 'repurchaseCount', |
|
|
key: 'repurchaseCount', |
|
|
key: 'repurchaseCount', |
|
|
width: 120, |
|
|
width: 120, |
|
|
|
|
|
render: (text, record) => <span>{text || '-'}</span> |
|
|
}, { |
|
|
}, { |
|
|
title: '是否可复制的业务路径', |
|
|
title: '是否可复制的业务路径', |
|
|
dataIndex: 'reproducible', |
|
|
dataIndex: 'reproducible', |
|
|
key: 'reproducible', |
|
|
key: 'reproducible', |
|
|
width: 120, |
|
|
width: 120, |
|
|
|
|
|
render: (text, record) => <span>{text ? '是' : '否'}</span> |
|
|
}, { |
|
|
}, { |
|
|
title: '省外业务1.1', |
|
|
title: '省外业务1.1', |
|
|
dataIndex: 'outProvince', |
|
|
dataIndex: 'outProvince', |
|
|
key: 'outProvince', |
|
|
key: 'outProvince', |
|
|
width: 140, |
|
|
width: 140, |
|
|
|
|
|
render: (text, record) => <span>{text || '-'}</span> |
|
|
}, { |
|
|
}, { |
|
|
title: '复购业务1.05', |
|
|
title: '复购业务1.05', |
|
|
dataIndex: 'repurchase', |
|
|
dataIndex: 'repurchase', |
|
|
key: 'repurchase', |
|
|
key: 'repurchase', |
|
|
width: 140, |
|
|
width: 140, |
|
|
|
|
|
render: (text, record) => <span>{text || '-'}</span> |
|
|
}, { |
|
|
}, { |
|
|
title: '可复制的业务路径1.1', |
|
|
title: '可复制的业务路径1.1', |
|
|
dataIndex: 'isreproduce', |
|
|
dataIndex: 'isreproduce', |
|
|
key: 'isreproduce', |
|
|
key: 'isreproduce', |
|
|
width: 120, |
|
|
width: 120, |
|
|
|
|
|
render: (text, record) => <span>{text || '-'}</span> |
|
|
}] |
|
|
}] |
|
|
function handleRow(record, index) {// 给偶数行设置斑马纹 |
|
|
function handleRow(record, index) {// 给偶数行设置斑马纹 |
|
|
if (index % 2 === 0) { |
|
|
if (index % 2 === 0) { |
|
@ -163,6 +193,23 @@ const AchievementDetails = (props) => { |
|
|
return {}; |
|
|
return {}; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const exportAllData = () => { |
|
|
|
|
|
dispatch(businessManagement.getAchievementDetail({ limit: 1 })).then((res) => {//看看有没有 |
|
|
|
|
|
if (res.success) { |
|
|
|
|
|
if (res.payload.data.count) { |
|
|
|
|
|
let url = `detail/achievement?token=${user.token}&toExport=1×tamp=${moment().valueOf()}` |
|
|
|
|
|
setExportUrl(url); |
|
|
|
|
|
} else { |
|
|
|
|
|
Toast.info({ |
|
|
|
|
|
content: '暂无可导出的数据', |
|
|
|
|
|
duration: 3, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const scroll = useMemo(() => ({}), []); |
|
|
const scroll = useMemo(() => ({}), []); |
|
|
return ( |
|
|
return ( |
|
|
<> |
|
|
<> |
|
@ -206,12 +253,15 @@ const AchievementDetails = (props) => { |
|
|
setQuery({ limit: 10, page: 0 }) |
|
|
setQuery({ limit: 10, page: 0 }) |
|
|
}}>查询</Button> |
|
|
}}>查询</Button> |
|
|
</div> |
|
|
</div> |
|
|
<div style={{ display: 'flex', marginRight: 20 }}> |
|
|
<div style={{ display: 'flex' }}> |
|
|
<div style={{ padding: '6px 20px', background: '#0F7EFB', color: '#FFFFFF', fontSize: 14, cursor: "pointer" }} |
|
|
<div style={{ padding: '6px 20px', background: '#0F7EFB', color: '#FFFFFF', fontSize: 14, cursor: "pointer" }} |
|
|
onClick={() => { setImportModalV(true); }}> |
|
|
onClick={() => { setImportModalV(true); }}> |
|
|
导入 |
|
|
导入 |
|
|
</div> |
|
|
</div> |
|
|
<div style={{ padding: '6px 20px', background: '#00BA85', color: '#FFFFFF', fontSize: 14, marginLeft: 18 }}> |
|
|
<div style={{ padding: '6px 20px', background: '#00BA85', color: '#FFFFFF', fontSize: 14, cursor: "pointer", marginLeft: 18 }} |
|
|
|
|
|
onClick={() => { |
|
|
|
|
|
exportAllData() |
|
|
|
|
|
}}> |
|
|
导出全部 |
|
|
导出全部 |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -257,6 +307,9 @@ const AchievementDetails = (props) => { |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
{ |
|
|
|
|
|
exportUrl ? <iframe src={`/_api/${exportUrl}`} style={{ display: 'none' }} /> : '' |
|
|
|
|
|
} |
|
|
</div> |
|
|
</div> |
|
|
</> |
|
|
</> |
|
|
) |
|
|
) |
|
|