import React from 'react';
import TableWithQuery from '../../../components/TableWithQuery';
import { Button } from 'antd';
import req_url from '../../config/req_url';

class SettleOrderList extends TableWithQuery {
  constructor(props) {
    super(props);
    this.TABLE_CONFIG = {
      ...this.TABLE_CONFIG,
      PAGE_HEADER_PROPS: {
        title: false,
      },
      REQUEST_URL: req_url.settlement.order_list,
      COLUMNS: [
        {
          title: '订单时间',
          dataIndex: 'create_time',
          align: 'center',
        },
        {
          title: '订单号',
          dataIndex: 'order_id',
          align: 'center',
        },
        {
          title: '订单号',
          dataIndex: 'order_id',
          align: 'center',
        },
        {
          title: '拆前订单号',
          dataIndex: 'origin_order_id',
          align: 'center',
        },
        {
          title: '订单金额',
          dataIndex: 'actual_price',
          align: 'center',
        },
        {
          title: '采购金额',
          dataIndex: 'price_cost',
          align: 'center',
        },
        {
          title: '商品数量',
          dataIndex: 'all_count',
          align: 'center',
        },
        {
          title: '退货商品数量',
          dataIndex: 'return_sku_count',
          align: 'center',
        },
        {
          title: '操作者',
          dataIndex: '',
          align: 'center',
          render: record => {
            return (
              <Button
                type="link"
                onClick={() => {
                  console.log('record', record);
                }}
              >
                订单详情
              </Button>
            );
          },
        },
      ],
    };

    this.state = {
      ...this.state,
      queryFilterArr: [],
      queryParams: {
        supplier_id: props.match ? props.match.params.id : -1,
        time: props.match ? props.match.params.time: null,
      },
    };
  }
}

export default SettleOrderList;
