Explorar o código

feat: 修复客户名称相关操作重复请求数据

lanjianrong %!s(int64=5) %!d(string=hai) anos
pai
achega
9a82a201e8

+ 5 - 2
src/components/PopContent/Contacts/index.jsx

@@ -33,10 +33,13 @@ const PopContent = props => {
     }
   }
   useEffect(() => {
-    if (visible || shouldUpdate) {
+    if (shouldUpdate) {
       initData()
     }
-  }, [visible, shouldUpdate])
+  }, [shouldUpdate])
+  useEffect(() => {
+    visible && initData()
+  }, [])
   return (
     <div className="sheet-box">
       <Row>

+ 0 - 7
src/pages/Customer/Contact/components/ChangeCompany/index.jsx

@@ -14,13 +14,6 @@ const ChangeCompanyInput = props => {
   const {
     dataSource: { customerId, clientId, customerName, clientName }
   } = props
-  // const [companyName, setCompanyName] = useState('')
-  // useEffect(() => {
-  //   setCompanyName(customerName)
-  // }, [customerName])
-  // const changeCompany = name => {
-  //   setCompanyName(name)
-  // }
   const refreshClient = () => {
     dispatch({
       type: 'refresh/commitAction',