import request from '@/utils/request'

// 查询盘存单列表
export function listTakeInventory(query) {
  return request({
    url: '/yfc-admin/inventory/takeInventory/list',
    method: 'get',
    params: query
  })
}

// 查询盘存单详细
export function getTakeInventory(id) {
  return request({
    url: '/yfc-admin/inventory/takeInventory/' + id,
    method: 'get'
  })
}

// 新增盘存单
export function addTakeInventory(data) {
  return request({
    url: '/yfc-admin/inventory/takeInventory',
    method: 'post',
    data: data
  })
}

// 修改盘存单
export function updateTakeInventory(data) {
  return request({
    url: '/yfc-admin/inventory/takeInventory',
    method: 'put',
    data: data
  })
}

// 删除盘存单
export function delTakeInventory(id) {
  return request({
    url: '/yfc-admin/inventory/takeInventory/' + id,
    method: 'delete'
  })
}

// 导出盘存单
export function exportTakeInventory(query) {
  return request({
    url: '/yfc-admin/inventory/takeInventory/export',
    method: 'get',
    params: query
  })
}

//提交
export function submit(id) {
  return request({
    url: '/yfc-admin/inventory/takeInventory/submit/' + id,
    method: 'put',
  })
}

//记账
export function keeping(id) {
  return request({
    url: '/yfc-admin/inventory/takeInventory/keeping/' + id,
    method: 'put',
  })
}

//开始、结束盘存
export function start(query) {
  return request({
    url: '/yfc-admin/inventory/takeInventory/startOrEnd',
    method: 'get',
    params: query
  })
}


//开始、结束盘存
export function summaryMethod(query) {
  return request({
    url: '/yfc-admin/inventory/takeInventory/hz',
    method: 'get',
    params: query
  })
}
