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

class CurrentSettleTable extends TableWithQuery {
  constructor(props) {
    super(props);

    this.TABLE_CONFIG = {
      ...this.TABLE_CONFIG,
      SHOW_PAGE_HEADER: false,
      REQUEST_URL: req_url.settlement.settle_detail.order_current,
      COLUMNS: [
        {
          title: '订单时间',
          dataIndex: 'create_time',
          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: '操作',
          align: 'center',
          dataIndex: '',
          render: record => {
            return (
              <Button
                type="link"
                onClick={() => {
                  // console.log('detail', { supplier_id: props.supplier_id, time: '' });
                }}
              >
                订单详情
              </Button>
            );
          },
        },
      ],
    };

    this.state = {
      ...this.state,
      queryFilterArr: [],
      queryParams: {
        supplier_id: props.supplier_id,
      },
    };
  }
}
export default CurrentSettleTable;
