authExamine.jsx 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. import React from 'react';
  2. import { Button, Input, Select, Spin, Table, Switch, message, DatePicker } from 'antd';
  3. import $ from 'jquery/src/ajax';
  4. import moment from 'moment';
  5. import './techDemand.less';
  6. import TechDemandDesc from './authDesc.jsx';
  7. import {industry} from '@/dataDic.js';
  8. import { getIndustry } from '@/tools.js';
  9. const DemandList = React.createClass({
  10. loadData(pageNo) {
  11. this.state.data = [];
  12. this.setState({
  13. selectedRowKeys:[],
  14. loading: true
  15. });
  16. $.ajax({
  17. method: "get",
  18. dataType: "json",
  19. crossDomain: false,
  20. url: globalConfig.context + "/api/user/getExpertAuditList",
  21. data: {
  22. pageNo: pageNo || 1,
  23. pageSize: this.state.pagination.pageSize,
  24. username: this.state.nameSearch,
  25. industry:this.state.demandTypeSearch,
  26. expert: this.state.statusSearch,
  27. expertAudit:'1'
  28. },
  29. success: function (data) {
  30. let theArr = [];
  31. if (!data.data || !data.data.list) {
  32. if (data.error && data.error.length) {
  33. message.warning(data.error[0].message);
  34. };
  35. } else {
  36. for (let i = 0; i < data.data.list.length; i++) {
  37. let thisdata = data.data.list[i];
  38. theArr.push({
  39. key: i,
  40. id: thisdata.id,
  41. uid:thisdata.uid,
  42. serialNumber: thisdata.serialNumber,
  43. identifyName: thisdata.username,
  44. mobile: thisdata.contactMobile,
  45. industry: thisdata.industry,
  46. expert:thisdata.expert,
  47. });
  48. };
  49. }
  50. this.state.pagination.current = data.data.pageNo;
  51. this.state.pagination.total = data.data.totalCount;
  52. if(data.data&&data.data.list&&!data.data.list.length){
  53. this.state.pagination.current=0
  54. this.state.pagination.total=0
  55. }
  56. this.setState({
  57. dataSource: theArr,
  58. pagination: this.state.pagination
  59. });
  60. }.bind(this),
  61. }).always(function () {
  62. this.setState({
  63. loading: false
  64. });
  65. }.bind(this));
  66. },
  67. getInitialState() {
  68. return {
  69. searchMore: true,
  70. validityPeriodDate: [],
  71. releaseDate: [],
  72. selectedRowKeys: [],
  73. selectedRows: [],
  74. loading: false,
  75. pagination: {
  76. defaultCurrent: 1,
  77. defaultPageSize: 10,
  78. showQuickJumper: true,
  79. pageSize: 10,
  80. onChange: function (page) {
  81. this.loadData(page);
  82. }.bind(this),
  83. showTotal: function (total) {
  84. return '共' + total + '条数据';
  85. }
  86. },
  87. columns: [
  88. {
  89. title: '编号',
  90. dataIndex: 'serialNumber',
  91. key: 'serialNumber',
  92. }, {
  93. title: '姓名',
  94. dataIndex: 'identifyName',
  95. key: 'identifyName',
  96. render:text=>{
  97. return text&&text.length>16?text.substr(0,16)+'...':text
  98. }
  99. },
  100. {
  101. title: '手机号码',
  102. dataIndex: 'mobile',
  103. key: 'mobile',
  104. },
  105. {
  106. title: '行业',
  107. dataIndex: 'industry',
  108. key: 'industry',
  109. render: (text) => { return getIndustry(text); }
  110. },
  111. {
  112. title: '认证类型',
  113. dataIndex: 'expert',
  114. key: 'expert',
  115. render: text => { return text=='1'?'专家认证':text=='2'?'顾问认证':'未认证' }
  116. },
  117. {
  118. title: '认证审核',
  119. dataIndex: 'caozuo',
  120. key: 'caozuo',
  121. render:(text,recard) => {
  122. return <div className="btnRight">
  123. <Button type="primary" onClick={(e)=>{e.stopPropagation();this.tableRowClick(recard)}}>审核</Button>
  124. </div>
  125. }
  126. }
  127. ],
  128. dataSource: [],
  129. searchTime: [,]
  130. };
  131. },
  132. componentWillMount() {
  133. let theArr = [];
  134. industry.map(function (item) {
  135. theArr.push(
  136. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  137. )
  138. });
  139. this.state.demandTypeOption = theArr;
  140. this.loadData();
  141. },
  142. tableRowClick(record, index) {
  143. this.state.RowData = record;
  144. this.setState({
  145. showDesc: true,
  146. examineState:true
  147. });
  148. },
  149. closeDesc(e, s) {
  150. this.state.showDesc = e;
  151. if (s) {
  152. if(this.state.pagination.total%10==1){
  153. this.loadData((this.state.page)-1);
  154. }else{
  155. this.loadData(this.state.page);
  156. }
  157. };
  158. },
  159. search() {
  160. this.loadData();
  161. },
  162. reset() {
  163. this.state.nameSearch = '';
  164. this.state.demandTypeSearch = undefined;
  165. this.state.statusSearch = undefined;
  166. this.loadData();
  167. },
  168. searchSwitch() {
  169. this.setState({
  170. searchMore: !this.state.searchMore
  171. });
  172. },
  173. render() {
  174. const rowSelection = {
  175. selectedRowKeys: this.state.selectedRowKeys,
  176. onChange: (selectedRowKeys, selectedRows) => {
  177. this.setState({
  178. selectedRows: selectedRows.slice(-1),
  179. selectedRowKeys: selectedRowKeys.slice(-1)
  180. });
  181. }
  182. };
  183. const hasSelected = this.state.selectedRowKeys.length > 0;
  184. const { RangePicker } = DatePicker;
  185. return (
  186. <div className="user-content" >
  187. <div className="content-title">
  188. <span>专家顾问认证审核</span>
  189. </div>
  190. <div className="user-search">
  191. <Input placeholder="姓名"
  192. value={this.state.nameSearch}
  193. onChange={(e) => { this.setState({ nameSearch: e.target.value }); }} />
  194. <Select placeholder="行业"
  195. style={{ width: 120 }}
  196. value={this.state.demandTypeSearch}
  197. onChange={(e) => { this.setState({ demandTypeSearch: e }) }}>
  198. {this.state.demandTypeOption}
  199. </Select>
  200. <Select placeholder="认证类型" style={{ width: 160 }}
  201. value={this.state.statusSearch}
  202. onChange={(e) => { this.setState({ statusSearch: e }) }}>
  203. <Select.Option value="0" >专家认证</Select.Option>
  204. <Select.Option value="1" >顾问认证</Select.Option>
  205. </Select>
  206. <Button type="primary" onClick={this.search}>搜索</Button>
  207. <Button onClick={this.reset}>重置</Button>
  208. </div>
  209. <div className="patent-table">
  210. <Spin spinning={this.state.loading}>
  211. <Table columns={this.state.columns}
  212. dataSource={this.state.dataSource}
  213. rowSelection={rowSelection}
  214. pagination={this.state.pagination}
  215. />
  216. </Spin>
  217. </div>
  218. <TechDemandDesc
  219. data={this.state.RowData}
  220. demandTypeOption={this.state.demandTypeOption}
  221. examineState={this.state.examineState}
  222. showDesc={this.state.showDesc}
  223. closeDesc={this.closeDesc} />
  224. </div >
  225. );
  226. }
  227. });
  228. export default DemandList;