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

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

    this.TABLE_CONFIG = {
      ...this.TABLE_CONFIG,
      SHOW_PAGE_HEADER: false,
      REQUEST_URL: req_url.settlement.settle_detail.order_return,
      COLUMNS: [
        {
          title: '订单时间',
          dataIndex: 'create_time',
          align: 'center',
        },
        {
          title: '订单号',
          dataIndex: 'order_id',
          align: 'center',
        },
        {
          title: '拆前订单号',
          dataIndex: 'origin_order_id',
          align: 'center',
        },
        {
          title: '商品名称',
          dataIndex: 'spu_name',
          align: 'center',
        },
        {
          title: '售价',
          dataIndex: 'sku_price',
          align: 'center',
        },
        {
          title: '成本',
          dataIndex: 'price_cost',
          align: 'center',
        },
        {
          title: '退货数量',
          dataIndex: 'return_number',
          align: 'center',
        },
        {
          title: '售价总额',
          dataIndex: 'price_count',
          align: 'center',
        },
        {
          title: '成本总额',
          dataIndex: 'price_cost_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.supplier_id,
      },
    };
  }
}

export default ReturnSettleTable;
