import React, { useMemo } from 'react';
import DetailPro from '@/components/DetailPro';
import AutoTable from '@/components/AutoTable/mtable';
import { Tooltip } from "antd";
import { useNavigate, history } from '@umijs/max';
const Leaseresume = ({ setdrawer, drawer }) => {
    const navigator = useNavigate();
    const columns = [
        {
            title: '客户名称',
            dataIndex: 'customerName',
            key: 'customerName',
        },
        {
            title: '开始租赁日期',
            dataIndex: 'startLeaseTime',
            key: 'startLeaseTimeList',
            valueType: 'dateRange',
        },
        {
            title: '实际结束日期',
            dataIndex: 'endLeaseTime',
            key: 'endLeaseTimeList',
            valueType: 'dateRange',
        },
        {
            title: '相关单号',
            dataIndex: 'businessNo',
            key: 'businessNo',
            render: (_, row) => {
                return (
                    <Tooltip title={row.businessNo}>
                        <a
                            className="table-cell"
                            onClick={() => {
                                navigator('/lease/contract', {
                                    state: {
                                        isFinish: row.isFinish,
                                        contractNo: row.businessNo
                                    }
                                })
                            }}
                        >
                            {row.businessNo}
                        </a>
                    </Tooltip>
                );
            }
        },
    ];
    return (
        <AutoTable
            columns={columns}
            path={'/lease/umLeaseLedgerCustomer/queryList'}
            resizeable={false}
            pageextra="none"
            bordered={false}
            extraparams={{ leaseLedgerId: drawer?.item?.id }}
        />
    );
};
export default Leaseresume;
