const initheaders = [
  "商品编码",
  "商品名称",
  "买入方公司编码",
  "买入方公司名称",
  "卖出方公司编码",
  "卖出方公司名称",
  "采购税率",
  "采购类目编码",
  "采购类目名称",
  "采购开票商品名称",
  "财务税率",
  "财务类目编码",
  "财务开票商品名称",
  "税率标识",
  "是否有优惠政策",
  "增值税管理内容"
];

export const mapProp = {
  value0: "spuCode",
  value1: "spuName",
  value2: "buyerCompanyCode",
  value3: "buyerCompanyName",
  value4: "sellerCompanyCode",
  value5: "sellerCompanyName",
  value6: "cg_tax",
  value7: "cg_cat_code",
  value8: "cg_cat_name",
  value9: "cg_inv_good_name",
  value10: "tax",
  value11: "cat_code",
  value12: "inv_good_name",
  value13: "inv_tag",
  value14: "is_discount",
  value15: "addTax"
};

export const requireHeaders = [
  "spuCode",
  "tax",
  "cat_code",
  "inv_good_name",
  "is_discount"
];

const columns = () => {
  const list: any[] = [
    {
      type: "index",
      width: "50",
      fixed: "left",
      label: "序号"
    }
  ];
  initheaders.forEach((si, sii) => {
    list.push({
      prop: "value" + sii,
      label: si,
      minWidth: sii === 0 || sii === 1 ? "120px" : "135px"
    });
  });

  return list;
};

export { initheaders, columns };
