import React from "react"; import $ from "jquery/src/ajax"; import "react-quill/dist/quill.bubble.css"; import moment from "moment"; import { Form, Icon, Button, Input, Spin, Table, message, Modal, Select, DatePicker, Popconfirm, } from "antd"; const { Option } = Select; const { TextArea } = Input; const { RangePicker } = DatePicker; //主体 const Customers = Form.create()( React.createClass({ loadData(pageNo) { this.state.data = []; this.setState({ loading: true, page: pageNo }); $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/visitingCustomers/listVisitingCustomers", data: { pageNo: 1, pageSize: this.state.pagination.pageSize, name: this.state.name, startTime: this.state.time[0], endTime: this.state.time[1] }, 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 + 1, id: thisdata.id, name: thisdata.name, mobile: thisdata.mobile, status: thisdata.status, remark: thisdata.remark, createTimes: thisdata.createTimes }); } this.state.pagination.current = data.data.pageNo; this.state.pagination.total = data.data.totalCount; } this.setState({ dataSource: theArr, pagination: this.state.pagination }); }.bind(this) }).always( function() { this.setState({ loading: false }); }.bind(this) ); }, getInitialState() { return { //数据类型 loading: false, visible: false, time: [], pagination: { defaultCurrent: 1, defaultPageSize: 10, showQuickJumper: true, pageSize: 10, onChange: function(page) { this.loadData(page); this.setState({ selectedRowKeys: [] }); }.bind(this), showTotal: function(total) { return "共" + total + "条数据"; } }, columns: [ { title: "序号", dataIndex: "id", key: "id" }, { title: "姓名", dataIndex: "name", key: "name" }, { title: "联系方式", dataIndex: "mobile", key: "mobile" }, { title: "提交时间", dataIndex: "createTimes", key: "createTimes" }, { title: "是否查看", dataIndex: "status", key: "status", render: text => { if (text == 0) { return "未读"; } else if (text == 1) { return "已读"; } } }, { title: "回复备注", dataIndex: "remark", key: "remark" }, { title: "操作", dataIndex: "aab", key: "aab", render: (text, record) => { return (