import { ContentConfig } from "/@/components/PageContent";

import { statusOptions } from "./options";
import { httpList } from "/@/api/sellOut/returnOrder";
import { renderStatus } from "/@/utils/column-helper";

const columns = [
  {
    type: "selection",
    width: 55,
    hide: ({ checkList }) => !checkList.includes("勾选列")
  },
  {
    label: "序号",
    type: "index",
    width: 70,
    hide: ({ checkList }) => !checkList.includes("序号列")
  },
  {
    prop: "thNo",
    label: "售后退货单编号",
    width: "180"
  },
  {
    prop: "good_code",
    label: "商品属性编号",
    width: "180"
  },
  {
    prop: "good_name",
    label: "商品名称",
    width: "150"
  },

  {
    prop: "customer_code",
    label: "客户编号",
    width: "180"
  },
  {
    prop: "return_num",
    label: "退货数量",
    width: "140"
  },
  {
    prop: "normal_num",
    label: "正常数量",
    width: "140"
  },
  {
    prop: "post_fee",
    label: "邮费"
  },

  {
    prop: "post_company",
    label: "物流公司",
    width: "140"
  },
  {
    prop: "post_code",
    label: "快递单号",
    width: "180"
  },

  {
    prop: "status",
    label: "状态",
    width: "100px",
    cellRenderer({ row }) {
      return renderStatus(statusOptions, row.status);
    }
  },
  {
    prop: "addtime",
    label: "申请时间",
    sortable: true,
    width: 150
  },
  {
    label: "操作",
    fixed: "right",
    width: 60,
    slot: "operation"
  }
];

const contentConfig: ContentConfig = {
  title: "售后退货单",
  columns,
  apis: {
    httpList
  }
};

export default contentConfig;
