张延森 4 anos atrás
pai
commit
c808220934

+ 101
- 0
src/pages/property/proprietor/Audit.jsx Ver arquivo

@@ -0,0 +1,101 @@
1
+import React from 'react'
2
+import { Spin, Button, Form, Input, Popconfirm,  } from 'antd'
3
+import { fetch, fetchList, apis } from '@/utils/request'
4
+import Search from '../components/Search'
5
+import List from '../components/List'
6
+
7
+const Condition = props => {
8
+  return (
9
+    <Search
10
+      onSearch={props.onSearch}
11
+      onReset={props.onReset}
12
+      render={form => {
13
+        const { getFieldDecorator } = form
14
+
15
+        return (
16
+          <>
17
+            <Form.Item label="姓名">
18
+            {
19
+              getFieldDecorator('ownerName')(<Input style={{ width: '160px' }} placeholder="姓名" />)
20
+            }
21
+            </Form.Item>
22
+            <Form.Item label="手机号">
23
+            {
24
+              getFieldDecorator('ownerTel')(<Input style={{ width: '160px' }} placeholder="手机号" />)
25
+            }
26
+            </Form.Item>
27
+            <Form.Item label="身份证">
28
+            {
29
+              getFieldDecorator('idCard')(<Input style={{ width: '200px' }} placeholder="身份证" />)
30
+            }
31
+            </Form.Item>
32
+          </>
33
+        )
34
+      }}
35
+    />
36
+  )
37
+}
38
+
39
+const propRole = {
40
+  1: '户主',
41
+  2: '租客',
42
+  3: '家属'
43
+}
44
+
45
+const userVerifyAll = fetchList(apis.propUser.userVerifyAll)
46
+const userVerifyAudit = fetch(apis.propUser.userVerifyAudit)
47
+
48
+export default props => {
49
+  const [loading, setLoading] = useState(false)
50
+  const [listData, setListData] = useState([])
51
+
52
+  const handleSearch = vals => {}
53
+
54
+  const handleDeleteRow = row => {}
55
+
56
+  return (
57
+    <div>
58
+      <Condition onSearch={handleSearch} onSearch={handleSearch} />
59
+      <div>
60
+        <p style={{color: '#888'}}>注意,审核后无法修改审核结果,请仔细确认</p>
61
+      </div>
62
+      <Spin spinning={loading}>
63
+        <List dataSource={listData} rowKey="id">
64
+          <Table.Column title="姓名" dataIndex="userName" key="userName" />
65
+          <Table.Column title="手机号" dataIndex="phone" key="phone" />
66
+          <Table.Column title="身份证" dataIndex="idCard" key="idCard" />
67
+          <Table.Column title="性别" dataIndex="gender" key="gender" render={x => x === '1' ? '男' : '女'} />
68
+          <Table.Column
69
+            title="房产"
70
+            dataIndex="address"
71
+            key="address"
72
+            render={(_, row) => row.phaseName + row.buildingName + row.unitName + row.levelName + row.roomNoName}
73
+          />
74
+          <Table.Column title="角色" dataIndex="roleId" key="roleId" render={x => propRole[x]} />
75
+          <Table.Column title="提交时间" dataIndex="createDate" key="createDate" />
76
+          <Table.Column
77
+            title="操作"
78
+            key="action"
79
+            render={(_, row) => {
80
+              return (
81
+                <>
82
+                  <Popconfirm
83
+                    title="确认进行删除操作?"
84
+                    onConfirm={() => handleDeleteRow(row)}
85
+                    okText="删除"
86
+                    cancelText="取消"
87
+                  >
88
+                    <Button type="link">删除</Button>
89
+                  </Popconfirm>
90
+                  <Divider type="vertical" />
91
+                  <Button type="link">审核通过</Button>
92
+                  <Button type="link">审核不通过</Button>
93
+                </>
94
+              )
95
+            }}
96
+          />
97
+        </List>
98
+      </Spin>
99
+    </div>
100
+  )
101
+}

+ 10
- 1
src/pages/property/proprietor/Detail.jsx Ver arquivo

@@ -1,10 +1,14 @@
1 1
 import React, { useState } from 'react'
2 2
 import { Button, Descriptions } from 'antd'
3 3
 import Section from './components/Section'
4
+import Edit from './components/Edit'
4 5
 
