import React, { Component } from "react"; import SearchForm from './SearchForm'; import PTable from '../../../components/Pro/PTable'; import { Tabs } from "antd"; import { bktGetInvoiceTotal, } from '../../../services/api'; const { TabPane } = Tabs; export default class Messages extends Component { constructor(props, context) { super(props, context); this.state = { forceUpdate: false, //是否更新表格 pageParm: { //表格参数 pageSize: '10', pageNumber: '1', comBizInvoiceId: '', //父组件传入的id }, searchDataReady: false, //筛选参数是否准备就绪 comBizInvoiceIdReady: false, //comBizInvoiceId是否准备就绪 statisticsInfo: null, //表格上面部分统计数据 }; } componentDidMount() { } componentWillReceiveProps(nextProps) { const { comBizInvoiceId } = nextProps; if(comBizInvoiceId && comBizInvoiceId != this.state.comBizInvoiceId) { this.setState({ pageParm: { ...this.state.pageParm, comBizInvoiceId }, comBizInvoiceIdReady: true }, () => { // 获取统计数据 if(!this.state.statisticsInfo) { this.setState({ statisticsInfo: {} }, () => { bktGetInvoiceTotal({comBizInvoiceId}).then(res => { this.setState({ statisticsInfo: res.data }); }); }); } }); } } _search = (values) => { this.setState({ pageParm: { ...this.state.pageParm, ...values }, searchDataReady: true }); } render() { const columns = [ { title: '序号', dataIndex: 'number', key: 'number', }, { title: '类型', dataIndex: 'bizType', key: 'bizType', }, { title: '课程名称', dataIndex: 'trackName', key: 'trackName', }, { title: '学员名称', dataIndex: 'fullName', key: 'fullName', }, // { // title: '开票方确认状态', // dataIndex: 'drawerConfirm', // key: 'drawerConfirm', // }, { title: '身份证号', dataIndex: 'identityNumber', key: 'identityNumber', }, { title: '手机号码', dataIndex: 'phone', key: 'phone', }, { title: '付款方名称', dataIndex: 'drawerName', key: 'drawerName', }, { title: '收款方名称', dataIndex: 'receverName', key: 'receverName', }, { title: '金额(元)', dataIndex: 'amount', key: 'amount', render: (text) => { return Number(text).toFixed(2); } }, { title: '交易时间', dataIndex: 'bizDate', key: 'bizDate', }, { title: '对应业务订单号', dataIndex: 'bizOrderNo', key: 'bizOrderNo', } ]; const { statisticsInfo } = this.state; return (