import { statusOptions } from "./constants";
import { httpList } from "/@/api/postSupplierOrder/sendOrderRecord";

// import { httpList } from "/@/api/postSupplierOrder/sendOrderPay";
import { ContentConfig } from "/@/components/PageContent";
import { renderIconLabelLeft, renderProp } from "/@/utils/columnRenderHelper";
import { hasAccountOptions } from "/@/utils/status";

const columns = [
  {
    type: "selection",
    width: 40,
    align: "center",
    fixed: 'left'
  },
  {
    prop: "payNo",
    'min-width': '150px',
    label: "对账编号"
  },
  {
    prop: "total_fee",
    'min-width': '100px',
    label: "对账总金额"
  },
  {
    'min-width': '140px',
    label: "状态",
    ...renderProp(statusOptions)
  },
  {
    'min-width': '80px',
    label: "供应商端",
    ...renderProp(hasAccountOptions, "has_account")
  },
  {
    prop: "supplierName",
    'min-width': '150px',
    label: '物流供应商',
    ...renderIconLabelLeft('supplierNo', 'supplierName', '物流供应商编号:')
  },
  {
    label: "业务公司",
    'min-width': '150px',
    ...renderIconLabelLeft('companyNo', 'companyName', '业务公司编号:')
  },
  {
    prop: "apply_name",
    label: "创建人",
    'min-width': '80px'
  },
  {
    prop: "addtime",
    label: "申请时间",
    'min-width': '120px'
  },
  {
    label: '操作',
    'min-width': '100px',
    fixed: 'right',
    slot: 'operation'
  }
];

const contentConfig: ContentConfig = {
  columns,
  superUserNoAction: true,
  apis: {
    httpList: (data = {}) => httpList({ ...data, pay_type: '2' }),
    httpAdd: true
  }
};

export default contentConfig;
