import request from '@/utils/request'

// 查询商品库存变更记录列表
export function listRecord(query) {
  return request({
    url: '/mapi/goods/record/list',
    method: 'get',
    params: query
  })
}

// 查询商品库存变更记录详细
export function getRecord(id) {
  return request({
    url: '/mapi/goods/record/' + id,
    method: 'get'
  })
}

// 新增商品库存变更记录
export function addRecord(data) {
  return request({
    url: '/mapi/goods/record',
    method: 'post',
    data: data
  })
}

// 修改商品库存变更记录
export function updateRecord(data) {
  return request({
    url: '/mapi/goods/record',
    method: 'put',
    data: data
  })
}

// 删除商品库存变更记录
export function delRecord(id) {
  return request({
    url: '/mapi/goods/record/' + id,
    method: 'delete'
  })
}


// 修改商品库存变更记录状态
export function updateRecordStatus(id,status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/mapi/goods/record/updateStatus',
    method: 'post',
    data: data
  })
}
