import request from "@/utils/request"

/** 市场进栏登记 — 分页列表 */
export function listMarketEntry(query) {
  return request({
    url: "/tradeMarket/marketEntry/list",
    method: "get",
    params: query
  })
}

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

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

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

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

/** 有效栏位下拉 */
export function listStallOptions() {
  return request({
    url: "/tradeMarket/marketEntry/stallOptions",
    method: "get"
  })
}

/** 供应商可选耳标（A−B） */
export function listSupplierEarTags(supplierId) {
  return request({
    url: "/tradeMarket/marketEntry/supplierEarTags",
    method: "get",
    params: { supplierId }
  })
}
