import request from '@/utils/request'

// 查询商品详情列表
export function listGoods(query) {
  return request({
    url: '/basicdata/goods/list',
    method: 'get',
    params: query
  })
}

// 查询商品详情详细
export function getGoods(fId) {
  return request({
    url: '/basicdata/goods/' + fId,
    method: 'get'
  })
}

// 新增商品详情
export function addGoods(data) {
  return request({
    url: '/basicdata/goods',
    method: 'post',
    data: data
  })
}

// 修改商品详情
export function updateGoods(data) {
  return request({
    url: '/basicdata/goods',
    method: 'put',
    data: data
  })
}

// 状态修改
export function changeGoodsStatus(fId, fStatus) {
  const data = {
    fId,
    fStatus
  }
  return request({
    url: '/basicdata/goods',
    method: 'put',
    data: data
  })
}
// 删除商品详情
export function delGoods(fId) {
  return request({
    url: '/basicdata/goods/' + fId,
    method: 'delete'
  })
}

// 导出商品详情
export function exportGoods(query) {
  return request({
    url: '/basicdata/goods/export',
    method: 'get',
    params: query
  })
}
