import { NavLink } from "react-router-dom"; import { useEffect, useState } from "react"; import { observer } from "mobx-react"; import { toJS } from "mobx"; import { Row, Col, Space, Button, Table, Input, DatePicker,Typography,App,Steps } from "antd"; import { useStore } from "@/stores/StoreContext.js"; import * as config from "@/config"; import { formatDate,isNotEmpty } from "@/utils/commons"; import { AuditOutlined, SmileOutlined, SolutionOutlined, EditOutlined } from '@ant-design/icons'; const { Title } = Typography; function Index() { const { invoiceStore } = useStore(); const { invoiceList ,invoicePage } = invoiceStore; const [groupNo, onGroupNoChange] = useState(''); const [arrivalDateRange, onDateRangeChange] = useState([]); const [dataLoading, setDataLoading] = useState(false); const { notification } = App.useApp(); const invoiceListColumns = [ { title: '团名', dataIndex: 'GroupName', key: 'GroupName', }, { title: '离团时间', dataIndex: 'GetGDate', key: 'GetGDate', render:(text,record) =>formatDate(new Date(text)) }, { title: '接团时间', key: 'LeftGDate', dataIndex: 'LeftGDate', render:(text,record) => isNotEmpty(text)?formatDate(new Date(text)):"" }, { title: '人数', key: 'PersonNum', dataIndex: 'PersonNum' }, { title: '团总额', key: 'AllMoney', dataIndex: 'AllMoney' }, { title: '填表时间', key: 'GMD_FWks_LastEditTime', dataIndex: 'GMD_FWks_LastEditTime', render:(text,record) => isNotEmpty(text)?formatDate(new Date(text)):"" }, { title: '填表人', key: 'GMD_FillWorkers_Name', dataIndex: 'GMD_FillWorkers_Name' }, { title: '账单状态', key: 'status', render:BillStatus }, { title: 'Action', key: 'action', render:(text, record) => Details, } ]; function BillStatus(text,record){ // if (record.GMD_Dealed){ // return "已审核"; // }else if (record.GMDFillworkers_SN<1){ // return "未填写"; // }else if (record.VRequestVerify){ // return "未审核"; // }else{ // return "未提交"; // } let FKState = record.FKState-1 return , }, { title: '顾问', // status: 'finish', icon: , }, { title: '财务', //status: 'process', icon: , }, { title: 'Done', //status: 'wait', icon: , }, ]} /> } const onSearchClick = (current = 1) => { setDataLoading(true); invoiceStore.fetchInvoiceList(current, 0, groupNo, arrivalDateRange[0], arrivalDateRange[1], 1) .catch(ex => { notification.error({ message: `Notification`, description: ex.message, placement: 'top', duration: 4, }); }) .finally(() => { setDataLoading(false); }); } return ( 账单管理 { onGroupNoChange(e.target.value) }} /> Date { onDateRangeChange(dateRange) }} /> {onSearchClick(pagination.current);}} columns={invoiceListColumns} dataSource={toJS(invoiceList)} /> ) } export default observer(Index);