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, Table, message, Modal, Select, DatePicker, Popconfirm, Tooltip, } from "antd"; import SpinContainer from '../../SpinContainer'; import {companyList, getCompanyName} from "../../common/configure"; const { Option } = Select; const { TextArea } = Input; const { RangePicker } = DatePicker; //主体 const Customers = Form.create()( React.createClass({ loadData(pageNo = 1) { this.state.data = []; this.setState({ loading: true, }); $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/visitingCustomers/listVisitingCustomers", data: { pageNo: pageNo, pageSize: this.state.pagination.pageSize, name: this.state.name, startTime: this.state.time[0], endTime: this.state.time[1], location:this.state.locationSearch, }, 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]; thisdata.key = i + 1; theArr.push(thisdata); } this.state.pagination.current = data.data.pageNo; this.state.pagination.total = data.data.totalCount; } this.setState({ dataSource: theArr, pagination: this.state.pagination, page: data.data.pageNo }); }.bind(this) }).always( function() { this.setState({ loading: false }); }.bind(this) ); }, getInitialState() { return { //数据类型 loading: false, visible: false, time: [], locationSearch:[], 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: "location", key: "location", width:150, render: r => { return( getCompanyName(r) ) } }, { title: "回复备注", dataIndex: "remark", key: "remark" }, { title: "操作", dataIndex: "aab", key: "aab", render: (text, record) => { return (