import { ContentConfig } from "/@/components/PageContent";
import { createHttpRequset } from "../../../_http/createRequset";
import { xs_order_type_options } from "/@/utils/status";

const columns = [
  // {
  //   type: "expand",
  //   _slot_: "expand",
  //   fixed: "left",
  //   _noset_: true,
  // },
  // {
  //   type: "selection",
  //   fixed: "left",
  //   _noset_: true
  // },
  // {
  //   prop: "addtime",
  //   label: "下单日期",
  //   minWidth: "155px",
  // },
  {
    prop: "orderCode",
    label: "订单编号",
    minWidth: "155px"
  },
  {
    prop: "order_type",
    label: "商品类型",
    width: "100px",
    cellRenderer({ row }) {
      console.log(row);
      return (
        xs_order_type_options.find(({ value }) => value === row.order_type)
          ?.label || "--"
      );
    }
  },
  {
    prop: "status",
    label: "订单状态",
    width: "110px",
    cellRenderer({ row }) {
      return (
        [
          { value: "0", label: "待发货" },
          { value: "1", label: "待发货完成" },
          { value: "2", label: "发货已完成" },
          { value: "3", label: "订单已取消" }
        ].find(({ value }) => value === row.status)?.label || "--"
      );
    }
  },

  {
    prop: "good_code",
    label: "商品成本编号",
    width: "160px"
  },
  {
    prop: "skuCode",
    label: "上线商品编号",
    width: "155px"
  },
  {
    prop: "good_name",
    label: "商品名称",
    minWidth: "155px"
  },
  {
    prop: "good_num",
    label: "购买数量",
    width: "110px"
  },
  {
    prop: "send_num",
    label: "已发数量",
    width: "110px"
  },
  {
    prop: "wsend_num",
    label: "未发数量",
    width: "110px"
  },
  {
    prop: "not_addr_address_good_num",
    label: "无地址数量",
    width: "110px"
  },

  {
    prop: "nickname",
    label: "申请人",
    width: "70px"
  },
  {
    prop: "name",
    label: "所属部门",
    width: "90px"
  }
];

const contentConfig: ContentConfig = {
  notPagination: true,
  superUserNoAction: false,
  notNeedCompanyFilter: true,
  columns,
  apis: {
    httpList: createHttpRequset("sna")
  }
};

export default contentConfig;
