index.jsx 6.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. import React, { useState, useEffect } from 'react'
  2. import { Select, Spin, Table, Button, Form, Input } from 'antd'
  3. import NavLink from 'umi/navlink'
  4. import { fetchList, apis } from '@/utils/request'
  5. import Search from '../components/Search'
  6. import List from '../components/List'
  7. const fetchPhaseList = fetchList(apis.buildingOwnerInfo.getPhaseList)
  8. const fetchBuildingList = fetchList(apis.buildingOwnerInfo.getBuildingList)
  9. const fetchUnitList = fetchList(apis.buildingOwnerInfo.getUnitList)
  10. const fetchLevelList = fetchList(apis.buildingOwnerInfo.getLevelList)
  11. const fetchRoomNoList = fetchList(apis.buildingOwnerInfo.getRoomNoList)
  12. const Condition = props => {
  13. const [phaseList, setPhaseList] = useState([])
  14. const [buildingList, setBuildingList] = useState([])
  15. const [unitList, setUnitList] = useState([])
  16. const [levelList, setLevelList] = useState([])
  17. const [roomNoList, setRoomNoList] = useState([])
  18. useEffect(() => {
  19. // getPhaseList()
  20. }, [])
  21. return (
  22. <Search
  23. onSearch={props.onSearch}
  24. onReset={props.onReset}
  25. render={form => {
  26. const { getFieldDecorator, setFieldsValue } = form
  27. const getPhaseList = () => {}
  28. const getBuildingList = () => {}
  29. const getUnitList = () => {}
  30. const getLevelList = () => {}
  31. const getRoomNoList = () => {}
  32. return (
  33. <>
  34. <Form.Item>
  35. {
  36. getFieldDecorator('phaseId')(
  37. <Select onChange={getBuildingList} style={{ minWidth: '120px' }} placeholder="期/区">
  38. {
  39. phaseList.map(x => (<Select.Option key={x.id} value={x.id}>{x.name}</Select.Option>))
  40. }
  41. </Select>
  42. )
  43. }
  44. </Form.Item>
  45. <Form.Item>
  46. {
  47. getFieldDecorator('buildingId')(
  48. <Select onChange={getUnitList} style={{ minWidth: '120px' }} placeholder="栋">
  49. {
  50. buildingList.map(x => (<Select.Option key={x.id} value={x.id}>{x.name}</Select.Option>))
  51. }
  52. </Select>
  53. )
  54. }
  55. </Form.Item>
  56. <Form.Item>
  57. {
  58. getFieldDecorator('unitId')(
  59. <Select onChange={getLevelList} style={{ minWidth: '120px' }} placeholder="单元">
  60. {
  61. unitList.map(x => (<Select.Option key={x.id} value={x.id}>{x.name}</Select.Option>))
  62. }
  63. </Select>
  64. )
  65. }
  66. </Form.Item>
  67. <Form.Item>
  68. {
  69. getFieldDecorator('levelId')(
  70. <Select onChange={getRoomNoList} style={{ minWidth: '120px' }} placeholder="楼层">
  71. {
  72. levelList.map(x => (<Select.Option key={x.id} value={x.id}>{x.name}</Select.Option>))
  73. }
  74. </Select>
  75. )
  76. }
  77. </Form.Item>
  78. <Form.Item>
  79. {
  80. getFieldDecorator('roomNoId')(
  81. <Select style={{ minWidth: '120px' }} placeholder="户号">
  82. {
  83. roomNoList.map(x => (<Select.Option key={x.id} value={x.id}>{x.name}</Select.Option>))
  84. }
  85. </Select>
  86. )
  87. }
  88. </Form.Item>
  89. <Form.Item>
  90. {
  91. getFieldDecorator('ownerName')(<Input style={{ width: '160px' }} placeholder="姓名" />)
  92. }
  93. </Form.Item>
  94. <Form.Item>
  95. {
  96. getFieldDecorator('ownerTel')(<Input style={{ width: '160px' }} placeholder="手机号" />)
  97. }
  98. </Form.Item>
  99. <Form.Item>
  100. {
  101. getFieldDecorator('idCard')(<Input style={{ width: '200px' }} placeholder="身份证" />)
  102. }
  103. </Form.Item>
  104. </>
  105. )
  106. }}
  107. />
  108. )
  109. }
  110. const verifyStatusDict = {
  111. '0': '未审核',
  112. '1': '审核通过',
  113. '2': '审核不通过'
  114. }
  115. export default props => {
  116. const [loading, setLoading] = useState(false)
  117. const [listData, setListData] = useState([])
  118. const handleSearch = () => {
  119. }
  120. const handleDeleteRow = row => {
  121. }
  122. const handlePageChange = (pageNum, pageSize) => {
  123. }
  124. return (
  125. <div>
  126. <Condition onSearch={handleSearch} onReset={handleSearch} />
  127. <div style={{ margin: '24px 0' }}>
  128. <NavLink to={`/xxx`}>
  129. <Button type="primary">添加</Button>
  130. </NavLink>
  131. <Button style={{ marginLeft: '24px' }}>批量导入业主资料</Button>
  132. </div>
  133. <Spin spinning={loading}>
  134. <List dataSource={listData} onPageChange={handlePageChange} rowKey="userVerifyId">
  135. <Table.Column title="编号" dataIndex="userVerifyId" key="userVerifyId" />
  136. <Table.Column
  137. title="姓名"
  138. dataIndex="ownerName"
  139. key="ownerName"
  140. render={(_, row) => {
  141. return (
  142. <NavLink to={`/xxx?id=${row.userVerifyId}`}>
  143. <Button type="link">{row.ownerName}</Button>
  144. </NavLink>
  145. )
  146. }}
  147. />
  148. <Table.Column title="手机号" dataIndex="ownerTel" key="ownerTel" />
  149. <Table.Column title="身份证" dataIndex="idCard" key="idCard" />
  150. <Table.Column
  151. title="房间号"
  152. dataIndex="roomNoName"
  153. key="roomNoName"
  154. render={(_, row) => {
  155. return (
  156. <span>
  157. {row.phaseName + row.buildingName + row.unitName + row.levelName + row.roomNoName}
  158. </span>
  159. )
  160. }}
  161. />
  162. <Table.Column title="身份" dataIndex="roleName" key="roleName" />
  163. <Table.Column
  164. title="审核状态"
  165. dataIndex="verifyStatus"
  166. key="verifyStatus"
  167. render={(_, row) => {
  168. return (
  169. <span>
  170. {verifyStatusDict[row.verifyStatus] || ''}
  171. </span>
  172. )
  173. }}
  174. />
  175. <Table.Column title="编辑人" dataIndex="updateName" key="updateName" />
  176. <Table.Column title="编辑时间" dataIndex="createDate" key="createDate" />
  177. <Table.Column
  178. title="操作"
  179. key="action"
  180. render={(_, row) => {
  181. return (
  182. <Popconfirm
  183. title="确认进行删除操作?"
  184. onConfirm={() => handleDeleteRow(row)}
  185. okText="删除"
  186. cancelText="取消"
  187. >
  188. <Button type="link">删除</Button>
  189. </Popconfirm>
  190. )
  191. }}
  192. />
  193. </List>
  194. </Spin>
  195. </div>
  196. )
  197. }