import request from "@/utils/request"

/** 交易订单 — 分页列表 */
export function listTradeOrder(query) {
  return request({
    url: "/tradeMarket/tradeOrder/list",
    method: "get",
    params: query
  })
}

/** 详情 */
export function getTradeOrder(id) {
  return request({
    url: "/tradeMarket/tradeOrder/" + id,
    method: "get"
  })
}

/** 新增 */
export function addTradeOrder(data) {
  return request({
    url: "/tradeMarket/tradeOrder",
    method: "post",
    data
  })
}

/** 修改 */
export function updateTradeOrder(data) {
  return request({
    url: "/tradeMarket/tradeOrder",
    method: "put",
    data
  })
}

/** 删除 */
export function delTradeOrder(ids) {
  return request({
    url: "/tradeMarket/tradeOrder/" + ids,
    method: "delete"
  })
}

/** 供应商进栏耳标下拉 */
export function listTradeOrderSupplierEarTags(supplierId) {
  return request({
    url: "/tradeMarket/tradeOrder/supplierEarTags",
    method: "get",
    params: { supplierId }
  })
}

/** 完成支付 */
export function completeTradeOrderPay(data) {
  return request({
    url: "/tradeMarket/tradeOrder/completePay",
    method: "put",
    data
  })
}
