outaozhen hace 4 años
padre
commit
05deff0c66
Se han modificado 1 ficheros con 2 adiciones y 3 borrados
  1. 2 3
      src/pages/Customer/Client/components/AddClient/index.jsx

+ 2 - 3
src/pages/Customer/Client/components/AddClient/index.jsx

@@ -42,14 +42,13 @@ const AddClient = props => {
   }, [])
 
   const handleChange = () => {
-    if (!clientName.value === false) {
+    if (!formRef.current?.getFieldValue('clientName')) {
       const clientNameNum = clientName.value.split('')
       const [firstName, ...lastName] = clientNameNum
       const nameAfter = `(${lastName.join('')})`
       const newClientName = `${firstName + nameAfter}工`
       formRef.current?.setFieldsValue({ niceName: newClientName })
-    }
-    if (!qq.value === false) {
+    } else if (!formRef.current?.getFieldValue('qq')) {
       const emailNum = qq.value
       const newEmail = `${emailNum}@qq.com`
       formRef.current?.setFieldsValue({ email: newEmail })