import { ElTag } from "element-plus";
import { h } from "vue";
import { DescriptionColumns } from "/@/components/BasicDescriptions";
export const capital_columns = [
  {
    label: "资金编号",
    prop: "tradNo"
  },
  {
    label: "资金认领编号",
    prop: "logNo"
  },
  {
    label: "交易时间",
    prop: "trade_time"
  },
  {
    label: "认领资金总金额",
    width: "160px",
    prop: "total_fee"
  },
  {
    label: "申请人",
    prop: "apply_name"
  },
  {
    label: "认领时间",
    prop: "addtime"
  }
];

//资金详情列数据
export const capital_detail_columns: DescriptionColumns = [
  {
    label: "资金编号",
    field: "tradNo"
  },
  {
    label: "资金认领编号",
    field: "logNo"
  },
  {
    label: "交易时间",
    field: "trade_time"
  },
  {
    label: "认领资金总金额",
    field: "total_fee"
  },
  {
    label: "申请人",
    field: "apply_name"
  },
  {
    label: "付款公司",
    field: "trade_out"
  },
  {
    label: "收款公司",
    field: "trade_in"
  },
  {
    label: "银行",
    field: "trade_bank"
  },
  {
    label: "资金余额",
    field: "balance"
  },
  {
    label: "资金使用金额",
    field: "used_fee"
  }
];

//资金退款列数据
export const refund_detail_columns: DescriptionColumns = [
  {
    label: "退款编号",
    field: "returnCode"
  },
  {
    label: "资金认领编号",
    field: "logNo"
  },
  {
    label: "资金编号",
    field: "tradNo"
  },
  {
    label: "退款类型",
    field: "type",
    render(type) {
      return h(ElTag, null, {
        default: () => return_type.find(t => t.value === type)?.label
      });
    }
  },
  {
    label: "申请人",
    field: "apply_name"
  },
  {
    label: "退款原因",
    field: "return_reason"
  },
  {
    label: "付款公司",
    field: "trade_out"
  },
  {
    label: "备注",
    field: "remark"
  },
  {
    label: "退款截图凭证",
    field: "return_img"
  },
  {
    label: "退款状态",
    field: "status",
    render(status) {
      return h(ElTag, null, {
        default: () => return_status.find(s => s.value === status)?.label
      });
    }
  },
  {
    label: "退款时间",
    field: "addtime"
  },
  {
    label: "交易公司",
    field: "trade_out"
  },
  {
    label: "收款公司",
    field: "trade_in"
  },
  {
    label: "交易银行",
    field: "trade_bank"
  },
  {
    label: "总金额",
    field: "total_fee"
  },
  {
    label: "余额",
    field: "balance"
  },
  {
    label: "已认领金额",
    field: "used_fee"
  },
  {
    label: "认领金额",
    field: "log_total_fee"
  },
  {
    label: "认领申请人",
    field: "log_apply_id"
  }
];

//退款类型
export const return_type = [
  {
    value: "1",
    label: "退款"
  },
  {
    value: "2",
    label: "资金认领解除"
  }
];

//退款状态
export const return_status = [
  {
    value: "0",
    label: "待审核"
  },
  {
    value: "1",
    label: "财务审核"
  },
  {
    value: "2",
    label: "财务驳回"
  }
];
