import React from 'react'; import { Button, Input, Select, Spin, Table, Switch, message, DatePicker } from 'antd'; import $ from 'jquery/src/ajax'; import moment from 'moment'; import './techDemand.less'; import TechDemandDesc from './authDesc.jsx'; import {industry} from '@/dataDic.js'; import { getIndustry } from '@/tools.js'; const DemandList = React.createClass({ loadData(pageNo) { this.state.data = []; this.setState({ selectedRowKeys:[], loading: true }); $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/getExpertAuditList", data: { pageNo: pageNo || 1, pageSize: this.state.pagination.pageSize, identifyName: this.state.nameSearch, industry:this.state.demandTypeSearch, auditStatus:'1', expert: this.state.statusSearch?this.state.statusSearch=='1'?this.state.statusSearch:'2':'', consultantType:this.state.statusSearch=='3'?'4':'' }, success: function (data) { let theArr = []; if (!data.data || !data.data.list) { if (data.error && data.error.length) { message.warning(data.error[0].message); }; } else { for (let i = 0; i < data.data.list.length; i++) { let thisdata = data.data.list[i]; theArr.push({ key: i, id: thisdata.id, uid:thisdata.uid, serialNumber: thisdata.serialNumber, identifyName: thisdata.identifyName, mobile: thisdata.contactMobile, industry: thisdata.industry, expert:thisdata.expert, consultantType:thisdata.consultantType }); }; } this.state.pagination.current = data.data.pageNo; this.state.pagination.total = data.data.totalCount; if(data.data&&data.data.list&&!data.data.list.length){ this.state.pagination.current=0 this.state.pagination.total=0 } this.setState({ dataSource: theArr, pagination: this.state.pagination }); }.bind(this), }).always(function () { this.setState({ loading: false }); }.bind(this)); }, getInitialState() { return { searchMore: true, validityPeriodDate: [], releaseDate: [], selectedRowKeys: [], selectedRows: [], loading: false, pagination: { defaultCurrent: 1, defaultPageSize: 10, showQuickJumper: true, pageSize: 10, onChange: function (page) { this.loadData(page); }.bind(this), showTotal: function (total) { return '共' + total + '条数据'; } }, columns: [ { title: '姓名', dataIndex: 'identifyName', key: 'identifyName', render:text=>{ return text&&text.length>16?text.substr(0,16)+'...':text } }, { title: '手机号码', dataIndex: 'mobile', key: 'mobile', }, { title: '行业', dataIndex: 'industry', key: 'industry', render: (text) => { return getIndustry(text); } }, { title: '认证类型', dataIndex: 'expert', key: 'expert', render: (text,recard) => { if(text=='1'){ return '专家认证'; }else if(text=='2'&&recard.consultantType=='4'){ return '法律顾问认证'; }else if(text=='2'&&recard.consultantType!='4'){ return '顾问认证'; }else{ return '未认证'; } } }, { title: '认证审核', dataIndex: 'caozuo', key: 'caozuo', render:(text,recard) => { return
} } ], dataSource: [], searchTime: [,] }; }, componentWillMount() { let theArr = []; industry.map(function (item) { theArr.push( {item.key} ) }); this.state.demandTypeOption = theArr; this.loadData(); }, tableRowClick(record, index) { this.state.RowData = record; this.setState({ showDesc: true, examineState:true }); }, closeDesc(e, s) { this.state.showDesc = e; if (s) { if(this.state.pagination.total%10==1){ this.loadData((this.state.page)-1); }else{ this.loadData(this.state.page); } }; }, search() { this.loadData(); }, reset() { this.state.nameSearch = ''; this.state.demandTypeSearch = undefined; this.state.statusSearch = undefined; this.loadData(); }, searchSwitch() { this.setState({ searchMore: !this.state.searchMore }); }, render() { const rowSelection = { selectedRowKeys: this.state.selectedRowKeys, onChange: (selectedRowKeys, selectedRows) => { this.setState({ selectedRows: selectedRows.slice(-1), selectedRowKeys: selectedRowKeys.slice(-1) }); } }; const hasSelected = this.state.selectedRowKeys.length > 0; const { RangePicker } = DatePicker; return (
专家顾问认证审核
{ this.setState({ nameSearch: e.target.value }); }} />
); } }); export default DemandList;