/**
 * 资金认领详情
 */
import { ElTag } from "element-plus";
import { h } from "vue";
import { DescriptionColumns } from "/@/components/BasicDescriptions";

//资金认领审核状态
export const CAPITAL_STATUS = [
  {
    value: "1",
    label: "待审批"
  },
  {
    value: "2",
    label: "审批通过"
  },
  {
    value: "3",
    label: "审批驳回"
  },
  {
    value: "4",
    label: "已解除认领"
  },
  {
    value: "5",
    label: "已取消认领"
  }
];

//认领详情描述列表
export const CAPITAL_COLUMNS: DescriptionColumns = [
  {
    field: "logNo",
    label: "编码",
    width: "180px",
    span: 6
  },
  {
    field: "status",
    label: "状态",
    render(status) {
      return h(ElTag, null, {
        default: () =>
          CAPITAL_STATUS.find(s => s.value === status)?.label || "---"
      });
    }
  },
  {
    field: "addtime",
    label: "认领时间",
    span: 6
  },
  {
    field: "used_fee",
    label: "资金使用金额",
    width: "130px",
    span: 6
  },
  {
    field: "remark",
    label: "备注",
    span: 24
  }
];

export const tableColumns = [
  {
    field: "tradNo",
    label: "资金编码",
    width: "180px",
    span: 2
  },
  {
    field: "logNo",
    label: "认领编码",
    width: "180px",
    span: 2
  },
  {
    field: "orderCode",
    label: "销售订单编码",
    width: "180px",
    span: 2
  },
  {
    field: "totalPrice",
    label: "订单总金额",
    span: 2
  },
  {
    field: "cancel_fee",
    label: "认领金额",
    span: 2
  },
  {
    field: "addtime",
    label: "认领时间",
    span: 2
  },
  {
    field: "used_fee",
    label: "资金使用金额",
    width: "130px",
    span: 2
  },
  {
    field: "remark",
    label: "备注",
    span: 6
  }
];
