张延森 4 gadus atpakaļ
vecāks
revīzija
aa4af14032

+ 13
- 1
config/routes.js Parādīt failu

571
               {
571
               {
572
                 path: 'proprietor/add',
572
                 path: 'proprietor/add',
573
                 name: '增加业主',
573
                 name: '增加业主',
574
-                component: './property/proprietor/Add'
574
+                component: './property/proprietor/Add',
575
+                hideInMenu: true,
575
               },
576
               },
576
               {
577
               {
577
                 path: 'proprietor/detail',
578
                 path: 'proprietor/detail',
579
                 component: './property/proprietor/Detail',
580
                 component: './property/proprietor/Detail',
580
                 hideInMenu: true,
581
                 hideInMenu: true,
581
               },
582
               },
583
+              {
584
+                path: 'proprietor/audit',
585
+                name: '资料审核',
586
+                component: './property/proprietor/Audit',
587
+              },
588
+              {
589
+                path: 'proprietor/batch',
590
+                name: '业主导入',
591
+                component: './property/proprietor/BatchImport',
592
+                hideInMenu: true,
593
+              },
582
               {
594
               {
583
                 path: 'notice',
595
                 path: 'notice',
584
                 name: '公告管理',
596
                 name: '公告管理',

+ 1
- 1
src/pages/property/building/BatchImport.jsx Parādīt failu

19
   const downloadExcel = () => {
19
   const downloadExcel = () => {
20
     const link = document.createElement('a')
20
     const link = document.createElement('a')
21
     link.href = "http://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/%E6%A5%BC%E6%A0%8B%E5%BA%93%E6%A8%A1%E6%9D%BF.xlsx"
21
     link.href = "http://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/%E6%A5%BC%E6%A0%8B%E5%BA%93%E6%A8%A1%E6%9D%BF.xlsx"
22
-    link.setAttribute('download', '业主资料库.xlsx')
22
+    link.setAttribute('download', '楼栋库模板.xlsx')
23
     link.click()
23
     link.click()
24
   }
24
   }
25
 
25
 

+ 127
- 44
src/pages/property/proprietor/Audit.jsx Parādīt failu

1
-import React from 'react'
2
-import { Spin, Button, Form, Input, Popconfirm,  } from 'antd'
1
+import React, { useEffect, useRef, useState } from 'react'
2
+import { Spin, Button, Form, Input, Popconfirm, Table, Modal, notification } from 'antd'
3
 import { fetch, fetchList, apis } from '@/utils/request'
3
 import { fetch, fetchList, apis } from '@/utils/request'
4
 import Search from '../components/Search'
4
 import Search from '../components/Search'
5
 import List from '../components/List'
5
 import List from '../components/List'
17
           <>
17
           <>
18
             <Form.Item label="姓名">
18
             <Form.Item label="姓名">
19
             {
19
             {
20
-              getFieldDecorator('ownerName')(<Input style={{ width: '160px' }} placeholder="姓名" />)
20
+              getFieldDecorator('userName')(<Input style={{ width: '160px' }} placeholder="姓名" />)
21
             }
21
             }
22
             </Form.Item>
22
             </Form.Item>
23
             <Form.Item label="手机号">
23
             <Form.Item label="手机号">
24
             {
24
             {
25
-              getFieldDecorator('ownerTel')(<Input style={{ width: '160px' }} placeholder="手机号" />)
25
+              getFieldDecorator('phone')(<Input style={{ width: '160px' }} placeholder="手机号" />)
26
             }
26
             }
27
             </Form.Item>
27
             </Form.Item>
28
             <Form.Item label="身份证">
28
             <Form.Item label="身份证">
50
   const [loading, setLoading] = useState(false)
50
   const [loading, setLoading] = useState(false)
51
   const [noPassShow, setNoPassShow] = useState(false)
51
   const [noPassShow, setNoPassShow] = useState(false)
52
   const [listData, setListData] = useState([])
52
   const [listData, setListData] = useState([])
53
+  const [pagination, setPagination] = useState({})
54
+  const [queryParams, setQueryParams] = useState({ pageNum: 1, pageSize: 10 })
53
 
55
 
54
-  const handleSearch = vals => {}
56
+  const currentRow = useRef()
57
+  
58
+  const handleSearch = vals => {
59
+    setQueryParams({
60
+      ...queryParams,
61
+      ...vals,
62
+      pageNum: 1
63
+    })
64
+  }
55
 
65
 
56
   const handleDeleteRow = row => {}
66
   const handleDeleteRow = row => {}
57
 
67
 
68
+  const showAuditDialog = row => {
69
+    currentRow.current = row
70
+    setNoPassShow(true)
71
+  }
72
+
73
+  const handleVerfiy = (row, verifyStatus) => {
74
+    const params = {
75
+      verifyStatus,
76
+      remark: row.remark
77
+    }
78
+
79
+    userVerifyAudit({ urlData: { id: row.id }, params }).then(res => {
80
+      Modal.success({
81
+        content: '审核提交成功',
82
+        onOk: () => {
83
+          // 触发数据刷新
84
+          setQueryParams({...queryParams})
85
+        }
86
+      })
87
+    })
88
+  }
89
+
90
+  const handleSubmit = vals => {
91
+    if (!currentRow.current) {
92
+      notification.error({
93
+        message: '操作异常',
94
+        description: '未找到对应行数据'
95
+      })
96
+      return
97
+    }
98
+
99
+    const row = {
100
+      ...currentRow.current,
101
+      ...vals,
102
+    }
103
+
104
+    handleVerfiy(row, false)
105
+    setNoPassShow(false)
106
+  }
107
+
108
+  useEffect(() => {
109
+    setLoading(true)
110
+    userVerifyAll(queryParams).then(res => {
111
+      const [records, pagi] = res || []
112
+      setListData(records)
113
+      setPagination(pagi)
114
+      setLoading(false)
115
+    }).catch(() => setLoading(false))
116
+  }, [queryParams])
117
+
58
   return (
118
   return (
59
     <div>
119
     <div>
60
       <Condition onSearch={handleSearch} onSearch={handleSearch} />
120
       <Condition onSearch={handleSearch} onSearch={handleSearch} />
61
-      <div>
62
-        <p style={{color: '#888'}}>注意,审核后无法修改审核结果,请仔细确认</p>
121
+      <div style={{ marginTop: '24px' }}>
122
+        <p style={{color: '#888', fontSize: '0.8em'}}>注意,审核后无法修改审核结果,请仔细确认</p>
63
       </div>
123
       </div>
64
-      <Spin spinning={loading}>
65
-        <List dataSource={listData} rowKey="id">
66
-          <Table.Column title="姓名" dataIndex="userName" key="userName" />
67
-          <Table.Column title="手机号" dataIndex="phone" key="phone" />
68
-          <Table.Column title="身份证" dataIndex="idCard" key="idCard" />
69
-          <Table.Column title="性别" dataIndex="gender" key="gender" render={x => x === '1' ? '男' : '女'} />
70
-          <Table.Column
71
-            title="房产"
72
-            dataIndex="address"
73
-            key="address"
74
-            render={(_, row) => row.phaseName + row.buildingName + row.unitName + row.levelName + row.roomNoName}
75
-          />
76
-          <Table.Column title="角色" dataIndex="roleId" key="roleId" render={x => propRole[x]} />
77
-          <Table.Column title="提交时间" dataIndex="createDate" key="createDate" />
78
-          <Table.Column
79
-            title="操作"
80
-            key="action"
81
-            render={(_, row) => {
82
-              return (
83
-                <>
84
-                  <Popconfirm
85
-                    title="确认进行删除操作?"
86
-                    onConfirm={() => handleDeleteRow(row)}
87
-                    okText="删除"
88
-                    cancelText="取消"
89
-                  >
90
-                    <Button type="link">删除</Button>
91
-                  </Popconfirm>
92
-                  <Divider type="vertical" />
93
-                  <Button type="link">审核通过</Button>
94
-                  <Button type="link">审核不通过</Button>
95
-                </>
96
-              )
97
-            }}
98
-          />
99
-        </List>
100
-      </Spin>
124
+      <List dataSource={listData} loading={loading} rowKey="id">
125
+        <Table.Column title="姓名" dataIndex="userName" key="userName" />
126
+        <Table.Column title="手机号" dataIndex="phone" key="phone" />
127
+        <Table.Column title="身份证" dataIndex="idCard" key="idCard" />
128
+        <Table.Column title="性别" dataIndex="gender" key="gender" render={x => x === '2' ? '女' : '男'} />
129
+        <Table.Column
130
+          title="房产"
131
+          dataIndex="address"
132
+          key="address"
133
+          render={(_, row) => row.phaseName + row.buildingName + row.unitName + row.levelName + row.roomNoName}
134
+        />
135
+        <Table.Column title="角色" dataIndex="roleId" key="roleId" render={x => propRole[x]} />
136
+        <Table.Column title="提交时间" dataIndex="createDate" key="createDate" />
137
+        <Table.Column
138
+          title="操作"
139
+          key="action"
140
+          render={(_, row) => {
141
+            return (
142
+              <>
143
+                {/* <Popconfirm
144
+                  title="确认进行删除操作?"
145
+                  onConfirm={() => handleDeleteRow(row)}
146
+                  okText="删除"
147
+                  cancelText="取消"
148
+                >
149
+                  <Button type="link">删除</Button>
150
+                </Popconfirm>
151
+                <Divider type="vertical" /> */}
152
+                {
153
+                  row.verifyStatus !== '1' && (
154
+                    <Popconfirm
155
+                      title="确认进行审核通过操作?"
156
+                      onConfirm={() => handleVerfiy(row, true)}
157
+                      okText="通过"
158
+                      cancelText="取消"
159
+                    >
160
+                      <Button type="link">审核通过</Button>
161
+                    </Popconfirm>
162
+                  )
163
+                }
164
+                {
165
+                  row.verifyStatus === '0' && <Divider type="vertical" />
166
+                }
167
+                {
168
+                  row.verifyStatus !== '2' && (
169
+                    <Popconfirm
170
+                      title="确认进行审核不通过操作?"
171
+                      onConfirm={() => showAuditDialog(row)}
172
+                      okText="不通过"
173
+                      cancelText="取消"
174
+                    >
175
+                      <Button type="link">审核不通过</Button>
176
+                    </Popconfirm>
177
+                  )
178
+                }
179
+              </>
180
+            )
181
+          }}
182
+        />
183
+      </List>
101
       <AuditNot visible={noPassShow} onSubmit={handleSubmit} onCancel={() => setNoPassShow(false)} />
184
       <AuditNot visible={noPassShow} onSubmit={handleSubmit} onCancel={() => setNoPassShow(false)} />
102
     </div>
185
     </div>
103
   )
186
   )

+ 98
- 0
src/pages/property/proprietor/BatchImport.jsx Parādīt failu

1
+import React, { useRef, useState } from 'react'
2
+import { Button, Spin, Table, Icon, notification } from 'antd'
3
+import router from 'umi/router'
4
+import { fetch, apis } from '@/utils/request'
5
+
6
+const { Column } = Table
7
+const spaceStyle = { marginLeft: '16px' }
8
+
9
+const buildingDownloadExcel = fetch(apis.buildingOwnerInfo.buildingDownloadExcel)
10
+const uploadBuildingExcel = fetch(apis.buildingOwnerInfo.uploadBuildingExcel)
11
+const submitBuildingExcel = fetch(apis.buildingOwnerInfo.submitBuildingExcel)
12
+
13
+export default props => {
14
+  const [loading, setLoading] = useState(false)
15
+  const [dataList, setDataList] = useState([])
16
+  const [pagenavi, setPagenavi] = useState({ pageSize: 10, total: 0 })
17
+
18
+  const excelRef = useRef()
19
+
20
+  const downloadExcel = () => {
21
+    buildingDownloadExcel().then(res => {
22
+      const url = window.URL.createObjectURL(new Blob([res]))
23
+      const link = document.createElement('a')
24
+      link.href = url
25
+      link.setAttribute('download', '业主资料库.xlsx')
26
+      link.click()
27
+    })
28
+  }
29
+
30
+  const importExcel = () => {
31
+    const input = document.createElement('input')
32
+    input.setAttribute('type', 'file')
33
+    input.addEventListener('input', e => {
34
+      const files = e.target.files
35
+      if (files && files[0]) {
36
+        excelRef.current = files[0]
37
+        const formData = new FormData()
38
+        formData.append('file', excelRef.current)
39
+        
40
+        setLoading(true)
41
+        uploadBuildingExcel({ data: formData }).then(res => {
42
+          setDataList(res.list)
43
+          setPagenavi({
44
+            ...pagenavi,
45
+            pageSize: res.size,
46
+            total: res.total
47
+          })
48
+          setLoading(false)
49
+        }).catch(() => {
50
+          setLoading(false)
51
+        })
52
+      }
53
+    })
54
+    input.click()
55
+  }
56
+
57
+  const submitExcel = () => {
58
+    if (!excelRef.current) {
59
+      notification.warning({ message: '没有选择文件' })
60
+      return
61
+    }
62
+
63
+    const formData = new FormData()
64
+    formData.append('file', excelRef.current)
65
+
66
+    setLoading(true)
67
+    submitBuildingExcel({ data: formData }).then(res => {
68
+      notification.success({ message: '提交成功' })
69
+
70
+      setLoading(false)
71
+    }).catch(() => {
72
+      setLoading(false)
73
+    })
74
+  }
75
+
76
+  return (
77
+    <div>
78
+      <div style={{ marginBottom: '24px' }}>
79
+        <Button onClick={downloadExcel}><Icon type="download" />下载模板</Button>
80
+        <Button onClick={importExcel} style={spaceStyle}><Icon type="upload" />选取文件并预览</Button>
81
+        <Button type="primary" onClick={submitExcel} style={spaceStyle}>提交</Button>
82
+        <Button style={spaceStyle} onClick={() => router.go(-1)}>取消</Button>
83
+      </div>
84
+
85
+      <Table dataSource={dataList} pagination={pagenavi} loading={loading}>
86
+        <Column key="phaseName" title="期/区" dataIndex="phaseName" />
87
+        <Column key="buildingName" title="栋" dataIndex="buildingName" />
88
+        <Column key="unitName" title="单元" dataIndex="unitName" />
89
+        <Column key="levelName" title="楼层" dataIndex="levelName" />
90
+        <Column key="roomNoName" title="户号" dataIndex="roomNoName" />
91
+        <Column key="ownerName" title="户主姓名" dataIndex="ownerName" />
92
+        <Column key="roleName" title="身份" dataIndex="roleName" />
93
+        <Column key="ownerTel" title="手机号码" dataIndex="ownerTel" />
94
+      </Table>
95
+    </div>
96
+  )
97
+
98
+}

+ 67
- 17
src/pages/property/proprietor/Detail.jsx Parādīt failu

1
-import React, { useState } from 'react'
2
-import { Button, Descriptions } from 'antd'
1
+import React, { useEffect, useState } from 'react'
2
+import { Button, Descriptions, List, Modal } from 'antd'
3
+import router from 'umi/router'
4
+import { fetch, apis } from '@/utils/request'
3
 import Section from './components/Section'
5
 import Section from './components/Section'
4
 import Edit from './components/Edit'
6
 import Edit from './components/Edit'
5
 
7
 
8
+const VerifyStatusDict = {
9
+  '0': '未审核',
10
+  '1': '通过',
11
+  '2': '不通过',
12
+}
13
+
14
+const buildingDetails = fetch(apis.buildingOwnerInfo.buildingDetails)
15
+const verifyinfoAdd = fetch(apis.buildingOwnerInfo.verifyinfoAdd)
16
+
6
 export default props => {
17
 export default props => {
7
   const [editorShow, setEditorShow] = useState(false)
18
   const [editorShow, setEditorShow] = useState(false)
8
-  const [roomName, setRoomName] = useState('1期1号楼1单元13层1331')
19
+  const [userData, setUserData] = useState({})
20
+  
21
+  const { id } = props.location.query
22
+  const roomName = userData.phaseName + userData.buildingName + userData.unitName + userData.levelName + userData.roomNoName
9
 
23
 
10
-  const handleEdit = () => {}
24
+  const handleEdit = vals => {
25
+    verifyinfoAdd({ urlData: { id }, params: vals }).then(res => {
26
+      Modal.success({
27
+        content: '提交修改成功',
28
+        onOk: () => {
29
+          setEditorShow(false)
30
+        }
31
+      })
32
+    })
33
+  }
34
+
35
+  useEffect(() => {
36
+    buildingDetails({ data: { id } }).then(res => {
37
+      const { taUser = {}, taUserVerify = {} } = res || {}
38
+      setUserData({
39
+        userName: taUser.userName,
40
+        gender: taUser.gender,
41
+        loginName : taUser.loginName,
42
+        nickname : taUser.nickname,
43
+        openid: taUser.openid,
44
+        idCard: taUser.idCard,
45
+        headPortrait: taUser.headPortrait,
46
+        description: taUser.description,
47
+        verifyStatus: taUserVerify.verifyStatus + '',
48
+        status: taUserVerify.verifyStatus + '',
49
+        faceImg: taUserVerify.faceImg,
50
+        roomNoName: taUserVerify.roomNoName,
51
+        roomInfoList : roomInfoList,
52
+        roleId: taUserVerify.roleId + '',
53
+        phaseName: taUserVerify.phaseName,
54
+        unitName: taUserVerify.unitName,
55
+        buildingName: taUserVerify.buildingName,
56
+        levelName: taUserVerify.levelName,
57
+      })
58
+    })
59
+  }, [id])
11
 
60
 
12
   return (
61
   return (
13
     <div>
62
     <div>
14
       <Section title="基本信息">
63
       <Section title="基本信息">
15
         <Descriptions column={3}>
64
         <Descriptions column={3}>
16
-          <Descriptions.Item label="姓名">测试</Descriptions.Item>
17
-          <Descriptions.Item label="性别">男</Descriptions.Item>
18
-          <Descriptions.Item label="手机号">1382383843</Descriptions.Item>
19
-          <Descriptions.Item label="微信昵称">Big Big</Descriptions.Item>
20
-          <Descriptions.Item label="微信ID">iwnxlspqpsisnxghgys</Descriptions.Item>
21
-          <Descriptions.Item label="身份证">320101200001011234</Descriptions.Item>
65
+          <Descriptions.Item label="姓名">{userData.userName}</Descriptions.Item>
66
+          <Descriptions.Item label="性别">{userData.gender === '2' ? '女' : ''}</Descriptions.Item>
67
+          <Descriptions.Item label="手机号">{userData.loginName}</Descriptions.Item>
68
+          <Descriptions.Item label="微信昵称">{userData.nickname}</Descriptions.Item>
69
+          <Descriptions.Item label="微信ID">{userData.openid}</Descriptions.Item>
70
+          <Descriptions.Item label="身份证">{userData.idCard}</Descriptions.Item>
22
           <Descriptions.Item label="头像">
71
           <Descriptions.Item label="头像">
23
-            <img src="" alt=""/>
72
+            <img src={userData.headPortrait} alt="" style={{ width: '128px', height: '128px' }}/>
24
           </Descriptions.Item>
73
           </Descriptions.Item>
25
         </Descriptions>
74
         </Descriptions>
26
       </Section>
75
       </Section>
27
       <Section title="在当前房屋" subTitle={roomName} action={<Button type="link" onClick={() => setEditorShow(true)}>修改</Button>}>
76
       <Section title="在当前房屋" subTitle={roomName} action={<Button type="link" onClick={() => setEditorShow(true)}>修改</Button>}>
28
         <Descriptions column={3}>
77
         <Descriptions column={3}>
29
-          <Descriptions.Item label="身份">户主</Descriptions.Item>
30
-          <Descriptions.Item label="审核状态">未审核</Descriptions.Item>
31
-          <Descriptions.Item label="资料手机">1382383843</Descriptions.Item>
78
+          <Descriptions.Item label="身份">{userData.description}</Descriptions.Item>
79
+          <Descriptions.Item label="审核状态">{VerifyStatusDict[userData.status]}</Descriptions.Item>
80
+          <Descriptions.Item label="资料手机">{userData.loginName}</Descriptions.Item>
32
           <Descriptions.Item label="人脸">
81
           <Descriptions.Item label="人脸">
33
-            <img src="" alt=""/>
82
+            <img src={userData.faceImg} alt="" style={{ width: '128px', height: '128px' }}/>
34
           </Descriptions.Item>
83
           </Descriptions.Item>
35
         </Descriptions>
84
         </Descriptions>
36
       </Section>
85
       </Section>
37
-      <Section title="关联本小区其他房屋">
38
-
86
+      <Section title="关联本小区其他房屋" subTitle="使用用户手机号在小区用户列表中搜索查看">
87
+        <List dataSource={userData.roomInfoList || []} renderItem={x => (<List.Item>{x}</List.Item>)} size="small" />
39
       </Section>
88
       </Section>
40
       <p style={{ color: '#888' }}>
89
       <p style={{ color: '#888' }}>
41
         若想修改户主登录手机号,需要户主自己登录APP在个人中心修改。
90
         若想修改户主登录手机号,需要户主自己登录APP在个人中心修改。
44
       </p>
93
       </p>
45
       <Edit
94
       <Edit
46
         visible={editorShow}
95
         visible={editorShow}
96
+        userData={userData}
47
         onSubmit={handleEdit}
97
         onSubmit={handleEdit}
48
         onCancel={() => setEditorShow(false)}
98
         onCancel={() => setEditorShow(false)}
49
       />
99
       />

+ 13
- 23
src/pages/property/proprietor/components/AuditNot.jsx Parādīt failu

1
 import React, { useEffect } from 'react'
1
 import React, { useEffect } from 'react'
2
-import { Form, Select, Button, Modal } from 'antd'
2
+import { Form, Radio, Button, Modal } from 'antd'
3
 
3
 
4
 const formItemLayout = {
4
 const formItemLayout = {
5
   labelCol: {
5
   labelCol: {
25
   },
25
   },
26
 }
26
 }
27
 
27
 
28
+const blockRadio = {
29
+  display: 'block',
30
+  height: '30px',
31
+  lineHeight: '30px',
32
+}
33
+
28
 export default Form.create()(props => {
34
 export default Form.create()(props => {
29
 
35
 
30
   const handleSubmit = e => {
36
   const handleSubmit = e => {
36
     })
42
     })
37
   }
43
   }
38
 
44
 
39
-  useEffect(() => {
40
-    // props.setFieldsValue()
41
-  }, [])
42
-
43
   return (
45
   return (
44
     <Modal footer={null} maskClosable={false} onCancel={props.onCancel} visible={props.visible}>
46
     <Modal footer={null} maskClosable={false} onCancel={props.onCancel} visible={props.visible}>
45
       <Form {...formItemLayout} onSubmit={handleSubmit}>
47
       <Form {...formItemLayout} onSubmit={handleSubmit}>
46
-        <Form.Item label="身份">
47
-          {
48
-            props.form.getFieldDecorator('roleId')(
49
-              <Select>
50
-                <Select.Option key="1" value="1">户主</Select.Option>
51
-                <Select.Option key="2" value="2">租客</Select.Option>
52
-                <Select.Option key="3" value="3">家属</Select.Option>
53
-              </Select>
54
-            )
55
-          }
56
-        </Form.Item>
57
-        <Form.Item label="审核状态">
48
+        <Form.Item label="不通过原因">
58
           {
49
           {
59
-            props.form.getFieldDecorator('verifyStatus')(
60
-              <Select>
61
-                <Select.Option key="1" value="1">审核通过</Select.Option>
62
-                <Select.Option key="2" value="2">审核未通过</Select.Option>
63
-                <Select.Option key="0" value="0">未审核</Select.Option>
64
-              </Select>
50
+            props.form.getFieldDecorator('remark')(
51
+              <Radio.Group>
52
+                <Radio value="不认识的人的手机号" style={blockRadio}>不认识的人的手机号</Radio>
53
+                <Radio value="其他原因需要沟通" style={blockRadio}>其他原因需要沟通</Radio>
54
+              </Radio.Group>
65
             )
55
             )
66
           }
56
           }
67
         </Form.Item>
57
         </Form.Item>

+ 32
- 13
src/pages/property/proprietor/components/Edit.jsx Parādīt failu

1
 import React, { useEffect } from 'react'
1
 import React, { useEffect } from 'react'
2
-import { Form, Select, Button, Modal } from 'antd'
2
+import { Form, Select, Button, Modal, Radio } from 'antd'
3
 
3
 
4
 const formItemLayout = {
4
 const formItemLayout = {
5
   labelCol: {
5
   labelCol: {
25
   },
25
   },
26
 }
26
 }
27
 
27
 
28
+const blockRadio = {
29
+  display: 'block',
30
+  height: '30px',
31
+  lineHeight: '30px',
32
+}
33
+
28
 export default Form.create()(props => {
34
 export default Form.create()(props => {
29
 
35
 
30
   const handleSubmit = e => {
36
   const handleSubmit = e => {
31
     e.preventDefault()
37
     e.preventDefault()
32
     props.form.validateFields((err, values) => {
38
     props.form.validateFields((err, values) => {
33
       if (!err) {
39
       if (!err) {
34
-        props.onSubmit(values)
40
+        props.onSubmit({
41
+          status: userData.status,
42
+          ...values,
43
+        })
35
       }
44
       }
36
     })
45
     })
37
   }
46
   }
38
 
47
 
39
-  useEffect(() => {
40
-    // props.setFieldsValue()
41
-  }, [])
42
-
43
   return (
48
   return (
44
     <Modal footer={null} maskClosable={false} onCancel={props.onCancel} visible={props.visible}>
49
     <Modal footer={null} maskClosable={false} onCancel={props.onCancel} visible={props.visible}>
45
       <Form {...formItemLayout} onSubmit={handleSubmit}>
50
       <Form {...formItemLayout} onSubmit={handleSubmit}>
54
             )
59
             )
55
           }
60
           }
56
         </Form.Item>
61
         </Form.Item>
57
-        <Form.Item label="审核状态">
62
+        {          
63
+          userData.verifyStatus !== '1' && (
64
+            <Form.Item label="审核状态">
65
+              {
66
+                props.form.getFieldDecorator('status')(
67
+                  <Select>
68
+                    <Select.Option key="1" value="1">审核通过</Select.Option>
69
+                    <Select.Option key="2" value="2">审核未通过</Select.Option>
70
+                    <Select.Option key="0" value="0">未审核</Select.Option>
71
+                  </Select>
72
+                )
73
+              }
74
+            </Form.Item>
75
+          )
76
+        }
77
+        <Form.Item label="不通过原因">
58
           {
78
           {
59
-            props.form.getFieldDecorator('verifyStatus')(
60
-              <Select>
61
-                <Select.Option key="1" value="1">审核通过</Select.Option>
62
-                <Select.Option key="2" value="2">审核未通过</Select.Option>
63
-                <Select.Option key="0" value="0">未审核</Select.Option>
64
-              </Select>
79
+            props.form.getFieldDecorator('remark')(
80
+              <Radio.Group>
81
+                <Radio value="不认识的人的手机号" style={blockRadio}>不认识的人的手机号</Radio>
82
+                <Radio value="其他原因需要沟通" style={blockRadio}>其他原因需要沟通</Radio>
83
+              </Radio.Group>
65
             )
84
             )
66
           }
85
           }
67
         </Form.Item>
86
         </Form.Item>

+ 98
- 69
src/pages/property/proprietor/index.jsx Parādīt failu

1
 import React, { useState, useEffect } from 'react'
1
 import React, { useState, useEffect } from 'react'
2
-import { Select, Spin, Table, Button, Form, Input, Icon } from 'antd'
2
+import { Select, Spin, Table, Button, Form, Input, Icon, Modal } from 'antd'
3
 import NavLink from 'umi/navlink'
3
 import NavLink from 'umi/navlink'
4
-import { fetch, apis } from '@/utils/request'
4
+import { fetch, fetchList, apis } from '@/utils/request'
5
 import Search from '../components/Search'
5
 import Search from '../components/Search'
6
 import List from '../components/List'
6
 import List from '../components/List'
7
 
7
 
10
 const fetchUnitList = fetch(apis.buildingOwnerInfo.getUnitList)
10
 const fetchUnitList = fetch(apis.buildingOwnerInfo.getUnitList)
11
 const fetchLevelList = fetch(apis.buildingOwnerInfo.getLevelList)
11
 const fetchLevelList = fetch(apis.buildingOwnerInfo.getLevelList)
12
 const fetchRoomNoList = fetch(apis.buildingOwnerInfo.getRoomNoList)
12
 const fetchRoomNoList = fetch(apis.buildingOwnerInfo.getRoomNoList)
13
+const buildingInfoList = fetch(apis.buildingOwnerInfo.buildingList)
14
+const deleteBuilding = fetch(apis.buildingOwnerInfo.deleteBuilding)
13
 
15
 
14
 const Condition = props => {
16
 const Condition = props => {
15
   const [phaseList, setPhaseList] = useState([])
17
   const [phaseList, setPhaseList] = useState([])
142
 export default props => {
144
 export default props => {
143
   const [loading, setLoading] = useState(false)
145
   const [loading, setLoading] = useState(false)
144
   const [listData, setListData] = useState([])
146
   const [listData, setListData] = useState([])
147
+  const [pagination, setPagination] = useState({})
148
+  const [queryParams, setQueryParams] = useState({ pageNum: 1, pageSize: 10 })
145
 
149
 
146
-  const handleSearch = () => {
147
-
150
+  const handleSearch = (vals) => {
151
+    setQueryParams({
152
+      ...vals,      
153
+      pageNum: 1,
154
+      pageSize: queryParams.pageSize,
155
+    })
148
   }
156
   }
149
 
157
 
150
   const handleDeleteRow = row => {
158
   const handleDeleteRow = row => {
151
-
159
+    deleteBuilding({ data: [row.id] }).then(res => {
160
+      Modal.success({
161
+        content: '数据参数成功',
162
+        onOk: () => {
163
+          window.location.reload()
164
+        }
165
+      })
166
+    })
152
   }
167
   }
153
 
168
 
154
   const handlePageChange = (pageNum, pageSize) => {
169
   const handlePageChange = (pageNum, pageSize) => {
155
-
170
+    setQueryParams({
171
+      ...queryParams,      
172
+      pageNum,
173
+      pageSize,
174
+    })
156
   }
175
   }
157
 
176
 
177
+  useEffect(() => {
178
+    setLoading(true)
179
+    buildingInfoList({ data: queryParams }).then(res => {
180
+      const { records, ...pageInfo } = res || {}
181
+      setListData(records)
182
+      setPagination(pageInfo)
183
+      setLoading(false)
184
+    }).catch(() => setLoading(false))
185
+  }, [queryParams])
186
+
158
   return (
187
   return (
159
     <div>
188
     <div>
160
       <Condition onSearch={handleSearch} onReset={handleSearch} />
189
       <Condition onSearch={handleSearch} onReset={handleSearch} />
162
         <NavLink to={`/property/proprietor/add`}>
191
         <NavLink to={`/property/proprietor/add`}>
163
           <Button type="primary">添加</Button>
192
           <Button type="primary">添加</Button>
164
         </NavLink>
193
         </NavLink>
165
-        <Button type="link"><Icon type="upload"/>批量导入业主资料</Button>
194
+        <NavLink to={`/property/proprietor/batch`}>
195
+          <Button type="link"><Icon type="upload"/>批量导入业主资料</Button>
196
+        </NavLink>
166
       </div>
197
       </div>
167
-      <Spin spinning={loading}>
168
-        <List dataSource={listData} onPageChange={handlePageChange} rowKey="userVerifyId">
169
-          <Table.Column title="编号" dataIndex="userVerifyId" key="userVerifyId" />
170
-          <Table.Column
171
-            title="姓名"
172
-            dataIndex="ownerName"
173
-            key="ownerName"
174
-            render={(_, row) => {
175
-              return (
176
-                <NavLink to={`/xxx?id=${row.userVerifyId}`}>
177
-                  <Button type="link">{row.ownerName}</Button>
178
-                </NavLink>
179
-              )
180
-            }}
181
-          />
182
-          <Table.Column title="手机号" dataIndex="ownerTel" key="ownerTel" />
183
-          <Table.Column title="身份证" dataIndex="idCard" key="idCard" />
184
-          <Table.Column
185
-            title="房间号"
186
-            dataIndex="roomNoName"
187
-            key="roomNoName"
188
-            render={(_, row) => {
189
-              return (
190
-                <span>
191
-                  {row.phaseName + row.buildingName + row.unitName + row.levelName + row.roomNoName}
192
-                </span>
193
-              )
194
-            }}
195
-          />
196
-          <Table.Column title="身份" dataIndex="roleName" key="roleName" />
197
-          <Table.Column
198
-            title="审核状态"
199
-            dataIndex="verifyStatus"
200
-            key="verifyStatus"
201
-            render={(_, row) => {
202
-              return (
203
-                <span>
204
-                  {verifyStatusDict[row.verifyStatus] || ''}
205
-                </span>
206
-              )
207
-            }}
208
-          />
209
-          <Table.Column title="编辑人" dataIndex="updateName" key="updateName" />
210
-          <Table.Column title="编辑时间" dataIndex="createDate" key="createDate" />
211
-          <Table.Column
212
-            title="操作"
213
-            key="action"
214
-            render={(_, row) => {
215
-              return (
216
-                <Popconfirm
217
-                  title="确认进行删除操作?"
218
-                  onConfirm={() => handleDeleteRow(row)}
219
-                  okText="删除"
220
-                  cancelText="取消"
221
-                >
222
-                  <Button type="link">删除</Button>
223
-                </Popconfirm>
224
-              )
225
-            }}
226
-          />
227
-        </List>
228
-      </Spin>
198
+      <List dataSource={listData} loading={loading} onPageChange={handlePageChange} pagination={pagination} rowKey="userVerifyId">
199
+        <Table.Column title="编号" dataIndex="userVerifyId" key="userVerifyId" />
200
+        <Table.Column
201
+          title="姓名"
202
+          dataIndex="ownerName"
203
+          key="ownerName"
204
+          render={(_, row) => {
205
+            return (
206
+              <NavLink to={`/property/proprietor/detail?id=${row.userVerifyId}`}>
207
+                <Button type="link">{row.ownerName}</Button>
208
+              </NavLink>
209
+            )
210
+          }}
211
+        />
212
+        <Table.Column title="手机号" dataIndex="ownerTel" key="ownerTel" />
213
+        <Table.Column title="身份证" dataIndex="idCard" key="idCard" />
214
+        <Table.Column
215
+          title="房间号"
216
+          dataIndex="roomNoName"
217
+          key="roomNoName"
218
+          render={(_, row) => {
219
+            return (
220
+              <span>
221
+                {row.phaseName + row.buildingName + row.unitName + row.levelName + row.roomNoName}
222
+              </span>
223
+            )
224
+          }}
225
+        />
226
+        <Table.Column title="身份" dataIndex="roleName" key="roleName" />
227
+        <Table.Column
228
+          title="审核状态"
229
+          dataIndex="verifyStatus"
230
+          key="verifyStatus"
231
+          render={(_, row) => {
232
+            return (
233
+              <span>
234
+                {verifyStatusDict[row.verifyStatus] || ''}
235
+              </span>
236
+            )
237
+          }}
238
+        />
239
+        <Table.Column title="编辑人" dataIndex="updateName" key="updateName" />
240
+        <Table.Column title="编辑时间" dataIndex="createDate" key="createDate" />
241
+        <Table.Column
242
+          title="操作"
243
+          key="action"
244
+          render={(_, row) => {
245
+            return (
246
+              <Popconfirm
247
+                title="确认进行删除操作?"
248
+                onConfirm={() => handleDeleteRow(row)}
249
+                okText="删除"
250
+                cancelText="取消"
251
+              >
252
+                <Button type="link">删除</Button>
253
+              </Popconfirm>
254
+            )
255
+          }}
256
+        />
257
+      </List>
229
 
258
 
230
     </div>
259
     </div>
231
   )
260
   )

+ 2
- 2
src/services/buildingOwnerInfo_api.js Parādīt failu

88
 
88
 
89
     // 根据楼栋信息 id 查询
89
     // 根据楼栋信息 id 查询
90
     getByIdBuildingId: {
90
     getByIdBuildingId: {
91
-      url: `${prefix}/${moduleName}/verify/:buildingId`,
91
+      url: `${prefix}/${moduleName}/verify/:id`,
92
       method: 'get',
92
       method: 'get',
93
       action: `admin.${moduleName}.verify`
93
       action: `admin.${moduleName}.verify`
94
     },
94
     },
144
 
144
 
145
     // 楼栋详情审核用户
145
     // 楼栋详情审核用户
146
     verifyinfoAdd: {
146
     verifyinfoAdd: {
147
-      url: `${prefix}/${moduleName}/user/verifyinfo/:userVerifyId`,
147
+      url: `${prefix}/${moduleName}/user/verifyinfo/:id`,
148
       method: 'put',
148
       method: 'put',
149
       action: `admin.${moduleName}.user.verifyinfo`
149
       action: `admin.${moduleName}.user.verifyinfo`
150
     },
150
     },