import { ContentConfig } from "/@/components/PageContent";
import {
  httpList,
  httpAdd,
  httpDelete,
  httpUpdate
} from "/@/api/parameter/invoiceheader";

import dayjs from "dayjs";

const columns = [
  {
    type: "selection",
    width: 55,
    hide: ({ checkList }) => !checkList.includes("勾选列")
  },
  {
    label: "序号",
    type: "index",
    width: 70,
    hide: ({ checkList }) => !checkList.includes("序号列")
  },

  {
    label: "业务公司",
    prop: "invoice_title",
    width: 100
  },
  {
    label: "企业法人",
    prop: "invoice_people",
    width: 100
  },
  {
    label: "企业注册地址",
    prop: "invoice_addr",
    width: 120
  },
  {
    label: "企业联系方式",
    prop: "invoice_mobile",
    width: 120
  },
  {
    label: "企业纳税识别号",
    prop: "invoice_code",
    width: 140
  },
  {
    label: "对公银行",
    prop: "invoice_bank",
    width: 120
  },
  {
    label: "对公银行账户",
    prop: "invoice_bankNo",
    width: 120
  },
  {
    label: "创建人",
    prop: "apply_name",
    width: 80
  },
  {
    label: "创建时间",
    prop: "addTime",
    formatter: ({ createTime }) =>
      dayjs(createTime).format("YYYY-MM-DD HH:mm:ss")
  },
  {
    label: "操作",
    fixed: "right",
    width: 120,
    slot: "operation"
  }
];

const contentConfig: ContentConfig = {
  title: "业务公司发票",
  powers: ["001", "002", "003", "004", "005", "006", "007", "008"],
  columns,
  apis: {
    httpList,
    httpAdd,
    httpDelete,
    httpUpdate
  }
};

export default contentConfig;
