import { ElTag } from "element-plus";
import { h } from "vue";
export const order_columns = [
  {
    label: "销售订单编码",
    prop: "sequenceNo",
    width: 150,
    align: "left",
    fixed: "left"
  },
  {
    label: "销售订单主编码",
    prop: "cxCode",
    width: 150,
    align: "left"
  },
  {
    label: "客户名称",
    prop: "customerName",
    minWidth: 150,
    align: "left"
  },
  {
    label: "订单总金额",
    prop: "totalPrice",
    width: 110,
    align: "left"
  },
  {
    prop: "apay_fee",
    width: 110,
    label: "已付款"
  },
  {
    prop: "pay_fee",
    width: 110,
    label: "付款中"
  },
  {
    prop: "wpay_fee",
    width: 110,
    label: "未付款"
  },
  {
    label: "商品名称",
    prop: "goodName",
    minWidth: 150,
    align: "left"
  },
  {
    label: "平台名称",
    prop: "platName",
    width: 120,
    align: "left"
  },
  {
    label: "销售员",
    prop: "saler",
    width: 90,
    align: "left"
  },
  {
    label: "购买方公司",
    prop: "customerName",
    minWidth: 150,
    align: "left"
  },
  {
    label: "销售方公司",
    prop: "companyName",
    minWidth: 150,
    align: "left"
  },
  {
    label: "此次认领",
    prop: "cchx",
    width: 110,
    align: "left"
  },
  {
    label: "交易时间",
    prop: "addtime",
    width: 140,
    align: "left"
  }
];

export const order_status = [
  {
    value: "0",
    label: "未对账"
  },
  {
    value: "1",
    label: "参与对账"
  },
  {
    value: "2",
    label: "不参与核销对账"
  },
  {
    value: "3",
    label: "参与核销对账"
  }
];

//收款方
export const description_columns_in = [
  {
    label: "收款公司编码",
    field: "companyNo",
    span: 24
  },
  {
    label: "收款公司名称",
    span: 24,
    field: "companyName"
  },
  {
    label: "收款公司账户",
    span: 24,
    field: "trade_in_account"
  }
];

//付款方
export const description_columns_out = [
  {
    label: "付款单位名称",
    span: 24,
    field: "trade_out"
  },
  {
    label: "账户",
    span: 24,
    field: "trade_account"
  },
  {
    label: "交易时间",
    span: 24,
    field: "trade_time"
  },
  {
    label: "交易行名",
    span: 24,
    field: "trade_bank"
  },
  {
    label: "付款方省市",
    span: 24,
    field: ""
  }
];

export const public_columns = [
  {
    label: "资金编码",
    span: 24,
    field: "tradNo"
  },
  {
    label: "状态",
    field: "status",
    slot: "status",
    span: 24,
    render(status) {
      return h(
        ElTag,
        { size: "small" },
        {
          default: () =>
            status_options.find(s => s.value === String(status))?.label
        }
      );
    }
  },
  {
    label: "收入金额",
    span: 24,
    field: "total_fee"
  },
  {
    label: "未认领金额",
    span: 24,
    field: "balance"
  },
  {
    label: "已认领金额",
    span: 24,
    field: "used_fee"
  },
  {
    label: "交易用途",
    span: 24,
    field: "trade_used"
  },
  {
    label: "新建时间",
    span: 24,
    field: "addtime"
  }
  // {
  //   label: "收款公司编码",
  //   field: "companyNo"
  // },
  // {
  //   label: "收款公司名称",
  //   field: "companyName"
  // }
];

export const status_options = [
  {
    label: "未认领",
    value: "1"
  },
  {
    label: "部分认领",
    value: "2"
  },
  {
    label: "已认领",
    value: "3"
  }
];

export const sale_columns = [
  {
    type: "selection",
    width: 40,
    align: "center",
    fixed: "left"
  },
  {
    field: "sequenceNo",
    label: "销售订单编码",
    width: 150,
    fixed: "left"
  },
  {
    label: "销售订单主编码",
    prop: "cxCode",
    width: 160,
    align: "left"
  },
  {
    field: "qrdSource",
    label: "订单来源",
    width: 100
  },
  {
    field: "qrdType",
    label: "商品类型",
    width: 100
  },

  {
    label: "平台类型",
    field: "platform_type",
    width: 80
  },
  {
    label: "发货状态",
    field: "sendStatus",
    width: 80
  },
  {
    label: "平台名称",
    field: "platName",
    width: 130,
    align: "left"
  },
  {
    label: "客户名称",
    field: "customerName",
    width: 180,
    align: "left"
  },
  {
    field: "totalPrice",
    width: 100,
    label: "订单总金额"
  },
  {
    field: "apay_fee",
    label: "已付款"
  },
  {
    field: "pay_fee",
    label: "付款中"
  },
  {
    field: "wpay_fee",
    label: "未付款"
  },
  {
    field: "goodName",
    label: "商品名称",
    width: 140
  },
  {
    field: "goodNo",
    label: "商品编码",
    width: 140
  },

  {
    field: "ownerName",
    label: "销售员"
  },

  {
    field: "companyNo",
    label: "业务公司编码",
    width: 140
  },
  {
    field: "companyName",
    width: 120,
    label: "业务公司名称"
  }
];

//销售订单订单类型
export const sale_type = [
  {
    value: "1",
    label: "备库"
  },
  {
    value: "2",
    label: "非库存"
  },
  {
    value: "3",
    label: "咨询商品"
  }
];

//认领状态
export const capital_status = [
  {
    value: "1",
    label: "未认领"
  },
  {
    value: "2",
    label: "部分认领"
  },
  {
    value: "3",
    label: "已认领"
  }
];

export const capital_status_list = [
  {
    value: "1",
    label: "待审批"
  },
  {
    value: "2",
    label: "审批通过"
  },
  {
    value: "3",
    label: "审批驳回"
  },
  {
    value: "4",
    label: "解除认领"
  },
  {
    value: "5",
    label: "退款"
  }
];
