import React from 'react'; import { Icon, Button, Input, Select, Spin, Table, message, DatePicker, Modal } from 'antd'; import ajax from 'jquery/src/ajax/xhr.js'; import $ from 'jquery/src/ajax'; import './userList.less'; const OrderList = React.createClass({ loadData (pageNo) { this.state.data = []; this.setState({ loading: true }); $.ajax({ method: "post", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/orgList", data: { pageNo: pageNo || 1, pageSize: this.state.pagination.pageSize }, success: function (data) { 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]; this.state.data.push({ key: i, id: thisdata.id, mobile: thisdata.mobile, email: thisdata.email, createTime: thisdata.createTime, aftUsername: thisdata.aftUsername, managerName: thisdata.managerName, number: thisdata.number, orgAuditStatus: thisdata.orgAuditStatus, createTimeFormattedDate: thisdata.createTimeFormattedDate, adminName: thisdata.adminName, unitName: thisdata.unitName }); }; this.state.pagination.current = data.data.pageNo; this.state.pagination.total = data.data.totalCount; }; this.setState({ dataSource: this.state.data, pagination: this.state.pagination }); }.bind(this), }).always(function () { this.setState({ loading: false }); }.bind(this)); }, getInitialState () { return { searchMore: true, data: [], searchTime: [], 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: 'number', key: 'number', }, { title: '账号', dataIndex: 'mobile', key: 'mobile', }, { title: '认证名称', dataIndex: 'unitName', key: 'unitName', }, { title: '订单状态', dataIndex: 'orderStatus', key: 'orderStatus', }, { title: '生成时间', dataIndex: 'createTimeFormattedDate', key: 'createTimeFormattedDate', } ], dataSource: [] }; }, componentWillMount () { this.loadData(); }, search () { this.loadData(); }, reset () { this.state.searchOrderNumber = undefined; this.state.searchAftNumber = undefined; this.state.searchOrderStatus = undefined; this.state.searchName = undefined; this.state.searchTime = []; this.loadData(); }, render () { const { RangePicker } = DatePicker; const Option = Select.Option; return (
用户订单列表
{ this.setState({ searchOrderNumber: e.target.value }); }} /> { this.setState({ searchAftNumber: e.target.value }); }} /> { this.setState({ searchName: e.target.value }); }} />
订单生成时间: { this.setState({ searchTime: dataString }); }} />
); } }); export default OrderList;