import React, { useState, useEffect } from 'react' import { Select, Spin, Table, Button, Form, Input, Divider, Icon } from 'antd' import NavLink from 'umi/navlink' import { fetchList, apis, fetch } from '@/utils/request' import Search from '../../components/Search' import List from '../../components/List' const exportStatementExcel = fetch(apis.bill.exportStatementExcel) const getBillStatementAll = fetch(apis.bill.getBillStatementAll) const StatusDict = { '0': '未支付', '1': '已支付', '2': '支付中', '3': '已关闭', } const PayTypeDict = { '0': '微信缴费', '1': '线下缴费', '2': '支付宝缴费', } const Condition = props => { return ( { const { getFieldDecorator, setFieldsValue } = form return ( <> { getFieldDecorator('orderBumber')() } { getFieldDecorator('billId')() } { getFieldDecorator('billName')() } { getFieldDecorator('billInvoiceId')() } { getFieldDecorator('payPhone')() } ) }} /> ) } export default props => { const [loading, setLoading] = useState(false) const [listData, setListData] = useState([]) const [pagination, setPagination] = useState({}) const [queryParams, setQueryParams] = useState({ pageNum: 1, pageSize: 10 }) const handleSearch = vals => { setQueryParams({ ...queryParams, ...vals, pageNum: 1, }) } const handlePageChange = (pageNum, pageSize) => { setQueryParams({ ...queryParams, pageNum, pageSize, }) } const exportExcel = () => { exportStatementExcel().then(res => { const link = document.createElement('a') link.href = window.URL.createObjectURL(new Blob([res])) link.setAttribute('download', '流水信息.xls') link.click() }) } useEffect(() => { setLoading(true) getBillStatementAll({ data: queryParams }).then(res => { const {list, ...pagi} = res || {} setListData(list) setPagination(pagi) setLoading(false) }).catch(err => setLoading(false)) }, [queryParams]) return (
{ return ( ) }} /> { return (row.billIdList || []).map(item => ( )) }} /> { return (row.billInvoiceIdList || []).map(item => ( {item} )) }} /> (sumPrice === null || sumPrice === undefined ? '' : sumPrice/100)} /> StatusDict[row.orderStatus]} /> PayTypeDict[payType]}/>
) }