authExamine.jsx 8.9 KB

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