|
@@ -4,13 +4,12 @@ import styles from '@/pages/Customer/Company/components/ConnectCompany/index.les
|
|
|
import { SearchOutlined, CloseOutlined } from '@ant-design/icons'
|
|
import { SearchOutlined, CloseOutlined } from '@ant-design/icons'
|
|
|
import { useDebounceFn } from 'ahooks'
|
|
import { useDebounceFn } from 'ahooks'
|
|
|
import { useDispatch } from 'dva'
|
|
import { useDispatch } from 'dva'
|
|
|
-import { apiAddClient, linkBusiWithClient, queryClient } from '@/services/customer'
|
|
|
|
|
-import { apiChangeClient } from '@/services/lock'
|
|
|
|
|
|
|
+import { apiAddClient, apiChangeClient, queryClient } from '@/services/customer'
|
|
|
import consts from '@/basic/consts'
|
|
import consts from '@/basic/consts'
|
|
|
import { formatValues } from '@/components/LazyCascader'
|
|
import { formatValues } from '@/components/LazyCascader'
|
|
|
import AddClient from '../AddClient'
|
|
import AddClient from '../AddClient'
|
|
|
|
|
|
|
|
-const ConnectClient = ({ longleId, dataId, onSelect, preUrl }) => {
|
|
|
|
|
|
|
+const ConnectClient = ({ dataId, onSelect, preUrl = 'client', showFooter = true }) => {
|
|
|
const dispatch = useDispatch()
|
|
const dispatch = useDispatch()
|
|
|
const scrollRef = useRef()
|
|
const scrollRef = useRef()
|
|
|
const [state, setState] = useState({
|
|
const [state, setState] = useState({
|
|
@@ -75,8 +74,7 @@ const ConnectClient = ({ longleId, dataId, onSelect, preUrl }) => {
|
|
|
|
|
|
|
|
// 商机/软件锁关联联系人
|
|
// 商机/软件锁关联联系人
|
|
|
const connectClient = async clientId => {
|
|
const connectClient = async clientId => {
|
|
|
- // const { code = -1 } = await apiChangeClient(preUrl, { id: dataId, clientId })
|
|
|
|
|
- const { code = -1 } = await apiChangeClient(preUrl, { id: longleId, clientId })
|
|
|
|
|
|
|
+ const { code = -1 } = await apiChangeClient(preUrl, { id: dataId, clientId })
|
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
|
onSelect()
|
|
onSelect()
|
|
|
closeModal()
|
|
closeModal()
|
|
@@ -127,15 +125,17 @@ const ConnectClient = ({ longleId, dataId, onSelect, preUrl }) => {
|
|
|
))}
|
|
))}
|
|
|
</Spin>
|
|
</Spin>
|
|
|
</div>
|
|
</div>
|
|
|
- <div className={styles.modalFooter}>
|
|
|
|
|
- <AddClient
|
|
|
|
|
- onConfirm={addConfirm}
|
|
|
|
|
- dataId={dataId}
|
|
|
|
|
- dataType={preUrl}
|
|
|
|
|
- buttonProps={{ ghost: true }}
|
|
|
|
|
- btnTitle={'添加并关联到新联系人'}
|
|
|
|
|
- />
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ {showFooter ? (
|
|
|
|
|
+ <div className={styles.modalFooter}>
|
|
|
|
|
+ <AddClient
|
|
|
|
|
+ onConfirm={addConfirm}
|
|
|
|
|
+ dataId={dataId}
|
|
|
|
|
+ dataType={preUrl}
|
|
|
|
|
+ buttonProps={{ ghost: true }}
|
|
|
|
|
+ btnTitle={'添加并关联到新联系人'}
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ ) : null}
|
|
|
</div>
|
|
</div>
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|