|
|
@@ -1,24 +1,84 @@
|
|
|
-import React from 'react'
|
|
|
-// import { Button } from 'antd'
|
|
|
+import React, { useState } from 'react'
|
|
|
import consts from '@/consts'
|
|
|
import { connect } from 'umi'
|
|
|
import ProTable from '@ant-design/pro-table'
|
|
|
+import { useModal } from '@/components/Modal'
|
|
|
import { queryReminderList } from '@/services/dashboard'
|
|
|
// import styles from '@/pages/Customer/Company/components/ConnectCompany/index.less'
|
|
|
import CustomModal from '@/components/Modal/src/components/CustomModal'
|
|
|
+import ContactDetail from '@/pages/Customer/Client/components/ClientDetail'
|
|
|
+import CompanyDetail from '@/pages/Customer/Company/components/CompanyDetail'
|
|
|
+import Detail from '@/pages/Customer/Business/components/BusinessDetail'
|
|
|
|
|
|
const ReminderList = props => {
|
|
|
// const dispatch = useDispatch()
|
|
|
const { dataType, reminderCyclical } = props
|
|
|
+ const { toggleDrawer, setDrawerProps } = useModal()
|
|
|
+ const [state] = useState({
|
|
|
+ orderIds: []
|
|
|
+ })
|
|
|
// const [state, setState] = useState({
|
|
|
// params: { dataType, reminderCyclical }
|
|
|
// })
|
|
|
+ // 展示客户
|
|
|
+ const showDrawer = id => {
|
|
|
+ setDrawerProps({
|
|
|
+ zIndex: 1001,
|
|
|
+ closable: true,
|
|
|
+ onClose: () => toggleDrawer(),
|
|
|
+ bodyStyle: {
|
|
|
+ height: '100vh'
|
|
|
+ // overflowY: 'hidden'
|
|
|
+ },
|
|
|
+ children: <ContactDetail dataId={id} orderIds={state.orderIds} />
|
|
|
+ })
|
|
|
+ toggleDrawer()
|
|
|
+ }
|
|
|
+ // 展示单位
|
|
|
+ const showDrawerComapny = id => {
|
|
|
+ setDrawerProps({
|
|
|
+ zIndex: 1001,
|
|
|
+ closable: true,
|
|
|
+ onClose: () => toggleDrawer(),
|
|
|
+ bodyStyle: {
|
|
|
+ height: '100vh'
|
|
|
+ // overflowY: 'hidden'
|
|
|
+ },
|
|
|
+ children: <CompanyDetail dataId={id} orderIds={state.orderIds} />
|
|
|
+ })
|
|
|
+ toggleDrawer()
|
|
|
+ }
|
|
|
+ // 展示商机详情
|
|
|
+ const showDrawerBusiness = (id, isCompany = false) => {
|
|
|
+ setDrawerProps({
|
|
|
+ zIndex: 1001,
|
|
|
+ closable: true,
|
|
|
+ onClose: () => toggleDrawer(),
|
|
|
+ bodyStyle: {
|
|
|
+ height: '100vh',
|
|
|
+ overflowY: 'hidden'
|
|
|
+ },
|
|
|
+ children: isCompany ? (
|
|
|
+ <CompanyDetail dataId={id} />
|
|
|
+ ) : (
|
|
|
+ <Detail dataId={id} orderIds={state.orderIds} />
|
|
|
+ )
|
|
|
+ })
|
|
|
+ toggleDrawer()
|
|
|
+ }
|
|
|
const clientColumns = [
|
|
|
{
|
|
|
title: '客户名称',
|
|
|
dataIndex: 'clientName',
|
|
|
ellipsis: true,
|
|
|
- width: '10%'
|
|
|
+ width: '10%',
|
|
|
+ render: (clientName, record) => (
|
|
|
+ <span
|
|
|
+ onClick={() => showDrawer(record.id)}
|
|
|
+ className="text-primary cursor-pointer hover:text-[#967bbd]">
|
|
|
+ {clientName}
|
|
|
+ </span>
|
|
|
+ )
|
|
|
},
|
|
|
{
|
|
|
title: '地区',
|
|
|
@@ -63,7 +123,14 @@ const ReminderList = props => {
|
|
|
title: '单位名称',
|
|
|
dataIndex: 'companyName',
|
|
|
width: '15%',
|
|
|
- ellipsis: true
|
|
|
+ ellipsis: true,
|
|
|
+ render: (companyName, record) => (
|
|
|
+ <span
|
|
|
+ onClick={() => showDrawerComapny(record.id)}
|
|
|
+ className="text-primary cursor-pointer hover:text-[#967bbd]">
|
|
|
+ {companyName}
|
|
|
+ </span>
|
|
|
+ )
|
|
|
},
|
|
|
{
|
|
|
title: '地区',
|
|
|
@@ -108,7 +175,14 @@ const ReminderList = props => {
|
|
|
title: '商机名称',
|
|
|
dataIndex: 'name',
|
|
|
width: '15%',
|
|
|
- ellipsis: true
|
|
|
+ ellipsis: true,
|
|
|
+ render: (text, record) => (
|
|
|
+ <span
|
|
|
+ onClick={() => showDrawerBusiness(record.id)}
|
|
|
+ className="text-primary cursor-pointer hover:text-[#967bbd]">
|
|
|
+ {text}
|
|
|
+ </span>
|
|
|
+ )
|
|
|
},
|
|
|
{
|
|
|
title: '单位名称',
|