|
@@ -7,57 +7,56 @@ import { useDispatch } from 'dva'
|
|
|
import ConnectClient from '@/pages/Customer/Client/components/ConnectClient'
|
|
import ConnectClient from '@/pages/Customer/Client/components/ConnectClient'
|
|
|
import styles from './index.less'
|
|
import styles from './index.less'
|
|
|
|
|
|
|
|
-export const ChangeCompMap = {
|
|
|
|
|
- LONGLE: {
|
|
|
|
|
- key: 'software',
|
|
|
|
|
- title: '联系人'
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
const ChangeClient = props => {
|
|
const ChangeClient = props => {
|
|
|
const dispatch = useDispatch()
|
|
const dispatch = useDispatch()
|
|
|
- const { toggleModal, setModalProps } = useModal()
|
|
|
|
|
- const {
|
|
|
|
|
- dataSource: { longleId, clientId, clientName, actionPayload = ChangeCompMap.LONGLE.key }
|
|
|
|
|
- } = props
|
|
|
|
|
|
|
+ const { toggleModal, setModalProps, toggleDrawer, setDrawerProps } = useModal()
|
|
|
|
|
+ const { clientName = '', dataId, clientId, actionPayload } = props.dataSource
|
|
|
const refreshClient = () => {
|
|
const refreshClient = () => {
|
|
|
dispatch({
|
|
dispatch({
|
|
|
type: 'refresh/commitAction',
|
|
type: 'refresh/commitAction',
|
|
|
- payload: 'clientlist'
|
|
|
|
|
|
|
+ payload: actionPayload
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
- const handleConnectClient = () => {
|
|
|
|
|
|
|
+ const handleConnectCustomer = () => {
|
|
|
setModalProps({
|
|
setModalProps({
|
|
|
width: '60vw',
|
|
width: '60vw',
|
|
|
modalRender: () => (
|
|
modalRender: () => (
|
|
|
- <ConnectClient
|
|
|
|
|
- onSelect={refreshClient}
|
|
|
|
|
- id={longleId}
|
|
|
|
|
- clientId={clientId}
|
|
|
|
|
- preUrl={actionPayload}
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <ConnectClient onSelect={refreshClient} id={dataId} postUrl="/software/changeClient" />
|
|
|
),
|
|
),
|
|
|
onCancel: () => toggleModal()
|
|
onCancel: () => toggleModal()
|
|
|
})
|
|
})
|
|
|
toggleModal()
|
|
toggleModal()
|
|
|
}
|
|
}
|
|
|
const notValueRender = (
|
|
const notValueRender = (
|
|
|
- <div onClick={handleConnectClient} className={styles.notCompanyContent}>
|
|
|
|
|
|
|
+ <div onClick={handleConnectCustomer} className={styles.notCompanyContent}>
|
|
|
<LinkOne size="14" />
|
|
<LinkOne size="14" />
|
|
|
<span className="ml-5px">关联联系人</span>
|
|
<span className="ml-5px">关联联系人</span>
|
|
|
</div>
|
|
</div>
|
|
|
)
|
|
)
|
|
|
-
|
|
|
|
|
|
|
+ const handleCompanyClick = () => {
|
|
|
|
|
+ toggleDrawer()
|
|
|
|
|
+ setDrawerProps({
|
|
|
|
|
+ closable: true,
|
|
|
|
|
+ onClose: () => toggleDrawer(),
|
|
|
|
|
+ bodyStyle: {
|
|
|
|
|
+ height: '100vh',
|
|
|
|
|
+ overflowY: 'hidden'
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ toggleDrawer()
|
|
|
|
|
+ }
|
|
|
const normalValueRender = (
|
|
const normalValueRender = (
|
|
|
<Card size="small">
|
|
<Card size="small">
|
|
|
<div className="flex justify-between">
|
|
<div className="flex justify-between">
|
|
|
- <div className={styles.nameContent}>{clientName}</div>
|
|
|
|
|
|
|
+ <div className={styles.nameContent} onClick={handleCompanyClick}>
|
|
|
|
|
+ {clientName}
|
|
|
|
|
+ </div>
|
|
|
<div className="max-w-55px">
|
|
<div className="max-w-55px">
|
|
|
<Tooltip
|
|
<Tooltip
|
|
|
placement="right"
|
|
placement="right"
|
|
|
title="更换联系人"
|
|
title="更换联系人"
|
|
|
className="ml-5px"
|
|
className="ml-5px"
|
|
|
- onClick={handleConnectClient}>
|
|
|
|
|
|
|
+ onClick={handleConnectCustomer}>
|
|
|
<span className={styles.switchIcon}>
|
|
<span className={styles.switchIcon}>
|
|
|
<Switch />
|
|
<Switch />
|
|
|
</span>
|
|
</span>
|