张延森 4 年前
父节点
当前提交
4683e16d11

+ 5
- 0
config/routes.js 查看文件

@@ -568,6 +568,11 @@ export default [
568 568
                 name: '业主管理',
569 569
                 component: './property/proprietor'
570 570
               },
571
+              {
572
+                path: 'proprietor/add',
573
+                name: '增加业主',
574
+                component: './property/proprietor/Add'
575
+              },
571 576
               {
572 577
                 path: 'proprietor/detail',
573 578
                 name: '业主详情',

+ 7
- 0
src/components/Prompt/index.jsx 查看文件

@@ -15,6 +15,12 @@ export default props => {
15 15
     }
16 16
   }
17 17
 
18
+  const handleCancel = () => {
19
+    if (props.onCancel) {
20
+      return props.onCancel()
21
+    }
22
+  }
23
+
18 24
   return (
19 25
     <Modal
20 26
       {...props}
@@ -22,6 +28,7 @@ export default props => {
22 28
       closable={false}
23 29
       maskClosable={false}
24 30
       onOk={handleOk}
31
+      onCancel={handleCancel}
25 32
     >
26 33
       <Input value={value} onChange={handleValue} />
27 34
     </Modal>

+ 5
- 3
src/pages/property/building/components/NodeLabel.jsx 查看文件

@@ -18,15 +18,17 @@ export default props => {
18 18
 
19 19
   const menu = (
20 20
     <Menu onClick={handleMenuClick}>
21
-      <Menu.Item key="add">增加</Menu.Item>
21
+      {
22
+        props.data.type !== 'end' && (<Menu.Item key="add">增加子节点</Menu.Item>)
23
+      }
22 24
       <Menu.Item key="delete">删除</Menu.Item>
23 25
     </Menu>
24 26
   );
25 27
 
26 28
   return (
27
-    <Dropdown menu={menu} size="small">
29
+    <Dropdown overlay={menu} size="small">
28 30
       <Button type="link" size="small">
29
-        <span>{props.data.title}</span>
31
+        <span>{props.data.name}</span>
30 32
         <Icon type="edit" />
31 33
       </Button>
32 34
     </Dropdown>

+ 76
- 18
src/pages/property/building/index.jsx 查看文件

@@ -1,29 +1,81 @@
1 1
 import React, { useState, useEffect, useCallback, useRef } from 'react'
2
-import { Tree, Button } from 'antd'
2
+import { Tree, Button, Icon, Modal } from 'antd'
3 3
 import router from 'umi/router'
4 4
 import Prompt from '@/components/Prompt'
5 5
 import { fetch, fetchList, apis } from '@/utils/request'
6 6
 import NodeLabel from './components/NodeLabel'
7 7
 
8
-const getTrees = fetchList(apis.buildingOwnerInfo.getTrees)
8
+const getTrees = fetch(apis.buildingOwnerInfo.getTrees)
9 9
 const addNode = fetch(apis.buildingOwnerInfo.addNode)
10 10
 const deleteNode = fetch(apis.buildingOwnerInfo.deleteNode)
11 11
 
12
+const noticeAndReload = (content, type = 'success') => {
13
+  Modal[type]({
14
+    content,
15
+    onOk: () => {
16
+      window.location.reload()
17
+    }
18
+  })
19
+}
20
+
12 21
 export default props => {
13 22
   const nodeRef = useRef()
14 23
   const [promptVisible, setPromptVisible] = useState(false)
15 24
   const [treeData, setTreeData] = useState()
16 25
 
17
-  const getTreeData = nodeData => {
26
+  const updateTreeData = (origin, parent, nodes) => {
27
+    if (!parent) {
28
+      const newData = [
29
+        ...(origin || []),
30
+        ...(Array.isArray(nodes) ? nodes : [nodes])
31
+      ]
32
+      return newData
33
+    }
34
+
35
+    const newData = (origin || []).map(x => {
36
+      if (x.id === parent) {
37
+        if (Array.isArray(nodes)) {
38
+          x.children = [
39
+            ...(x.children || []),
40
+            ...nodes
41
+          ]
42
+        } else {
43
+          x.children = [
44
+            ...(x.children || []),
45
+            nodes
46
+          ]
47
+        }
48
+      } else {
49
+        if (x.children && x.children.length) {
50
+          x.children = updateTreeData(x.children, parent, nodes)
51
+        }
52
+      }
53
+
54
+      return x
55
+    })
56
+
57
+    return newData
58
+  }
59
+
60
+  const getTreeData = (nodeData, refresh) => {
61
+
18 62
     const query = nodeData ? {
19
-      id: nodeData.id,
20
-      name: nodeData.name,
21
-      treeType: nodeData.treeType,
22
-      nodeNumber: nodeData.nodeNumber,
63
+      id: nodeData.props.dataRef.id,
64
+      name: nodeData.props.dataRef.name,
65
+      treeType: nodeData.props.dataRef.type,
66
+      nodeNumber: nodeData.props.dataRef.nodeNumber,
23 67
     } : { treeType: 'phase' }
24 68
 
25
-    getTrees(query).then(res => {
26
-      setTreeData(res.filter(x => x && Object.keys(x).length))
69
+    return new Promise((resolve, reject) => {
70
+      getTrees({ params: query }).then(res => {
71
+        if (refresh) {
72
+          setTreeData(res)
73
+        } else {
74
+          const data = updateTreeData(treeData, query.id, res)
75
+          setTreeData(data)
76
+        }
77
+        resolve()
78
+      }).catch(err => reject(err))
27 79
     })
28 80
   }
29 81
 
@@ -38,11 +90,13 @@ export default props => {
38 90
     addNode({ data: {
39 91
       id: nodeData.id,
40 92
       name: nodeData.name,
41
-      treeType: nodeData.treeType,
93
+      type: nodeData.type,
42 94
       nodeNumber: promptData,
43 95
     }}).then(() => {
44 96
       // 刷新页面, 重新请求数据
45
-      getTreeData()
97
+      // 直接刷数据, ant 有 bug
98
+      // getTreeData(null, true)
99
+      noticeAndReload('添加成功')
46 100
     })
47 101
   }
48 102
 
@@ -50,11 +104,13 @@ export default props => {
50 104
     deleteNode({ data: {
51 105
       id: nodeData.id,
52 106
       name: nodeData.name,
53
-      treeType: nodeData.treeType,
107
+      type: nodeData.type,
54 108
       nodeNumber: nodeData.nodeNumber,
55 109
     }}).then(() => {
56 110
       // 刷新页面, 重新请求数据
57
-      getTreeData()
111
+      // 直接刷数据, ant 有 bug
112
+      // getTreeData(null, true)
113
+      noticeAndReload('删除成功')
58 114
     })
59 115
   }
60 116
 
@@ -63,15 +119,16 @@ export default props => {
63 119
   }
64 120
 
65 121
   useEffect(() => {
66
-    getTreeData()
122
+    getTreeData(null, true)
67 123
   }, [])
68 124
 
69 125
   const renderTreeNodes = data => data.map(node => {
70 126
     return (      
71 127
       <Tree.TreeNode
72 128
         {...node}
73
-        key={node.key}
129
+        key={node.id}
74 130
         dataRef={node}
131
+        isLeaf={node.type === 'end'}
75 132
         title={(<NodeLabel data={node} onAdd={showPrompt} onDelete={handleNodeDelete} />)}
76 133
       >
77 134
         {
@@ -83,8 +140,9 @@ export default props => {
83 140
 
84 141
   return (
85 142
     <>
86
-      <div>
87
-        <Button type="primary" onClick={handleBatchImport}>批量导入小区楼栋信息</Button>
143
+      <div style={{ marginBottom: '24px' }}>
144
+        <Button onClick={() => showPrompt({ type: 'phase' })}><Icon type="plus" />增加顶级节点</Button>
145
+        <Button type="link" onClick={handleBatchImport} style={{ marginLeft: '24px' }}>批量导入小区楼栋信息</Button>
88 146
       </div>
89 147
       {
90 148
         treeData && treeData.length ? (
@@ -95,7 +153,7 @@ export default props => {
95 153
           <p style={{ color: '#aaa', fontSize: '0.8em', textAlign: 'center', marginTop: '16px' }}>暂无数据</p>
96 154
         )
97 155
       }
98
-      <Prompt visible={promptVisible} onOk={handleNodeAdd} />
156
+      <Prompt visible={promptVisible} onOk={handleNodeAdd} onCancel={() => setPromptVisible(false)} />
99 157
     </>
100 158
   )
101 159
 }

+ 243
- 0
src/pages/property/proprietor/Add.jsx 查看文件

@@ -0,0 +1,243 @@
1
+import React, { useRef, useState, useEffect } from 'react'
2
+import { Form, Input, Select, Button, Radio, Modal, Descriptions } from 'antd'
3
+import router from 'umi/router'
4
+import { fetch, apis } from '@/utils/request'
5
+
6
+const fetchPhaseList = fetch(apis.buildingOwnerInfo.getPhaseList)
7
+const fetchBuildingList = fetch(apis.buildingOwnerInfo.getBuildingList)
8
+const fetchUnitList = fetch(apis.buildingOwnerInfo.getUnitList)
9
+const fetchLevelList = fetch(apis.buildingOwnerInfo.getLevelList)
10
+const fetchRoomNoList = fetch(apis.buildingOwnerInfo.getRoomNoList)
11
+const addPerson = fetch(apis.buildingOwnerInfo.addBuilding)
12
+const taUserHasOwner = fetch(apis.propUser.taUserHasOwner)
13
+const taUserHas = fetch(apis.propUser.taUserHas)
14
+
15
+const formItemLayout = {
16
+  labelCol: {
17
+    xs: { span: 24 },
18
+    sm: { span: 6 },
19
+  },
20
+  wrapperCol: {
21
+    xs: { span: 24 },
22
+    sm: { span: 12 },
23
+  },
24
+}
25
+
26
+const tailFormItemLayout = {
27
+  wrapperCol: {
28
+    xs: {
29
+      span: 24,
30
+      offset: 0,
31
+    },
32
+    sm: {
33
+      span: 16,
34
+      offset: 6,
35
+    },
36
+  },
37
+}
38
+
39
+export default Form.create()(props => {
40
+  const [phaseList, setPhaseList] = useState([])
41
+  const [buildingList, setBuildingList] = useState([])
42
+  const [unitList, setUnitList] = useState([])
43
+  const [levelList, setLevelList] = useState([])
44
+  const [roomNoList, setRoomNoList] = useState([])
45
+
46
+  const [phaseId, setPhaseId] = useState()
47
+  const [buildingId, setBuildingId] = useState()
48
+  const [unitId, setUnitId] = useState()
49
+  const [levelId, setLevelId] = useState()
50
+  const [roomNoId, setRoomNoId] = useState()
51
+
52
+  const [owerExist, setOwnerExist] = useState(false)
53
+  const [telAccUser, setTelAccUser] = useState()
54
+  
55
+  const handlePhaseChange = e => setPhaseId(e)
56
+  const handleBuildingChange = e => setBuildingId(e)
57
+  const handleUnitChange = e => setUnitId(e)
58
+  const handleLevelChange = e => setLevelId(e)
59
+  const handleRoomChange = e => setRoomNoId(e)
60
+  const handlePhoneBlur = e => {
61
+    const ownerTel = props.form.getFieldValue('ownerTel')
62
+    if (ownerTel) {
63
+      taUserHas({params: {ownerTel}}).then(res => {
64
+        setTelAccUser(res)
65
+      })
66
+    }
67
+  }
68
+
69
+  // 获取期
70
+  useEffect(() => {
71
+    fetchPhaseList().then(res => setPhaseList(res))
72
+  }, [])
73
+
74
+  // 楼栋
75
+  useEffect(() => {
76
+    if (phaseId) {
77
+      fetchBuildingList({params: {phaseId}}).then(res => setBuildingList(res))
78
+    }
79
+    setBuildingId()
80
+  }, [phaseId])
81
+
82
+  // 单元
83
+  useEffect(() => {
84
+    if (phaseId && buildingId) {
85
+      fetchUnitList({params: {phaseId, buildingId}}).then(res => setUnitList(res))
86
+    }
87
+    setUnitId()
88
+  }, [phaseId, buildingId])
89
+
90
+  // 楼层
91
+  useEffect(() => {
92
+    if (phaseId && buildingId && unitId) {
93
+      fetchLevelList({params: {phaseId, buildingId, unitId}}).then(res => setLevelList(res))
94
+    }
95
+    setLevelId()
96
+  }, [phaseId, buildingId, unitId])
97
+
98
+  // 房号
99
+  useEffect(() => {
100
+    if (phaseId && buildingId && unitId && levelId) {
101
+      fetchRoomNoList({params: {phaseId, buildingId, unitId, levelId}}).then(res => setRoomNoList(res))
102
+    }
103
+    setRoomNoId()
104
+  }, [phaseId, buildingId, unitId, levelId])
105
+
106
+  useEffect(() => {
107
+    if (roomNoId) {
108
+      taUserHasOwner({ params: {phaseId, buildingId, unitId, levelId, roomNoId} }).then(res => {
109
+        setOwnerExist(res.boolRole)
110
+      })
111
+    }
112
+  }, [roomNoId])
113
+  
114
+  useEffect(() => {
115
+    if (roomNoId) {
116
+      taUserHasOwner({ params: {phaseId, buildingId, unitId, levelId, roomNoId} }).then(res => {
117
+        setOwnerExist(res.boolRole)
118
+      })
119
+    }
120
+  }, [roomNoId])
121
+
122
+
123
+  const handleSubmit = e => {
124
+    e.preventDefault();
125
+    if (telAccUser) {
126
+      return
127
+    }
128
+
129
+    props.form.validateFields((err, values) => {
130
+      if (!err) {
131
+        const data = {
132
+          ...values,
133
+          phaseId,
134
+          buildingId,
135
+          unitId,
136
+          levelId,
137
+          roomNoId
138
+        }
139
+
140
+        addPerson({ data }).then(res => {
141
+          Modal.success({
142
+            content: '添加成功',
143
+            onOk: () => {
144
+              router.go(-1)
145
+            }
146
+          })
147
+        })
148
+      }
149
+    });
150
+  }
151
+
152
+  return (
153
+    <div>
154
+      <Form {...formItemLayout} onSubmit={handleSubmit}>
155
+        <Form.Item label="期/区" required>
156
+          <Select value={phaseId} onChange={handlePhaseChange} style={{ minWidth: '120px' }} placeholder="期/区">
157
+            {
158
+              phaseList.map(x => (<Select.Option key={x.id} value={x.id}>{x.name}</Select.Option>))
159
+            }
160
+          </Select>
161
+        </Form.Item>
162
+        <Form.Item label="栋/幢" required>
163
+          <Select value={buildingId} onChange={handleBuildingChange} style={{ minWidth: '120px' }} placeholder="栋/幢">
164
+            {
165
+              buildingList.map(x => (<Select.Option key={x.id} value={x.id}>{x.name}</Select.Option>))
166
+            }
167
+          </Select>
168
+        </Form.Item>
169
+        <Form.Item label="单元" required>
170
+          <Select value={unitId} onChange={handleUnitChange} style={{ minWidth: '120px' }} placeholder="单元">
171
+            {
172
+              unitList.map(x => (<Select.Option key={x.id} value={x.id}>{x.name}</Select.Option>))
173
+            }
174
+          </Select>
175
+        </Form.Item>
176
+        <Form.Item label="楼层" required>
177
+          <Select value={levelId} onChange={handleLevelChange} style={{ minWidth: '120px' }} placeholder="楼层">
178
+            {
179
+              levelList.map(x => (<Select.Option key={x.id} value={x.id}>{x.name}</Select.Option>))
180
+            }
181
+          </Select>
182
+        </Form.Item>
183
+        <Form.Item label="户号" required>
184
+          <Select value={roomNoId} onChange={handleRoomChange} style={{ minWidth: '120px' }} placeholder="户号">
185
+            {
186
+              roomNoList.map(x => (<Select.Option key={x.id} value={x.id}>{x.name}</Select.Option>))
187
+            }
188
+          </Select>
189
+        </Form.Item>
190
+        <Form.Item label="手机号">
191
+          {
192
+            props.form.getFieldDecorator('ownerTel', {
193
+              rules: [
194
+                { required: true, message: '请填写手机号' }
195
+              ]
196
+            })(<Input onBlur={handlePhoneBlur} />)
197
+          }
198
+        </Form.Item>
199
+        <Form.Item label="身份">
200
+          {
201
+            props.form.getFieldDecorator('roleId')(
202
+              <Select style={{ minWidth: '120px' }} placeholder="请选择身份">
203
+                <Select.Option value="1" disabled={owerExist}>户主</Select.Option>
204
+                <Select.Option value="2">租客</Select.Option>
205
+                <Select.Option value="3">家属</Select.Option>
206
+              </Select>
207
+            )
208
+          }
209
+        </Form.Item>
210
+        <Form.Item label="姓名">
211
+          {
212
+            props.form.getFieldDecorator('ownerName')(<Input />)
213
+          }
214
+        </Form.Item>
215
+        <Form.Item label="性别">
216
+          {
217
+            props.form.getFieldDecorator('gender')(
218
+              <Radio.Group>
219
+                <Radio value="1">男</Radio>
220
+                <Radio value="2">女</Radio>
221
+              </Radio.Group>
222
+            )
223
+          }
224
+        </Form.Item>
225
+        {
226
+          telAccUser && (
227
+            <Form.Item label=" " colon={false}>
228
+              <Descriptions column={3}>
229
+                <Descriptions.Item label="姓名">{telAccUser.userName}</Descriptions.Item>
230
+                <Descriptions.Item label="性别">{telAccUser.gender === '2' ? '女' : '男'}</Descriptions.Item>
231
+                <Descriptions.Item label="身份证号">{(telAccUser.idCard || '').replace(/^(.{4})(?:\w+)(.{4})$/, "$1****$2")}</Descriptions.Item>
232
+              </Descriptions>
233
+            </Form.Item>
234
+          )
235
+        }
236
+        <Form.Item {...tailFormItemLayout}>
237
+          <Button type="primary" htmlType="submit">提交</Button>
238
+          <Button style={{ marginLeft: '48px' }} onClick={() => router.go(-1)}>取消</Button>
239
+        </Form.Item>
240
+      </Form>
241
+    </div>
242
+  )
243
+})

+ 80
- 61
src/pages/property/proprietor/index.jsx 查看文件

@@ -1,15 +1,15 @@
1 1
 import React, { useState, useEffect } from 'react'
2
-import { Select, Spin, Table, Button, Form, Input } from 'antd'
2
+import { Select, Spin, Table, Button, Form, Input, Icon } from 'antd'
3 3
 import NavLink from 'umi/navlink'
4
-import { fetchList, apis } from '@/utils/request'
4
+import { fetch, apis } from '@/utils/request'
5 5
 import Search from '../components/Search'
6 6
 import List from '../components/List'
7 7
 
8
-const fetchPhaseList = fetchList(apis.buildingOwnerInfo.getPhaseList)
9
-const fetchBuildingList = fetchList(apis.buildingOwnerInfo.getBuildingList)
10
-const fetchUnitList = fetchList(apis.buildingOwnerInfo.getUnitList)
11
-const fetchLevelList = fetchList(apis.buildingOwnerInfo.getLevelList)
12
-const fetchRoomNoList = fetchList(apis.buildingOwnerInfo.getRoomNoList)
8
+const fetchPhaseList = fetch(apis.buildingOwnerInfo.getPhaseList)
9
+const fetchBuildingList = fetch(apis.buildingOwnerInfo.getBuildingList)
10
+const fetchUnitList = fetch(apis.buildingOwnerInfo.getUnitList)
11
+const fetchLevelList = fetch(apis.buildingOwnerInfo.getLevelList)
12
+const fetchRoomNoList = fetch(apis.buildingOwnerInfo.getRoomNoList)
13 13
 
14 14
 const Condition = props => {
15 15
   const [phaseList, setPhaseList] = useState([])
@@ -18,79 +18,98 @@ const Condition = props => {
18 18
   const [levelList, setLevelList] = useState([])
19 19
   const [roomNoList, setRoomNoList] = useState([])
20 20
 
21
+  const [phaseId, setPhaseId] = useState()
22
+  const [buildingId, setBuildingId] = useState()
23
+  const [unitId, setUnitId] = useState()
24
+  const [levelId, setLevelId] = useState()
25
+  const [roomNoId, setRoomNoId] = useState()
26
+
27
+  // 获取期
21 28
   useEffect(() => {
22
-    // getPhaseList()
29
+    fetchPhaseList().then(res => setPhaseList(res))
23 30
   }, [])
24 31
 
32
+  // 楼栋
33
+  useEffect(() => {
34
+    if (phaseId) {
35
+      fetchBuildingList({params: {phaseId}}).then(res => setBuildingList(res))
36
+    }
37
+    setBuildingId()
38
+  }, [phaseId])
39
+
40
+  // 单元
41
+  useEffect(() => {
42
+    if (phaseId && buildingId) {
43
+      fetchUnitList({params: {phaseId, buildingId}}).then(res => setUnitList(res))
44
+    }
45
+    setUnitId()
46
+  }, [phaseId, buildingId])
47
+
48
+  // 楼层
49
+  useEffect(() => {
50
+    if (phaseId && buildingId && unitId) {
51
+      fetchLevelList({params: {phaseId, buildingId, unitId}}).then(res => setLevelList(res))
52
+    }
53
+    setLevelId()
54
+  }, [phaseId, buildingId, unitId])
55
+
56
+  // 房号
57
+  useEffect(() => {
58
+    if (phaseId && buildingId && unitId && levelId) {
59
+      fetchRoomNoList({params: {phaseId, buildingId, unitId, levelId}}).then(res => setRoomNoList(res))
60
+    }
61
+    setRoomNoId()
62
+  }, [phaseId, buildingId, unitId, levelId])
63
+
25 64
   return (
26 65
     <Search
27 66
       onSearch={props.onSearch}
28 67
       onReset={props.onReset}
29 68
       render={form => {
30
-        const { getFieldDecorator, setFieldsValue } = form
69
+        const { getFieldDecorator } = form
31 70
         
32
-        const getPhaseList = () => {}
33
-        const getBuildingList = () => {}
34
-        const getUnitList = () => {}
35
-        const getLevelList = () => {}
36
-        const getRoomNoList  = () => {}
71
+        const handlePhaseChange = e => setPhaseId(e)
72
+        const handleBuildingChange = e => setBuildingId(e)
73
+        const handleUnitChange = e => setUnitId(e)
74
+        const handleLevelChange = e => setLevelId(e)
75
+        const handleRoomChange = e => setRoomNoId(e)
37 76
 
38 77
         return (
39 78
           <>
40 79
             <Form.Item>
41
-            {
42
-              getFieldDecorator('phaseId')(
43
-                <Select onChange={getBuildingList} style={{ minWidth: '120px' }} placeholder="期/区">
44
-                  {
45
-                    phaseList.map(x => (<Select.Option key={x.id} value={x.id}>{x.name}</Select.Option>))
46
-                  }
47
-                </Select>
48
-              )
49
-            }
80
+              <Select value={phaseId} onChange={handlePhaseChange} style={{ minWidth: '120px' }} placeholder="期/区">
81
+                {
82
+                  phaseList.map(x => (<Select.Option key={x.id} value={x.id}>{x.name}</Select.Option>))
83
+                }
84
+              </Select>
50 85
             </Form.Item>
51 86
             <Form.Item>
52
-            {
53
-              getFieldDecorator('buildingId')(
54
-                <Select onChange={getUnitList} style={{ minWidth: '120px' }} placeholder="栋">
55
-                  {
56
-                    buildingList.map(x => (<Select.Option key={x.id} value={x.id}>{x.name}</Select.Option>))
57
-                  }
58
-                </Select>
59
-              )
60
-            }
87
+              <Select value={buildingId} onChange={handleBuildingChange} style={{ minWidth: '120px' }} placeholder="栋">
88
+                {
89
+                  buildingList.map(x => (<Select.Option key={x.id} value={x.id}>{x.name}</Select.Option>))
90
+                }
91
+              </Select>
61 92
             </Form.Item>
62 93
             <Form.Item>
63
-            {
64
-              getFieldDecorator('unitId')(
65
-                <Select onChange={getLevelList} style={{ minWidth: '120px' }} placeholder="单元">
66
-                  {
67
-                    unitList.map(x => (<Select.Option key={x.id} value={x.id}>{x.name}</Select.Option>))
68
-                  }
69
-                </Select>
70
-              )
71
-            }
94
+              <Select value={unitId} onChange={handleUnitChange} style={{ minWidth: '120px' }} placeholder="单元">
95
+                {
96
+                  unitList.map(x => (<Select.Option key={x.id} value={x.id}>{x.name}</Select.Option>))
97
+                }
98
+              </Select>
72 99
             </Form.Item>
73 100
             <Form.Item>
74
-            {
75
-              getFieldDecorator('levelId')(
76
-                <Select onChange={getRoomNoList} style={{ minWidth: '120px' }} placeholder="楼层">
77
-                  {
78
-                    levelList.map(x => (<Select.Option key={x.id} value={x.id}>{x.name}</Select.Option>))
79
-                  }
80
-                </Select>
81
-              )
82
-            }
101
+              <Select value={levelId} onChange={handleLevelChange} style={{ minWidth: '120px' }} placeholder="楼层">
102
+                {
103
+                  levelList.map(x => (<Select.Option key={x.id} value={x.id}>{x.name}</Select.Option>))
104
+                }
105
+              </Select>
83 106
             </Form.Item>
84 107
             <Form.Item>
85
-            {
86
-              getFieldDecorator('roomNoId')(
87
-                <Select style={{ minWidth: '120px' }} placeholder="户号">
88
-                  {
89
-                    roomNoList.map(x => (<Select.Option key={x.id} value={x.id}>{x.name}</Select.Option>))
90
-                  }
91
-                </Select>
92
-              )
93
-            }
108
+              <Select value={roomNoId} onChange={handleRoomChange} style={{ minWidth: '120px' }} placeholder="户号">
109
+                {
110
+                  roomNoList.map(x => (<Select.Option key={x.id} value={x.id}>{x.name}</Select.Option>))
111
+                }
112
+              </Select>
94 113
             </Form.Item>
95 114
             <Form.Item>
96 115
             {
@@ -140,10 +159,10 @@ export default props => {
140 159
     <div>
141 160
       <Condition onSearch={handleSearch} onReset={handleSearch} />
142 161
       <div style={{ margin: '24px 0' }}>
143
-        <NavLink to={`/xxx`}>
162
+        <NavLink to={`/property/proprietor/add`}>
144 163
           <Button type="primary">添加</Button>
145 164
         </NavLink>
146
-        <Button style={{ marginLeft: '24px' }}>批量导入业主资料</Button>
165
+        <Button type="link"><Icon type="upload"/>批量导入业主资料</Button>
147 166
       </div>
148 167
       <Spin spinning={loading}>
149 168
         <List dataSource={listData} onPageChange={handlePageChange} rowKey="userVerifyId">

+ 20
- 2
src/services/prop_user_api.js 查看文件

@@ -1,16 +1,34 @@
1 1
 
2
+const moduleName = 'prop-user'
3
+
2 4
 export default prefix => {
3 5
   return {
4 6
     // 获取审核列表
5 7
     userVerifyAll: {
6
-      url: `${prefix}/user/verify/all`,
8
+      url: `${prefix}/${moduleName}/verify/all`,
7 9
       method: 'get',
10
+      action: `admin.${moduleName}.verify.all`
8 11
     },
9 12
 
10 13
     // 审核用户
11 14
     userVerifyAudit: {
12
-      url: `${prefix}/user/verify/audit/:id`,
15
+      url: `${prefix}/${moduleName}/verify/audit/:id`,
13 16
       method: 'put',
17
+      action: `admin.${moduleName}.verify.audit`
18
+    },
19
+
20
+    // 校验移动端手机号是否注册
21
+    taUserHas: {
22
+      url: `${prefix}/${moduleName}/has`,
23
+      method: 'get',
24
+      action: `admin.${moduleName}.has`
25
+    },
26
+
27
+    // 校验移动端手机号是否注册以及户主
28
+    taUserHasOwner: {
29
+      url: `${prefix}/${moduleName}/hasOwner`,
30
+      method: 'get',
31
+      action: `admin.${moduleName}.hasOwner`
14 32
     }
15 33
   }
16 34
 }