import React,{Component} from "react";
import TabelContent from "../../../common/tabelContent";
import {Button} from "antd";

class PressMoney extends Component{
    constructor(props) {
        super(props);
        this.state={
            columns: [
                {
                    title: "序号",
                    dataIndex: "key",
                    key: "key",
                    width: 120,
                },
                {
                    title: "合同编号",
                    dataIndex: "key",
                    key: "key",
                    width: 200,
                },
                {
                    title: "客户名称",
                    dataIndex: "key",
                    key: "key",
                    width: 200,
                },
                {
                    title: "订单负责人",
                    dataIndex: "key",
                    key: "key",
                    width: 120,
                },
                {
                    title: "订单部门",
                    dataIndex: "key",
                    key: "key",
                    width: 120,
                },
                {
                    title: "签单金额（万元）",
                    dataIndex: "key",
                    key: "key",
                    width: 120,
                },
                {
                    title: "已收款（万元）",
                    dataIndex: "key",
                    key: "key",
                    width: 120,
                },
                {
                    title: "应收款（万元）",
                    dataIndex: "key",
                    key: "key",
                    width: 120,
                },
                {
                    title: "欠款（万元）",
                    dataIndex: "key",
                    key: "key",
                    width: 120,
                },
                {
                    title: "催款启动日期",
                    dataIndex: "key",
                    key: "key",
                    width: 120,
                },
                {
                    title: "自动移交法务（天）",
                    dataIndex: "key",
                    key: "key",
                    width: 120,
                },
                {
                    title: "操作",
                    dataIndex: "id",
                    key: "id",
                    render: (text, record, index) => {
                        return (
                            <div>
                                <Button
                                    type="primary"
                                    style={{marginRight: "10px",}}
                                    onClick={e => {
                                        e.stopPropagation();
                                    }}
                                >
                                    移交法务
                                </Button>
                                <Button
                                    type="primary"
                                    style={{marginRight: "10px",}}
                                    onClick={e => {
                                        e.stopPropagation();
                                    }}
                                >
                                    催款记录
                                </Button>
                                <Button
                                    type="primary"
                                    style={{marginRight: "10px",}}
                                    onClick={e => {
                                        e.stopPropagation();
                                    }}
                                >
                                    法务记录
                                </Button>
                            </div>
                        )
                    }
                }
            ],
            searchList:[]
        }
    }

    render() {
        return(
            <div className="user-content signatureStatistics">
                <div className="content-title">
                    <span>
                        催款记录
                    </span>
                </div>
                <TabelContent
                    scroll={{ x: 0, y: 1000 }}
                    searchList={this.state.searchList}
                    columns={this.state.columns}
                    tabelApi={'/api/admin/newOrder/statisticsList'}
                    exportApi={'/api/admin/newOrder/statisticsListExprot'}
                    dataProcessing={(data)=>{
                        let theArr = [];
                        for (let i = 0; i < data.data.length; i++) {
                            let thisdata = data.data[i];
                            thisdata.key=i + 1;
                            theArr.push(thisdata);
                        }
                        return theArr;
                    }}
                />
            </div>
        )
    }
}

export default PressMoney;