outaozhen 5 år sedan
förälder
incheckning
bfa8c13f01

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

@@ -4,6 +4,7 @@ import { useModal } from '@/components/Modal'
 import { Card, Tooltip } from 'antd'
 import consts from '@/basic/consts'
 import { useDispatch } from 'dva'
+import { isEmpty, isNullOrUnDef } from '@/utils/is'
 import ConnectClient from '@/pages/Customer/Client/components/ConnectClient'
 import ContactDetail from '@/pages/Customer/Client/components/ClientDetail'
 import styles from './index.less'
@@ -12,6 +13,7 @@ const ChangeClient = props => {
   const dispatch = useDispatch()
   const { toggleModal, setModalProps, toggleDrawer, setDrawerProps } = useModal()
   const { clientName = '', longleId, clientId, actionPayload } = props.dataSource
+  if (isNullOrUnDef(clientName) || isEmpty(clientName)) return null
   const refreshClient = () => {
     dispatch({
       type: 'refresh/commitAction',

+ 7 - 7
src/pages/Product/Lock/Lockstore/components/LocksDetail/TabList.jsx

@@ -49,14 +49,14 @@ const LockTabList = props => {
     if (code === consts.RET_CODE.SUCCESS) {
       message.success('新增成功')
       setState({ ...state, data: values })
+      // 请求完了
+      setAddLonglelog({ ...addLonglelog, loading: false, visible: false })
+      // 刷新数据
+      dispatch({
+        type: 'refresh/commitAction',
+        payload: 'longle'
+      })
     }
-    // 请求完了
-    setAddLonglelog({ ...addLonglelog, loading: false, visible: false })
-    // 刷新数据
-    dispatch({
-      type: 'refresh/commitAction',
-      payload: 'longle'
-    })
   }
 
   const handleClientClick = () => {