import React, { Component } from "react"; import ReactDOM from 'react-dom'; import moment from 'moment'; import "moment/locale/zh-cn"; import axios from 'axios'; import store from 'store'; import { DatePicker, Input, Select, Button, Table, Alert } from 'antd'; // import ExcelButton from '../../../../components/ExcelButton'; const { Option } = Select; const { RangePicker } = DatePicker; import { host, getComWalletReconciliation, publicCommonDictGetDictByCodeTypes } from '../../../../services/api'; export default class Reconciliation extends Component { constructor(props, context) { super(props, context); this.state = { tableList: [], searchData: { // 表格数据请求参数 startDate: moment().subtract(30, 'days').format('YYYYMMDD'), endDate: moment().format('YYYYMMDD'), fundFlowType: '1', //1收入 2支出 (资金流向) bankTradeType: '', //银行交易类型 accountName: '', //对方账户 pageNumber: '1', // 页 pageSize: '10' //条目 }, rangePickeValue: [moment().subtract(30, 'days'), moment()], pagination: { //分页数据 total: 1, current: 1, pageSize: 10, showSizeChanger: true, showQuickJumper: true, showTotal: total => `共搜索到${total}条记录` }, tradeTypes: [], //交易类型 info: { TotalCount: 0, errorAmount: 0, errorCount: 0, processingAmount: 0, processingCount: 0, successAmount: 0, successCount: 0, sumAmount: 0, } }; } componentDidMount() { // // test start // this.setState({ // tableList: [{ // "serviceType": "通用下账", // "amount": "10.00", // "accounts_deal_date": "2019-06-27 17:03:03", // "flow_no": "01328943255678636117", // "account_in": "", // "memo": "", // "trade_flow_no": "M0128946956654248027", // "trade_date": "2019-06-27 17:17:46", // "balance": "1602.00", // "hand_status": "成功", // "trade_type": "消费", // "account_out": "3008001002356511000010", // "create_date": "2019-06-27 17:17:46", // "direction": "出账" // }] // }); // //test end this.__getTable(); // 获取类型 this.__getCodeTypes(); } // 获取表格信息 __getTable = () => { let { searchData } = this.state; getComWalletReconciliation(searchData).then(res => { const { pageInfo } = res.data; this.setState({ tableList: pageInfo.data, pagination: { ...this.state.pagination, total: pageInfo.total, current: pageInfo.pageNumber, pageSize: pageInfo.pageSize }, info: { totalCount: res.data.totalCount ? res.data.totalCount : 0, errorAmount: res.data.errorAmount ? res.data.errorAmount : 0, errorCount: res.data.errorCount ? res.data.errorCount : 0, processingAmount: res.data.processingAmount ? res.data.processingAmount : 0, processingCount: res.data.processingCount ? res.data.processingCount : 0, successAmount: res.data.successAmount ? res.data.successAmount : 0, successCount: res.data.successCount ? res.data.successCount : 0, sumAmount: res.data.sumAmount ? res.data.sumAmount : 0, } }); }); } //类型查询 __getCodeTypes = () => { publicCommonDictGetDictByCodeTypes({ codeTypes: "bankTradeType" }).then((data) => { const tradeTypes = data.data.bankTradeType; tradeTypes.unshift({ codeType: "bankTradeType", codeValue: "", label: "全部" }); this.setState({ tradeTypes: data.data.bankTradeType }); }, (err) => { console.log(err); }); } render() { const columns = [ { title: '交易流水号', dataIndex: 'tradeSerialNo', key: 'tradeSerialNo', fixed: 'left', width: 250, }, // { // title: '业务类型', // dataIndex: 'trade_flow_no', // key: 'trade_flow_no' // }, { title: '交易类型', dataIndex: 'bankTradeType', key: 'bankTradeType', }, { title: '交易状态', dataIndex: 'tradeStatus', key: 'tradeStatus', }, { title: '交易订单创建时间', dataIndex: 'tradeStartTime', key: 'tradeStartTime', }, { title: '交易金额', dataIndex: 'tradeAmount', key: 'tradeAmount', }, { title: '出账方户名', dataIndex: 'expendAccountName', key: 'expendAccountName', }, { title: '出账方账号', dataIndex: 'expendAccountNo', key: 'expendAccountNo', }, { title: '出账方银行简称', dataIndex: 'expendBank', key: 'expendBank', }, { title: '入账方户名', dataIndex: 'incomeAccountName', key: 'incomeAccountName', }, { title: '入账方账号', dataIndex: 'incomeAccountNo', key: 'incomeAccountNo', }, { title: '入账方银行简称', dataIndex: 'incomeBank', key: 'incomeBank', }, { title: '入账方证件号', dataIndex: 'incomeCerNo', key: 'incomeCerNo', width: 200, }, { title: '交易备注', dataIndex: 'remark', key: 'remark', } ]; return (