5 6
 export default props => {
7
+  const [editorShow, setEditorShow] = useState(false)
6 8
   const [roomName, setRoomName] = useState('1期1号楼1单元13层1331')
7 9
 
10
+  const handleEdit = () => {}
11
+
8 12
   return (
9 13
     <div>
10 14
       <Section title="基本信息">
@@ -20,7 +24,7 @@ export default props => {
20 24
           </Descriptions.Item>
21 25
         </Descriptions>
22 26
       </Section>
23
-      <Section title="在当前房屋" subTitle={roomName} action={<Button type="link">修改</Button>}>
27
+      <Section title="在当前房屋" subTitle={roomName} action={<Button type="link" onClick={() => setEditorShow(true)}>修改</Button>}>
24 28
         <Descriptions column={3}>
25 29
           <Descriptions.Item label="身份">户主</Descriptions.Item>
26 30
           <Descriptions.Item label="审核状态">未审核</Descriptions.Item>
@@ -38,6 +42,11 @@ export default props => {
38 42
         或者联系荟房网络运营人员核实后修改,因为此手机号可能在其他社区在用。
39 43
         若想修改成员为其他成员的手机号,请删除此成员后添加新成员。 
40 44
       </p>
45
+      <Edit
46
+        visible={editorShow}
47
+        onSubmit={handleEdit}
48
+        onCancel={() => setEditorShow(false)}
49
+      />
41 50
     </div>
42 51
   )
43 52
 }

+ 75
- 0
src/pages/property/proprietor/components/AuditNot.jsx Ver arquivo

@@ -0,0 +1,75 @@
1
+import React, { useEffect } from 'react'
2
+import { Form, Select, Button, Modal } from 'antd'
3
+
4
+const formItemLayout = {
5
+  labelCol: {
6
+    xs: { span: 24 },
7
+    sm: { span: 6 },
8
+  },
9
+  wrapperCol: {
10
+    xs: { span: 24 },
11
+    sm: { span: 12 },
12
+  },
13
+}
14
+
15
+const tailFormItemLayout = {
16
+  wrapperCol: {
17
+    xs: {
18
+      span: 24,
19
+      offset: 0,
20
+    },
21
+    sm: {
22
+      span: 16,
23
+      offset: 6,
24
+    },
25
+  },
26
+}
27
+
28
+export default Form.create()(props => {
29
+
30
+  const handleSubmit = e => {
31
+    e.preventDefault()
32
+    props.form.validateFields((err, values) => {
33
+      if (!err) {
34
+        props.onSubmit(values)
35
+      }
36
+    })
37
+  }
38
+
39
+  useEffect(() => {
40
+    // props.setFieldsValue()
41
+  }, [])
42
+
43
+  return (
44
+    <Modal footer={null} maskClosable={false} onCancel={props.onCancel} visible={props.visible}>
45
+      <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="审核状态">
58
+          {
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>
65
+            )
66
+          }
67
+        </Form.Item>
68
+        <Form.Item {...tailFormItemLayout}>
69
+          <Button type="primary" htmlType="submit">确定</Button>
70
+          <Button onClick={props.onCancel} style={{ marginLeft: '48px' }}>取消</Button>
71
+        </Form.Item>
72
+      </Form>
73
+    </Modal>
74
+  )
75
+})

+ 75
- 0
src/pages/property/proprietor/components/Edit.jsx Ver arquivo

@@ -0,0 +1,75 @@
1
+import React, { useEffect } from 'react'
2
+import { Form, Select, Button, Modal } from 'antd'
3
+
4
+const formItemLayout = {
5
+  labelCol: {
6
+    xs: { span: 24 },
7
+    sm: { span: 6 },
8
+  },
9
+  wrapperCol: {
10
+    xs: { span: 24 },
11
+    sm: { span: 12 },
12
+  },
13
+}
14
+
15
+const tailFormItemLayout = {
16
+  wrapperCol: {
17
+    xs: {
18
+      span: 24,
19
+      offset: 0,
20
+    },
21
+    sm: {
22
+      span: 16,
23
+      offset: 6,
24
+    },
25
+  },
26
+}
27
+
28
+export default Form.create()(props => {
29
+
30
+  const handleSubmit = e => {
31
+    e.preventDefault()
32
+    props.form.validateFields((err, values) => {
33
+      if (!err) {
34
+        props.onSubmit(values)
35
+      }
36
+    })
37
+  }
38
+
39
+  useEffect(() => {
40
+    // props.setFieldsValue()
41
+  }, [])
42
+
43
+  return (
44
+    <Modal footer={null} maskClosable={false} onCancel={props.onCancel} visible={props.visible}>
45
+      <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="审核状态">
58
+          {
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>
65
+            )
66
+          }
67
+        </Form.Item>
68
+        <Form.Item {...tailFormItemLayout}>
69
+          <Button type="primary" htmlType="submit">确定</Button>
70
+          <Button onClick={props.onCancel} style={{ marginLeft: '48px' }}>取消</Button>
71
+        </Form.Item>
72
+      </Form>
73
+    </Modal>
74
+  )
75
+})

+ 1
- 1
src/pages/property/proprietor/index.jsx Ver arquivo

@@ -22,7 +22,7 @@ const Condition = props => {
22 22
     // getPhaseList()
23 23
   }, [])
24 24
 
25
-  return (    
25
+  return (
26 26
     <Search
27 27
       onSearch={props.onSearch}
28 28
       onReset={props.onReset}

+ 4
- 2
src/services/apis.js Ver arquivo

@@ -1,6 +1,7 @@
1 1
 import { APIBaseURL, AMapAPIPrefix } from '../utils/constant'
2
-import bill from './bill'
3
-import buildingOwnerInfo from './buildingOwnerInfo'
2
+import bill from './bill_api'
3
+import buildingOwnerInfo from './buildingOwnerInfo_api'
4
+import propUser from './prop_user_api'
4 5
 
5 6
 const prefix = `${APIBaseURL}api/admin`
6 7
 
@@ -10,6 +11,7 @@ const amapPrefix = AMapAPIPrefix
10 11
 
11 12
 export default {
12 13
   bill: bill(prefix),
14
+  propUser: propUser(prefix),
13 15
   buildingOwnerInfo: buildingOwnerInfo(prefix),
14 16
   image: {
15 17
     uploadForAnt: {

src/services/bill.js → src/services/bill_api.js Ver arquivo


src/services/buildingOwnerInfo.js → src/services/buildingOwnerInfo_api.js Ver arquivo


+ 16
- 0
src/services/prop_user_api.js Ver arquivo

@@ -0,0 +1,16 @@
1
+
2
+export default prefix => {
3
+  return {
4
+    // 获取审核列表
5
+    userVerifyAll: {
6
+      url: `${prefix}/user/verify/all`,
7
+      method: 'get',
8
+    },
9
+
10
+    // 审核用户
11
+    userVerifyAudit: {
12
+      url: `${prefix}/user/verify/audit/:id`,
13
+      method: 'put',
14
+    }
15
+  }
16
+}