|
|
@@ -41,23 +41,33 @@ const renderBadge = (count, active = false) => {
|
|
|
}
|
|
|
|
|
|
/** 服务环比数据Tab切换表格 */
|
|
|
-const ServiceRatioPanels = ({ cyclical, dataPermission }) => {
|
|
|
+const ServiceRatioPanels = ({ cyclical, dataPermission, dataType }) => {
|
|
|
const [state, setState] = useState({
|
|
|
activeKey: '0',
|
|
|
total: 0
|
|
|
})
|
|
|
|
|
|
- const columns = [
|
|
|
+ const clientColumns = [
|
|
|
+ {
|
|
|
+ dataIndex: 'clientName',
|
|
|
+ title: '联系人名称',
|
|
|
+ width: '10%'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'customerName',
|
|
|
+ title: '客户名称',
|
|
|
+ width: '20%'
|
|
|
+ },
|
|
|
{
|
|
|
dataIndex: 'status',
|
|
|
title: '服务类型',
|
|
|
- width: '25%',
|
|
|
+ width: '10%',
|
|
|
render: type => servicelogEnum[type]
|
|
|
},
|
|
|
{
|
|
|
dataIndex: 'date',
|
|
|
title: '服务日期',
|
|
|
- width: '25%',
|
|
|
+ width: '10%',
|
|
|
valueType: 'date'
|
|
|
},
|
|
|
{
|
|
|
@@ -66,6 +76,69 @@ const ServiceRatioPanels = ({ cyclical, dataPermission }) => {
|
|
|
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%',
|
|
|
+ render: type => servicelogEnum[type]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'date',
|
|
|
+ title: '服务日期',
|
|
|
+ width: '10%',
|
|
|
+ valueType: 'date'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'mark',
|
|
|
+ width: '50%',
|
|
|
+ title: '服务内容'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+
|
|
|
+ const dataMap = {
|
|
|
+ 0: {
|
|
|
+ key: 'client',
|
|
|
+ columns: clientColumns
|
|
|
+ },
|
|
|
+ 1: {
|
|
|
+ key: 'customer',
|
|
|
+ columns: customerColumns
|
|
|
+ },
|
|
|
+ 2: {
|
|
|
+ key: 'business',
|
|
|
+ columns: businessColumns
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
return (
|
|
|
<ProTable
|
|
|
@@ -74,7 +147,7 @@ const ServiceRatioPanels = ({ cyclical, dataPermission }) => {
|
|
|
rowKey={record => record.id}
|
|
|
scroll={{ y: 400 }}
|
|
|
border={true}
|
|
|
- columns={columns}
|
|
|
+ columns={dataMap[dataType].columns}
|
|
|
search={false}
|
|
|
toolbar={{
|
|
|
settings: false,
|