import { ContentConfig } from "/@/components/PageContent";
import { httpList } from "/@/api/parameter/supplierPay";

import dayjs from "dayjs";

const columns = [
  {
    type: "selection",
    width: 40,
    align: "center",
    hide: ({ checkList }) => !checkList.includes("勾选列")
  },
  {
    label: "序号",
    type: "index",
    width: 70,
    hide: ({ checkList }) => !checkList.includes("序号列")
  },
  {
    label: "公司编码",
    prop: "code",
    width: 200
  },
  {
    label: "纳税号",
    prop: "registercode",
    width: 180
  },
  {
    label: "公司名称",
    prop: "name",
    width: 210
  },
  {
    label: "公司类型",
    prop: "nature",
    width: 180
  },
  // {
  //   label: "公司类型",
  //   type: "type",
  //   width: 100,
  //   cellRenderer({ row }) {
  //     return String(row.type) === "1"
  //       ? "正式供应商"
  //       : String(row.type) === "2"
  //         ? "临时供应商"
  //         : "业务公司";
  //   }
  // },
  {
    label: "地址",
    prop: "address",
    minWidth: 180
  },
  {
    label: "创建时间",
    prop: "addtime",
    minWidth: "120px",
    formatter: ({ addtime }) => dayjs(addtime).format("YYYY-MM-DD HH:mm:ss")
  }
];

const contentConfig: ContentConfig = {
  title: "公司管理",
  columns,
  notNeedCompanyFilter: true,
  apis: {
    httpList
  }
};

export default contentConfig;
