|
|
@@ -8,9 +8,22 @@ import { Badge } from 'antd'
|
|
|
import { cardTypeMap } from '../consts'
|
|
|
|
|
|
const dataTypeEunm = {
|
|
|
- 0: 'client',
|
|
|
- 1: 'customer',
|
|
|
- 2: 'business'
|
|
|
+ 0: {
|
|
|
+ key: 'client',
|
|
|
+ title: '新增联系人'
|
|
|
+ },
|
|
|
+ 1: {
|
|
|
+ key: 'customer',
|
|
|
+ title: '新增客户'
|
|
|
+ },
|
|
|
+ 2: {
|
|
|
+ key: 'business',
|
|
|
+ title: '新增商机'
|
|
|
+ },
|
|
|
+ 3: {
|
|
|
+ key: 'service',
|
|
|
+ title: '新增服务记录'
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const renderBadge = (count, active = false) => {
|
|
|
@@ -60,6 +73,7 @@ const ServiceRatioPanels = ({ cyclical, dataPermission }) => {
|
|
|
params={{ dataType: state.activeKey, cyclical, dataPermission }}
|
|
|
rowKey={record => record.id}
|
|
|
scroll={{ y: 400 }}
|
|
|
+ border={true}
|
|
|
columns={columns}
|
|
|
search={false}
|
|
|
toolbar={{
|
|
|
@@ -72,7 +86,7 @@ const ServiceRatioPanels = ({ cyclical, dataPermission }) => {
|
|
|
key: '0',
|
|
|
label: (
|
|
|
<span>
|
|
|
- 联系人服务记录
|
|
|
+ 联系人
|
|
|
{renderBadge(state.total, state.activeKey === '0')}
|
|
|
</span>
|
|
|
)
|
|
|
@@ -81,7 +95,7 @@ const ServiceRatioPanels = ({ cyclical, dataPermission }) => {
|
|
|
key: '1',
|
|
|
label: (
|
|
|
<span>
|
|
|
- 客户服务记录
|
|
|
+ 客户
|
|
|
{renderBadge(state.total, state.activeKey === '1')}
|
|
|
</span>
|
|
|
)
|
|
|
@@ -90,7 +104,7 @@ const ServiceRatioPanels = ({ cyclical, dataPermission }) => {
|
|
|
key: '2',
|
|
|
label: (
|
|
|
<span>
|
|
|
- 商机服务记录
|
|
|
+ 商机
|
|
|
{renderBadge(state.total, state.activeKey === '2')}
|
|
|
</span>
|
|
|
)
|
|
|
@@ -213,29 +227,32 @@ const RatioPanels = ({ dataType, retioCyclical, dataPermission }) => {
|
|
|
}
|
|
|
|
|
|
return (
|
|
|
- <CustomModal title="卡片详情">
|
|
|
- <div className="mx-4 pb-4">
|
|
|
+ <CustomModal title={`卡片详情(${dataTypeEunm[dataType].title})`}>
|
|
|
+ <div className="pb-4">
|
|
|
{dataType === cardTypeMap.SERVICE ? (
|
|
|
<ServiceRatioPanels cyclical={retioCyclical} dataPermission={dataPermission} />
|
|
|
) : (
|
|
|
- <ProTable
|
|
|
- size="small"
|
|
|
- pagination={{ defaultPageSize: 10 }}
|
|
|
- rowKey={record => record.id}
|
|
|
- scroll={{ y: 400 }}
|
|
|
- columns={columnsMap[dataType]}
|
|
|
- params={{ dataType, dataPermission, cyclical: retioCyclical }}
|
|
|
- request={async params => {
|
|
|
- const { code = -1, data } = await queryRatioPanelsList(params)
|
|
|
- return {
|
|
|
- data: data[dataTypeEunm[dataType]],
|
|
|
- success: code === consts.RET_CODE.SUCCESS,
|
|
|
- total: data.total
|
|
|
- }
|
|
|
- }}
|
|
|
- search={false}
|
|
|
- toolBarRender={false}
|
|
|
- />
|
|
|
+ <div className="mx-4">
|
|
|
+ <ProTable
|
|
|
+ size="small"
|
|
|
+ border={true}
|
|
|
+ pagination={{ defaultPageSize: 10 }}
|
|
|
+ rowKey={record => record.id}
|
|
|
+ scroll={{ y: 400 }}
|
|
|
+ columns={columnsMap[dataType]}
|
|
|
+ params={{ dataType, dataPermission, cyclical: retioCyclical }}
|
|
|
+ request={async params => {
|
|
|
+ const { code = -1, data } = await queryRatioPanelsList(params)
|
|
|
+ return {
|
|
|
+ data: data[dataTypeEunm[dataType].key],
|
|
|
+ success: code === consts.RET_CODE.SUCCESS,
|
|
|
+ total: data.total
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ search={false}
|
|
|
+ toolBarRender={false}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
)}
|
|
|
</div>
|
|
|
{/* <div className={styles.modalFooter}>
|