/** * 徐祥健 * 2018年8月28日 10:41 * */ import React from 'react'; import HeadView from '../view/HeadView'; import TableBtnView from '../view/TableBtnView'; import LinkView from '../view/LinkView'; import { Input, Button, DatePicker, Divider, Row, Col, message, Modal, Popconfirm, Badge } from 'antd'; import moment from 'moment'; import Fetch from '../fetch'; import TableView from '../view/TableView'; export default class BusList extends React.Component { constructor(props) { super(props); this.state = { data: [], formdata: {}, key: 0, type: this.props.type, loading: false, msgType: '' }; } componentDidMount() { document.title = '投诉建议管理'; // Fetch.getSpecialPerson() // .then(res => { // this.setState({ // data: res // }); // }); const { type } = this.state; var msgType; switch(type){ case 'onlineAdvice': msgType = 1; break; case 'onlineComplaints': msgType = 2; break; case 'onlineLetter': msgType = 3; break; case 'another': msgType = 4; break; default: break; } this.setState({ loading: true,msgType }); Fetch.getComSugges({msgType, businessType: 22}).then( res => { for(var i=0;i { const formdata = { ...this.state.formdata, createTime: dateString }; this.setState({ formdata }); } onInputChange = ({ target: { value, name } }) => { if (name === 'reset') { this.setState({ formdata: {} }); this.onReset(); } else { const formdata = { ...this.state.formdata, [name]: value }; this.setState({ formdata }); } } onReset = () => { this.setState(prev => ({ key: prev.key + 1 })); this.setState({ resetKey: Date.now(), formdata: {} }, this.onTableChange); } onSubmit = e => { e.preventDefault(); this.onTableChange(); } onTableChange = () => { this.setState({ loading: true }); const { msgType } = this.state; Fetch.getComSugges({msgType,...this.state.formdata}).then( res => { for(var i=0;i{ const { type } = this.state; this.props.history.push('/busDetail/' + _text.businessType + '/' + _text.businessId + '/' + _text.createId + '/' + 'detail' + '/' + type); } onDo = (_text, _record) =>{ const { type } = this.state; this.props.history.push('/busDetail/' + _text.businessType + '/' + _text.businessId + '/' + _text.createId + '/' + 'com' + '/' + type); } onDel = (_text, _record) => { Fetch.businessDel({businessId: _text.businessId}).then( res => { if(res.code == 0){ message.warning('正在更新列表'); this.onTableChange(); } }, err => { message.error(err); }); } render() { const columns = [{ title: '序号', dataIndex: 'index', key: 'index', },{ title: '发送人', dataIndex: 'userName', key: 'userName', }, { title: '消息内容', dataIndex: 'content', key: 'content', }, { title: '发送时间', dataIndex: 'createTime', key: 'createTime', render: text => {moment(text).format("YYYY-MM-DD HH:mm")} }, { title: '状态', dataIndex: 'status', key: 'status', render: text => ( text == "待审" ? : ) },{ title: '操作', key: 'action', render: (text, record) => ( { record.status == "待审" ? : } {this.onDel(text, record)}} okText="确定" cancelText="取消"> ), }]; const { data, loading } = this.state; const { title, local, type, total, notRead, contact, sed } = this.props; return (
{/* */} {/* */}
); } }