فهرست منبع

feat: 软件锁更换联系人

outaozhen 5 سال پیش
والد
کامیت
e83c780af5

+ 4 - 2
src/pages/Customer/Client/components/ConnectClient/index.jsx

@@ -5,11 +5,12 @@ import { SearchOutlined, CloseOutlined } from '@ant-design/icons'
 import { useDebounceFn } from 'ahooks'
 import { useDispatch } from 'dva'
 import { apiAddClient, linkBusiWithClient, queryClient } from '@/services/customer'
+import { apiChangeClient } from '@/services/lock'
 import consts from '@/basic/consts'
 import { formatValues } from '@/components/LazyCascader'
 import AddClient from '../AddClient'
 
-const ConnectClient = ({ dataId, onSelect, preUrl, postUrl }) => {
+const ConnectClient = ({ longleId, dataId, onSelect, preUrl }) => {
   const dispatch = useDispatch()
   const scrollRef = useRef()
   const [state, setState] = useState({
@@ -74,7 +75,8 @@ const ConnectClient = ({ dataId, onSelect, preUrl, postUrl }) => {
 
   // 商机/软件锁关联联系人
   const connectClient = async clientId => {
-    const { code = -1 } = await linkBusiWithClient(postUrl, { id: dataId, clientId })
+    // const { code = -1 } = await apiChangeClient(preUrl, { id: dataId, clientId })
+    const { code = -1 } = await apiChangeClient(preUrl, { id: longleId, clientId })
     if (code === consts.RET_CODE.SUCCESS) {
       onSelect()
       closeModal()

+ 6 - 2
src/pages/Product/Lock/Lockstore/components/ChangeClient/index.jsx

@@ -10,7 +10,7 @@ import styles from './index.less'
 const ChangeClient = props => {
   const dispatch = useDispatch()
   const { toggleModal, setModalProps, toggleDrawer, setDrawerProps } = useModal()
-  const { clientName = '', dataId, clientId, actionPayload } = props.dataSource
+  const { clientName = '', longleId, clientId, actionPayload } = props.dataSource
   const refreshClient = () => {
     dispatch({
       type: 'refresh/commitAction',
@@ -21,7 +21,11 @@ const ChangeClient = props => {
     setModalProps({
       width: '60vw',
       modalRender: () => (
-        <ConnectClient onSelect={refreshClient} id={dataId} postUrl="/software/changeClient" />
+        <ConnectClient
+          onSelect={refreshClient}
+          longleId={longleId}
+          preUrl="/software/changeClient"
+        />
       ),
       onCancel: () => toggleModal()
     })