import request from "@/utils/request"

/** 供应商 — 分页列表 */
export function listSupplier(query) {
  return request({
    url: "/tradeMarket/supplier/list",
    method: "get",
    params: query
  })
}

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

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

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

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

/** 分配账号 */
export function assignAccountSupplier(id) {
  return request({
    url: "/tradeMarket/supplier/assignAccount/" + id,
    method: "post"
  })
}
