张延森 4 年之前
父節點
當前提交
502bfc0ad6
共有 1 個檔案被更改,包括 6 行新增2 行删除
  1. 6
    2
      src/pages/property/proprietor/Add.jsx

+ 6
- 2
src/pages/property/proprietor/Add.jsx 查看文件

@@ -32,6 +32,8 @@ const tailFormItemLayout = {
32 32
   },
33 33
 }
34 34
 
35
+const isEmpty = o => !o || (Array.isArray(o) && !o.length) || (typeof o === 'object' && !Object.keys(o).length)
36
+
35 37
 export default Form.create()(props => {
36 38
   const {
37 39
     phaseId,
@@ -63,7 +65,9 @@ export default Form.create()(props => {
63 65
     const ownerTel = props.form.getFieldValue('ownerTel')
64 66
     if (ownerTel) {
65 67
       taUserHas({params: {ownerTel}}).then(res => {
66
-        setTelAccUser(res)
68
+        if (!isEmpty(res)) {
69
+          setTelAccUser(res)
70
+        }
67 71
       })
68 72
     }
69 73
   }
@@ -87,7 +91,7 @@ export default Form.create()(props => {
87 91
 
88 92
   const handleSubmit = e => {
89 93
     e.preventDefault();
90
-    if (telAccUser) {
94
+    if (!isEmpty(telAccUser)) {
91 95
       return
92 96
     }
93 97