|
|
@@ -41,105 +41,42 @@ const renderBadge = (count, active = false) => {
|
|
|
}
|
|
|
|
|
|
/** 服务环比数据Tab切换表格 */
|
|
|
-const ServiceRatioPanels = ({ cyclical, dataPermission, dataType }) => {
|
|
|
+const ServiceRatioPanels = ({ cyclical, dataPermission }) => {
|
|
|
+ const activeKeyMap = {
|
|
|
+ 0: { key: 'clientName', title: '联系人' },
|
|
|
+ 1: { key: 'customerName', title: '客户' },
|
|
|
+ 2: { key: 'businessName', title: '商机' }
|
|
|
+ }
|
|
|
const [state, setState] = useState({
|
|
|
activeKey: '0',
|
|
|
total: 0
|
|
|
})
|
|
|
|
|
|
- const clientColumns = [
|
|
|
- {
|
|
|
- dataIndex: 'clientName',
|
|
|
- title: '联系人名称',
|
|
|
- width: '10%'
|
|
|
- },
|
|
|
+ const columns = [
|
|
|
{
|
|
|
- dataIndex: 'customerName',
|
|
|
- title: '客户名称',
|
|
|
+ dataIndex: activeKeyMap[state.activeKey].key,
|
|
|
+ title: `${activeKeyMap[state.activeKey].title}名称`,
|
|
|
width: '20%'
|
|
|
},
|
|
|
{
|
|
|
dataIndex: 'status',
|
|
|
title: '服务类型',
|
|
|
- width: '10%',
|
|
|
- render: type => servicelogEnum[type]
|
|
|
- },
|
|
|
- {
|
|
|
- dataIndex: 'date',
|
|
|
- title: '服务日期',
|
|
|
- width: '10%',
|
|
|
- valueType: 'date'
|
|
|
- },
|
|
|
- {
|
|
|
- dataIndex: 'mark',
|
|
|
- width: '50%',
|
|
|
- title: '服务内容'
|
|
|
- }
|
|
|
- ]
|
|
|
- const customerColumns = [
|
|
|
- {
|
|
|
- dataIndex: 'clientName',
|
|
|
- title: '客户名称',
|
|
|
- width: '10%'
|
|
|
- },
|
|
|
- {
|
|
|
- dataIndex: 'status',
|
|
|
- title: '服务类型',
|
|
|
- width: '10%',
|
|
|
- render: type => servicelogEnum[type]
|
|
|
- },
|
|
|
- {
|
|
|
- dataIndex: 'date',
|
|
|
- title: '服务日期',
|
|
|
- width: '10%',
|
|
|
- valueType: 'date'
|
|
|
- },
|
|
|
- {
|
|
|
- dataIndex: 'mark',
|
|
|
- width: '50%',
|
|
|
- title: '服务内容'
|
|
|
- }
|
|
|
- ]
|
|
|
- const businessColumns = [
|
|
|
- {
|
|
|
- dataIndex: 'name',
|
|
|
- title: '商机名称',
|
|
|
- width: '10%'
|
|
|
- },
|
|
|
- {
|
|
|
- dataIndex: 'status',
|
|
|
- title: '服务类型',
|
|
|
- width: '10%',
|
|
|
+ width: '15%',
|
|
|
render: type => servicelogEnum[type]
|
|
|
},
|
|
|
{
|
|
|
dataIndex: 'date',
|
|
|
title: '服务日期',
|
|
|
- width: '10%',
|
|
|
+ width: '15%',
|
|
|
valueType: 'date'
|
|
|
},
|
|
|
{
|
|
|
dataIndex: 'mark',
|
|
|
- width: '50%',
|
|
|
+ width: '45%',
|
|
|
title: '服务内容'
|
|
|
}
|
|
|
]
|
|
|
|
|
|
- const dataMap = {
|
|
|
- 0: {
|
|
|
- key: 'client',
|
|
|
- columns: clientColumns
|
|
|
- },
|
|
|
- 1: {
|
|
|
- key: 'customer',
|
|
|
- columns: customerColumns
|
|
|
- },
|
|
|
- 2: {
|
|
|
- key: 'business',
|
|
|
- columns: businessColumns
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
return (
|
|
|
<ProTable
|
|
|
size="small"
|
|
|
@@ -147,7 +84,7 @@ const ServiceRatioPanels = ({ cyclical, dataPermission, dataType }) => {
|
|
|
rowKey={record => record.id}
|
|
|
scroll={{ y: 400 }}
|
|
|
border={true}
|
|
|
- columns={dataMap[dataType].columns}
|
|
|
+ columns={columns}
|
|
|
search={false}
|
|
|
toolbar={{
|
|
|
settings: false,
|