import { ContentConfig } from "/@/components/PageContent";
import { httpList } from "/@/api/InvoiceSales/inspectTicketBill";
import { addition, multiplication } from "/@/utils/calc";


const columns = [
  {
    label: "账单日期",
    prop: "daydate",
    width: 100
  },
  {
    label: "采购对账回票验票次数",
    width: 150,
    cellRenderer({ row }){
      const { pay_success, pay_fail } = row
      return addition(pay_success, pay_fail)
    }
  },
  {
    label: "销售开票申请验票次数",
    width: 150,
    cellRenderer({ row }){
      const { ocr_success, ocr_fail } = row
      return addition(ocr_success, ocr_fail)
    }
  },
  {
    label: "合计验票次数",
    prop: 'total',
    width: 100
  },
  {
    label: "业务公司编号",
    prop: "companyNo",
    'min-width': 150
  },
  {
    label: "业务公司名称",
    prop: "companyName",
    'min-width': 150
  },
  {
    label: "应付金额",
    prop: "ocr_price",
    width: 80,
    cellRenderer({ row }){
      return Number(multiplication(row.total, row.ocr_price)).toFixed(2)
    }
  },
  {
    label: "账单生成日期",
    prop: "addtime",
    'min-width': 100
  }
];

const contentConfig: ContentConfig = {
  title: "验票账单",
  // mockData: [{}],
  columns,
  apis: {
    httpList
  }
};

export default contentConfig;
